Commit ddabca21 authored by John Garry's avatar John Garry Committed by Martin K. Petersen

scsi: hisi_sas: error hisi_sas_task_prep() when port down

When sas_port is NULL, then return SAS_PHY_DOWN.

In addition, when the sas_dev is gone then explicitly return
SAS_PHY_DOWN.
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 405314df
...@@ -200,7 +200,7 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba, ...@@ -200,7 +200,7 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba,
*/ */
if (device->dev_type != SAS_SATA_DEV) if (device->dev_type != SAS_SATA_DEV)
task->task_done(task); task->task_done(task);
return 0; return SAS_PHY_DOWN;
} }
if (DEV_IS_GONE(sas_dev)) { if (DEV_IS_GONE(sas_dev)) {
...@@ -211,8 +211,7 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba, ...@@ -211,8 +211,7 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba,
dev_info(dev, "task prep: device %016llx not ready\n", dev_info(dev, "task prep: device %016llx not ready\n",
SAS_ADDR(device->sas_addr)); SAS_ADDR(device->sas_addr));
rc = SAS_PHY_DOWN; return SAS_PHY_DOWN;
return rc;
} }
port = to_hisi_sas_port(sas_port); port = to_hisi_sas_port(sas_port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment