Re: [PATCH] scsi: hisi_sas: add missing break in switch statement

2017-03-28 Thread John Garry
;colin.k...@canonical.com> Thanks, checkpatch.pl would normally catch this but it was hidden in the formatted patch Signed-off-by: John Garry <john.ga...@huawei.com>

[PATCH 14/23] scsi: hisi_sas: remove task free'ing for timeouts

2017-03-22 Thread John Garry
When a TMF or internal abort times-out, do not free slot. We expect this to be done upon later escalated error handling. Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff

[PATCH 02/23] scsi: hisi_sas: add controller reset

2017-03-22 Thread John Garry
g 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.h | 7 ++ drivers/scsi/hisi_sas/hisi_sas_main.c | 134 +++-

[PATCH 08/23] scsi: hisi_sas: modify error handling for v2 hw

2017-03-22 Thread John Garry
or. So Instead of adding special error handling for this scenario in the LLDD, allow the upper layer to handle completely. No performance hit is seen by taking this approach. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- dri

[PATCH 05/23] scsi: hisi_sas: remove hisi_sas_port_deformed()

2017-03-22 Thread John Garry
the code to link slots to the hisi_sas_device, and not hisi_sas_port. Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 4 +- drivers/scsi/hisi_sas/hisi_sas_

[PATCH 22/23] scsi: hisi_sas: use dev_is_sata to identify SATA or SAS disk

2017-03-22 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> When SMP IO is sent, sas_protocol_ata couldn't judge whether the disk is SATA or SAS disk. So use dev_is_sata to identify SATA or SAS disk. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.g

[PATCH 01/23] scsi: hisi_sas: add to_hisi_sas_port()

2017-03-22 Thread John Garry
Introduce function to get hisi_sas_port from asd_sas_port. Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 2 ++ drivers/scsi/hisi_sas/hisi_sas_main.c | 17 +

[PATCH 06/23] scsi: hisi_sas: error hisi_sas_task_prep() when port down

2017-03-22 Thread John Garry
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: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 5 ++--- 1

[PATCH 15/23] scsi: hisi_sas: process error codes according to their priority

2017-03-22 Thread John Garry
gned-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 553 - 1 file changed, 398 insertions(+), 155 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2

[PATCH 18/23] scsi: hisi_sas: rename hisi_sas_link_timeout_{enable, disable}_link

2017-03-22 Thread John Garry
For consistency, remove the "hisi_sas_" prefix. Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drive

[PATCH 17/23] scsi: hisi_sas: handle PHY UP+DOWN simultaneous irq

2017-03-22 Thread John Garry
From: Xiaofei Tan <tanxiao...@huawei.com> Handle the situation that PHY UP and DOWN irq happen simultaneously. There is no mechanism of SoC HW to ensure this situation will never happen. So, we add this handle just in case. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-

[PATCH 04/23] scsi: hisi_sas: add softreset function for SATA disk

2017-03-22 Thread John Garry
e need to execute internal abort for device. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/Kconfig | 2 +- drivers/scsi/hisi_sas/hisi_sas_main.c | 70 -- dri

[PATCH 19/23] scsi: hisi_sas: add hisi_sas_clear_nexus_ha()

2017-03-22 Thread John Garry
Add function for upper-layer to reset controller when all else fails. Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 8 1 file changed, 8 insertions(+) diff --git a/

[PATCH 03/23] scsi: hisi_sas: move PHY init to hisi_sas_scan_start()

2017-03-22 Thread John Garry
Relocate the PHY init code from LLDD hw init path to hisi_sas_scan_start(). Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 2 +- drivers/scsi/hisi_sas/hisi_sas_main.c | 9 +++---

[PATCH 10/23] scsi: hisi_sas: hardreset for SATA disk in LU reset

2017-03-22 Thread John Garry
When issuing an LU reset for a SATA target, issue an internal abort and a hard reset. Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 38 ++- 1 file

[PATCH 13/23] scsi: hisi_sas: fix some sas_task.task_state_lock locking

2017-03-22 Thread John Garry
Some more locking needs to be added/modified for when read-modify-writing sas_task.task_state_flags. Note: since we can attempt to grab this lock in interrupt context we should use irq variant of spin_lock. Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xian

[PATCH 20/23] scsi: hisi_sas: release SMP slot in lldd_abort_task

2017-03-22 Thread John Garry
s_task will still be later released, so the slot's sas_task is NULL, which will cause NULL pointer when hisi_sas_slot_task_free happens later. To resolve, check the return value of internal abort, and release the slot if it failed. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by

[PATCH 12/23] scsi: hisi_sas: free slots after hardreset

2017-03-22 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> After hardreset, we clear up IOs of remote disks, so we need to free those slots in LLDD. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hi

[PATCH 16/23] scsi: hisi_sas: some modifications to v2 hw reg init values

2017-03-22 Thread John Garry
This patch includes: (1) Disable transport layer retry (2) Support CQ time and count interrupt coal (3) fix link FIFO full issue Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: Zhao Nenglong <zhaonengl...@hisilicon.com> Signed-off-by: John Garry <john.g

[PATCH 21/23] scsi: hisi_sas: check hisi_sas_lu_reset() error message

2017-03-22 Thread John Garry
Unless we actually get some sort of failure in hisi_sas_lu_reset(), don't print a message. Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 5 +++-- 1 file changed, 3 insertions(+),

[PATCH 09/23] scsi: hisi_sas: modify hisi_sas_abort_task() for SSP

2017-03-22 Thread John Garry
-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 28 ++-- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 2 +- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/

[PATCH 23/23] scsi: hisi_sas: add is_sata_phy_v2_hw()

2017-03-22 Thread John Garry
From: Xiaofei Tan <tanxiao...@huawei.com> Add helper function is_sata_phy_v2_hw() to judge whether the attached device is SATA disk for a root PHY. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sa

[PATCH 11/23] scsi: hisi_sas: check for SAS_TASK_STATE_ABORTED in slot complete

2017-03-22 Thread John Garry
Check in slot_complete_v2_hw() for whether a task has already been completed by upper layer. 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 | 10 ++ 1 file changed, 10 inserti

[PATCH 07/23] scsi: hisi_sas: only reset link for PHY_FUNC_LINK_RESET

2017-03-22 Thread John Garry
We currently do a hard reset for a link reset. Change this to do a link reset only. Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxi...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

[PATCH 00/23] hisi_sas: error handling and other misc fixes and improvements

2017-03-22 Thread John Garry
This patchset introduces a range of error handling and other misc improvements for the HiSilicon SAS controller, including: - controller reset function - softreset for SATA error handling - fixes for slot free'ing - v2 hw error handling improvements - and other misc, more minor stuff John Garry

Re: [PATCH] scsi: libsas: fix ata xfer length

2017-03-20 Thread John Garry
On 19/03/2017 17:21, Martin K. Petersen wrote: John Garry <john.ga...@huawei.com> writes: John, The total ata xfer length may not be calculated properly, in that we do not use the proper method to get an sg element dma length. According to the code comment, sg_dma_len() should be used

[PATCH] scsi: libsas: fix ata xfer length

2017-03-16 Thread John Garry
controller in hip07. Multiple sg elements were being combined into a single element, but the original first element length was being use as the total xfer length. Signed-off-by: John Garry <john.ga...@huawei.com> diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 7

[PATCH v2 5/7] scsi: hisi_sas: downgrade internal abort exit print

2017-01-20 Thread John Garry
Downgrade the exit print in hisi_sas_internal_task_abort() to dbg level, as info is not required. Signed-off-by: John Garry <john.ga...@huawei.com> Reviewed-by: Xiang Chen <chenxian...@hisilicon.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/scsi/hisi_s

[PATCH v2 3/7] scsi: hisi_sas: downgrade refclk message

2017-01-20 Thread John Garry
The message to inform that the controller has no refclk is currently at warning level, which is unnecessary, so downgrade to debug. Signed-off-by: John Garry <john.ga...@huawei.com> Reviewed-by: Xiang Chen <chenxian...@hisilicon.com> Reviewed-by: Johannes Thumshirn <jth

