@@ -70,6 +70,20 @@ struct r535_gsp_msg {
70
70
71
71
#define GSP_MSG_HDR_SIZE offsetof(struct r535_gsp_msg, data)
72
72
73
+ static int
74
+ r535_rpc_status_to_errno (uint32_t rpc_status )
75
+ {
76
+ switch (rpc_status ) {
77
+ case 0x55 : /* NV_ERR_NOT_READY */
78
+ case 0x66 : /* NV_ERR_TIMEOUT_RETRY */
79
+ return - EAGAIN ;
80
+ case 0x51 : /* NV_ERR_NO_MEMORY */
81
+ return - ENOMEM ;
82
+ default :
83
+ return - EINVAL ;
84
+ }
85
+ }
86
+
73
87
static void *
74
88
r535_gsp_msgq_wait (struct nvkm_gsp * gsp , u32 repc , u32 * prepc , int * ptime )
75
89
{
@@ -584,8 +598,9 @@ r535_gsp_rpc_rm_alloc_push(struct nvkm_gsp_object *object, void *argv, u32 repc)
584
598
return rpc ;
585
599
586
600
if (rpc -> status ) {
587
- nvkm_error (& gsp -> subdev , "RM_ALLOC: 0x%x\n" , rpc -> status );
588
- ret = ERR_PTR (- EINVAL );
601
+ ret = ERR_PTR (r535_rpc_status_to_errno (rpc -> status ));
602
+ if (ret != - EAGAIN )
603
+ nvkm_error (& gsp -> subdev , "RM_ALLOC: 0x%x\n" , rpc -> status );
589
604
} else {
590
605
ret = repc ? rpc -> params : NULL ;
591
606
}
@@ -639,9 +654,10 @@ r535_gsp_rpc_rm_ctrl_push(struct nvkm_gsp_object *object, void *argv, u32 repc)
639
654
return rpc ;
640
655
641
656
if (rpc -> status ) {
642
- nvkm_error (& gsp -> subdev , "cli:0x%08x obj:0x%08x ctrl cmd:0x%08x failed: 0x%08x\n" ,
643
- object -> client -> object .handle , object -> handle , rpc -> cmd , rpc -> status );
644
- ret = ERR_PTR (- EINVAL );
657
+ ret = ERR_PTR (r535_rpc_status_to_errno (rpc -> status ));
658
+ if (ret != - EAGAIN )
659
+ nvkm_error (& gsp -> subdev , "cli:0x%08x obj:0x%08x ctrl cmd:0x%08x failed: 0x%08x\n" ,
660
+ object -> client -> object .handle , object -> handle , rpc -> cmd , rpc -> status );
645
661
} else {
646
662
ret = repc ? rpc -> params : NULL ;
647
663
}
0 commit comments