File tree Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ int rmi_mailbox_xfer(struct sbrmi_data *data,
23
23
struct sbrmi_mailbox_msg * msg )
24
24
{
25
25
unsigned int bytes ;
26
- int i , ret , retry = 10 ;
26
+ int i , ret ;
27
27
int sw_status ;
28
28
u8 byte ;
29
29
@@ -64,21 +64,10 @@ int rmi_mailbox_xfer(struct sbrmi_data *data,
64
64
* an ALERT (if enabled) to initiator (BMC) to indicate completion
65
65
* of the requested command
66
66
*/
67
- do {
68
- ret = regmap_read (data -> regmap , SBRMI_STATUS , & sw_status );
69
- if (sw_status < 0 ) {
70
- ret = sw_status ;
71
- goto exit_unlock ;
72
- }
73
- if (sw_status & SW_ALERT_MASK )
74
- break ;
75
- usleep_range (50 , 100 );
76
- } while (retry -- );
77
-
78
- if (retry < 0 ) {
79
- ret = - EIO ;
67
+ ret = regmap_read_poll_timeout (data -> regmap , SBRMI_STATUS , sw_status ,
68
+ sw_status & SW_ALERT_MASK , 500 , 2000000 );
69
+ if (ret )
80
70
goto exit_unlock ;
81
- }
82
71
83
72
/*
84
73
* For a read operation, the initiator (BMC) reads the firmware
You can’t perform that action at this time.
0 commit comments