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

scsi: hisi_sas: Stop returning error code from slot_complete_vX_hw()

The error codes are never checked, stop returning them.

Link: https://lore.kernel.org/r/1589552025-165012-5-git-send-email-john.garry@huawei.comSigned-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 1a0efb55
...@@ -1175,15 +1175,14 @@ static void slot_err_v1_hw(struct hisi_hba *hisi_hba, ...@@ -1175,15 +1175,14 @@ static void slot_err_v1_hw(struct hisi_hba *hisi_hba,
} }
static int slot_complete_v1_hw(struct hisi_hba *hisi_hba, static void slot_complete_v1_hw(struct hisi_hba *hisi_hba,
struct hisi_sas_slot *slot) struct hisi_sas_slot *slot)
{ {
struct sas_task *task = slot->task; struct sas_task *task = slot->task;
struct hisi_sas_device *sas_dev; struct hisi_sas_device *sas_dev;
struct device *dev = hisi_hba->dev; struct device *dev = hisi_hba->dev;
struct task_status_struct *ts; struct task_status_struct *ts;
struct domain_device *device; struct domain_device *device;
enum exec_status sts;
struct hisi_sas_complete_v1_hdr *complete_queue = struct hisi_sas_complete_v1_hdr *complete_queue =
hisi_hba->complete_hdr[slot->cmplt_queue]; hisi_hba->complete_hdr[slot->cmplt_queue];
struct hisi_sas_complete_v1_hdr *complete_hdr; struct hisi_sas_complete_v1_hdr *complete_hdr;
...@@ -1194,7 +1193,7 @@ static int slot_complete_v1_hw(struct hisi_hba *hisi_hba, ...@@ -1194,7 +1193,7 @@ static int slot_complete_v1_hw(struct hisi_hba *hisi_hba,
cmplt_hdr_data = le32_to_cpu(complete_hdr->data); cmplt_hdr_data = le32_to_cpu(complete_hdr->data);
if (unlikely(!task || !task->lldd_task || !task->dev)) if (unlikely(!task || !task->lldd_task || !task->dev))
return -EINVAL; return;
ts = &task->task_status; ts = &task->task_status;
device = task->dev; device = task->dev;
...@@ -1260,7 +1259,7 @@ static int slot_complete_v1_hw(struct hisi_hba *hisi_hba, ...@@ -1260,7 +1259,7 @@ static int slot_complete_v1_hw(struct hisi_hba *hisi_hba,
slot_err_v1_hw(hisi_hba, task, slot); slot_err_v1_hw(hisi_hba, task, slot);
if (unlikely(slot->abort)) if (unlikely(slot->abort))
return ts->stat; return;
goto out; goto out;
} }
...@@ -1309,12 +1308,9 @@ static int slot_complete_v1_hw(struct hisi_hba *hisi_hba, ...@@ -1309,12 +1308,9 @@ static int slot_complete_v1_hw(struct hisi_hba *hisi_hba,
out: out:
hisi_sas_slot_task_free(hisi_hba, task, slot); hisi_sas_slot_task_free(hisi_hba, task, slot);
sts = ts->stat;
if (task->task_done) if (task->task_done)
task->task_done(task); task->task_done(task);
return sts;
} }
/* Interrupts */ /* Interrupts */
......
...@@ -2318,8 +2318,8 @@ static void slot_err_v2_hw(struct hisi_hba *hisi_hba, ...@@ -2318,8 +2318,8 @@ static void slot_err_v2_hw(struct hisi_hba *hisi_hba,
} }
} }
static int static void slot_complete_v2_hw(struct hisi_hba *hisi_hba,
slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) struct hisi_sas_slot *slot)
{ {
struct sas_task *task = slot->task; struct sas_task *task = slot->task;
struct hisi_sas_device *sas_dev; struct hisi_sas_device *sas_dev;
...@@ -2327,7 +2327,6 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) ...@@ -2327,7 +2327,6 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
struct task_status_struct *ts; struct task_status_struct *ts;
struct domain_device *device; struct domain_device *device;
struct sas_ha_struct *ha; struct sas_ha_struct *ha;
enum exec_status sts;
struct hisi_sas_complete_v2_hdr *complete_queue = struct hisi_sas_complete_v2_hdr *complete_queue =
hisi_hba->complete_hdr[slot->cmplt_queue]; hisi_hba->complete_hdr[slot->cmplt_queue];
struct hisi_sas_complete_v2_hdr *complete_hdr = struct hisi_sas_complete_v2_hdr *complete_hdr =
...@@ -2337,7 +2336,7 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) ...@@ -2337,7 +2336,7 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
u32 dw0; u32 dw0;
if (unlikely(!task || !task->lldd_task || !task->dev)) if (unlikely(!task || !task->lldd_task || !task->dev))
return -EINVAL; return;
ts = &task->task_status; ts = &task->task_status;
device = task->dev; device = task->dev;
...@@ -2406,7 +2405,7 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) ...@@ -2406,7 +2405,7 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
error_info[2], error_info[3]); error_info[2], error_info[3]);
if (unlikely(slot->abort)) if (unlikely(slot->abort))
return ts->stat; return;
goto out; goto out;
} }
...@@ -2456,12 +2455,11 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) ...@@ -2456,12 +2455,11 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
} }
out: out:
sts = ts->stat;
spin_lock_irqsave(&task->task_state_lock, flags); spin_lock_irqsave(&task->task_state_lock, flags);
if (task->task_state_flags & SAS_TASK_STATE_ABORTED) { if (task->task_state_flags & SAS_TASK_STATE_ABORTED) {
spin_unlock_irqrestore(&task->task_state_lock, flags); spin_unlock_irqrestore(&task->task_state_lock, flags);
dev_info(dev, "slot complete: task(%pK) aborted\n", task); dev_info(dev, "slot complete: task(%pK) aborted\n", task);
return SAS_ABORTED_TASK; return;
} }
task->task_state_flags |= SAS_TASK_STATE_DONE; task->task_state_flags |= SAS_TASK_STATE_DONE;
spin_unlock_irqrestore(&task->task_state_lock, flags); spin_unlock_irqrestore(&task->task_state_lock, flags);
...@@ -2473,15 +2471,13 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) ...@@ -2473,15 +2471,13 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
spin_unlock_irqrestore(&device->done_lock, flags); spin_unlock_irqrestore(&device->done_lock, flags);
dev_info(dev, "slot complete: task(%pK) ignored\n", dev_info(dev, "slot complete: task(%pK) ignored\n",
task); task);
return sts; return;
} }
spin_unlock_irqrestore(&device->done_lock, flags); spin_unlock_irqrestore(&device->done_lock, flags);
} }
if (task->task_done) if (task->task_done)
task->task_done(task); task->task_done(task);
return sts;
} }
static void prep_ata_v2_hw(struct hisi_hba *hisi_hba, static void prep_ata_v2_hw(struct hisi_hba *hisi_hba,
......
...@@ -2156,8 +2156,8 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task, ...@@ -2156,8 +2156,8 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task,
} }
} }
static int static void slot_complete_v3_hw(struct hisi_hba *hisi_hba,
slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) struct hisi_sas_slot *slot)
{ {
struct sas_task *task = slot->task; struct sas_task *task = slot->task;
struct hisi_sas_device *sas_dev; struct hisi_sas_device *sas_dev;
...@@ -2165,7 +2165,6 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) ...@@ -2165,7 +2165,6 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
struct task_status_struct *ts; struct task_status_struct *ts;
struct domain_device *device; struct domain_device *device;
struct sas_ha_struct *ha; struct sas_ha_struct *ha;
enum exec_status sts;
struct hisi_sas_complete_v3_hdr *complete_queue = struct hisi_sas_complete_v3_hdr *complete_queue =
hisi_hba->complete_hdr[slot->cmplt_queue]; hisi_hba->complete_hdr[slot->cmplt_queue];
struct hisi_sas_complete_v3_hdr *complete_hdr = struct hisi_sas_complete_v3_hdr *complete_hdr =
...@@ -2175,7 +2174,7 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) ...@@ -2175,7 +2174,7 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
u32 dw0, dw1, dw3; u32 dw0, dw1, dw3;
if (unlikely(!task || !task->lldd_task || !task->dev)) if (unlikely(!task || !task->lldd_task || !task->dev))
return -EINVAL; return;
ts = &task->task_status; ts = &task->task_status;
device = task->dev; device = task->dev;
...@@ -2237,7 +2236,7 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) ...@@ -2237,7 +2236,7 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
error_info[0], error_info[1], error_info[0], error_info[1],
error_info[2], error_info[3]); error_info[2], error_info[3]);
if (unlikely(slot->abort)) if (unlikely(slot->abort))
return ts->stat; return;
goto out; goto out;
} }
...@@ -2282,12 +2281,11 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) ...@@ -2282,12 +2281,11 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
} }
out: out:
sts = ts->stat;
spin_lock_irqsave(&task->task_state_lock, flags); spin_lock_irqsave(&task->task_state_lock, flags);
if (task->task_state_flags & SAS_TASK_STATE_ABORTED) { if (task->task_state_flags & SAS_TASK_STATE_ABORTED) {
spin_unlock_irqrestore(&task->task_state_lock, flags); spin_unlock_irqrestore(&task->task_state_lock, flags);
dev_info(dev, "slot complete: task(%pK) aborted\n", task); dev_info(dev, "slot complete: task(%pK) aborted\n", task);
return SAS_ABORTED_TASK; return;
} }
task->task_state_flags |= SAS_TASK_STATE_DONE; task->task_state_flags |= SAS_TASK_STATE_DONE;
spin_unlock_irqrestore(&task->task_state_lock, flags); spin_unlock_irqrestore(&task->task_state_lock, flags);
...@@ -2299,15 +2297,13 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) ...@@ -2299,15 +2297,13 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
spin_unlock_irqrestore(&device->done_lock, flags); spin_unlock_irqrestore(&device->done_lock, flags);
dev_info(dev, "slot complete: task(%pK) ignored\n ", dev_info(dev, "slot complete: task(%pK) ignored\n ",
task); task);
return sts; return;
} }
spin_unlock_irqrestore(&device->done_lock, flags); spin_unlock_irqrestore(&device->done_lock, flags);
} }
if (task->task_done) if (task->task_done)
task->task_done(task); task->task_done(task);
return sts;
} }
static irqreturn_t cq_thread_v3_hw(int irq_no, void *p) static irqreturn_t cq_thread_v3_hw(int irq_no, void *p)
......
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