Patch "scsi: hisi_sas: Rollback some operations if FLR failed" has been added to the 5.15-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: hisi_sas: Rollback some operations if FLR failed

to the 5.15-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-hisi_sas-rollback-some-operations-if-flr-failed.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 5b795ccf6d6f89696f06893ff5eafdacd74b6a60
Author: Yihang Li <liyihang9@xxxxxxxxxx>
Date:   Thu Dec 14 11:45:15 2023 +0800

    scsi: hisi_sas: Rollback some operations if FLR failed
    
    [ Upstream commit 7ea3e7763c50b20a8bd25cf524ea0c6463de69be ]
    
    We obtain the semaphore and set HISI_SAS_RESETTING_BIT in
    hisi_sas_reset_prepare_v3_hw(), block the scsi host and set
    HISI_SAS_REJECT_CMD_BIT in hisi_sas_controller_reset_prepare(), released
    them in hisi_sas_controller_reset_done(). However, if the HW reset failure
    in FLR results in early return, the semaphore and flag bits will not be
    release.
    
    Rollback some operations including clearing flags / releasing semaphore
    when FLR is failed.
    
    Fixes: e5ea48014adc ("scsi: hisi_sas: Implement handlers of PCIe FLR for v3 hw")
    Signed-off-by: Yihang Li <liyihang9@xxxxxxxxxx>
    Signed-off-by: Xiang Chen <chenxiang66@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/1702525516-51258-5-git-send-email-chenxiang66@xxxxxxxxxxxxx
    Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
index 88af529ab100..4505310c0c3c 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -4948,6 +4948,7 @@ static void hisi_sas_reset_done_v3_hw(struct pci_dev *pdev)
 {
 	struct sas_ha_struct *sha = pci_get_drvdata(pdev);
 	struct hisi_hba *hisi_hba = sha->lldd_ha;
+	struct Scsi_Host *shost = hisi_hba->shost;
 	struct device *dev = hisi_hba->dev;
 	int rc;
 
@@ -4956,6 +4957,10 @@ static void hisi_sas_reset_done_v3_hw(struct pci_dev *pdev)
 	rc = hw_init_v3_hw(hisi_hba);
 	if (rc) {
 		dev_err(dev, "FLR: hw init failed rc=%d\n", rc);
+		clear_bit(HISI_SAS_REJECT_CMD_BIT, &hisi_hba->flags);
+		scsi_unblock_requests(shost);
+		clear_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags);
+		up(&hisi_hba->sem);
 		return;
 	}
 




[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