Commit ede596b
scsi: lpfc: Handle mailbox timeouts in lpfc_get_sfp_info
The MBX_TIMEOUT return code is not handled in lpfc_get_sfp_info and the
routine unconditionally frees submitted mailbox commands regardless of
return status. The issue is that for MBX_TIMEOUT cases, when firmware
returns SFP information at a later time, that same mailbox memory region
references previously freed memory in its cmpl routine.
Fix by adding checks for the MBX_TIMEOUT return code. During mailbox
resource cleanup, check the mbox flag to make sure that the wait did not
timeout. If the MBOX_WAKE flag is not set, then do not free the resources
because it will be freed when firmware completes the mailbox at a later
time in its cmpl routine.
Also, increase the timeout from 30 to 60 seconds to accommodate boot
scripts requiring longer timeouts.
Signed-off-by: Justin Tee <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin K. Petersen <[email protected]>1 parent 15e21dc commit ede596b
1 file changed
+11
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7302 | 7302 | | |
7303 | 7303 | | |
7304 | 7304 | | |
7305 | | - | |
7306 | | - | |
| 7305 | + | |
7307 | 7306 | | |
7308 | 7307 | | |
7309 | 7308 | | |
7310 | 7309 | | |
7311 | | - | |
| 7310 | + | |
| 7311 | + | |
7312 | 7312 | | |
7313 | 7313 | | |
7314 | 7314 | | |
| |||
7361 | 7361 | | |
7362 | 7362 | | |
7363 | 7363 | | |
7364 | | - | |
| 7364 | + | |
| 7365 | + | |
| 7366 | + | |
| 7367 | + | |
7365 | 7368 | | |
7366 | 7369 | | |
7367 | 7370 | | |
| |||
7372 | 7375 | | |
7373 | 7376 | | |
7374 | 7377 | | |
7375 | | - | |
7376 | | - | |
| 7378 | + | |
| 7379 | + | |
| 7380 | + | |
| 7381 | + | |
7377 | 7382 | | |
7378 | 7383 | | |
7379 | 7384 | | |
| |||
0 commit comments