Commit b4bb6da
scsi: ufs: core: Fix EH failure after W-LUN resume error
When a W-LUN resume fails, its parent devices in the SCSI hierarchy,
including the scsi_target, may be runtime suspended. Subsequently, the
error handler in ufshcd_recover_pm_error() fails to set the W-LUN device
back to active because the parent target is not active. This results in
the following errors:
google-ufshcd 3c2d0000.ufs: ufshcd_err_handler started; HBA state eh_fatal; ...
ufs_device_wlun 0:0:0:49488: START_STOP failed for power mode: 1, result 40000
ufs_device_wlun 0:0:0:49488: ufshcd_wl_runtime_resume failed: -5
...
ufs_device_wlun 0:0:0:49488: runtime PM trying to activate child device 0:0:0:49488 but parent (target0:0:0) is not active
Address this by:
1. Ensuring the W-LUN's parent scsi_target is runtime resumed before
attempting to set the W-LUN to active within
ufshcd_recover_pm_error().
2. Explicitly checking for power.runtime_error on the HBA and W-LUN
devices before calling pm_runtime_set_active() to clear the error
state.
3. Adding pm_runtime_get_sync(hba->dev) in
ufshcd_err_handling_prepare() to ensure the HBA itself is active
during error recovery, even if a child device resume failed.
These changes ensure the device power states are managed correctly
during error recovery.
Signed-off-by: Brian Kao <powenkao@google.com>
Tested-by: Brian Kao <powenkao@google.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20251112063214.1195761-1-powenkao@google.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>1 parent 82f78ac commit b4bb6da
1 file changed
Lines changed: 28 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6504 | 6504 | | |
6505 | 6505 | | |
6506 | 6506 | | |
| 6507 | + | |
| 6508 | + | |
| 6509 | + | |
| 6510 | + | |
| 6511 | + | |
6507 | 6512 | | |
6508 | 6513 | | |
6509 | 6514 | | |
| |||
6543 | 6548 | | |
6544 | 6549 | | |
6545 | 6550 | | |
| 6551 | + | |
6546 | 6552 | | |
6547 | 6553 | | |
6548 | 6554 | | |
| |||
6557 | 6563 | | |
6558 | 6564 | | |
6559 | 6565 | | |
| 6566 | + | |
6560 | 6567 | | |
6561 | 6568 | | |
6562 | 6569 | | |
6563 | | - | |
| 6570 | + | |
6564 | 6571 | | |
6565 | 6572 | | |
| 6573 | + | |
6566 | 6574 | | |
6567 | | - | |
6568 | | - | |
| 6575 | + | |
| 6576 | + | |
6569 | 6577 | | |
6570 | | - | |
| 6578 | + | |
| 6579 | + | |
| 6580 | + | |
| 6581 | + | |
| 6582 | + | |
| 6583 | + | |
| 6584 | + | |
| 6585 | + | |
| 6586 | + | |
| 6587 | + | |
| 6588 | + | |
| 6589 | + | |
| 6590 | + | |
| 6591 | + | |
| 6592 | + | |
| 6593 | + | |
6571 | 6594 | | |
6572 | | - | |
6573 | | - | |
6574 | | - | |
6575 | 6595 | | |
6576 | 6596 | | |
6577 | 6597 | | |
6578 | 6598 | | |
6579 | 6599 | | |
6580 | 6600 | | |
6581 | | - | |
| 6601 | + | |
6582 | 6602 | | |
6583 | 6603 | | |
6584 | 6604 | | |
| |||
0 commit comments