Commit 1ef8da6
net: libwx: fix firmware mailbox abnormal return
[ Upstream commit 8ce4f28 ]
The existing SW-FW interaction flow on the driver is wrong. Follow this
wrong flow, driver would never return error if there is a unknown command.
Since firmware writes back 'firmware ready' and 'unknown command' in the
mailbox message if there is an unknown command sent by driver. So reading
'firmware ready' does not timeout. Then driver would mistakenly believe
that the interaction has completed successfully.
It tends to happen with the use of custom firmware. Move the check for
'unknown command' out of the poll timeout for 'firmware ready'. And adjust
the debug log so that mailbox messages are always printed when commands
timeout.
Fixes: 1efa9bf ("net: libwx: Implement interaction with firmware")
Signed-off-by: Jiawen Wu <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>1 parent df82565 commit 1ef8da6
1 file changed
+11
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
337 | 344 | | |
338 | 345 | | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
| 346 | + | |
352 | 347 | | |
353 | 348 | | |
354 | 349 | | |
355 | 350 | | |
356 | 351 | | |
357 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
358 | 356 | | |
359 | 357 | | |
360 | 358 | | |
| |||
0 commit comments