[PATCH v2.1] sd: Micro-optimize READ / WRITE CDB encoding

2017-10-24 Thread Douglas Gilbert
The sd_setup_read_write_cmnd() function is on the "fast path" for block system access to SCSI devices (logical units). Rewrite this function to improve speed and readability: - use put_unaligned_be family of functions to save lots of shifts - improve the scaling code when sector_size > 512 bytes

Re: [PATCH] sd: Micro-optimize READ / WRITE CDB encoding

2017-10-24 Thread Douglas Gilbert
On 2017-10-17 06:41 PM, Bart Van Assche wrote: On Tue, 2017-10-17 at 18:17 -0400, Douglas Gilbert wrote: On 2017-10-17 05:03 PM, Bart Van Assche wrote: @@ -1025,7 +1025,6 @@ static int sd_setup_read_write_cmnd(struct scsi_cmnd *SCpnt) struct gendisk *disk = rq->rq_disk; struct

Re: [PATCHv6,2/5] scsi: Export blacklist flags to sysfs

2017-10-24 Thread jeffy
Hi guys, maybe we need to add the generated scsi_devinfo_tbl.c into drivers/scsi/.gitignore :) On 10/02/2017 10:26 PM, Hannes Reinecke wrote: Each scsi device is scanned according to the found blacklist flags, but this information is never presented to sysfs. This makes it quite hard to figur

Re: [PATCH V9 1/4] dma-mapping: Rework dma_get_cache_alignment()

2017-10-24 Thread 陈华才
Hi, Marek Patch3 is needed for stable, but Patch3 depend on Patch1 and Patch2. Huacai -- Original -- From: "Marek Szyprowski"; Date: Tue, Oct 24, 2017 09:30 PM To: "Huacai Chen"; "Christoph Hellwig"; Cc: "Robin Murphy"; "Andrew Morton"; "Fuxin Zhang"; "l

Re: [PATCH V9 1/4] dma-mapping: Rework dma_get_cache_alignment()

2017-10-24 Thread Mark Greer
On Mon, Oct 23, 2017 at 03:12:44PM +0800, Huacai Chen wrote: > Make dma_get_cache_alignment() to accept a 'dev' argument. As a result, > it can return different alignments due to different devices' I/O cache > coherency. > > Currently, ARM/ARM64 and MIPS support coherent & noncoherent devices > co

Re: [PATCH 9/9] bsg: split handling of SCSI CDBs vs transport requeues

2017-10-24 Thread Jens Axboe
On 10/23/2017 01:17 AM, Martin K. Petersen wrote: > > Christoph, > >>> Yes, I expected the bsg bits to go through Jens' tree. >> >> Ok, then I misremembered it, and we'll have to delay the remaining >> patches until the next merge window, as they depend on the previous >> ones. > > I don't mind

[PATCH] usb: storage: uas: mark expected switch fall-through

2017-10-24 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115016 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/storage/uas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/storage/uas.c b/drivers/usb/

Re: [PATCH 9/9] bsg: split handling of SCSI CDBs vs transport requeues