[PATCH v2 2/7] scsi: hisi_sas: modify some values of ITCT table

2017-01-20 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> Set SMP connection timeout and continue AWT timer; Clear ITCT table when dev gone. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> Reviewed-by: Johannes Thumshirn &

[PATCH v2 0/7] hisi_sas: SATA IO workaround and other misc patches

2017-01-20 Thread John Garry
This patchset introduces some misc fixes and improvements. Most signifigantly this patchset includes a workaround for a SATA IO issue on v2 hw (hip06/7). Differences v1->v2: - Add macro for SMP TIMEOUT in ITCT struct John Garry (2): scsi: hisi_sas: downgrade refclk message scsi: hisi_

[PATCH v2 1/7] scsi: hisi_sas: workaround v2 hw SATA IO timeout issue

2017-01-20 Thread John Garry
figure the SAS controller so it doesn't receive STP setup requests from SATA disks for a while, so IO can be sent during this period. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.

[PATCH v2 6/7] scsi: hisi_sas: fix probe ordering problem

2017-01-20 Thread John Garry
t;hw_init(). To avoid this issue, initialise the hw after sas_register_ha() in the same probe context. Note: it is not necessary to use 1s timer now (modified v2 hw only). Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> Reviewed-by: Johann

[PATCH v2 4/7] scsi: hisi_sas: modify hard reset for directed-attached disk

2017-01-20 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> Correctly set registers in v2 for root PHY hardreset for directly attached disk. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> Reviewed-by: Johannes Thumshirn <jthumsh...@

[PATCH v2 7/7] scsi: hisi_sas: decrease running_req in hisi_sas_slot_task_free()

2017-01-20 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> There is an issue that hisi_sas_dev.running_req is not decremented properly for internal abort and TMF. To resolve, only decrease running_req in hisi_sas_slot_task_free() Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by

Re: [PATCH 2/7] scsi: hisi_sas: modify some values of ITCT table

2017-01-19 Thread John Garry
On 19/01/2017 08:44, Johannes Thumshirn wrote: On Thu, Jan 19, 2017 at 12:32:48AM +0800, John Garry wrote: From: Xiang Chen <chenxian...@hisilicon.com> Set SMP connection timeout and continue AWT timer; Clear ITCT table when dev gone. Signed-off-by: Xiang Chen <chenxian...@hisi

[PATCH 6/7] scsi: hisi_sas: fix probe ordering problem

2017-01-18 Thread John Garry
t;hw_init(). To avoid this issue, initialise the hw after sas_register_ha() in the same probe context. Note: it is not necessary to use 1s timer now (modified v2 hw only). Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/his

[PATCH 7/7] scsi: hisi_sas: decrease running_req in hisi_sas_slot_task_free()

2017-01-18 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> There is an issue that hisi_sas_dev.running_req is not decremented properly for internal abort and TMF. To resolve, only decrease running_req in hisi_sas_slot_task_free() Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by

[PATCH 0/7] hisi_sas: SATA IO workaround and other misc patches

2017-01-18 Thread John Garry
This patchset introduces some misc fixes and improvements. Most signifigantly this patchset includes a workaround for a SATA IO issue on v2 hw (hip06/7). John Garry (2): scsi: hisi_sas: downgrade refclk message scsi: hisi_sas: downgrade internal abort exit print Xiang Chen (5): scsi

[PATCH 5/7] scsi: hisi_sas: downgrade internal abort exit print

2017-01-18 Thread John Garry
Downgrade the exit print in hisi_sas_internal_task_abort() to dbg level, as info is not required. Signed-off-by: John Garry <john.ga...@huawei.com> Reviewed-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 +- 1 file changed, 1 insertion(+)

[PATCH 2/7] scsi: hisi_sas: modify some values of ITCT table

2017-01-18 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> Set SMP connection timeout and continue AWT timer; Clear ITCT table when dev gone. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c |

[PATCH 1/7] scsi: hisi_sas: workaround v2 hw SATA IO timeout issue

