hisi_sas: Some misc patches
Subsystems (2)
cover hisi_sas: Some misc patches
This series includes some misc patches, generally tidy-up. The most significant is the patch to not reset the phy up timer for when the phy is already up - the HW designers do not have an answer for why this occurs, so we workaround.
John Garry (1):
scsi: hisi_sas: Stop returning error code from slot_complete_vX_hw()
Luo Jiaxing (3):
scsi: hisi_sas: Do not reset phy timer to wait for stray phyup
scsi: hisi_sas: Modify the commit information for DSM method
scsi: hisi_sas: Add SAS_RAS_INTR0 to debugfs register name list
drivers/scsi/hisi_sas/hisi_sas_main.c | 5 ++++- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 12 ++++-------- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 16 ++++++---------- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 25 +++++++++++++------------ 4 files changed, 27 insertions(+), 31 deletions(-)
Signature · 1 line
2.16.4
PATCH 1/4 scsi: hisi_sas: Do not reset phy timer to wait for stray phyup
From: Luo Jiaxing <[email protected]>
We found out that after phy up, the hardware report another oob interrupt, but did not follow a phy up interrupt:
oob ready -> phy up -> DEV found -> oob read -> wait phy up -> timeout
We run link reset when wait phy up timeout, and it make a normal disk into reset processing. So we made some circumvention action in the code, so that this abnormal oob interrupt will not start the timer to wait for phy up.
--- drivers/scsi/hisi_sas/hisi_sas_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/scsi/hisi_sas/hisi_sas_main.c +4 -1
@@ -898,8 +898,11 @@ void hisi_sas_phy_oob_ready(struct hisi_hba *hisi_hba, int phy_no)struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no];struct device *dev = hisi_hba->dev; +dev_dbg (dev,"phy%d OOB ready\n" , phy_no); +if (phy->phy_attached) +return ; +if (!timer_pending (&phy->timer)) { -dev_dbg (dev,"phy%d OOB ready\n" , phy_no); phy->timer.expires = jiffies +HISI_SAS_WAIT_PHYUP_TIMEOUT *HZ ;add_timer (&phy->timer); }
Signature · 1 line
2.16.4
PATCH 2/4 scsi: hisi_sas: Modify the commit information for DSM method
In reply to John GarryFrom: Luo Jiaxing <[email protected]>
Make it clear that BIOS may modify some register settings.
--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +6 -2
@@ -912,11 +912,15 @@ static int hw_init_v3_hw(struct hisi_hba *hisi_hba)return -EINVAL ; } -/* Switch over to MSI handling , from PCI AER default */ +/* +* This DSM handles some hardware-related configurations: +* 1. Switch over to MSI error handling in kernel +* 2. BIOS *may* reset some register values through this method +*/ obj =acpi_evaluate_dsm (ACPI_HANDLE (dev), &guid,0 ,DSM_FUNC_ERR_HANDLE_MSI ,NULL );if (!obj) -dev_warn (dev,"Switch over to MSI handling failed\n" ); +dev_warn (dev,"can not find DSM method, ignore\n" );else ACPI_FREE (obj);
Signature · 1 line
2.16.4
PATCH 3/4 scsi: hisi_sas: Add SAS_RAS_INTR0 to debugfs register name list
In reply to John GarryFrom: Luo Jiaxing <[email protected]>
Register SAS_RAS_INTR0 can help us to figure out which ECC error was occurred. This register is helpful to locate RAS issue, so we add it to the list of debugfs register name list for easier retrieval.
--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +1 -0
@@ -2901,6 +2901,7 @@ static const struct hisi_sas_debugfs_reg debugfs_axi_reg = { };static const struct hisi_sas_debugfs_reg_lu debugfs_ras_reg_lu[] = { +HISI_SAS_DEBUGFS_REG (SAS_RAS_INTR0 ),HISI_SAS_DEBUGFS_REG (SAS_RAS_INTR1 ),HISI_SAS_DEBUGFS_REG (SAS_RAS_INTR0_MASK ),HISI_SAS_DEBUGFS_REG (SAS_RAS_INTR1_MASK ),
Signature · 1 line
2.16.4
PATCH 4/4 scsi: hisi_sas: Stop returning error code from slot_complete_vX_hw()
In reply to John GarryThe error codes are never checked, so stop returning them.
--- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 12 ++++-------- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 16 ++++++---------- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 16 ++++++---------- 3 files changed, 16 insertions(+), 28 deletions(-)
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +4 -8
@@ -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, -struct hisi_sas_slot *slot) +static void slot_complete_v1_hw (struct hisi_hba *hisi_hba, +struct hisi_sas_slot *slot) {struct sas_task *task = slot->task;struct hisi_sas_device *sas_dev;struct device *dev = hisi_hba->dev;struct task_status_struct *ts;struct domain_device *device; -enum exec_status sts;struct hisi_sas_complete_v1_hdr *complete_queue = hisi_hba->complete_hdr[slot->cmplt_queue];struct hisi_sas_complete_v1_hdr *complete_hdr;
@@ -1194,7 +1193,7 @@ static int slot_complete_v1_hw(struct hisi_hba *hisi_hba, cmplt_hdr_data =le32_to_cpu (complete_hdr->data);if (unlikely (!task || !task->lldd_task || !task->dev)) -return -EINVAL ; +return ; ts = &task->task_status; device = task->dev;
@@ -1260,7 +1259,7 @@ static int slot_complete_v1_hw(struct hisi_hba *hisi_hba,slot_err_v1_hw (hisi_hba, task, slot);if (unlikely (slot->abort)) -return ts->stat; +return ; goto out; }
@@ -1309,12 +1308,9 @@ static int slot_complete_v1_hw(struct hisi_hba *hisi_hba, out:hisi_sas_slot_task_free (hisi_hba, task, slot); - sts = ts->stat;if (task->task_done) task->task_done (task); - -return sts; }/* Interrupts */
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +6 -10
@@ -2318,8 +2318,8 @@ static void slot_err_v2_hw(struct hisi_hba *hisi_hba, } } -static int -slot_complete_v2_hw (struct hisi_hba *hisi_hba,struct hisi_sas_slot *slot) +static void slot_complete_v2_hw (struct hisi_hba *hisi_hba, +struct hisi_sas_slot *slot) {struct sas_task *task = slot->task;struct hisi_sas_device *sas_dev;
@@ -2327,7 +2327,6 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)struct task_status_struct *ts;struct domain_device *device;struct sas_ha_struct *ha; -enum exec_status sts;struct hisi_sas_complete_v2_hdr *complete_queue = hisi_hba->complete_hdr[slot->cmplt_queue]; 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)u32 dw0;if (unlikely (!task || !task->lldd_task || !task->dev)) -return -EINVAL ; +return ; ts = &task->task_status; device = task->dev;
@@ -2406,7 +2405,7 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) error_info[2], error_info[3]);if (unlikely (slot->abort)) -return ts->stat; +return ; goto out; }
@@ -2456,12 +2455,11 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) } out: - sts = ts->stat;spin_lock_irqsave (&task->task_state_lock, flags);if (task->task_state_flags &SAS_TASK_STATE_ABORTED ) {spin_unlock_irqrestore (&task->task_state_lock, flags);dev_info (dev,"slot complete: task(%pK) aborted\n" , task); -return SAS_ABORTED_TASK ; +return ; } task->task_state_flags |=SAS_TASK_STATE_DONE ;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)spin_unlock_irqrestore (&device->done_lock, flags);dev_info (dev,"slot complete: task(%pK) ignored\n" , task); -return sts; +return ; }spin_unlock_irqrestore (&device->done_lock, flags); }if (task->task_done) task->task_done (task); - -return sts; } static void prep_ata_v2_hw(struct hisi_hba *hisi_hba,
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +6 -10
@@ -2156,8 +2156,8 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task, } } -static int -slot_complete_v3_hw (struct hisi_hba *hisi_hba,struct hisi_sas_slot *slot) +static void slot_complete_v3_hw (struct hisi_hba *hisi_hba, +struct hisi_sas_slot *slot) {struct sas_task *task = slot->task;struct hisi_sas_device *sas_dev;
@@ -2165,7 +2165,6 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)struct task_status_struct *ts;struct domain_device *device;struct sas_ha_struct *ha; -enum exec_status sts;struct hisi_sas_complete_v3_hdr *complete_queue = hisi_hba->complete_hdr[slot->cmplt_queue]; 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)u32 dw0, dw1, dw3;if (unlikely (!task || !task->lldd_task || !task->dev)) -return -EINVAL ; +return ; ts = &task->task_status; device = task->dev;
@@ -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[2], error_info[3]);if (unlikely (slot->abort)) -return ts->stat; +return ; goto out; }
@@ -2282,12 +2281,11 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot) } out: - sts = ts->stat;spin_lock_irqsave (&task->task_state_lock, flags);if (task->task_state_flags &SAS_TASK_STATE_ABORTED ) {spin_unlock_irqrestore (&task->task_state_lock, flags);dev_info (dev,"slot complete: task(%pK) aborted\n" , task); -return SAS_ABORTED_TASK ; +return ; } task->task_state_flags |=SAS_TASK_STATE_DONE ;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)spin_unlock_irqrestore (&device->done_lock, flags);dev_info (dev,"slot complete: task(%pK) ignored\n " , task); -return sts; +return ; }spin_unlock_irqrestore (&device->done_lock, flags); }if (task->task_done) task->task_done (task); - -return sts; }static irqreturn_t cq_thread_v3_hw (int irq_no,void *p)
Signature · 1 line
2.16.4
Martin K. Petersen
AppliedQuoted 9 lines · John Garry
This series includes some misc patches, generally tidy-up. The most significant is the patch to not reset the phy up timer for when the phy is already up - the HW designers do not have an answer for why this occurs, so we workaround.
John Garry (1):
scsi:hisi_sas: Stop returning error code fromslot_complete_vX_hw()[...]
Applied to 5.8/scsi-queue, thanks!
[1/4] scsi: hisi_sas: Do not reset phy timer to wait for stray phy up
https://git.kernel.org/mkp/scsi/c/e16b9ed61e07 [2/4] scsi: hisi_sas: Modify the commit information for DSM method https://git.kernel.org/mkp/scsi/c/1e954d1f002d [3/4] scsi: hisi_sas: Add SAS_RAS_INTR0 to debugfs register name list https://git.kernel.org/mkp/scsi/c/1a0efb55b2bb [4/4] scsi: hisi_sas: Stop returning error code from slot_complete_vX_hw() https://git.kernel.org/mkp/scsi/c/1cdee0044261
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering