Re: [PATCH V4 1/2] scsi: core: avoid host-wide host_busy counter for scsi_mq

2019-10-23 Thread John Garry
On 09/10/2019 10:32, Ming Lei wrote: It isn't necessary to check the host depth in scsi_queue_rq() any more since it has been respected by blk-mq before calling scsi_queue_rq() via getting driver tag. Lots of LUNs may attach to same host and per-host IOPS may reach millions, so we should avoid e

Re: [RESEND PATCH] scsi: megaraid: disable device when probe failed after enabled device

2019-09-10 Thread John Garry
On 07/09/2019 02:07, chenxiang wrote: From: Xiang Chen For pci device, need to disable device when probe failed after enabled device. Signed-off-by: Xiang Chen Reviewed-by: John Garry --- drivers/scsi/megaraid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

Re: [PATCH RFC 00/24] scsi: enable reserved commands for LLDDs

2019-09-02 Thread John Garry
On 26/08/2019 16:27, Hannes Reinecke wrote: On 8/23/19 3:26 PM, John Garry wrote: On 29/05/2019 14:28, Hannes Reinecke wrote: Hi all, quite some drivers use internal commands for various purposes, most commonly sending TMFs or querying the HBA status. While these commands use the same

Re: [PATCH RFC 00/24] scsi: enable reserved commands for LLDDs

2019-08-23 Thread John Garry
On 29/05/2019 14:28, Hannes Reinecke wrote: Hi all, quite some drivers use internal commands for various purposes, most commonly sending TMFs or querying the HBA status. While these commands use the same submission mechanism than normal I/O commands, they will not be counted as outstanding comma

Re: [PATCH] scsi: hisi_sas: remove set but not used variable 'irq_value'

2019-08-22 Thread John Garry
d-by: Hulk Robot Signed-off-by: zhengbin --- Acked-by: John Garry

Re: [PATCH v2] scsi: kill useless scsi_use_blk_mq and force_blk_mq

2019-07-12 Thread John Garry
在 09/07/2019 10:06, Jason Yan 写道: ping? On 2019/6/4 21:35, Jason Yan wrote: The legacy path is gone and we do not have to choose mq or not. The module parameter scsi_use_blk_mq and scsi_host_template.force_blk_mq is useless now. Signed-off-by: Jason Yan Reviewed-by: John Garry --- v2

Re: [PATCH] scsi: kill useless scsi_use_blk_mq

2019-06-04 Thread John Garry
On 04/06/2019 12:44, Jason Yan wrote: The legacy path is gone and we do not have to choose mq or not. The module parameter scsi_use_blk_mq is useless now. Can you look to also remove scsi_host_template.force_blk_mq? It only looks to be set (in virtio_scsi.c) and not read. cheers Signed-of

Re: [PATCH RFC] hisi_sas_v3: multiqueue support (v2 hw divergence)

2019-06-03 Thread John Garry
The crazy (escalating from weird) rules to workaround the HW bug(s) mean that we need to chop up the command tag range into blocks of 32 even tag indexes per SATA device; this means that SATA device #0 can use 64, 66, 68, 70...126. device #1 can use 128, 130, 132,..., device #2 can use 192, 194,.

Re: [PATCH RFC] hisi_sas_v3: multiqueue support

2019-06-03 Thread John Garry
On 03/06/2019 10:54, Ming Lei wrote: On Mon, Jun 03, 2019 at 09:57:26AM +0100, John Garry wrote: Otherwise duplicated slot can be used from different blk-mq hw queue. The worsen thing is that V3's actual max queue depth is (4096 - 96), but this patch claims that the device can support

Re: [PATCH RFC] hisi_sas_v3: multiqueue support

2019-06-03 Thread John Garry
On 03/06/2019 08:46, Hannes Reinecke wrote: On 6/3/19 9:37 AM, Ming Lei wrote: On Mon, Jun 03, 2019 at 08:08:18AM +0200, Hannes Reinecke wrote: On 6/1/19 1:06 AM, Ming Lei wrote: On Fri, May 31, 2019 at 12:26:56PM +0200, Hannes Reinecke wrote: On 5/31/19 10:46 AM, Ming Lei wrote: [ .. ] Fir

Re: [PATCH RFC] hisi_sas_v3: multiqueue support

2019-06-03 Thread John Garry
Otherwise duplicated slot can be used from different blk-mq hw queue. The worsen thing is that V3's actual max queue depth is (4096 - 96), but this patch claims that the device can support (4096 - 96) * 32 command slots To be clear about the hw, the hw supports max 4096 command tags and has

Re: [PATCH RFC] hisi_sas_v3: multiqueue support

2019-05-31 Thread John Garry
On 31/05/2019 14:18, Hannes Reinecke wrote: On 5/31/19 11:42 AM, John Garry wrote: -static int hisi_sas_slot_index_alloc(struct hisi_hba *hisi_hba, - struct scsi_cmnd *scsi_cmnd) +static int hisi_sas_slot_index_alloc(struct hisi_hba *hisi_hba) { int index; void

Re: [PATCH RFC] hisi_sas_v3: multiqueue support

2019-05-31 Thread John Garry
-static int hisi_sas_slot_index_alloc(struct hisi_hba *hisi_hba, -struct scsi_cmnd *scsi_cmnd) +static int hisi_sas_slot_index_alloc(struct hisi_hba *hisi_hba) { int index; void *bitmap = hisi_hba->slot_index_tags; unsigned long flags;

Re: [PATCH 10/24] scsi: allocate separate queue for reserved commands

2019-05-30 Thread John Garry
On 29/05/2019 14:28, Hannes Reinecke wrote: From: Hannes Reinecke Allocate a separate 'reserved_cmd_q' for sending reserved commands. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 15 ++- include/scsi/scsi_host.h | 4 2 files changed, 18 insertions(+), 1 del

Re: [PATCH 03/24] scsi: add 'nr_reserved_cmds' field to the SCSI host template

2019-05-30 Thread John Garry
On 29/05/2019 14:28, Hannes Reinecke wrote: From: Hannes Reinecke Add a new field 'nr_reserved_cmds' to the SCSI host template to instruct the block layer to set aside a tag space for reserved commands. Out of curiousity, is there a reason why this would not also be added to scsi_host_templ

Re: [PATCH 06/24] virtio_scsi: use reserved commands for TMF

2019-05-30 Thread John Garry
On 29/05/2019 14:28, Hannes Reinecke wrote: static int virtscsi_map_queues(struct Scsi_Host *shost) @@ -827,6 +830,8 @@ static int virtscsi_probe(struct virtio_device *vdev) shost->max_channel = 0; shost->max_cmd_len = VIRTIO_SCSI_CDB_SIZE; shost->nr_hw_queues = num_queu

Re: [PATCH RFT plinth/v4.15 11/12] blk-mq: Allow PCI vector offset for mapping queues

2019-05-23 Thread John Garry
On 23/05/2019 18:50, John Garry wrote: From: Keith Busch Please ignore these. I was supposed to only send internally, git then I forgot to suppress the recipients. The PCI interrupt vectors intended to be associated with a queue may not start at 0; a driver may allocate pre_vectors for

[PATCH RFT plinth/v4.15 11/12] blk-mq: Allow PCI vector offset for mapping queues

2019-05-23 Thread John Garry
From: Keith Busch The PCI interrupt vectors intended to be associated with a queue may not start at 0; a driver may allocate pre_vectors for special use. This patch adds an offset parameter so blk-mq may find the intended affinity mask and updates all drivers using this API accordingly. Cc: Don

Re: [PATCH 17/24] libsas: switch remaining files to SPDX tags

2019-05-05 Thread John Garry
On 01/05/2019 17:14, Christoph Hellwig wrote: Use the the GPLv2 SPDX tag instead of verbose boilerplate text. Should we update the Kconfig+Makefile similarly? Signed-off-by: Christoph Hellwig --- drivers/scsi/libsas/sas_discover.c | 18 +- drivers/scsi/libsas/sas_event.c

Re: [PATCH 0/6] libsas: Some minor improvements and tidy-up

2019-04-24 Thread John Garry
On 16/04/2019 00:33, Martin K. Petersen wrote: John, This patchset introduces some minor improvements and tidy-up, including: - fix PHY info in sysfs for PHY events - min pathway rate programming improvement - some other tidy-up and neatening Applied to 5.2/scsi-queue, thanks! Hi Martin,

[PATCH 1/6] scsi: libsas: Stop hardcoding SAS address length

2019-04-12 Thread John Garry
, and whitespace indentation in sas_hash_addr() is also fixed (see sas_hash_addr()). Signed-off-by: John Garry --- drivers/scsi/libsas/sas_expander.c | 15 +-- drivers/scsi/libsas/sas_init.c | 40 -- include/scsi/libsas.h | 6 ++--- 3 files change

[PATCH 2/6] scsi: libsas: Try to retain programmed min linkrate for SATA min pathway unmatch fixing

2019-04-12 Thread John Garry
-off-by: John Garry --- drivers/scsi/libsas/sas_expander.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 93f297199d4c..dfdf3c94d326 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers

[PATCH 4/6] scsi: libsas: Inject revalidate event for root port event

2019-04-12 Thread John Garry
broadcast event. This causes an issue for libsas, in that we will not revalidate the domain for these events. As a solution, for when a root PHY is formed or deformed from a root port, insert a broadcast event to trigger a domain revalidation. Signed-off-by: John Garry --- drivers/scsi/libsas

[PATCH 6/6] scsi: libsas: Print expander PHY indexes in decimal

2019-04-12 Thread John Garry
-by: John Garry --- drivers/scsi/libsas/sas_ata.c | 2 +- drivers/scsi/libsas/sas_expander.c | 44 +++--- drivers/scsi/libsas/sas_init.c | 2 +- drivers/scsi/libsas/sas_phy.c | 7 ++--- 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/drivers

[PATCH 5/6] scsi: libsas: Do discovery on empty PHY to update PHY info

2019-04-12 Thread John Garry
sociated with the PHY (in sas_unregister_devs_sas_addr()). Signed-off-by: John Garry --- drivers/scsi/libsas/sas_expander.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 6f569a65d791..ad96bc843acc 1006

[PATCH 0/6] libsas: Some minor improvements and tidy-up

2019-04-12 Thread John Garry
This patchset introduces some minor improvements and tidy-up, including: - fix PHY info in sysfs for PHY events - min pathway rate programming improvement - some other tidy-up and neatening John Garry (6): scsi: libsas: Stop hardcoding SAS address length scsi: libsas: Try to retain programmed

[PATCH 3/6] scsi: libsas: Improve vague log in SAS rediscovery

2019-04-12 Thread John Garry
ative (and more consistent with the reset of the expander logs). Signed-off-by: John Garry --- drivers/scsi/libsas/sas_expander.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expand

[PATCH 0/9] hisi_sas: Some misc patches

2019-04-11 Thread John Garry
/scsi-queue branch plus patch 0e83fc61eee6 ("scsi: hisi_sas: Add softreset in hisi_sas_I_T_nexus_reset()"). John Garry (1): scsi: hisi_sas: Fix for setting the PHY linkrate when disconnected Luo Jiaxing (2): scsi: hisi_sas: Don't hard reset disk during controller reset scsi: his

[PATCH 2/9] scsi: hisi_sas: Remedy inconsistent PHY down state in software

2019-04-11 Thread John Garry
efore and after reset, the same issue occurs. To solve it, use hisi_sas_phy_down() directly in rescan topology function. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH 4/9] scsi: hisi_sas: Adjust the printk format of functions hisi_sas_init_device()

2019-04-11 Thread John Garry
Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index d4da537f9a45..ede812759991 100644 --- a/drivers/scsi/hisi_sas

[PATCH 8/9] scsi: hisi_sas: Don't fail IT nexus reset for Open Reject timeout

2019-04-11 Thread John Garry
-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index c02cf78a20c7..ebeec7a52ddc

[PATCH 9/9] scsi: hisi_sas: Some misc tidy-up

2019-04-11 Thread John Garry
From: Xiang Chen Do some minor tidy-up. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 13 +++- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 9 ++ drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 42 +++--- drivers/scsi

[PATCH 7/9] scsi: hisi_sas: Don't hard reset disk during controller reset

2019-04-11 Thread John Garry
all hisi_sas_init_device() to re-init the disks, so calling hardreset() is unnecessary and it also will cause some delay at controller reset. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --gi

[PATCH 5/9] scsi: hisi_sas: allocate different SAS address for directly attached situation

2019-04-11 Thread John Garry
From: Xiang Chen In commit 8b8d66531555 ("scsi: hisi_sas: make SAS address of SATA disks unique"), we ensured that each SATA disk in the system has a unique SAS address, even if it is fake. That was for v2 hw. Add this for v3 hw. Signed-off-by: Xiang Chen Signed-off-by:

[PATCH 3/9] scsi: hisi_sas: Fix for setting the PHY linkrate when disconnected

2019-04-11 Thread John Garry
d linkrate properly when the PHY comes down. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 3 ++ drivers/scsi/hisi_sas/hisi_sas_main.c | 43 -- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 11 ++- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 6 ++-- dr

[PATCH 1/9] scsi: hisi_sas: add host reset interface for test

2019-04-11 Thread John Garry
From: Xiang Chen Add host reset interface to make it easier for testing the host reset feature. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 13 + drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 1 + drivers/scsi/hisi_sas

[PATCH 6/9] scsi: hisi_sas: Support all RAS events with MSI interrupts

2019-04-11 Thread John Garry
AER, and will leave the device in offlined state, which is safe. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 437 +++-- 1 file changed, 259 insertions(+), 178 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Re: [PATCH] scsi: fix ata_port_wait_eh() hung caused by missing to wake up eh thread

2019-03-25 Thread John Garry
On 25/03/2019 11:55, zhengbin (A) wrote: On 2019/3/25 18:02, Pavel Tikhomirov wrote: Likely we should do the same for host_eh_scheduled++ as we do for host_failed++ in scsi_eh_inc_host_failed. Just put it in call_rcu. These way rcu_read_lock would be enough: if we don't see RECOVERY state in scs

[PATCH 2/6] scsi: hisi_sas: Fix a timeout race of driver internal and SMP IO

2019-02-28 Thread John Garry
237] [] scsi_error_handler+0x148/0x5c0 [ 729.206009] [] kthread+0x10c/0x138 [ 729.211563] [] ret_from_fork+0x10/0x18 To solve the issue, callback function task_done of those IOs need to be called when on SAS controller reset. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_

[PATCH 3/6] scsi: hisi_sas: print PHY RX errors count for later revision of v3 hw

2019-02-28 Thread John Garry
s, we use hisi_sas_phy.lock to protect error count value. Because we update them by calling phy_get_events_v3_hw(), which is also used by core driver (for get PHY events function). We relocate phy_get_events_v3_hw() to avoid a further declaration. Signed-off-by: Xiaofei Tan Signed-off-by: John

[PATCH 1/6] scsi: hisi_sas: Change return variable type in phy_up_v3_hw()

2019-02-28 Thread John Garry
From: Xiang Chen According to the tool fortify, phy_up_v3_hw() returns signed value, while it should return an unsigned value. So change variable "res" from int to irq_return_t. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 3 +

[PATCH 5/6] scsi: hisi_sas: Send HARD RESET to clear the previous affiliation of STP target port

2019-02-28 Thread John Garry
delay, and caller would wait for link to be established, cf. sas_ata_hard_reset(). Co-developed-by: Luo Jiaxing Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 7 drivers/scsi/hisi_sas/hisi_sas_main.c | 44 -- drivers

[PATCH 0/6] hisi_sas: Some misc patches

2019-02-28 Thread John Garry
changes - Add support to coalesce and print PHY errors - A tidy-up patch John Garry (1): scsi: hisi_sas: Set PHY linkrate when disconnected Xiang Chen (4): scsi: hisi_sas: Change return variable type in phy_up_v3_hw() scsi: hisi_sas: Fix a timeout race of driver internal and SMP IO scsi

[PATCH 6/6] scsi: hisi_sas: Change SERDES_CFG init value to increase reliability of HiLink

2019-02-28 Thread John Garry
Chen Reviewed-by: Yupeng Zhou Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 720721196b12..e2f2c04355b9 100644 --- a/drivers/scsi/his

[PATCH 4/6] scsi: hisi_sas: Set PHY linkrate when disconnected

2019-02-28 Thread John Garry
t's imperfect, as sas_phy_data is internal to libsas. I can't see another way without adding a new field to hisi_sas_phy and managing it, or changing SCSI SAS transport. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 10 ++ 1 file changed, 10 insertions(+

Re: [PATCH] scsi: csiostor: fix incorrect if condition for setting dma mask

2019-02-20 Thread John Garry
On 20/02/2019 15:35, Varun Prakash wrote: Use && instead of || in if condition as dma_set_mask_and_coherent() returns 0 on success. Fixes: c22b332d811b ("scsi: csiostor: switch to generic DMA API") Cc: sta...@vger.kernel.org Cc: Christoph Hellwig Signed-off-by: Varun Prakash --- drivers/scsi/

Re: [PATCH -next] scsi: hisi_sas: remove duplicated code

2019-02-19 Thread John Garry
On 19/02/2019 14:40, YueHaibing wrote: move some functions to hisi_sas_main.c, which can eliminate redundant code. main.c is for core driver, and does not access hw directly - We have hw module - like hisi_sas_v1_hw.c - for this. You're moving hw accessors to main.c now. I don't think that

Re: [PATCH 7/8] hisi_sas: fix calls to dma_set_mask_and_coherent()

2019-02-18 Thread John Garry
On 18/02/2019 07:34, Hannes Reinecke wrote: Hi Hannes, Thanks for this. I have some comments, below. The change to use dma_set_mask_and_coherent() incorrectly made a second call with the 32 bit DMA mask value when the call with the 64 bit DMA mask value succeeded. And the second call to dma_

Re: [PATCH 0/4] scsi: fixup dma_set_mask_and_coherent() calls

2019-02-18 Thread John Garry
On 18/02/2019 07:21, Hannes Reinecke wrote: On 2/15/19 10:16 AM, John Garry wrote: On 15/02/2019 08:08, Christoph Hellwig wrote: On Fri, Feb 15, 2019 at 08:43:55AM +0100, Christoph Hellwig wrote: On Fri, Feb 15, 2019 at 07:55:39AM +0100, Hannes Reinecke wrote: Yeah, there is a few more. And

Re: [PATCH 0/4] scsi: fixup dma_set_mask_and_coherent() calls

2019-02-15 Thread John Garry
On 15/02/2019 08:08, Christoph Hellwig wrote: On Fri, Feb 15, 2019 at 08:43:55AM +0100, Christoph Hellwig wrote: On Fri, Feb 15, 2019 at 07:55:39AM +0100, Hannes Reinecke wrote: Yeah, there is a few more. And the sad part is as of a few kernel release ago we shouldn't even need the fallback 32

[PATCH] scsi: libsas: Fix rphy phy_identifier for PHYs with end devices attached

2019-02-14 Thread John Garry
3 platform-HISI0162:01-sas-exp0x500e004aaa1f-phy8-lun-0-part2 -> ../../sdf2 lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaa1f-phy8-lun-0-part3 -> ../../sdf3 Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver") Reported-by: dann frazier Signed-of

Re: [PATCH 0/4] scsi: fixup dma_set_mask_and_coherent() calls

2019-02-14 Thread John Garry
On 13/02/2019 18:51, Ewan D. Milne wrote: On Wed, 2019-02-13 at 12:42 +0100, Hannes Reinecke wrote: The recent patchset to use dma_set_mask_and_coherent() introduced a regression where a call to set a 64-bit DMA mask was followed by a call to set a 32-bit DMA mask, leading to I/O errors and data

Re: [PATCH 4/4] hisi_sas: fix calls to dma_set_mask_and_coherent()

2019-02-13 Thread John Garry
On 13/02/2019 11:42, Hannes Reinecke wrote: The change to use dma_set_mask_and_coherent() incorrectly made a second call with the 32 bit DMA mask value when the call with the 64 bit DMA mask value succeeded. This resulted in FC connections failing due to corrupted data buffers, and various other

Re: [PATCH] scsi: lpfc: fix calls to dma_set_mask_and_coherent()

2019-02-13 Thread John Garry
On 13/02/2019 03:10, Martin K. Petersen wrote: Ewan, It also appears as if the patches to hptiop, hisi_sas and bfa need to be fixed up. I don't have a test environment for these, although I might be able to modify the test environment for bfa. Martin/James, what about the others? I'm afrai

[PATCH 5/6] scsi: hisi_sas: Use pci_irq_get_affinity() for v3 hw as experimental

2019-02-06 Thread John Garry
SI MQ, but we need to sort out the per-HBA tags performance issue. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 4 ++ drivers/scsi/hisi_sas/hisi_sas_main.c | 33 ++--- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 1 + drivers/

[PATCH 1/6] scsi: hisi_sas: Add support for DIX feature for v3 hw

2019-02-06 Thread John Garry
Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 40 --- drivers/scsi/hisi_sas/hisi_sas_main.c | 96 +++--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 80 + 3 files changed, 184 insertions(+), 32 deletions(-) diff --git a

[PATCH 3/6] scsi: hisi_sas: change queue depth from 512 to 4096

2019-02-06 Thread John Garry
From: Xiang Chen If sending IOs to many disks from single queue, it is possible that the queue may be full. To avoid the situation, change queue depth from 512 to 4096 which is the max number of IOs for v3 hw. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas

[PATCH 0/6] hisi_sas: DIX support, performance optimisation, and misc patches

2019-02-06 Thread John Garry
- And some other minor tidying and a driver debugfs feature This series is based on Martin's 5.1 queue + "scsi: hisi_sas: Set protection parameters prior to adding SCSI host" John Garry (2): scsi: hisi_sas: Issue internal abort on all relevant queues scsi: hisi_sas: Do some

[PATCH 4/6] scsi: hisi_sas: Issue internal abort on all relevant queues

2019-02-06 Thread John Garry
issued on the same queue as the command which we are trying to abort. For aborting all commands associated with a device, we issue a separate internal abort on all relevant queues. Issuing multiple internal aborts in this fashion would have not side affect. Signed-off-by: John Garry Signed-off-by

[PATCH 6/6] scsi: hisi_sas: Do some more tidy-up

2019-02-06 Thread John Garry
Do some very minor tidy-up, for things like needlessly initing variable and not leaving whitespace before quote endings. Originally-from: Xiang Chen Originally-from: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 10 +- drivers/scsi/hisi_sas

[PATCH 2/6] scsi: hisi_sas: Add manual trigger for debugfs dump

2019-02-06 Thread John Garry
From: Luo Jiaxing Add an interface to manually trigger a debugfs dump. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 34 +++ 1 file changed, 34 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b

Re: Question on handling managed IRQs when hotplugging CPUs

2019-02-06 Thread John Garry
On 05/02/2019 18:23, Christoph Hellwig wrote: On Tue, Feb 05, 2019 at 03:09:28PM +, John Garry wrote: For SCSI devices, unfortunately not all IO sent to the HW originates from blk-mq or any other single entity. Where else would SCSI I/O originate from? Please note that I was referring

Re: Question on handling managed IRQs when hotplugging CPUs

2019-02-05 Thread John Garry
On 05/02/2019 15:15, Hannes Reinecke wrote: On 2/5/19 4:09 PM, John Garry wrote: On 05/02/2019 14:52, Keith Busch wrote: On Tue, Feb 05, 2019 at 05:24:11AM -0800, John Garry wrote: On 04/02/2019 07:12, Hannes Reinecke wrote: Hi Hannes, So, as the user then has to wait for the system to

Re: Question on handling managed IRQs when hotplugging CPUs

2019-02-05 Thread John Garry
On 05/02/2019 14:52, Keith Busch wrote: On Tue, Feb 05, 2019 at 05:24:11AM -0800, John Garry wrote: On 04/02/2019 07:12, Hannes Reinecke wrote: Hi Hannes, So, as the user then has to wait for the system to declars 'ready for CPU remove', why can't we just disable the SQ and w

Re: Question on handling managed IRQs when hotplugging CPUs

2019-02-05 Thread John Garry
On 04/02/2019 07:12, Hannes Reinecke wrote: On 2/1/19 10:57 PM, Thomas Gleixner wrote: On Fri, 1 Feb 2019, Hannes Reinecke wrote: Thing is, if we have _managed_ CPU hotplug (ie if the hardware provides some means of quiescing the CPU before hotplug) then the whole thing is trivial; disable SQ a

Re: mpt3sas and T10DIF

2019-02-01 Thread John Garry
On 01/02/2019 16:20, Sebastian Andrzej Siewior wrote: Hi, I tried to use T10DIF on a SAS disk(s) behind a LSI SAS3008 controller. So I enabled type 1 via sg_format --format --fmtpinfo=2 /dev/sdX on each disk, waited a few hours. After the operation completed the disks reported that T10D

Re: [PATCH v2 4/7] scsi: libsas: split the replacement of sas disks in two steps

2019-02-01 Thread John Garry
On 01/02/2019 01:58, Jason Yan wrote: On 2019/2/1 0:38, John Garry wrote: On 31/01/2019 10:29, John Garry wrote: On 31/01/2019 02:04, Jason Yan wrote: On 2019/1/31 1:22, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: Now if a new device replaced a old device, the sas address

Re: [PATCH v2 7/7] scsi: libsas: fix issue of swapping two sas disks

2019-02-01 Thread John Garry
On 01/02/2019 02:04, Jason Yan wrote: On 2019/2/1 0:34, John Garry wrote: On 31/01/2019 02:55, Jason Yan wrote: On 2019/1/31 1:53, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: The work flow of revalidation now is scanning expander phy by the sequence of the phy and check if

Re: Question on handling managed IRQs when hotplugging CPUs

2019-01-31 Thread John Garry
On 30/01/2019 12:43, Thomas Gleixner wrote: On Wed, 30 Jan 2019, John Garry wrote: On 29/01/2019 17:20, Keith Busch wrote: On Tue, Jan 29, 2019 at 05:12:40PM +, John Garry wrote: On 29/01/2019 15:44, Keith Busch wrote: Hm, we used to freeze the queues with CPUHP_BLK_MQ_PREPARE callback

Re: [PATCH v2 4/7] scsi: libsas: split the replacement of sas disks in two steps

2019-01-31 Thread John Garry
On 31/01/2019 10:29, John Garry wrote: On 31/01/2019 02:04, Jason Yan wrote: On 2019/1/31 1:22, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: Now if a new device replaced a old device, the sas address will change. Hmmm... not if it's a SATA disk, which would have some

Re: [PATCH v2 7/7] scsi: libsas: fix issue of swapping two sas disks

2019-01-31 Thread John Garry
On 31/01/2019 02:55, Jason Yan wrote: On 2019/1/31 1:53, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: The work flow of revalidation now is scanning expander phy by the sequence of the phy and check if the phy have changed. This will leads to an issue of swapping two sas disks on

Re: [PATCH v2 4/7] scsi: libsas: split the replacement of sas disks in two steps

2019-01-31 Thread John Garry
On 31/01/2019 02:04, Jason Yan wrote: On 2019/1/31 1:22, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: Now if a new device replaced a old device, the sas address will change. Hmmm... not if it's a SATA disk, which would have some same invented SAS address. Yes, it's

Re: [PATCH v2 3/7] scsi: libsas: optimize the debug print of the revalidate process

2019-01-31 Thread John Garry
On 31/01/2019 01:31, Jason Yan wrote: On 2019/1/31 0:41, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: sas_rediscover() returns error code if discover failed for a expander phy. And sas_ex_revalidate_domain() only returns the last phy's error code. So when sas_revalidate_d

Re: [PATCH v2 6/7] scsi: libsas: reset the phy address if discover failed

2019-01-31 Thread John Garry
On 31/01/2019 02:13, Jason Yan wrote: On 2019/1/31 1:36, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: When we failed to discover the device, the phy address is still kept /s/phy/PHY/ in ex_phy. So when the next time we revalidate this phy the address and device type is the

Re: [PATCH v2 1/7] scsi: libsas: reset the negotiated_linkrate when phy is down

2019-01-31 Thread John Garry
On 31/01/2019 01:11, Jason Yan wrote: On 2019/1/30 21:08, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: If the device is unplugged or disconnected, the negotiated_linkrate still can be seen from the userspace by sysfs. This makes people confused and leaks information of the device

Re: [PATCH v2 7/7] scsi: libsas: fix issue of swapping two sas disks

2019-01-30 Thread John Garry
to retry again. The next revalidation will process the discovering of the new devices. Tested-by: Chen Liangfei Signed-off-by: Jason Yan CC: Xiaofei Tan CC: chenxiang CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams

Re: [PATCH v2 6/7] scsi: libsas: reset the phy address if discover failed

2019-01-30 Thread John Garry
: Jason Yan CC: Xiaofei Tan CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams CC: Hannes Reinecke --- drivers/scsi/libsas/sas_expander.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/libsas/sas_expander.c b

Re: [PATCH v2 4/7] scsi: libsas: split the replacement of sas disks in two steps

2019-01-30 Thread John Garry
hould revalidate again. Signed-off-by: Jason Yan CC: chenxiang CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams CC: Hannes Reinecke --- drivers/scsi/libsas/sas_discover.c | 20 +++- drivers/scsi/libsas/sas_expander.c

Re: [PATCH v2 3/7] scsi: libsas: optimize the debug print of the revalidate process

2019-01-30 Thread John Garry
every PHY, or just the PHY where res != 0? I don't see any optimisation here. Maybe an improvement. Signed-off-by: Jason Yan CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams CC: Hannes Reinecke --- drivers/s

Re: [PATCH v2 2/7] scsi: libsas: only clear phy->in_shutdown after shutdown event done

2019-01-30 Thread John Garry
ent will clear phy->in_shutdown and a new shutdown-event will be queued. The queue will be full of these shutdown-events. Fix this by only clear phy->in_shutdown in sas_phye_shutdown(), that is after the first shutdown-event has been executed. Seems ok as a fix: Reviewed-by: John Garry A

Re: [PATCH v2 1/7] scsi: libsas: reset the negotiated_linkrate when phy is down

2019-01-30 Thread John Garry
igned-off-by: Jason Yan CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams CC: Hannes Reinecke --- drivers/scsi/libsas/sas_expander.c | 2 ++ include/scsi/libsas.h | 3 +++ 2 files changed, 5 insertions(+) diff --

Re: Question on handling managed IRQs when hotplugging CPUs

2019-01-29 Thread John Garry
On 29/01/2019 16:27, Thomas Gleixner wrote: On Tue, 29 Jan 2019, John Garry wrote: On 29/01/2019 12:01, Thomas Gleixner wrote: If the last CPU which is associated to a queue (and the corresponding interrupt) goes offline, then the subsytem/driver code has to make sure that: 1) No more