2017-01-18 Thread John Garry
figure the SAS controller so it doesn't receive STP setup requests from SATA disks for a while, so IO can be sent during this period. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/his

[PATCH 4/7] scsi: hisi_sas: modify hard reset for directed-attached disk

2017-01-18 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> Correctly set registers in v2 for root PHY hardreset for directly attached disk. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c

[PATCH 3/7] scsi: hisi_sas: downgrade refclk message

2017-01-18 Thread John Garry
The message to inform that the controller has no refclk is currently at warning level, which is unnecessary, so downgrade to debug. Signed-off-by: John Garry <john.ga...@huawei.com> Reviewed-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c |

Re: [PATCH] libsas: fix \"sysfs group not found\" warnings at port teardown time

2017-01-11 Thread John Garry
On 11/01/2017 06:29, seeteena wrote: Hi All, Let me know if this patch is accepted in Upsteam? let me know the commit id If it is the patch I think it is then it is not upstream (https://patchwork.kernel.org/patch/6450731/). I did propose a patch at the end of last year which fixed the

Re: [PATCH] scsi: remove useless acpi functions in the head file

2017-01-10 Thread John Garry
* @status: the status passed up from the driver (including host and Looks ok, Reviewed-by: John Garry <john.ga...@huawei.com> -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 3/3] scsi: hisi_sas: lock sensitive region in hisi_sas_slot_abort()

2017-01-03 Thread John Garry
When we call hisi_sas_slot_task_free() we should grab the hisi_hba.lock, as hisi_sas_slot_task_free() accesses common hisi_hba elements. Function hisi_sas_slot_abort() is missing this, so add it. Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main

[PATCH 1/3] scsi: hisi_sas: service v2 hw CQ ISR with tasklet

2017-01-03 Thread John Garry
its down tasklet. Signed-off-by: John Garry <john.ga...@huawei.com> Reviewed-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 1 + drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 24 ++-- 2 files changed, 19 insertions(+), 6 deleti

[PATCH 0/3] hisi_sas: some CQ processing fixes

2017-01-03 Thread John Garry
done in the ISR. John Garry (3): scsi: hisi_sas: service v2 hw CQ ISR with tasklet scsi: hisi_sas: lock sensitive regions when servicing CQ interrupt scsi: hisi_sas: lock sensitive region in hisi_sas_slot_abort() drivers/scsi/hisi_sas/hisi_sas.h | 1 + drivers/scsi/hisi_sas

[PATCH 2/3] scsi: hisi_sas: lock sensitive regions when servicing CQ interrupt

2017-01-03 Thread John Garry
(in hisi_hba.slot_index_tags), and completion queue read pointer. As a solution, lock these elements with the hisi_hba.lock. Signed-off-by: John Garry <john.ga...@huawei.com> Reviewed-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 2 ++ drivers/s

[PATCH] scsi: hisi_sas: support deferred probe for v2 hw

2016-12-06 Thread John Garry
in the hw layer probe, so we not probe into the main layer and allocate shost, memories, etc., to later learn that we need to defer the probe. [1] ./Documentation/devicetree/bindings/interrupt-controller/hisilicon,mbigen-v2.txt Signed-off-by: John Garry <john.ga...@huawei.com> diff --git a/driver

[PATCH] scsi: hisi_sas: fix free'ing in probe and remove

2016-11-29 Thread John Garry
should also free the HBA memories. - We should free shost memory at the end of hisi_sas_remove(). - sha->core.shost is set twice, so remove extra set. Signed-off-by: Xiaofei Tan <tanxiao...@huawei.com> Signed-off-by: John Garry <john.ga...@huawei.com> diff --git a/drivers/scsi/hisi_s

Re: [patch] scsi: hisi_sas: shift vs compare typos

2016-11-29 Thread John Garry
148 #define HGC_INVLD_DQE_INFO_FB_CH0_OFF 9 #define HGC_INVLD_DQE_INFO_FB_CH0_MSK (0x1 << HGC_INVLD_DQE_INFO_FB_CH0_OFF) . Cheers These were introduced in recent patch applied to 4.10 queue, and would only affect rare occurance of AXI/ECC error. Signed-off-by: John Garry <john

Re: [PATCH 00/11] hisi_sas: some fixes, improvements, and new features

2016-11-25 Thread John Garry
On 22/11/2016 22:01, Martin K. Petersen wrote: "John" == John Garry <john.ga...@huawei.com> writes: John, John> Are you happy with this patchset now that I've got an external John> review? Zhangfei Geo asked a question about patch 1/11 that has yet to be answere

Re: [PATCH 01/11] hisi_sas: add v2 hw support for ECC and AXI bus fatal error

2016-11-23 Thread John Garry
On 16/11/2016 01:47, Zhangfei Gao wrote: On Mon, Nov 7, 2016 at 8:48 PM, John Garry <john.ga...@huawei.com> wrote: From: Xiang Chen <chenxian...@hisilicon.com> For ECC 1bit error, logic can recover it, so we only print a warning. For ECC multi-bit and AXI bus fatal err

Re: [RFC PATCH] scsi: libsas: fix WARN on device removal

2016-11-22 Thread John Garry
On 21/11/2016 17:13, Dan Williams wrote: On Mon, Nov 21, 2016 at 7:16 AM, John Garry <john.ga...@huawei.com> wrote: @Maintainers, would you be willing to accept this patch as an interim fix for the dastardly WARN while we try to fix the flutter issue? To me this adds a bug to quiet a

Re: [PATCH 00/11] hisi_sas: some fixes, improvements, and new features

2016-11-22 Thread John Garry
On 14/11/2016 23:49, Martin K. Petersen wrote: "John" == John Garry <john.ga...@huawei.com> writes: John> This patchset introduces some misc bug fixes, improvements, and John> new features to the HiSilicon SAS driver. This series needs review. Hi Martin, Are you ha

Re: [RFC PATCH] scsi: libsas: fix WARN on device removal

2016-11-21 Thread John Garry
@Maintainers, would you be willing to accept this patch as an interim fix for the dastardly WARN while we try to fix the flutter issue? To me this adds a bug to quiet a benign, albeit noisy, warning. What is the bug which is being added? The bug where we queue a port teardown, but see a

Re: [PATCH] scsi: hisi_sas: Add a missing call to kfree

2016-11-21 Thread John Garry
On 21/11/2016 14:25, Quentin Lambert wrote: On 11/21/2016 03:16 PM, John Garry wrote: On 21/11/2016 13:20, Quentin Lambert wrote: On 11/21/2016 01:53 PM, John Garry wrote: However I have noticed that we should do a call to hisi_sas_free() for this failure, and later failures in the probe

Re: [PATCH] scsi: hisi_sas: Add a missing call to kfree

2016-11-21 Thread John Garry
On 21/11/2016 13:20, Quentin Lambert wrote: On 11/21/2016 01:53 PM, John Garry wrote: However I have noticed that we should do a call to hisi_sas_free() for this failure, and later failures in the probe. I don't understand why, and would welcome the opportunity to learn something. We call

Re: [PATCH] scsi: hisi_sas: Add a missing call to kfree

2016-11-21 Thread John Garry
On 19/11/2016 17:42, Quentin Lambert wrote: Most error branches following the call to hisi_sas_shost_alloc contain a call to kfree. This patch add these calls where they are missing. This issue was found with Hector. I think that this patch is fine. However I have noticed that we should do a

Re: [RFC PATCH] scsi: libsas: fix WARN on device removal

2016-11-18 Thread John Garry
On 18/11/2016 01:53, Dan Williams wrote: On Thu, Nov 17, 2016 at 7:23 AM, John Garry <john.ga...@huawei.com> wrote: On 11/11/2016 08:49, wangyijing wrote: I have not seen the flutter issue. I am just trying to solve the horrible WARN dump. However I do understand that there may be a

Re: [RFC PATCH] scsi: libsas: fix WARN on device removal

2016-11-17 Thread John Garry
On 11/11/2016 08:49, wangyijing wrote: I have not seen the flutter issue. I am just trying to solve the horrible WARN dump. However I do understand that there may be a issue related to how we queue the events; there was a recent attempt to fix this, but it came to nothing:

Re: [PATCH 02/11] hisi_sas: alloc queue id of slot according to device id

2016-11-16 Thread John Garry
On 16/11/2016 01:41, Zhangfei Gao wrote: On Mon, Nov 7, 2016 at 8:48 PM, John Garry <john.ga...@huawei.com> wrote: From: Xiang Chen <chenxian...@hisilicon.com> Currently slots are allocated from queues in a round-robin fashion. This causes a problem for internal commands in

Re: [RFC PATCH] scsi: libsas: fix WARN on device removal

2016-11-11 Thread John Garry
On 11/11/2016 08:12, wangyijing wrote: They're not the same. I don't see how your solution properly deals with remote sas_port deletion. When we unplug a device connected to an expander, can't the sas_port be deleted twice, in sas_unregister_devs_sas_addr() from domain revalidation and also

Re: [RFC PATCH] scsi: libsas: fix WARN on device removal

2016-11-10 Thread John Garry
On 09/11/2016 20:35, Dan Williams wrote: On Wed, Nov 9, 2016 at 11:09 AM, Dan Williams <dan.j.willi...@intel.com> wrote: On Wed, Nov 9, 2016 at 9:36 AM, John Garry <john.ga...@huawei.com> wrote: On 09/11/2016 12:28, John Garry wrote: On 03/11/2016 14:58, John Garry wrote: T

Re: [RFC PATCH] scsi: libsas: fix WARN on device removal

2016-11-09 Thread John Garry
On 03/11/2016 14:58, John Garry wrote: The following patch introduces an annoying WARN when a device is removed from the SAS topology: [SCSI] libsas: prevent domain rediscovery competing with ata error handling Are there any views on this patch? I would have thought that the parties who use

[PATCH 07/11] hisi_sas: delete repeated configuration in free_device_v2_hw()

2016-11-07 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> Delete repeated configuration items for hisi_sas_device() when we free a device. These items are now only set in hisi_sas_dev_gone(). Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.co

[PATCH 01/11] hisi_sas: add v2 hw support for ECC and AXI bus fatal error

2016-11-07 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> For ECC 1bit error, logic can recover it, so we only print a warning. For ECC multi-bit and AXI bus fatal error, we panic. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com>

[PATCH 08/11] hisi_sas: modify some values in get_ata_protocol()

2016-11-07 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> Modify and add some SATA commands according to SATA protocol. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 14 --

[PATCH 10/11] hisi_sas: use atomic64_t for hisi_sas_device.running_req

2016-11-07 Thread John Garry
ned-off-by: John Garry <john.ga...@huawei.com> Reviewed-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 2 +- drivers/scsi/hisi_sas/hisi_sas_main.c | 9 + drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 4 ++-- drivers/scsi/hisi_sas/hisi_sas_v2_h

[PATCH 04/11] hisi_sas: fix port form bug in hisi_sas_port_notify_formed()

2016-11-07 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> When we form a wideport, we should use hardware PHY port_id instead of sas_phy->id. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_

[PATCH 03/11] hisi_sas: only process broadcast change in phy_bcast_v2_hw()

2016-11-07 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> There are many BROADCAST primitives generated by the host. We are only interested in BROADCAST (CHANGE) primitives currently, so only process this. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.g

[PATCH 00/11] hisi_sas: some fixes, improvements, and new features

2016-11-07 Thread John Garry
This patchset introduces some misc bug fixes, improvements, and new features to the HiSilicon SAS driver. The new features include: - ECC and AXI bus fatal error handling for v2 hw - PHY (min and max) linkrate setting John Garry (1): hisi_sas: use atomic64_t for hisi_sas_device.running_req

[PATCH 06/11] hisi_sas: modify return value of hisi_sas_query_task()

2016-11-07 Thread John Garry
; Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 9133238..504cbcf 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_ma

[PATCH 09/11] hisi_sas: check SATA FIS when directly attaching SATA device

2016-11-07 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> Check ERR bit of status to decide whether there is something wrong with initial register-D2H FIS. If error exists, PHY reset the channel to restart OOB. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Ga

[PATCH 11/11] hisi_sas: add PHY set linkrate support for v1 and v2 hw

2016-11-07 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> Add the function to set PHY min and max linkrate through sysfs interface. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 3

[PATCH 05/11] hisi_sas: replace WARN_ON() with dev_warn() for internal abort

2016-11-07 Thread John Garry
From: Xiang Chen <chenxian...@hisilicon.com> Replace WARN_ON() with dev_warn() print when internal abort fails. 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 ++- 1 file cha

[PATCH 02/11] hisi_sas: alloc queue id of slot according to device id

2016-11-07 Thread John Garry
should not be a blocker. Note: Even though v1 hw does not support internal abort, the allocation method is chosen to be the same for consistency. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/his

[RFC PATCH] scsi: libsas: fix WARN on device removal

2016-11-03 Thread John Garry
of signal event, in sas_port_deformed()]. Fixes: 87c8331fcf72e501c3a3c0cdc5c [SCSI] libsas: prevent domain rediscovery competing with ata error handling Signed-off-by: John Garry <john.ga...@huawei.com> diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index 6

