* [PATCH 0/4] hisi_sas: Some misc patches @ 2020-05-15 14:13 John Garry 2020-05-15 14:13 ` [PATCH 1/4] scsi: hisi_sas: Do not reset phy timer to wait for stray phyup John Garry ` (4 more replies) 0 siblings, 5 replies; 6+ messages in thread From: John Garry @ 2020-05-15 14:13 UTC (permalink / raw) To: jejb, martin.petersen; +Cc: linuxarm, linux-kernel, linux-scsi, 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 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(-) -- 2.16.4 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] scsi: hisi_sas: Do not reset phy timer to wait for stray phyup 2020-05-15 14:13 [PATCH 0/4] hisi_sas: Some misc patches John Garry @ 2020-05-15 14:13 ` John Garry 2020-05-15 14:13 ` [PATCH 2/4] scsi: hisi_sas: Modify the commit information for DSM method John Garry ` (3 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: John Garry @ 2020-05-15 14:13 UTC (permalink / raw) To: jejb, martin.petersen Cc: linuxarm, linux-kernel, linux-scsi, Luo Jiaxing, John Garry From: Luo Jiaxing <luojiaxing@huawei.com> 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. Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com> Signed-off-by: John Garry <john.garry@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 9a6deb21fe4d..11caa4b0d797 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -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); } -- 2.16.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] scsi: hisi_sas: Modify the commit information for DSM method 2020-05-15 14:13 [PATCH 0/4] hisi_sas: Some misc patches John Garry 2020-05-15 14:13 ` [PATCH 1/4] scsi: hisi_sas: Do not reset phy timer to wait for stray phyup John Garry @ 2020-05-15 14:13 ` John Garry 2020-05-15 14:13 ` [PATCH 3/4] scsi: hisi_sas: Add SAS_RAS_INTR0 to debugfs register name list John Garry ` (2 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: John Garry @ 2020-05-15 14:13 UTC (permalink / raw) To: jejb, martin.petersen Cc: linuxarm, linux-kernel, linux-scsi, Luo Jiaxing, John Garry From: Luo Jiaxing <luojiaxing@huawei.com> Make it clear that BIOS may modify some register settings. Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com> Signed-off-by: John Garry <john.garry@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 59b1421607dd..41e07e9f6c8a 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -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); -- 2.16.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] scsi: hisi_sas: Add SAS_RAS_INTR0 to debugfs register name list 2020-05-15 14:13 [PATCH 0/4] hisi_sas: Some misc patches John Garry 2020-05-15 14:13 ` [PATCH 1/4] scsi: hisi_sas: Do not reset phy timer to wait for stray phyup John Garry 2020-05-15 14:13 ` [PATCH 2/4] scsi: hisi_sas: Modify the commit information for DSM method John Garry @ 2020-05-15 14:13 ` John Garry 2020-05-15 14:13 ` [PATCH 4/4] scsi: hisi_sas: Stop returning error code from slot_complete_vX_hw() John Garry 2020-05-20 2:30 ` [PATCH 0/4] hisi_sas: Some misc patches Martin K. Petersen 4 siblings, 0 replies; 6+ messages in thread From: John Garry @ 2020-05-15 14:13 UTC (permalink / raw) To: jejb, martin.petersen Cc: linuxarm, linux-kernel, linux-scsi, Luo Jiaxing, John Garry From: Luo Jiaxing <luojiaxing@huawei.com> 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. Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com> Signed-off-by: John Garry <john.garry@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 41e07e9f6c8a..df9f06224f8f 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -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), -- 2.16.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] scsi: hisi_sas: Stop returning error code from slot_complete_vX_hw() 2020-05-15 14:13 [PATCH 0/4] hisi_sas: Some misc patches John Garry ` (2 preceding siblings ...) 2020-05-15 14:13 ` [PATCH 3/4] scsi: hisi_sas: Add SAS_RAS_INTR0 to debugfs register name list John Garry @ 2020-05-15 14:13 ` John Garry 2020-05-20 2:30 ` [PATCH 0/4] hisi_sas: Some misc patches Martin K. Petersen 4 siblings, 0 replies; 6+ messages in thread From: John Garry @ 2020-05-15 14:13 UTC (permalink / raw) To: jejb, martin.petersen; +Cc: linuxarm, linux-kernel, linux-scsi, John Garry The error codes are never checked, so stop returning them. Signed-off-by: John Garry <john.garry@huawei.com> --- 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(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index c205bff20943..2e1718f9ade2 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -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 */ diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index c725cffe141e..e7e7849a4c14 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -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, diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index df9f06224f8f..9acb67cae49c 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -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) -- 2.16.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] hisi_sas: Some misc patches 2020-05-15 14:13 [PATCH 0/4] hisi_sas: Some misc patches John Garry ` (3 preceding siblings ...) 2020-05-15 14:13 ` [PATCH 4/4] scsi: hisi_sas: Stop returning error code from slot_complete_vX_hw() John Garry @ 2020-05-20 2:30 ` Martin K. Petersen 4 siblings, 0 replies; 6+ messages in thread From: Martin K. Petersen @ 2020-05-20 2:30 UTC (permalink / raw) To: jejb, John Garry; +Cc: Martin K . Petersen, linuxarm, linux-scsi, linux-kernel On Fri, 15 May 2020 22:13:41 +0800, John Garry wrote: > 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() > > [...] 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 -- Martin K. Petersen Oracle Linux Engineering ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-05-20 2:32 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-05-15 14:13 [PATCH 0/4] hisi_sas: Some misc patches John Garry 2020-05-15 14:13 ` [PATCH 1/4] scsi: hisi_sas: Do not reset phy timer to wait for stray phyup John Garry 2020-05-15 14:13 ` [PATCH 2/4] scsi: hisi_sas: Modify the commit information for DSM method John Garry 2020-05-15 14:13 ` [PATCH 3/4] scsi: hisi_sas: Add SAS_RAS_INTR0 to debugfs register name list John Garry 2020-05-15 14:13 ` [PATCH 4/4] scsi: hisi_sas: Stop returning error code from slot_complete_vX_hw() John Garry 2020-05-20 2:30 ` [PATCH 0/4] hisi_sas: Some misc patches Martin K. Petersen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).