Skip to content

Commit ffb1c82

Browse files
Xiang Chenmartinkpetersen
authored andcommitted
scsi: hisi_sas: remove the check of sas_dev status in hisi_sas_I_T_nexus_reset()
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>
1 parent 5c31b0c commit ffb1c82

File tree

3 files changed

+0
-16
lines changed

3 files changed

+0
-16
lines changed

drivers/scsi/hisi_sas/hisi_sas.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ enum {
8383
PORT_TYPE_SATA = (1U << 0),
8484
};
8585

86-
enum dev_status {
87-
HISI_SAS_DEV_NORMAL,
88-
HISI_SAS_DEV_EH,
89-
};
90-
9186
enum {
9287
HISI_SAS_INT_ABT_CMD = 0,
9388
HISI_SAS_INT_ABT_DEV = 1,
@@ -188,7 +183,6 @@ struct hisi_sas_device {
188183
enum sas_device_type dev_type;
189184
int device_id;
190185
int sata_idx;
191-
u8 dev_status;
192186
};
193187

194188
struct hisi_sas_tmf_task {

drivers/scsi/hisi_sas/hisi_sas_main.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@ static struct hisi_sas_device *hisi_sas_alloc_dev(struct domain_device *device)
626626

627627
hisi_hba->devices[i].device_id = i;
628628
sas_dev = &hisi_hba->devices[i];
629-
sas_dev->dev_status = HISI_SAS_DEV_NORMAL;
630629
sas_dev->dev_type = device->dev_type;
631630
sas_dev->hisi_hba = hisi_hba;
632631
sas_dev->sas_device = device;
@@ -1495,7 +1494,6 @@ static int hisi_sas_abort_task(struct sas_task *task)
14951494
task->task_state_flags |= SAS_TASK_STATE_ABORTED;
14961495
spin_unlock_irqrestore(&task->task_state_lock, flags);
14971496

1498-
sas_dev->dev_status = HISI_SAS_DEV_EH;
14991497
if (task->lldd_task && task->task_proto & SAS_PROTOCOL_SSP) {
15001498
struct scsi_cmnd *cmnd = task->uldd_task;
15011499
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)
16391637

16401638
static int hisi_sas_I_T_nexus_reset(struct domain_device *device)
16411639
{
1642-
struct hisi_sas_device *sas_dev = device->lldd_dev;
16431640
struct hisi_hba *hisi_hba = dev_to_hisi_hba(device);
16441641
struct device *dev = hisi_hba->dev;
16451642
int rc = TMF_RESP_FUNC_FAILED;
16461643

1647-
if (sas_dev->dev_status != HISI_SAS_DEV_EH)
1648-
return TMF_RESP_FUNC_FAILED;
1649-
sas_dev->dev_status = HISI_SAS_DEV_NORMAL;
1650-
16511644
rc = hisi_sas_internal_task_abort(hisi_hba, device,
16521645
HISI_SAS_INT_ABT_DEV, 0);
16531646
if (rc < 0) {
@@ -1671,7 +1664,6 @@ static int hisi_sas_lu_reset(struct domain_device *device, u8 *lun)
16711664
struct device *dev = hisi_hba->dev;
16721665
int rc = TMF_RESP_FUNC_FAILED;
16731666

1674-
sas_dev->dev_status = HISI_SAS_DEV_EH;
16751667
if (dev_is_sata(device)) {
16761668
struct sas_phy *phy;
16771669

@@ -2100,7 +2092,6 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba, struct Scsi_Host *shost)
21002092
for (i = 0; i < HISI_SAS_MAX_DEVICES; i++) {
21012093
hisi_hba->devices[i].dev_type = SAS_PHY_UNUSED;
21022094
hisi_hba->devices[i].device_id = i;
2103-
hisi_hba->devices[i].dev_status = HISI_SAS_DEV_NORMAL;
21042095
}
21052096

21062097
for (i = 0; i < hisi_hba->queue_count; i++) {

drivers/scsi/hisi_sas/hisi_sas_v2_hw.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,6 @@ hisi_sas_device *alloc_dev_quirk_v2_hw(struct domain_device *device)
868868

869869
hisi_hba->devices[i].device_id = i;
870870
sas_dev = &hisi_hba->devices[i];
871-
sas_dev->dev_status = HISI_SAS_DEV_NORMAL;
872871
sas_dev->dev_type = device->dev_type;
873872
sas_dev->hisi_hba = hisi_hba;
874873
sas_dev->sas_device = device;

0 commit comments

Comments
 (0)