Re: Question on handling managed IRQs when hotplugging CPUs

2019-01-29 Thread John Garry
Hi Hannes, Thomas, On 29/01/2019 12:01, Thomas Gleixner wrote: On Tue, 29 Jan 2019, Hannes Reinecke wrote: That actually is a very good question, and I have been wondering about this for quite some time. I find it a bit hard to envision a scenario where the IRQ affinity is automatically (and,

Re: [PATCH] block: set rq->cmd_flags with bio->opf instead of data->cmd_flags when bio is not Null

2019-01-28 Thread John Garry
On 28/01/2019 15:57, Christoph Hellwig wrote: On Mon, Jan 28, 2019 at 03:36:58PM +, John Garry wrote: As I understood, the problem is the scenario of calling blk_mq_make_request()->bio_integrity_prep() where we then allocate a bio integrity payload in calling bio_integrity_alloc(). In t

Re: [PATCH] block: set rq->cmd_flags with bio->opf instead of data->cmd_flags when bio is not Null

2019-01-28 Thread John Garry
On 28/01/2019 14:07, Christoph Hellwig wrote: for rq->cmd_flags. It will cause dix=0 in function sd_setup_read_write_cmnd() when enabled DIX, which will cause IO exception when enabled DIX. For some IOs such as internal IO from SCSI layer, the parameter bio of function blk_mq_get_request() is Nu

[PATCH 04/13] scsi: hisi_sas: send primitive NOTIFY to SSP situation only

2019-01-25 Thread John Garry
From: Xiang Chen Send primitive NOTIFY to SSP situation only, or it causes underflow issue when sending IO. And also rename hisi_sas_hw.sl_notify() to hisi_sas_hw. sl_notify_ssp(). Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 2 +- drivers

[PATCH 00/13] hisi_sas: Misc fixes and other more minor patches

2019-01-25 Thread John Garry
This series includes a misc assortment of fixes found during testing. Also includes is some debugfs tidy-up and a patch missed from original upstreaming. John Garry (5): scsi: hisi_sas: No need to check return value of debugfs_create functions scsi: hisi_sas: Fix type casting and missing

[PATCH 06/13] scsi: hisi_sas: remove the check of sas_dev status in hisi_sas_I_T_nexus_reset()

2019-01-25 Thread John Garry
oid the endless loop of reset for directly-attached SATA device at probe time, actually we flutter it for it, so it is not necessary to add the check now. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 6 -- drivers/scsi/hisi_sas/hisi_

[PATCH 08/13] scsi: hisi_sas: Reject setting programmed minimum linkrate > 1.5G

2019-01-25 Thread John Garry
Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 8f7f82d..32f6928 100644 --- a/drivers/scsi/hisi_

[PATCH 02/13] scsi: hisi_sas: Fix type casting and missing static qualifier in debugfs code

2019-01-25 Thread John Garry
Sparse can detect some type casting issues in the debugfs code, so fix it up. Also a missing static qualifier is added to hisi_sas_debugfs_to_reg_name(). Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 4 ++-- drivers/scsi/hisi_sas/hisi_sas_main.c | 21

[PATCH 11/13] scsi: hisi_sas: Some misc tidy-up

2019-01-25 Thread John Garry
Sparse detected some problems in the driver, so tidy them up. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi

[PATCH 05/13] scsi: hisi_sas: shutdown axi bus to avoid exception CQ returned

2019-01-25 Thread John Garry
. To avoid the exception situation, shutdown AXI bus after fatal AXI interrupt. In SAS controller reset, it will restart AXI bus. For later version of v3 hw, hardware will shutdown AXI bus for this situation, so just fix current ver of v3 hw. Signed-off-by: Xiang Chen Signed-off-by: John Garry

[PATCH 13/13] scsi: hisi_sas: Add missing seq_printf() call in hisi_sas_show_row_32()

2019-01-25 Thread John Garry
This call must have been missed when I reworked the debugfs feature for upstreaming, so add it back. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas

[PATCH 09/13] scsi: hisi_sas: Fix losing directly attached disk when hot-plug

2019-01-25 Thread John Garry
f the PHY is not up in 20s, do link reset. Notes: the 20s is an experience value. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 4 drivers/scsi/hisi_sas/hisi_sas_main.c | 26 ++ drivers/scsi/hisi_sas/hisi_sas_v2

[PATCH 07/13] scsi: hisi_sas: Remove unused parameter of function hisi_sas_alloc()

2019-01-25 Thread John Garry
From: Xiang Chen Actually in function hisi_sas_alloc(), parameter shost is not used, so remove it. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 2 +- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 ++-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

[PATCH 01/13] scsi: hisi_sas: No need to check return value of debugfs_create functions

2019-01-25 Thread John Garry
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 1 + drivers/scsi/hisi_sas/hisi_sas_main.c

[PATCH 10/13] scsi: hisi_sas: Correct memory allocation size for DQ debugfs

2019-01-25 Thread John Garry
From: Luo Jiaxing Some sizes we allocate for debugfs structure is incorrect, so fix them. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/hisi_sas

[PATCH 03/13] scsi: hisi_sas: Add debugfs ITCT file and add file operations

2019-01-25 Thread John Garry
From: Luo Jiaxing This patch create debugfs file for ITCT and add file operations. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 33 + 1 file changed, 33 insertions(+) diff --git a/drivers/scsi/hisi_sas

[PATCH 12/13] scsi: hisi_sas: Fix to only call scsi_get_prot_op() for non-NULL scsi_cmnd

2019-01-25 Thread John Garry
A NULL-pointer dereference was introduced for TMF SSP commands from the upstreaming reworking. Fix this by relocating the scsi_get_prot_op() callsite. Fixes: d6a9000b81be ("scsi: hisi_sas: Add support for DIF feature for v2 hw") Signed-off-by: John Garry --- drivers/scs

Re: [PATCH] libsas: Remove scsi_to_u32()

2019-01-24 Thread John Garry
Luo Cc: John Garry Signed-off-by: Bart Van Assche Reviewed-by: John Garry --- drivers/scsi/libsas/sas_expander.c | 9 + include/scsi/scsi.h| 6 -- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi

  1   2   3   4   5   6   7   8   9   10   >