Re: [bug report] scsi: hisi_sas: add internal abort to hisi_sas_abort_task()

2016-10-12 Thread John Garry
On 12/10/2016 14:12, Dan Carpenter wrote: Hello John Garry, The patch dc8a49cabc73: "scsi: hisi_sas: add internal abort to hisi_sas_abort_task()" from Aug 24, 2016, leads to the following static checker warning: drivers/scsi/hisi_sas/hisi_sas_main.c:848 hisi_sas_

[PATCH v2 1/3] devicetree: bindings: scsi: hisi_sas add hip07 support

2016-10-04 Thread John Garry
Add support for hip07 chipset to hisi_sas controller. Chipset hip07 has v2 hw. Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- Documentation/devicetree/bindings/scsi/hisilicon-sas.txt | 1 + 1 file changed, 1 insertion(+)

[PATCH v2 0/3] hisi_sas add hip07 support

2016-10-04 Thread John Garry
/ Once 4.9-rc1 is released, the D03 dts can be updated for the refclock. Note: there will be only 1 D03 dts, UEFI will update the refclock rate for that board in the fdt at boottime. Differences to v1: - dropped sas-v2 quirk amt for hip07 John Garry (3

[PATCH v2 3/3] hisi_sas: add v2 hw support for different refclk

2016-10-04 Thread John Garry
when the refclk frequency is 66MHz. For ACPI we expect the _RST handler to set the correct value for PHY_CTRL (we're forced to take different approach for DT and ACPI as ACPI does not support fixed-clock device). Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <

[PATCH v2 2/3] hisi_sas: add device tree support for hip07

2016-10-04 Thread John Garry
Chipset hip07 incorporates v2 hw. Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/s

Re: [PATCH 1/3] devicetree: bindings: scsi: hisi_sas hip07 support

2016-09-24 Thread John Garry
On 23/09/2016 19:36, Rob Herring wrote: On Tue, Sep 20, 2016 at 06:48:58PM +0800, John Garry wrote: Add support for hip07 chipset to bindings. Chipset hip07 has v2 hw. The sas-v2 quirk amt is expanded to cover hip07. Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xian

[PATCH 1/3] devicetree: bindings: scsi: hisi_sas hip07 support

2016-09-20 Thread John Garry
Add support for hip07 chipset to bindings. Chipset hip07 has v2 hw. The sas-v2 quirk amt is expanded to cover hip07. Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- Documentation/devicetree/bindings/scsi/hisilicon-sas.tx

[PATCH 3/3] hisi_sas: add v2 hw support for different refclk

2016-09-20 Thread John Garry
approach for DT and ACPI as ACPI does not support fixed-clock device type). Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas.h | 2 ++ drivers/scsi/hisi_sas/hisi_sas_main.c | 7 +++

[PATCH 0/3] hisi_sas add hip07 support

2016-09-20 Thread John Garry
/ Once 4.9-rc1 is released, the D03 dts can be updated for the refclock. Note: there will be only 1 D03 dts, UEFI will update the refclock rate for that board in the fdt at boot time. John Garry (3): devicetree: bindings: scsi: hisi_sas add hip07 support hisi_sas: add device

[PATCH 2/3] hisi_sas: add device tree support for hip07

2016-09-20 Thread John Garry
Chipset hip07 incorporates v2 hw. Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/hisi_sas/hisi_sa

Re: [PATCH] [SCSI] wd719x: Avoid calling request_firmware under spinlock

2016-09-15 Thread John Garry
On 15/09/2016 15:08, John Garry wrote: On 15/09/2016 14:48, Vaishali Thakkar wrote: It is preferrable to use request_firmware where sleeping is allowed. Using it under spinlock can cause blocking. Here, the function wd719x_chip_init calls request_firmware while holding a spinlock. So, let's

Re: [PATCH] [SCSI] wd719x: Avoid calling request_firmware under spinlock

2016-09-15 Thread John Garry
On 15/09/2016 14:48, Vaishali Thakkar wrote: It is preferrable to use request_firmware where sleeping is allowed. Using it under spinlock can cause blocking. Here, the function wd719x_chip_init calls request_firmware while holding a spinlock. So, let's access it outside the spinlock. Coccinelle

[PATCH 01/15] hisi_sas: save completion queue read pointer

2016-09-06 Thread John Garry
Optimise by saving an avoidable read in the cq interrupt. The queue read pointer will only be updated by software, so don't bother re-reading what was already written in the previous interrupt. Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas.h

[PATCH 09/15] hisi_sas: set dma mask before allocate DMA memory

2016-09-06 Thread John Garry
The device DMA mask was being set after the bulk of the DMA allocations in the driver init, so potentially DMA allocates fail. To resolve, relocate before allocating the DMA memory when initialising the driver. Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> Signed-off-by: John

[PATCH 02/15] hisi_sas: save delivery queue write pointer

2016-09-06 Thread John Garry
Optimise by saving an avoidable read in the get_free_slot function. The delivery queue write pointer will only be updated by software, so don't bother re-reading what was already written in the previous call to start_delivery function. Signed-off-by: John Garry <john.ga...@huawei.

[PATCH 04/15] hisi_sas: only zero slot memory when reused

2016-09-06 Thread John Garry
Currently the slot memory is zeroed when it is freed and also when it is reused, like in hisi_sas_task_prep(). Optimise by avoiding the redundant zeroing in the free. Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 +- 1 file changed, 1 ins

[PATCH 00/15] hisi_sas misc fixes and minor optimisations

2016-09-06 Thread John Garry
This patchset introdcues some minor bug fixes and optimisations for v1+v2 hw. No new functional features are introduced in this patchset. John Garry (15): hisi_sas: save completion queue read pointer hisi_sas: save delivery queue write pointer hisi_sas: keep CHL_INT2 masked for v2 HW

[PATCH 15/15] hisi_sas: send three identify before phy up

2016-09-06 Thread John Garry
(according to 6.10.3.3.2 in SAS 3.0 spec) and close ready when the PHY is down. Signed-off-by: NengLong Zhao <zhaonengl...@hisilicon.com> Signed-off-by: John Garry <john.ga...@huawei.com> --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 20 1 file changed, 16 insertions(+),

[PATCH 08/15] hisi_sas: fix a potential warning for sata disk ejection

2016-09-06 Thread John Garry
by simply returning a failure status code to the upper layer. 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 | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-)

[PATCH 10/15] hisi_sas: fix HBA SAS addr endianness for v2 hw

2016-09-06 Thread John Garry
discovery responses. To fix, we byte swap the SAS addr from BE to LE (which is the endianness of the SAS controller). Signed-off-by: John Garry <john.ga...@huawei.com> Signed-off-by: Xiang Chen <chenxian...@hisilicon.com> --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 8 1 fil

<    1   2   3   4   5   6   7   8   >