2017-10-24 Thread Benjamin Block
> +static int bsg_transport_complete_rq(struct request *rq, struct sg_io_v4 > *hdr) > +{ > + struct bsg_job *job = blk_mq_rq_to_pdu(rq); > + int ret = 0; > + > + /* > + * The assignments below don't make much sense, but are kept for > + * bug by bug backwards compatibility: >

Re: [PATCH 02/12] hpsa: cleanup sas_phy structures in sysfs when unloading

2017-10-24 Thread Martin K. Petersen
Don, > Unsure. I do not see the mangled e-mail anywhere in the e-mail > chain. I did not type the e-mail in like that. But it originated from > me. I may have pulled the patch from an archive that mangled it. > > Do you want me to re-post the two patches? I'll fix them up. But it's a bad time t

[PATCH 18/19] scsi: hisi_sas: add v3 hw support for AXI fatal error

2017-10-24 Thread John Garry
From: Xiaofei Tan Add support for processing AXI bus fatal errors. If AXI bus fatal error happen, do controller reset to recover. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 125 + 1 file changed, 125 inser

[PATCH 12/19] scsi: hisi_sas: check PHY state in get_wideport_bitmap_v3_hw()

2017-10-24 Thread John Garry
From: Xiaofei Tan We should check register PHY_STATE when getting the bitmap of a wideport, as, if the PHY is not ready, the value of register PHY_PORT_NUM_MA is not valid. V2 hw has done this check, and v3 hw should do this check too. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry ---

[PATCH 13/19] scsi: hisi_sas: init connect cfg register for v3 hw

2017-10-24 Thread John Garry
From: Xiaofei Tan Add initialization of register CON_CFG_DRIVER for v3 hw, to limit number of the times of setup connection. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/hisi

[PATCH 11/19] scsi: hisi_sas: report v2 hw AXI errors to userspace

2017-10-24 Thread John Garry
From: Shiju Jose This patch adds reporting of AXI errors in the SAS v2 hw driver to userspace as non-standard trace events. rasdaemon can be used to read and log these AXI errors in userspace. Signed-off-by: Shiju Jose Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 54

[PATCH 14/19] scsi: hisi_sas: add v3 hw DFX feature

2017-10-24 Thread John Garry
From: Xiaofei Tan Realise get_events() to add DFX feature for v3 hw. Just like v2 hw, We support the following errors: - loss_of_dword_sync_count - invalid_dword_count - phy_reset_problem_count - running_disparity_error_count Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/sc

[PATCH 17/19] scsi: hisi_sas: complete all tasklets prior to host reset

2017-10-24 Thread John Garry
From: Xiaofei Tan The CQ event is handled in tasklet context, and it could be delayed if the system loading is high. It is possible to run into some problems when executing a host reset when cq_tasklet_vx_hw() is being executed. So, prior to host reset, execute tasklet_kill() to ensure that all

[PATCH 19/19] scsi: hisi_sas: add v3 hw port AXI error handling

2017-10-24 Thread John Garry
From: Xiaofei Tan Add support for servicing AXI errors handling. We do host a controller reset for such errors. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 42 ++ 1 file changed, 37 insertions(+), 5 deletion

[PATCH 16/19] scsi: hisi_sas: fix a bug when free device for v3 hw

2017-10-24 Thread John Garry
From: Xiang Chen Use completion to wait on ITCT CLR interrupt finishing before processing other things when freeing a device. This is safer than the pre-existing process of polling the register. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c |

[PATCH 15/19] scsi: hisi_sas: add hisi_hba.rst_work init for v3 hw

2017-10-24 Thread John Garry
From: Xiaofei Tan Add init code of hisi_hba->rst_work for v3 hw. Because v3 hw also need it to recover controller when some hw errors occurs. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 1 + drivers/scsi/hisi_sas/hisi_sas_main.c | 3 ++-

RE: [PATCH 02/12] hpsa: cleanup sas_phy structures in sysfs when unloading

2017-10-24 Thread Don Brace
> -Original Message- > On Fri, 2017-10-20 at 16:51 -0500, Don Brace wrote: > > From: Martin Wilck > > > > I am resubmitting this patch on behalf of Martin Wilck > > with his permission. > > > > The original patch can be found here: > > https://www.spinics.net/lists/linux-scsi/msg102083.htm

[PATCH 05/19] scsi: hisi_sas: fix SATA breakpoint memory size

2017-10-24 Thread John Garry
From: Xiang Chen Currently the size of memory we allocate for SATA breakpoint buffer is incorrect. The breakpoint memory size should be as follows: 32 (NCQ tags) * 128 * 2048 (max #devs) = 8MB Currently we only allocate 0.5MB, but get away with it as we never have SATA device index > 128 typica

[PATCH 04/19] scsi: hisi_sas: grab hisi_hba.lock when processing slots

2017-10-24 Thread John Garry
From: Xiang Chen When adding/removing slots from device list, we need to lock this operation with hisi_hba lock for safety. This patch adds missing instances of this. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 5 - drivers/scsi/hisi_s

[PATCH 01/19] scsi: hisi_sas: delete get_ncq_tag_v3_hw()

2017-10-24 Thread John Garry
From: Xiang Chen We already relocated hisi_sas_get_ncq_tag() into common file main.c, so delete get_ncq_tag_v3_hw() and use hisi_sas_get_ncq_tag() instead. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 16 +--- 1 file changed, 1 i

[PATCH 08/19] scsi: hisi_sas: fix the risk of freeing slot twice

2017-10-24 Thread John Garry
From: Xiaofei Tan The function hisi_sas_slot_task_free() is used to free the slot and do tidy-up of LLDD resources. The LLDD generally should know the state of a slot and decide when to free it, and it should only be done once. For some scenarios, we really don't know the state, like when TMF ti

[PATCH 03/19] scsi: hisi_sas: use spin_lock_irqsave() for hisi_hba.lock

2017-10-24 Thread John Garry
From: Xiaofei Tan We used spin_lock() to grab hisi_hba.lock in two places where spin_lock_irqsave() should be used, as hisi_hba.lock can be taken in interrupt context. This patch is to fix this. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c |

[PATCH 10/19] scsi: hisi_sas: report ECC errors in v2 hw to userspace

2017-10-24 Thread John Garry
From: Shiju Jose This patch adds reporting ECC errors in the SAS V2 driver to userspace as non-standard trace events. rasdaemon can be used to read and log these ECC errors in userspace. Rasdaemon log for the SAS errors with the decoding sample: cpu 00:[ 70.025830] hisi_sas_v2_hw HISI0162:01:

[PATCH 06/19] scsi: hisi_sas: us start_phy in PHY_FUNC_LINK_RESET

2017-10-24 Thread John Garry
From: Xiang Chen When a PHY_FUNC_LINK_RESET is issued, we need to fill the transport identify_frame to SAS controller before the PHYs are enabled. Without this, we may find that if a PHY which belonged to a wideport before the reset may generate a new port id. Signed-off-by: Xiang Chen Signed-

[PATCH 09/19] scsi: hisi_sas: use array for v2 hw AXI errors

2017-10-24 Thread John Garry
From: Shiju Jose The code to print AXI errors in v2 hw driver is repetitive. This patch condenses the code by looping an array of errors. Also, a formatting error in one_bit_ecc_errors[] and multi_bit_ecc_errors[] is fixed. Signed-off-by: Shiju Jose Signed-off-by: John Garry --- drivers/scs

[PATCH 07/19] scsi: hisi_sas: fix NULL check in SMP abort task path

2017-10-24 Thread John Garry
From: Xiaofei Tan This patch adds a NULL check of task->lldd_task before freeing the slot in SMP path. This is to guard against the scenario of the slot being freed during the from the preceding internal abort. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hi

[PATCH 02/19] scsi: hisi_sas: fix internal abort slot timeout bug

2017-10-24 Thread John Garry
From: Xiang Chen When an internal abort times out in hisi_sas_internal_task_abort(), goto the exit label in and not go through the other task status checks. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 1 + 1 file changed, 1 insertion(+) dif

[PATCH 00/19] hisi_sas: misc fixes, improvements, and new features

2017-10-24 Thread John Garry
This patchset contains many misc fixes, improvements, and a few new features. Here is a list of the significant changes: - more fixes for hisi_hba.locking - v3 hw DFX feature - random error handling bugfixes - reporting v2 hw errors to userspace Shiju Jose (3): scsi: hisi_sas: use array for v2

Re: [PATCH V9 1/4] dma-mapping: Rework dma_get_cache_alignment()

2017-10-24 Thread Marek Szyprowski
Hi Huacai, On 2017-10-23 09:12, Huacai Chen wrote: Make dma_get_cache_alignment() to accept a 'dev' argument. As a result, it can return different alignments due to different devices' I/O cache coherency. Currently, ARM/ARM64 and MIPS support coherent & noncoherent devices co-exist. This may be

答复: [PATCH v5 2/5] dt-bindings: scsi: ufs: add document for hisi-ufs

2017-10-24 Thread liwei (CM)
Hi, Arnd Sorry to bother you, what's your opinion about my explanation and revision method? I am looking forward to your reply, thanks! -邮件原件- 发件人: liwei (CM) 发送时间: 2017年10月21日 17:59 收件人: 'Arnd Bergmann' 抄送: Rob Herring; Mark Rutland; xuwei (O); Catalin Marinas; Will Deacon; Vinayak Ho