]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: hisi_sas: remove the check of sas_dev status in hisi_sas_I_T_nexus_reset()
authorXiang Chen <chenxiang66@hisilicon.com>
Fri, 25 Jan 2019 14:22:32 +0000 (22:22 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 29 Jan 2019 06:41:20 +0000 (01:41 -0500)
When issing a hardreset to a SATA device when running IO, it is possible
that abnormal CQs of the device are returned. Then enter error handler, it
doesn't enter function hisi_sas_abort_task() as there is no timeout IO, and
it doesn't set device as HISI_SAS_DEV_EH. So when hardreset by libata
later, it actually doesn't issue hardreset as there is a check to judge
whether device is in error.

For this situation, actually need to hardreset the device to recover.
So remove the check of sas_dev status in hisi_sas_I_T_nexus_reset().

Before we add the check to avoid the endless loop of reset for
directly-attached SATA device at probe time, actually we flutter it for
it, so it is not necessary to add the check now.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas.h
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c

index 97f0fda931a1bf402834d644aac5b5b3c1f8ff60..aac8b3864002877fbabd0df32f535af2e1c53d08 100644 (file)
@@ -83,11 +83,6 @@ enum {
        PORT_TYPE_SATA = (1U << 0),
 };
 
-enum dev_status {
-       HISI_SAS_DEV_NORMAL,
-       HISI_SAS_DEV_EH,
-};
-
 enum {
        HISI_SAS_INT_ABT_CMD = 0,
        HISI_SAS_INT_ABT_DEV = 1,
@@ -188,7 +183,6 @@ struct hisi_sas_device {
        enum sas_device_type    dev_type;
        int device_id;
        int sata_idx;
-       u8 dev_status;
 };
 
 struct hisi_sas_tmf_task {
index c6e5bce6c955c4382108b0c6bd42c458ee41c644..b7a370af4c32f2af49421fdc42ea21979c26035b 100644 (file)
@@ -626,7 +626,6 @@ static struct hisi_sas_device *hisi_sas_alloc_dev(struct domain_device *device)
 
                        hisi_hba->devices[i].device_id = i;
                        sas_dev = &hisi_hba->devices[i];
-                       sas_dev->dev_status = HISI_SAS_DEV_NORMAL;
                        sas_dev->dev_type = device->dev_type;
                        sas_dev->hisi_hba = hisi_hba;
                        sas_dev->sas_device = device;
@@ -1495,7 +1494,6 @@ static int hisi_sas_abort_task(struct sas_task *task)
        task->task_state_flags |= SAS_TASK_STATE_ABORTED;
        spin_unlock_irqrestore(&task->task_state_lock, flags);
 
-       sas_dev->dev_status = HISI_SAS_DEV_EH;
        if (task->lldd_task && task->task_proto & SAS_PROTOCOL_SSP) {
                struct scsi_cmnd *cmnd = task->uldd_task;
                struct hisi_sas_slot *slot = task->lldd_task;
@@ -1639,15 +1637,10 @@ static int hisi_sas_debug_I_T_nexus_reset(struct domain_device *device)
 
 static int hisi_sas_I_T_nexus_reset(struct domain_device *device)
 {
-       struct hisi_sas_device *sas_dev = device->lldd_dev;
        struct hisi_hba *hisi_hba = dev_to_hisi_hba(device);
        struct device *dev = hisi_hba->dev;
        int rc = TMF_RESP_FUNC_FAILED;
 
-       if (sas_dev->dev_status != HISI_SAS_DEV_EH)
-               return TMF_RESP_FUNC_FAILED;
-       sas_dev->dev_status = HISI_SAS_DEV_NORMAL;
-
        rc = hisi_sas_internal_task_abort(hisi_hba, device,
                                        HISI_SAS_INT_ABT_DEV, 0);
        if (rc < 0) {
@@ -1671,7 +1664,6 @@ static int hisi_sas_lu_reset(struct domain_device *device, u8 *lun)
        struct device *dev = hisi_hba->dev;
        int rc = TMF_RESP_FUNC_FAILED;
 
-       sas_dev->dev_status = HISI_SAS_DEV_EH;
        if (dev_is_sata(device)) {
                struct sas_phy *phy;
 
@@ -2100,7 +2092,6 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba, struct Scsi_Host *shost)
        for (i = 0; i < HISI_SAS_MAX_DEVICES; i++) {
                hisi_hba->devices[i].dev_type = SAS_PHY_UNUSED;
                hisi_hba->devices[i].device_id = i;
-               hisi_hba->devices[i].dev_status = HISI_SAS_DEV_NORMAL;
        }
 
        for (i = 0; i < hisi_hba->queue_count; i++) {
index 3792f8abec1acd21ee35b2b3b126244dda919b13..8a2a24bde8a5f7425a2005938d22d8eccf125b84 100644 (file)
@@ -868,7 +868,6 @@ hisi_sas_device *alloc_dev_quirk_v2_hw(struct domain_device *device)
 
                        hisi_hba->devices[i].device_id = i;
                        sas_dev = &hisi_hba->devices[i];
-                       sas_dev->dev_status = HISI_SAS_DEV_NORMAL;
                        sas_dev->dev_type = device->dev_type;
                        sas_dev->hisi_hba = hisi_hba;
                        sas_dev->sas_device = device;