Re: sense handling improvements

2017-02-21 Thread Christoph Hellwig
On Wed, Feb 15, 2017 at 10:42:56PM -0500, Martin K. Petersen wrote: > > "Christoph" == Christoph Hellwig writes: > > Christoph> this series is on top of the scsi_request changes in Jens' > Christoph> tree and further improves the handling of the sense buffer. > > Very nice

Re: [patch] scsi_dh_emc: return success in clariion_std_inquiry()

2017-02-21 Thread Hannes Reinecke
On 02/21/2017 07:46 PM, Dan Carpenter wrote: > We accidentally return an uninitialized variable on success. > > Fixes: b6ff1b14cdf4 ("[SCSI] scsi_dh: Update EMC handler") > Signed-off-by: Dan Carpenter > > diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c >

[PATCH 2/3] cciss: Fix checkpatch OPEN_BRACE

2017-02-21 Thread Tobin C. Harding
Checkpatch emits ERROR:OPEN_BRACE: that open brace { should be on the previous line. Move open brace to new line. Also add space after if/switch statement since we introduce more checkpatch errors if not fixed at the same time. Signed-off-by: Tobin C. Harding ---

[PATCH 3/3] cciss: Remove kmalloc cast

2017-02-21 Thread Tobin C. Harding
Coccinelle emits a warning about casting the return value of kmalloc(). Coccinelle suggests removing the cast as do kerneljanitors. Remove cast from kmalloc() call. Signed-off-by: Tobin C. Harding --- drivers/block/cciss_scsi.c | 3 +-- 1 file changed, 1 insertion(+), 2

[PATCH 0/3] cciss: Fix coccinelle/checkpatch warnings.

2017-02-21 Thread Tobin C. Harding
Re-send after spell checking. :( Coccinelle warns about unnecessary cast on call to kmalloc(). Checkpatch emits various warnings when parsing file. Clean up two checkpatch warnings. Remove trailing whitespace and clean up opening brace position. Remove unnecessary cast on kmalloc(). Tobin C.

[PATCH 1/3] cciss: Fix checkpatch TRAILING_WHITESPACE

2017-02-21 Thread Tobin C. Harding
Checkpatch emits 85 trailing whitespace warnings. Remove trailing whitespace. Signed-off-by: Tobin C. Harding --- drivers/block/cciss_scsi.c | 170 ++--- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git

[PATCH 0/3] cciss: Fix coccinelle/checkpatch warnings.

2017-02-21 Thread Tobin C. Harding
Coccinelle warns about unnesesary cast on call to kmalloc(). Checkpatch emits various warnings when parsing file. Clean up two checkpatch warnings. Remove trailing whitespace and clean up opending brace position. Remove unnesesary cast on kmalloc(). Tobin C. Harding (3): cciss: Fix checkpatch

[PATCH 2/3] cciss: Fix checkpatch OPEN_BRACE

2017-02-21 Thread Tobin C. Harding
Checkpatch emits ERROR:OPEN_BRACE: that open brace { should be on the previous line. Move open brace to new line. Also add space after if/switch statement since we introduce more checkpatch errors if not fixed at the same time. Signed-off-by: Tobin C. Harding ---

[PATCH 1/3] cciss: Fix checkpatch TRAILING_WHITESPACE

2017-02-21 Thread Tobin C. Harding
Checkpatch emits 85 trailing whitespace warnings. Remove trailing whitespace. Signed-off-by: Tobin C. Harding --- drivers/block/cciss_scsi.c | 170 ++--- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git

[PATCH 3/3] cciss: Remove kmalloc cast

2017-02-21 Thread Tobin C. Harding
Coccinelle emits a warning about casting the return value of kmalloc(). Coccinelle suggests removing the cast as do kerneljanitors. Remove cast from kmalloc() call. Signed-off-by: Tobin C. Harding --- drivers/block/cciss_scsi.c | 3 +-- 1 file changed, 1 insertion(+), 2

Re: [PATCH v5] sd: Check for unaligned partial completion

2017-02-21 Thread Damien Le Moal
Martin, On 2/22/17 13:24, Martin K. Petersen wrote: > Damien> I think we would still need the check for REQ_TYPE_FS to avoid > Damien> interfering with SG_IO commands. As for the "medium access > Damien> command" test, I am not sure if the block layer is the right > Damien> place to define that

Re: [PATCH v5] sd: Check for unaligned partial completion

2017-02-21 Thread Martin K. Petersen
> "Damien" == Damien Le Moal writes: Damien, Damien> I think we would still need the check for REQ_TYPE_FS to avoid Damien> interfering with SG_IO commands. As for the "medium access Damien> command" test, I am not sure if the block layer is the right Damien> place to

[patch] scsi_dh_emc: return success in clariion_std_inquiry()

2017-02-21 Thread Dan Carpenter
We accidentally return an uninitialized variable on success. Fixes: b6ff1b14cdf4 ("[SCSI] scsi_dh: Update EMC handler") Signed-off-by: Dan Carpenter diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c index

[PATCH] libiscsi: add lock around task lists to fix list corruption regression

2017-02-21 Thread Chris Leech
There's a rather long standing regression from commit 659743b [SCSI] libiscsi: Reduce locking contention in fast path Depending on iSCSI target behavior, it's possible to hit the case in iscsi_complete_task where the task is still on a pending list (!list_empty(>running)). When that happens the

[PATCH] PCI/MSI: Only disable affinity settings if pre and post vector count is equal to max_vecs and not min_vecs

2017-02-21 Thread Himanshu Madhani
From: Michael Hernandez min_vecs is the minimum amount of vectors needed to operate in MSI-X mode which may just include the vectors that don't need affinity. Disabling affinity settings causes the qla2xxx driver scsi_add_host to fail when blk_mq is enabled as the

Re: [PATCH 0/3] qla2xxx: Bug fixes and cleanup for the driver.

2017-02-21 Thread Madhani, Himanshu
Hi Martin, On 2/20/17, 7:16 PM, "Martin K. Petersen" wrote: > "Himanshu" == Himanshu Madhani writes: Hi Himanshu, Himanshu> This series contains small cleanup + fix for regression that Himanshu> was introduced by

Re: Manual driver binding and unbinding broken for SCSI

2017-02-21 Thread Jan Kara
On Sun 19-02-17 18:19:58, Omar Sandoval wrote: > On Fri, Feb 17, 2017 at 04:43:56PM -0800, James Bottomley wrote: > > This seems to be related to a 0day test we got on the block tree, > > details here: > > > > http://marc.info/?t=14862406881 > > > > I root caused the above to something not

Re: [PATCHv3] scsi: use 'scsi_device_from_queue()' for scsi_dh

2017-02-21 Thread Mike Snitzer
On Mon, Feb 20, 2017 at 10:22 PM, Martin K. Petersen wrote: >> "Hannes" == Hannes Reinecke writes: > > Hannes> The device handler needs to check if a given queue belongs to a > Hannes> scsi device; only then does it make sense to attach a device >

[PATCH] scsi: BusLogic: fix incorrect spelling of adatper_reset_req

2017-02-21 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake, adatper_reset_req should be adapter_reset_req. Also break up very long seq_printf statement into multiple lines. Signed-off-by: Colin Ian King --- drivers/scsi/BusLogic.c | 14

Re: [PATCH v2] scsi: zero per-cmd driver data before each I/O

2017-02-21 Thread Jens Axboe
On 02/21/2017 02:04 AM, Christoph Hellwig wrote: > Without this drivers that don't clear the state themselves can see off > effects. For example Hyper-V VMs using the storvsc driver will often > hang during boot due to uncleared Test Unit Ready failures. > > Fixes: e9c787e6 ("scsi: allocate

Re: [PATCH v2] scsi: zero per-cmd driver data before each I/O

2017-02-21 Thread Bart Van Assche
On 02/21/2017 01:29 AM, Christoph Hellwig wrote: > Without this drivers that don't clear the state themselves can see off > effects. For example Hyper-V VMs using the storvsc driver will often > hang during boot due to uncleared Test Unit Ready failures. > > Fixes: e9c787e6 ("scsi: allocate

Re: [PATCHv3 10/10] mpt3sas: lockless command submission for scsi-mq

2017-02-21 Thread Christoph Hellwig
On Tue, Feb 21, 2017 at 03:58:08PM +0100, Hannes Reinecke wrote: > >> + if (ioc->shost->use_blk_mq) { > >> + u32 unique_tag = blk_mq_unique_tag(scmd->request); > >> + > >> + tag = blk_mq_unique_tag_to_tag(unique_tag); > >> + } else > >> + tag = scmd->request->tag; > >

Re: [PATCHv3 10/10] mpt3sas: lockless command submission for scsi-mq

2017-02-21 Thread Hannes Reinecke
On 02/21/2017 03:34 PM, Christoph Hellwig wrote: > On Tue, Feb 21, 2017 at 01:27:09PM +0100, Hannes Reinecke wrote: >> Enable lockless command submission for scsi-mq by moving the >> command structure into the payload for struct request. > > No dependency on scsi-mq, so the changelog could use a

Re: [PATCHv3 09/10] mpt3sas: always use first reserved smid for ioctl passthrough

2017-02-21 Thread Hannes Reinecke
On 02/21/2017 03:18 PM, Christoph Hellwig wrote: > On Tue, Feb 21, 2017 at 01:27:08PM +0100, Hannes Reinecke wrote: >> ioctl passthrough commands require a SCSIIO smid, but cannot >> easily integrate with the block layer. But the driver already >> has reserved some SCSIIO smids and we're only ever

Re: [PATCHv3 10/10] mpt3sas: lockless command submission for scsi-mq

2017-02-21 Thread Christoph Hellwig
On Tue, Feb 21, 2017 at 01:27:09PM +0100, Hannes Reinecke wrote: > Enable lockless command submission for scsi-mq by moving the > command structure into the payload for struct request. No dependency on scsi-mq, so the changelog could use a little update. > @@ -2345,26 +2354,22 @@ struct

Re: [PATCHv3 09/10] mpt3sas: always use first reserved smid for ioctl passthrough

2017-02-21 Thread Christoph Hellwig
On Tue, Feb 21, 2017 at 01:27:08PM +0100, Hannes Reinecke wrote: > ioctl passthrough commands require a SCSIIO smid, but cannot > easily integrate with the block layer. But the driver already > has reserved some SCSIIO smids and we're only ever allowing > one ioctl command at a time we can use the

Re: [PATCHv3 08/10] scsi: allocate reserved commands

2017-02-21 Thread Christoph Hellwig
On Tue, Feb 21, 2017 at 01:27:07PM +0100, Hannes Reinecke wrote: > The block layer already has the notion of 'reserved' commands, so > we should be enabling scsi hosts to allocate them. Only if using blk-mq so far, so this patch is incomplete. But fortunately I don't think you actually need this

[PATCH] lpfc: use bitflag for 'exch_busy'

2017-02-21 Thread Hannes Reinecke
Use a bitflag for 'exch_busy' and clear the TBD marker in the driver. Signed-off-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_nvme.c | 16 +--- drivers/scsi/lpfc/lpfc_nvme.h | 3 +-- drivers/scsi/lpfc/lpfc_scsi.c | 19 +++

[PATCHv3 0/3] mpt3sas: Full mq support, part 2

2017-02-21 Thread Hannes Reinecke
Hi all, this is the second part of my patchset to enable scsi multiqueue for the mpt3sas driver. While the HBA only has a single mailbox register for submitting commands, it does have individual receive queues per MSI-X interrupt and as such does benefit from converting it to full multiqueue

[PATCHv3 3/3] mpt3sas: scsi-mq interrupt steering

2017-02-21 Thread Hannes Reinecke
The device has several reply queues, so this patch implements correct scsi-mq interrupt steering to take advantage of full blk-mq support. However, as performance results are inconclusive this patch also adds a module parameter 'enable_scsi_mq' to expose all completion queues via scsi-mq; default

[PATCHv3 2/3] block: Add blk_mq_make_unique_tag()

2017-02-21 Thread Hannes Reinecke
Implement blk_mq_make_unique_tag() to generate a unique tag value from a given hardware queue and tag value. Signed-off-by: Hannes Reinecke --- block/blk-mq-tag.c | 3 +-- include/linux/blk-mq.h | 5 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git

[PATCHv3 1/3] mpt3sas: Use 'msix_index' as argument for put_smid functions

2017-02-21 Thread Hannes Reinecke
Use msix_index as explicit argument for the various put_smid callbacks. No functional change. Signed-off-by: Hannes Reinecke --- drivers/scsi/mpt3sas/mpt3sas_base.c | 56 +--- drivers/scsi/mpt3sas/mpt3sas_base.h | 18 --

[PATCHv3 02/10] mpt3sas: set default value for cb_idx

2017-02-21 Thread Hannes Reinecke
No functional change. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/mpt3sas/mpt3sas_base.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c

[PATCHv3 10/10] mpt3sas: lockless command submission for scsi-mq

2017-02-21 Thread Hannes Reinecke
Enable lockless command submission for scsi-mq by moving the command structure into the payload for struct request. Signed-off-by: Hannes Reinecke --- drivers/scsi/mpt3sas/mpt3sas_base.c | 123 - drivers/scsi/mpt3sas/mpt3sas_base.h | 19 ++--

[PATCHv3 07/10] mpt3sas: check command status before attempting abort

2017-02-21 Thread Hannes Reinecke
When attempting a command abort we should check the command status prior to sending the abort; the command might've been completed already. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 11 --- 1

[PATCHv3 08/10] scsi: allocate reserved commands

2017-02-21 Thread Hannes Reinecke
The block layer already has the notion of 'reserved' commands, so we should be enabling scsi hosts to allocate them. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 1 + include/scsi/scsi_host.h | 1 + 2 files changed, 2 insertions(+) diff --git

[PATCHv3 09/10] mpt3sas: always use first reserved smid for ioctl passthrough

2017-02-21 Thread Hannes Reinecke
ioctl passthrough commands require a SCSIIO smid, but cannot easily integrate with the block layer. But the driver already has reserved some SCSIIO smids and we're only ever allowing one ioctl command at a time we can use the first reserved smid for ioctl commands. Signed-off-by: Hannes Reinecke

[PATCHv3 06/10] mpt3sas: Introduce mpt3sas_get_st_from_smid()

2017-02-21 Thread Hannes Reinecke
Abstract accesses to the scsi_lookup array by introducing mpt3sas_get_st_from_smid(). Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/mpt3sas/mpt3sas_base.c | 22 ++ drivers/scsi/mpt3sas/mpt3sas_base.h |

[PATCHv3 05/10] mpt3sas: open-code _scsih_scsi_lookup_get()

2017-02-21 Thread Hannes Reinecke
Just a wrapper around the scsi lookup array and only used in one place, so open-code it. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-)

[PATCHv3 01/10] mpt3sas: switch to pci_alloc_irq_vectors

2017-02-21 Thread Hannes Reinecke
Cleanup the MSI-X handling allowing us to use the PCI-layer provided vector allocation. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/mpt3sas/mpt3sas_base.c | 105 +---

[PATCHv3 04/10] mpt3sas: separate out _base_recovery_check()

2017-02-21 Thread Hannes Reinecke
No functional change. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/mpt3sas/mpt3sas_base.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c

[PATCHv3 03/10] mpt3sas: use 'list_splice_init()'

2017-02-21 Thread Hannes Reinecke
Use 'list_splice_init()' instead of hand-crafted function. No functional change. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/mpt3sas/mpt3sas_base.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git

[PATCHv3 00/10] mpt3sas: Full mq support, part 1

2017-02-21 Thread Hannes Reinecke
Hi all, this is the first part of my patchset to enable scsi multiqueue for the mpt3sas driver. While the HBA only has a single mailbox register for submitting commands, it does have individual receive queues per MSI-X interrupt and as such does benefit from converting it to full multiqueue

[PATCH v2] scsi: zero per-cmd driver data before each I/O

2017-02-21 Thread Christoph Hellwig
Without this drivers that don't clear the state themselves can see off effects. For example Hyper-V VMs using the storvsc driver will often hang during boot due to uncleared Test Unit Ready failures. Fixes: e9c787e6 ("scsi: allocate scsi_cmnd structures as part of struct request")