File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -132,10 +132,8 @@ static int ucsi_exec_command(struct ucsi *ucsi, u64 cmd)
132
132
if (ret )
133
133
return ret ;
134
134
135
- if (cci & UCSI_CCI_BUSY ) {
136
- ucsi -> ops -> async_write (ucsi , UCSI_CANCEL , NULL , 0 );
137
- return - EBUSY ;
138
- }
135
+ if (cmd != UCSI_CANCEL && cci & UCSI_CCI_BUSY )
136
+ return ucsi_exec_command (ucsi , UCSI_CANCEL );
139
137
140
138
if (!(cci & UCSI_CCI_COMMAND_COMPLETE ))
141
139
return - EIO ;
@@ -149,6 +147,11 @@ static int ucsi_exec_command(struct ucsi *ucsi, u64 cmd)
149
147
return ucsi_read_error (ucsi );
150
148
}
151
149
150
+ if (cmd == UCSI_CANCEL && cci & UCSI_CCI_CANCEL_COMPLETE ) {
151
+ ret = ucsi_acknowledge_command (ucsi );
152
+ return ret ? ret : - EBUSY ;
153
+ }
154
+
152
155
return UCSI_CCI_LENGTH (cci );
153
156
}
154
157
You can’t perform that action at this time.
0 commit comments