Patch "scsi: ufs: core: WLUN suspend dev/link state error recovery" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    scsi: ufs: core: WLUN suspend dev/link state error recovery

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scsi-ufs-core-wlun-suspend-dev-link-state-error-reco.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 84b2286de0100842090a67d6bdaa7d7b095bfcc2
Author: Peter Wang <peter.wang@xxxxxxxxxxxx>
Date:   Fri Mar 29 09:50:36 2024 +0800

    scsi: ufs: core: WLUN suspend dev/link state error recovery
    
    [ Upstream commit 6bc5e70b1c792b31b497e48b4668a9a2909aca0d ]
    
    When wl suspend error occurs, for example BKOP or SSU timeout, the host
    triggers an error handler and returns -EBUSY to break the wl suspend
    process.  However, it is possible for the runtime PM to enter wl suspend
    again before the error handler has finished, and return -EINVAL because the
    device is in an error state. To address this, ensure that the rumtime PM
    waits for the error handler to finish, or trigger the error handler in such
    cases, because returning -EINVAL can cause the I/O to hang.
    
    Signed-off-by: Peter Wang <peter.wang@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240329015036.15707-1-peter.wang@xxxxxxxxxxxx
    Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>
    Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index f3c25467e571f..948449a13247c 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -9044,7 +9044,10 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
 
 	/* UFS device & link must be active before we enter in this function */
 	if (!ufshcd_is_ufs_dev_active(hba) || !ufshcd_is_link_active(hba)) {
-		ret = -EINVAL;
+		/*  Wait err handler finish or trigger err recovery */
+		if (!ufshcd_eh_in_progress(hba))
+			ufshcd_force_error_recovery(hba);
+		ret = -EBUSY;
 		goto enable_scaling;
 	}
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux