Re: [PATCH] scsi: t10-pi: Return correct ref tag when queue has no integrity profile

2018-12-06 Thread John Garry
On 06/12/2018 04:17, Martin K. Petersen wrote: + Bart, Had you considered to use lower_32_bits() instead of "0x"? That would to avoid that reviewers have to count the 'f'-s to verify correctness of t10_pi_ref_tag(). I hadn't. I guess I tend to think of lower_32_bits() as something

Re: [PATCH -next] mvsas: Remove set but not used variable 'id'

2018-10-22 Thread John Garry
20b09c2992fe ("[SCSI] mvsas: add support for 94xx; layout change; bug fixes") Signed-off-by: YueHaibing Reviewed-by: John Garry --- drivers/scsi/mvsas/mv_sas.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c ind

Re: Looking for some help understanding error handling

2018-10-22 Thread John Garry
On 19/10/2018 17:46, chris.mo...@microchip.com wrote: -Original Message- From: linux-scsi-ow...@vger.kernel.org On Behalf Of John Garry Sent: Friday, October 19, 2018 2:19 AM To: Chris Moore - C33997 ; h...@suse.de; linux-scsi@vger.kernel.org; Jason Yan Subject: Re: Looking for some

Re: Looking for some help understanding error handling

2018-10-19 Thread John Garry
On 05/10/2018 16:51, chris.mo...@microchip.com wrote: Thanks Hannes, After some pointers from Shane Seymour I found that the FC and SRP transport layers have a devloss timer, so that when a device disappears they hold on to the target information for a time waiting to see if it comes back.

Re: [PATCH 05/12] hisi_sas: use dma_set_mask_and_coherent

2018-10-18 Thread John Garry
helper function in the driver to factor this out, but prob not worth it. Having said that, I think lots of drivers have this same pattern... Acked-by: John Garry shost = hisi_sas_shost_alloc_pci(pdev);

Re: [PATCH -next] scsi: hisi_sas: Fix missing unlock on error in hisi_sas_phy_read32()

2018-10-18 Thread John Garry
On 18/10/2018 04:58, Wei Yongjun wrote: Add the missing unlock before return from function hisi_sas_phy_read32() in the error handling case. Fixes: 784b46b7cba0 ("scsi: hisi_sas: Use block layer tag instead for IPTT") Signed-off-by: Wei Yongjun --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 4

Re: [PATCH 0/7] hisi_sas: Misc bugfixes and an optimisation patch

2018-10-11 Thread John Garry
On 11/10/2018 14:32, Ming Lei wrote: On Thu, Oct 11, 2018 at 02:12:11PM +0100, John Garry wrote: On 11/10/2018 11:15, Christoph Hellwig wrote: On Thu, Oct 11, 2018 at 10:59:11AM +0100, John Garry wrote: blk-mq tags are always per-host (which has actually caused problems for ATA, which

Re: [PATCH 0/7] hisi_sas: Misc bugfixes and an optimisation patch

2018-10-11 Thread John Garry
On 11/10/2018 11:15, Christoph Hellwig wrote: On Thu, Oct 11, 2018 at 10:59:11AM +0100, John Garry wrote: blk-mq tags are always per-host (which has actually caused problems for ATA, which is now using its own per-device tags). So, for example, if Scsi_host.can_queue = 2048

Re: [PATCH 0/7] hisi_sas: Misc bugfixes and an optimisation patch

2018-10-11 Thread John Garry
On 11/10/2018 07:36, Christoph Hellwig wrote: On Wed, Oct 10, 2018 at 09:58:25PM -0400, Martin K. Petersen wrote: This is because the IPTT index must be a unique value per HBA. However, if we switched to SCSI MQ, the block layer tag becomes unique per queue, and not per HBA. That doesn't

Re: [PATCH-next] scsi: libsas: dynamically allocate and free ata host

2018-08-24 Thread John Garry
On 28/06/2018 23:07, Martin K. Petersen wrote: John, OK, but please be aware that there may be a more serious issue fixed here than the WARN, in that we could try to free memory embedded in a structure. We can still get it into 4.18.x. I'm just wary of submitting stuff to Linus that has had

Re: [PATCH v2] scsi: aic94xx: fix an error code in aic94xx_init()

2018-08-08 Thread John Garry
On 08/08/2018 15:29, Dan Carpenter wrote: We accidentally return success instead of -ENOMEM on this error path. Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver") Signed-off-by: Dan Carpenter thanks Reviewed-by: John Garry --- v2: return -ENOMEM instead of -ENODEV diff --git

Re: [PATCH] scsi: aic94xx: fix an error code in aic94xx_init()

2018-08-08 Thread John Garry
On 08/08/2018 12:56, Dan Carpenter wrote: We accidentally return success instead of -ENODEV on this error path. Sorry to nitpick, but - as I see - the only way for sas_domain_attach_transport() to fail is if the kzalloc() in sas_attach_transport() fails, so should this be -ENOMEM? Other

Re: [PATCH-next] scsi: libsas: dynamically allocate and free ata host

2018-06-27 Thread John Garry
On 26/06/2018 17:40, Martin K. Petersen wrote: John, Took a while for all the prerequisites to materialize. I just rebased 4.19/scsi-queue to v4.18-rc1 and applied your patch. Thanks! Is it possible to add this patch to the 4.18 fixes? I was on the fence on this but felt it was an

Re: [PATCH-next] scsi: libsas: dynamically allocate and free ata host

2018-06-25 Thread John Garry
On 19/06/2018 03:31, Martin K. Petersen wrote: Jason, So we have to change this embedded static ata host to a dynamically allocated ata host and initialize the ->kref member. To use ata_host_get() and ata_host_put() in libsas, we need to move the declaration of these functions to the public

Re: [PATCH 1/2 v2] libsas: remove irq save in sas_ata_qc_issue()

2018-06-14 Thread John Garry
they were disabled and remain disabled. Therefore remove the operations which do not change the behaviour. Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: John Garry

Re: [PATCH 0/2 REPOST] remove unneded irq save

2018-06-12 Thread John Garry
On 12/06/2018 15:31, Sebastian Andrzej Siewior wrote: On 2018-06-12 13:54:36 [+0100], John Garry wrote: +Dan On 11/06/2018 19:23, Sebastian Andrzej Siewior wrote: On 2018-06-11 18:12:55 [+0100], John Garry wrote: On 11/06/2018 15:40, Sebastian Andrzej Siewior wrote: This is the repost

Re: [PATCH 0/2 REPOST] remove unneded irq save

2018-06-12 Thread John Garry
+Dan On 11/06/2018 19:23, Sebastian Andrzej Siewior wrote: On 2018-06-11 18:12:55 [+0100], John Garry wrote: On 11/06/2018 15:40, Sebastian Andrzej Siewior wrote: This is the repost of the two patches I posted in earlier this month: - [PATCH 1/2] libsas: remove irq save in sas_ata_qc_issue

Re: [PATCH 0/2 REPOST] remove unneded irq save

2018-06-11 Thread John Garry
On 11/06/2018 15:40, Sebastian Andrzej Siewior wrote: This is the repost of the two patches I posted in earlier this month: - [PATCH 1/2] libsas: remove irq save in sas_ata_qc_issue() Received feedback but nothing really changed. I explained that this is not about "local_irqsave() +

Re: [PATCH 1/2] libsas: remove irq save in sas_ata_qc_issue()

2018-05-30 Thread John Garry
On 30/05/2018 15:28, Sebastian Andrzej Siewior wrote: On 2018-05-30 15:08:37 [+0100], John Garry wrote: On 30/05/2018 14:45, Sebastian Andrzej Siewior wrote: excellent. So no more objections from your side or is this a complaint I didn't fully decode? I think the original code is not great

Re: [PATCH 1/2] libsas: remove irq save in sas_ata_qc_issue()

2018-05-30 Thread John Garry
On 30/05/2018 14:45, Sebastian Andrzej Siewior wrote: On 2018-05-30 14:37:50 [+0100], John Garry wrote: On 30/05/2018 12:22, Sebastian Andrzej Siewior wrote: Yes, there are the same on vanilla and not on RT. However my point is that the code does this instead: local_irq_save

Re: [PATCH 1/2] libsas: remove irq save in sas_ata_qc_issue()

2018-05-30 Thread John Garry
On 30/05/2018 12:22, Sebastian Andrzej Siewior wrote: On 2018-05-30 12:16:23 [+0100], John Garry wrote: On 30/05/2018 11:16, Sebastian Andrzej Siewior wrote: On 2018-05-30 10:34:12 [+0100], John Garry wrote: Sorry, but personally I don't see much value in this change. I think it's better

Re: [PATCH 1/2] libsas: remove irq save in sas_ata_qc_issue()

2018-05-30 Thread John Garry
On 30/05/2018 11:16, Sebastian Andrzej Siewior wrote: On 2018-05-30 10:34:12 [+0100], John Garry wrote: Sorry, but personally I don't see much value in this change. I think it's better for safety to be consistent in how we lock & unlock the spinlock, i.e. use irqsave variant (or sim

Re: [PATCH 1/2] libsas: remove irq save in sas_ata_qc_issue()

2018-05-30 Thread John Garry
On 23/05/2018 10:24, Sebastian Andrzej Siewior wrote: On 2018-05-23 09:46:30 [+0100], John Garry wrote: On 22/05/2018 18:31, Sebastian Andrzej Siewior wrote: On 2018-05-18 14:31:27 [+0100], John Garry wrote: On 04/05/2018 15:50, Sebastian Andrzej Siewior wrote: Since commit 312d3e56119a

Re: [PATCH 1/2] libsas: remove irq save in sas_ata_qc_issue()

2018-05-23 Thread John Garry
On 22/05/2018 18:31, Sebastian Andrzej Siewior wrote: On 2018-05-18 14:31:27 [+0100], John Garry wrote: On 04/05/2018 15:50, Sebastian Andrzej Siewior wrote: Since commit 312d3e56119a ("[SCSI] libsas: remove ata_port.lock management duties from lldds") the sas_ata_qc_issue() functi

[PATCH 01/13] scsi: hisi_sas: Introduce hisi_sas_phy_set_linkrate()

2018-05-21 Thread John Garry
There is much common code and functionality between the HW versions to set the PHY linkrate. As such, this patch factors out the common code into a generic function hisi_sas_phy_set_linkrate(). Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c

[PATCH 03/13] scsi: hisi_sas: Change common allocation mode of device id

2018-05-21 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> To reduce possibility of hitting unknown SoC bugs and aid debugging and test, change allocation mode of device id from last used device id instead of lowest available index. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-

[PATCH 07/13] scsi: hisi_sas: Init disks after controller reset

2018-05-21 Thread John Garry
; Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 7b8623b..0dfefdf 100644

[PATCH 02/13] scsi: hisi_sas: change slot index allocation mode

2018-05-21 Thread John Garry
e next allocation method is to use the next free slot adjacent to the most recently allocated slot, in a round-robin fashion. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 1 + dri

[PATCH 05/13] scsi: hisi_sas: Reset disks when discovered

2018-05-21 Thread John Garry
Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 50 ++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git

[PATCH 08/13] scsi: hisi_sas: Try wait commands before before controller reset

2018-05-21 Thread John Garry
s been reported to driver. We can use this register and it is reliable to resd this register in such scenarios that require host reset. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas.h |

[PATCH 06/13] scsi: hisi_sas: Create a scsi_host_template per HW module

2018-05-21 Thread John Garry
module to create the Scsi host. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 8 +-- drivers/scsi/hisi_sas/hisi_sas_main.c | 40 +- dri

[PATCH 12/13] scsi: hisi_sas: Fix return value when get_free_slot() failed

2018-05-21 Thread John Garry
e_slot() doesn't return failure when get_free_slot() failed. This patch is to fix it. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dri

[PATCH 00/13] hisi_sas: Misc improvements, bugfixes, etc.

2018-05-21 Thread John Garry
bugs - fix potential problem of removing the driver when a disk is mounted - other more minor stuff John Garry (1): scsi: hisi_sas: Introduce hisi_sas_phy_set_linkrate() Xiang Chen (5): scsi: hisi_sas: change slot index allocation mode scsi: hisi_sas: Change common allocation mode of device

[PATCH 11/13] scsi: hisi_sas: Terminate STP reject quickly for v2 hw

2018-05-21 Thread John Garry
device before terminating STP reject. This is a quirk of v2 hw. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 78 +++ 1 file changed, 78 insertions(+) di

[PATCH 09/13] scsi: hisi_sas: Include TMF elements in struct hisi_sas_slot

2018-05-21 Thread John Garry
ctions. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 14 +++--- drivers/scsi/hisi_sas/hisi_sas_main.c | 15 +++ drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 12 ++--

[PATCH 10/13] scsi: hisi_sas: Add v2 hw force PHY function for internal ATA command

2018-05-21 Thread John Garry
nction will be used in the later patch. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 2 ++ drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 11 +++ 2 files changed, 13 insertions(+) diff --

[PATCH 13/13] scsi: hisi_sas: Mark PHY as in reset for nexus reset

2018-05-21 Thread John Garry
enario that the PHY does not come up after a timeout period, then report the PHY down to libsas. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 5 - drivers/scsi/hisi_sas/his

[PATCH 04/13] scsi: hisi_sas: Add LED feature for v3 hw

2018-05-21 Thread John Garry
; Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 42 ++ 1 file changed, 42 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 0a80a39..a043d9c 100644

Re: [PATCH 1/2] libsas: remove irq save in sas_ata_qc_issue()

2018-05-18 Thread John Garry
On 04/05/2018 15:50, Sebastian Andrzej Siewior wrote: Since commit 312d3e56119a ("[SCSI] libsas: remove ata_port.lock management duties from lldds") the sas_ata_qc_issue() function unlocks the ata_port.lock and disables interrupts before doing so. That lock is always taken with disabled

[PATCH 2/6] scsi: hisi_sas: make return type of prep functions void

2018-05-09 Thread John Garry
ceeded the HW SGE limit. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 8 +++--- drivers/scsi/hisi_sas/hisi_sas_main.c | 45 ++ drivers/scsi/hisi_sa

[PATCH 6/6] scsi: hisi_sas: add check of device in hisi_sas_task_exec()

2018-05-09 Thread John Garry
check that the device pointer is still safe to reference. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --

[PATCH 3/6] scsi: hisi_sas: allocate slot buffer earlier

2018-05-09 Thread John Garry
estore() is removed from internal task exec function. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 55 --- 1 file changed, 31 insertions(+), 24 deleti

[PATCH 4/6] scsi: hisi_sas: Don't lock DQ for complete task sending

2018-05-09 Thread John Garry
t from the DQ and when delivering a slot to the HW. This approach is now safe, thanks to the previous patches to ensure that we always deliver a slot to the HW once allocated. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- dri

[PATCH 5/6] scsi: hisi_sas: Use device lock to protect slot alloc/free

2018-05-09 Thread John Garry
m> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 56 ++ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 3 -- 2 files changed, 16 insertions(+), 43 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main

[PATCH 1/6] scsi: hisi_sas: relocate smp sg map

2018-05-09 Thread John Garry
g Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 56 ++ drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 33 ++-- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 35 ++--

[PATCH 05/11] scsi: hisi_sas: check sas_dev gone earlier in hisi_sas_abort_task()

2018-05-02 Thread John Garry
Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_s

[PATCH 02/11] scsi: hisi_sas: Add some checks to avoid free'ing a sas_task twice

2018-05-02 Thread John Garry
rotect the LLDD and libsas free'ing the task. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 22 +++--- dri

[PATCH 00/11] hisi_sas: some misc patches

2018-05-02 Thread John Garry
This patchset introduces some misc changes for the driver. These include: - fixes for potential problems related to SCSI EH and device removal races - fix protection info size for all hw versions - some SoC bug workarounds - minor optimisations - other more minor things John Garry (2): scsi

[PATCH 04/11] scsi: hisi_sas: fix PI memory size

2018-05-02 Thread John Garry
;chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 147cfaf..04a40c4 100644 --- a/dri

[PATCH 03/11] scsi: hisi_sas: check host frozen before calling "done" function

2018-05-02 Thread John Garry
n the frozen state, we rely on SCSI EH and libsas to free the sas_task directly. We do not do this for the following IO types: - SMP - they are managed in libsas directly, outside SCSI EH - Any internally originated IO, for similar reason Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> S

[PATCH 08/11] scsi: hisi_sas: config ATA de-reset as an constrained command for v3 hw

2018-05-02 Thread John Garry
en ATA reset de-assert retry will also fail. Then we will retry the proper process of ATA reset assert and de-assert again. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 11 ++-

[PATCH 07/11] scsi: hisi_sas: update PHY linkrate after a controller reset

2018-05-02 Thread John Garry
ed PHY linkrate, honouring the max linkrate programmed via sysfs. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 1 + drivers/scsi/hisi_sas/hisi_sas_main.c | 16 dri

[PATCH 11/11] scsi: hisi_sas: workaround a v3 hw hilink bug

2018-05-02 Thread John Garry
PHY Then the HW will reissue PHY down interrupt. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff -

[PATCH 10/11] scsi: hisi_sas: add readl poll timeout helper wrappers

2018-05-02 Thread John Garry
It is common to use readl poll timeout helpers in the driver, so create custom wrappers. Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/driver

[PATCH 09/11] scsi: hisi_sas: remove redundant handling to event95 for v3

2018-05-02 Thread John Garry
From: Xiaofei Tan <tanxiao...@huawei.com> Event95 is used for DFX purpose. The relevant bit for this interrupt in the ENT_INT_SRC_MSK3 register has been disabled, so remove the processing. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.g

[PATCH 06/11] scsi: hisi_sas: stop controller timer for reset

2018-05-02 Thread John Garry
We should only have the timer enabled after PHY up after controller reset, so disable prior to reset. Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 +++ 1 file changed, 3 inserti

[PATCH 01/11] scsi: hisi_sas: optimise the usage of DQ locking

2018-05-02 Thread John Garry
would be no possible contention between DQ processing running for the same queue in parallel. It is still necessary to take hisi_hba lock when free'ing slots. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hi

[PATCH 5/8] scsi: hisi_sas: consolidate command check in hisi_sas_get_ata_protocol()

2018-03-23 Thread John Garry
com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 9563dfa..8557

[PATCH 4/8] scsi: hisi_sas: use dma_zalloc_coherent()

2018-03-23 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> This is a warning coming from Coccinelle, and need to use new interface dma_zalloc_coherent() instead of dma_alloc_coherent()/memset(). Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.g

[PATCH 1/8] scsi: hisi_sas: make SAS address of SATA disks unique

2018-03-23 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> When directly connected with SATA disks in different SAS cores, fill SAS address with scsi_host's id to make it's fake SAS address unique. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.g

[PATCH 3/8] scsi: hisi_sas: delete timer when removing hisi_sas driver

2018-03-23 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> Delete timer for v1 and v3 hw when removing hisi_sas driver. Signed-off-by: Xiang chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 +++ dri

[PATCH 2/8] scsi: hisi_sas: update RAS feature for later revision of v3 HW

2018-03-23 Thread John Garry
t;tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 60 -- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi

[PATCH 6/8] scsi: hisi_sas: check IPTT is valid before using it for v3 hw

2018-03-23 Thread John Garry
d slot. This workaround scheme is just to enhance fault-tolerance of the driver. So, we will apply this scheme for all version of v3 hw, although release version has fixed this SoC bug. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com>

[PATCH 0/8] hisi_sas: some misc changes

2018-03-23 Thread John Garry
This patchset introduces some minor, more trivial patches, some of which have been sitting on our internal dev branch for a while. The only bug fixes (hw workaround or sw) are the IPTT range check fix and a timer fix for module removal. Others are trivial. John Garry (2): scsi: hisi_sas: print

[PATCH 7/8] scsi: hisi_sas: print device id for errors

2018-03-23 Thread John Garry
When we find an erroneous slot completion, to help aid debugging add the device index to the current debug log. Signed-off-by: John Garry <john.ga...@huawei.com> Reviewed-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 4 ++-- drivers/s

[PATCH 8/8] scsi: hisi_sas: remove some unneeded structure members

2018-03-23 Thread John Garry
() Signed-off-by: John Garry <john.ga...@huawei.com> Reviewed-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 3 --- drivers/scsi/hisi_sas/hisi_sas_main.c | 17 + drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 -- 3 files changed,

Re: [PATCH v2 17/21] scsi: hisi_sas: Remove depends on HAS_DMA in case of platform dependency

2018-03-16 Thread John Garry
d-by: Mark Brown <broo...@kernel.org> Acked-by: Robin Murphy <robin.mur...@arm.com> Acked-by: John Garry <john.ga...@huawei.com>

Re: [PATCH v2] scsi: libsas: defer ata device eh commands to libata

2018-03-07 Thread John Garry
Xiaofei Tan <tanxiao...@huawei.com> CC: John Garry <john.ga...@huawei.com> CC: Dan Williams <dan.j.willi...@intel.com> Hi Jason, Would be good if you add the Fixes tag, so distribution could pick it up easily. And wasn't the idea to delete sas_eh_finish_cmd instead of sas_eh_defer_

[PATCH v4 0/10] hisi_sas: support x6000 board and some misc changes

2018-03-07 Thread John Garry
This patchset primarily adds support for the Huawei x6000 board, which includes hip07 chipset. Unfortunately, due to some board layout differences with our development board, we need to set a PHY-related register differently for optimal signal quality. As such, a signal attenuation property is

[PATCH v4 02/10] scsi: hisi_sas: support the property of signal attenuation for v2 hw

2018-03-07 Thread John Garry
board, this patch add support to reading the devicetree property, "hisilicon,signal-attenuation". Of course, we still keep an default value in driver to adapt old board. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com>

[PATCH v4 06/10] scsi: hisi_sas: remove unused variable hisi_sas_devices.running_req

2018-03-07 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> The structure element hisi_sas_devices.running_req to count how many commands are active is in effect only ever written in the code, so remove it. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.g

[PATCH v4 03/10] scsi: hisi_sas: fix the issue of link rate inconsistency

2018-03-07 Thread John Garry
; Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 ++ drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 1 - drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 8 +--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 13 + 4 files changed, 4 insertion

[PATCH v4 09/10] scsi: hisi_sas: modify some register config for hip08

2018-03-07 Thread John Garry
ed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) d

[PATCH v4 05/10] scsi: hisi_sas: increase timer expire of internal abort task

2018-03-07 Thread John Garry
rocess finished. The maximum time is 5s for the retry of setting up link. So, the timer expire should be more than 5s. This patch increases it from 110ms to 6s. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/h

[PATCH v4 10/10] scsi: hisi_sas: add v3 hw MODULE_DEVICE_TABLE()

2018-03-07 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> Export device table of v3 hw to userspace, or auto probe will fail for v3 hw. Also change the module alias to include "pci", instead of "platform". Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: J

[PATCH v4 08/10] scsi: hisi_sas: Code cleanup and minor bug fixes

2018-03-07 Thread John Garry
Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 14 +++--- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 4 +++- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 10 ++ drivers/scsi/his

[PATCH v4 01/10] dt-bindings: scsi: hisi_sas: add an property of signal attenuation

2018-03-07 Thread John Garry
t;hisilicon,signal-attenuation", which is used to describe the signal attenuation of an board. Cc: Rob Herring <robh...@kernel.org> Cc: Mark Rutland <mark.rutl...@arm.com> Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> ---

[PATCH v4 04/10] scsi: hisi_sas: fix the issue of setting linkrate register

2018-03-07 Thread John Garry
Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 5 +++-- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 5 +++-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 5 +++-- 3 files changed, 9 insertio

[PATCH v4 07/10] scsi: hisi_sas: fix return value of hisi_sas_task_prep()

2018-03-07 Thread John Garry
() may return the number of bytes of underrun. It will be conflicted with the scenaio lldd_execute_task() return an positive error code. This patch change the return value from SAS_PHY_DOWN to -ECOMM in hisi_sas_task_prep(). Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by

Re: [PATCH v3 5/8] scsi: hisi_sas: increase timer expire of internal abort task

2018-03-06 Thread John Garry
On 06/03/2018 11:23, Hannes Reinecke wrote: On 03/05/2018 03:48 PM, John Garry wrote: From: Xiaofei Tan <tanxiao...@huawei.com> The current 110ms expiry time is not long enough for the internal abort task. The reason is that the internal abort task could be blocked in HW if the HW is re

Re: [PATCH v3 8/8] scsi: hisi_sas: Code cleanup and minor bug fixes

2018-03-06 Thread John Garry
Hi Hannes, Thanks for checking this. > + } > return -EINVAL? >return 0; > } [ ... ] > + } > >return 0; > } return -EINVAL? > @@ -2408,7 +2410,7 @@ static void slot_err_v2_hw(struct hisi_hba *hisi_hba, >spin_lock_irqsave(_hba->lock, flags); >

[PATCH v3 7/8] scsi: hisi_sas: fix return value of hisi_sas_task_prep()

2018-03-05 Thread John Garry
() may return the number of bytes of underrun. It will be conflicted with the scenaio lldd_execute_task() return an positive error code. This patch change the return value from SAS_PHY_DOWN to -ECOMM in hisi_sas_task_prep(). Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by

[PATCH v3 0/8] hisi_sas: support x6000 board and some misc changes

2018-03-05 Thread John Garry
This patchset primarily adds support for the Huawei x6000 board, which includes hip07 chipset. Unfortunately, due to some board layout differences with our development board, we need to set a PHY-related register differently for optimal signal quality. As such, a signal attenuation property is

[PATCH v3 3/8] scsi: hisi_sas: fix the issue of link rate inconsistency

2018-03-05 Thread John Garry
; Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 ++ drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 1 - drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 8 +--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 13 + 4 files changed, 4 insertion

[PATCH v3 4/8] scsi: hisi_sas: fix the issue of setting linkrate register

2018-03-05 Thread John Garry
Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 5 +++-- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 5 +++-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 5 +++-- 3 files changed, 9 insertio

[PATCH v3 6/8] scsi: hisi_sas: remove unused variable hisi_sas_devices.running_req

2018-03-05 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> The structure element hisi_sas_devices.running_req to count how many commands are active is in effect only ever written in the code, so remove it. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.g

[PATCH v3 8/8] scsi: hisi_sas: Code cleanup and minor bug fixes

2018-03-05 Thread John Garry
on.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 14 +++--- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 4 +++- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 10 ++ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 16 +-

[PATCH v3 1/8] dt-bindings: scsi: hisi_sas: add an property of signal attenuation

2018-03-05 Thread John Garry
t;hisilicon,signal-attenuation", which is used to describe the signal attenuation of an board. Cc: Rob Herring <robh...@kernel.org> Cc: Mark Rutland <mark.rutl...@arm.com> Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> ---

[PATCH v3 2/8] scsi: hisi_sas: support the property of signal attenuation for v2 hw

2018-03-05 Thread John Garry
board, this patch add support to reading the devicetree property, "hisilicon,signal-attenuation". Of course, we still keep an default value in driver to adapt old board. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com>

[PATCH v3 5/8] scsi: hisi_sas: increase timer expire of internal abort task

2018-03-05 Thread John Garry
rocess finished. The maximum time is 5s for the retry of setting up link. So, the timer expire should be more than 5s. This patch increases it from 110ms to 6s. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/h

Re: [PATCH v2 1/8] dt-bindings: scsi: hisi_sas: add an property of signal attenuation

2018-03-02 Thread John Garry
On 02/03/2018 15:57, Rob Herring wrote: On Fri, Mar 2, 2018 at 9:06 AM, John Garry <john.ga...@huawei.com> wrote: > From: Xiaofei Tan <tanxiao...@huawei.com> > > For some new boards with hip07 chipset we are required to > set PHY config registers differently. The hw pro

[PATCH v2 3/8] scsi: hisi_sas: fix the issue of link rate inconsistency

2018-03-02 Thread John Garry
; Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 ++ drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 1 - drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 8 +--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 13 + 4 files changed, 4 insertion

[PATCH v2 7/8] scsi: hisi_sas: fix return value of hisi_sas_task_prep()

2018-03-02 Thread John Garry
() may return the number of bytes of underrun. It will be conflicted with the scenaio lldd_execute_task() return an positive error code. This patch change the return value from SAS_PHY_DOWN to -ECOMM in hisi_sas_task_prep(). Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by

[PATCH v2 6/8] scsi: hisi_sas: remove unused variable hisi_sas_devices.running_req

2018-03-02 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> The structure element hisi_sas_devices.running_req to count how many commands are active is in effect only ever written in the code, so remove it. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.g

[PATCH v2 1/8] dt-bindings: scsi: hisi_sas: add an property of signal attenuation

2018-03-02 Thread John Garry
signal-attenuation, which is used to describe the signal attenuation of an board. Cc: Rob Herring <robh...@kernel.org> Cc: Mark Rutland <mark.rutl...@arm.com> Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- Document

[PATCH v2 5/8] scsi: hisi_sas: increase timer expire of internal abort task

2018-03-02 Thread John Garry
rocess finished. The maximum time is 5s for the retry of setting up link. So, the timer expire should be more than 5s. This patch increases it from 110ms to 6s. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/h

[PATCH v2 0/8] hisi_sas: support x6000 board and some misc changes

2018-03-02 Thread John Garry
This patchset primarily adds support for the Huawei x6000 board, which includes hip07 chipset. Unfortunately, due to some board layout differences with our development board, we need to set a PHY-related register differently for optimal signal quality. As such, a signal attenuation property is

[PATCH v2 8/8] scsi: hisi_sas: Code cleanup and minor bug fixes

2018-03-02 Thread John Garry
on.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 14 +++--- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 4 +++- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 10 ++ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 16 +-

[PATCH v2 4/8] scsi: hisi_sas: fix the issue of setting linkrate register

2018-03-02 Thread John Garry
Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 5 +++-- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 5 +++-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 5 +++-- 3 files changed, 9 insertio

[PATCH v2 2/8] scsi: hisi_sas: support the property of signal attenuation for v2 hw

2018-03-02 Thread John Garry
board, this patch add support to reading the devicetree property, hisi-signal-attenuation. Of course, we still keep an default value in driver to adapt old board. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/his

  1   2   3   4   5   6   7   8   >