[PATCHv2 2/2] scsi: make 'state' device attribute pollable

2017-08-10 Thread Hannes Reinecke
While the 'state' attribute can (and will) change occasionally, calling 'poll()' or 'select()' on it fails as sysfs is never notified that the state has changed. With this patch calling 'poll()' or 'select()' will work properly. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Revie

[PATCHv2 1/2] scsi_lib: rework scsi_internal_device_unblock_nowait()

2017-08-10 Thread Hannes Reinecke
Rework scsi_internal_device_unblock_nowait() into using a switch statement. No functional changes. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/scsi/scsi_lib.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-)

[PATCHv2 0/2] scsi: pollable 'state' attribute

2017-08-10 Thread Hannes Reinecke
Hi all, here's a small patchset to make the 'state' device attribute pollable. It was supposed to be a small patch, but then hch suggested a rework. So there you go. Changes to v2: - Removed duplicate case value found by kbuild robot - Dropped state update patch Hannes Reinecke (2): scsi_lib:

Re: [PATCHv2 2/4] scsi: Export blacklist flags to sysfs

2017-08-10 Thread Hannes Reinecke
On 08/11/2017 02:43 AM, Martin K. Petersen wrote: > > Hannes, > >> 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 figure out if blacklisting worked as expected. With this >> patch we're expo

Re: [PATCH RESEND 0/6] hpsa: support legacy boards

2017-08-10 Thread Hannes Reinecke
On 08/10/2017 09:15 PM, Don Brace wrote: >> -Original Message- >> From: Hannes Reinecke [mailto:h...@suse.de] >> Sent: Thursday, August 10, 2017 9:11 AM >> To: James Bottomley ; >> Christoph Hellwig >> Cc: Don Brace ; Martin K. Petersen >> ; Meelis Roos ; linux- >> s...@vger.kernel.org >>

Re: [PATCH 2/3] scsi_lib: rework scsi_internal_device_unblock_nowait()

2017-08-10 Thread kbuild test robot
Hi Hannes, [auto build test ERROR on mkp-scsi/for-next] [also build test ERROR on v4.13-rc4 next-20170810] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Hannes-Reinecke/scsi-pollable-state

Re: [PATCH] scsi-mq: Always unprepare before requeuing a request

2017-08-10 Thread Michael Ellerman
Bart Van Assche writes: > On Thu, 2017-08-10 at 20:32 +1000, Michael Ellerman wrote: >> "Martin K. Petersen" writes: >> > > One of the two scsi-mq functions that requeue a request unprepares a >> > > request before requeueing (scsi_io_completion()) but the other >> > > function not (__scsi_queue_

Re: [PATCHv2 2/4] scsi: Export blacklist flags to sysfs

2017-08-10 Thread Martin K. Petersen
Hannes, > 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 figure out if blacklisting worked as expected. With this > patch we're exporting an additional attribute 'blacklist' containing > the b

Re: [PATCHv2 1/4] scsi_debug: allow to specify inquiry vendor and model

2017-08-10 Thread Martin K. Petersen
Hannes, > For testing purposes we need to be able to pass in the inquiry > vendor and model. This looks fine to me. -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH V2] sd_zbc: Write unlock zone from sd_uninit_cmnd()

2017-08-10 Thread Martin K. Petersen
Damien, > Releasing a zone write lock only when the write commnand that acquired > the lock completes can cause deadlocks due to potential command > reordering if the lock owning request is requeued and not > executed. This problem exists only with the scsi-mq path as, unlike > the legacy path, r

Re: [PATCH v2 0/2] virtio_scsi: Set can_queue based on size of virtqueue.

2017-08-10 Thread Martin K. Petersen
Richard, > v1 was here: > > https://lkml.org/lkml/2017/8/10/689 > > v1 -> v2: > > Remove .can_queue field from the templates. Applied to 4.14/scsi-queue. Thank you! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] qedi: Limit number for CQ queues.

2017-08-10 Thread Martin K. Petersen
Manish, > [qed_sp_iscsi_func_start:189(host_7-0)]Cannot satisfy CQ amount. Queues > requested 8, CQs available 4. Aborting function start > > Above condition will resolve as management firmware is capable of telling > us the number of CQs available for a given PF, qed will communicate the > same

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

2017-08-10 Thread Martin K. Petersen
John, > This patchset introduces an array of misc changes, most significantly > including: There were a couple of patches that did multiple things. In the future, please make sure you only make one logical change per patch. Applied to 4.14/scsi-queue. Thanks! -- Martin K. Petersen Oracle

Re: scsi: pm8001: fix double free in pm8001_pci_probe

2017-08-10 Thread Martin K. Petersen
Pan, > In function pm8001_pci_probe(), on errors that the control flow jumps to > label err_out_ha_free, function pm8001_free() is called. In pm8001_free(), > scsi_host_put() is called to release shost, which keeps the return value > of scsi_host_alloc(). After pm8001_free() returns, kfree() is c

Re: scsi: qla2xxx: use dma_mapping_error to check map errors

2017-08-10 Thread Martin K. Petersen
Pan, > The return value of dma_map_single() should be checked by > dma_mapping_error(). However, in function qla26xx_dport_diagnostics(), > its return value is checked against NULL, which could result in > failures. Applied to 4.14/scsi-queue. -- Martin K. Petersen Oracle Linux Engineerin

Re: scsi: mvsas: replace kfree with scsi_host_put

2017-08-10 Thread Martin K. Petersen
Pan, > The return value of scsi_host_alloc() should be released by > scsi_host_put(). However, in function mvs_pci_init(), kfree() > is used. This patch replaces kfree() with scsi_host_put() to avoid > possible memory leaks. Applied to 4.14/scsi-queue. -- Martin K. Petersen Oracle Linux E

Re: [PATCH v2] scsi: megaraid_sas: fix allocate instance->pd_info twice

2017-08-10 Thread Martin K. Petersen
weiping, > fix allocate instance->pd_info twice which was introduced by > 96188a89cc6d. Applied to 4.14/scsi-queue, thank you! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 0/5] qcom-ufs: phy/hcd: Refactor phy initialization code

2017-08-10 Thread Martin K. Petersen
Vivek, > Can you kindly review this patch series (for UFS controller changes) > and consider giving your Ack so that Kishon can pull in the series > through phy tree. SCSI piece looks OK. Would still like Subhash to review the rest. -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 0/7] smartpqi updates

2017-08-10 Thread Martin K. Petersen
Don, > These patches are based on Linus's tree > > The changes are: > > - smartpqi-add-pqi-reset-quiesce-support >- allow driver to confirm completion of a reset. > - smartpqi-enhance-bmic-cache-flush >- can now distinguish between shutdown and power > management operation. > - sm

Re: [PATCH 0/5] esp_scsi, mac_esp: Various fixes and cleanups

2017-08-10 Thread Martin K. Petersen
Finn, > This series has been tested on m68k Macs (ESP236 equivalent). > > Some more testing with different targets and devices (FAS236 etc) > might be nice. Being that the esp_scsi fixes are on error paths, more > review may actually be more valuable than more testing... Applied to 4.14/scsi-que

Re: [PATCH] arcmsr: add const to bin_attribute structures

2017-08-10 Thread Martin K. Petersen
Christoph, > Looks good, > > Reviewed-by: Christoph Hellwig Applied to 4.14/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH v2 3/5] aic7xxx: remove rules for shipped files

2017-08-10 Thread Martin K. Petersen
Michał, > Please drop this patch (only this one). I didn't notice, that the file > is needed by modpost: OK, done. -- Martin K. Petersen Oracle Linux Engineering

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-10 Thread Benjamin Block
On Fri, Aug 11, 2017 at 12:10:38AM +0200, Benjamin Block wrote: > On Thu, Aug 10, 2017 at 11:32:17AM +0200, Christoph Hellwig wrote: > > We can't use an on-stack buffer for the sense data, as drivers will > > dma to it. So we should reuse the SCSI init_rq_fn() for the BSG > > queues and/or impleme

Re: [RFC PATCH 5/6] bsg: reduce unnecessary arguments for bsg_map_hdr()

2017-08-10 Thread Benjamin Block
On Thu, Aug 10, 2017 at 11:35:31AM +0200, Christoph Hellwig wrote: > On Wed, Aug 09, 2017 at 04:11:19PM +0200, Benjamin Block wrote: > > Since struct bsg_command is now used in every calling case, we don't > > need separation of arguments anymore that are contained in the same > > bsg_command. > >

Re: [RFC PATCH 4/6] bsg: refactor ioctl to use regular BSG-command infrastructure for SG_IO

2017-08-10 Thread Benjamin Block
On Thu, Aug 10, 2017 at 10:24:56AM +0200, Johannes Thumshirn wrote: > On Wed, Aug 09, 2017 at 04:11:18PM +0200, Benjamin Block wrote: > > + return 0 == (bc->hdr.flags & BSG_FLAG_Q_AT_TAIL); > > return !(bc->hdr.flags & BSG_FLAG_Q_AT_TAIL); and make the function return > bool? I have to admit, th

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-10 Thread Benjamin Block
On Thu, Aug 10, 2017 at 11:32:17AM +0200, Christoph Hellwig wrote: > We can't use an on-stack buffer for the sense data, as drivers will > dma to it. So we should reuse the SCSI init_rq_fn() for the BSG > queues and/or implement the same scheme. > BSG is odd in this regard. Here is the data mode

Re: SCSI Oops: Unable to handle kernel NULL ptr dereference

2017-08-10 Thread Ewan D. Milne
[cc's snipped to linux-scsi ] On Thu, 2017-08-10 at 17:05 +, man...@openmail.cc wrote: > Hello, > > I'd like to report this rare panic I experienced today. I've been on > 4.12.3 since it was released and got this panic totally unexpected, > probably when terminating my WL compositor. I at

Re: [PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.

2017-08-10 Thread Richard W.M. Jones
On Fri, Aug 11, 2017 at 12:41:47AM +0300, Michael S. Tsirkin wrote: > On Thu, Aug 10, 2017 at 10:35:11PM +0100, Richard W.M. Jones wrote: > > On Fri, Aug 11, 2017 at 12:31:44AM +0300, Michael S. Tsirkin wrote: > > > Then we probably should fail probe if vq size is too small. > > > > What does this

Re: [PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.

2017-08-10 Thread Michael S. Tsirkin
On Thu, Aug 10, 2017 at 10:35:11PM +0100, Richard W.M. Jones wrote: > On Fri, Aug 11, 2017 at 12:31:44AM +0300, Michael S. Tsirkin wrote: > > Then we probably should fail probe if vq size is too small. > > What does this mean? > > Rich. We must prevent driver from submitting s/g lists > vq size

Re: [PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.

2017-08-10 Thread Richard W.M. Jones
On Fri, Aug 11, 2017 at 12:31:44AM +0300, Michael S. Tsirkin wrote: > Then we probably should fail probe if vq size is too small. What does this mean? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.

Re: [PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.

2017-08-10 Thread Michael S. Tsirkin
On Thu, Aug 10, 2017 at 10:30:38PM +0100, Richard W.M. Jones wrote: > On Fri, Aug 11, 2017 at 12:21:16AM +0300, Michael S. Tsirkin wrote: > > On Thu, Aug 10, 2017 at 05:40:34PM +0100, Richard W.M. Jones wrote: > > > If using indirect descriptors, you can make the total_sg as large as > > > you want

Re: [PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.

2017-08-10 Thread Richard W.M. Jones
On Fri, Aug 11, 2017 at 12:21:16AM +0300, Michael S. Tsirkin wrote: > On Thu, Aug 10, 2017 at 05:40:34PM +0100, Richard W.M. Jones wrote: > > If using indirect descriptors, you can make the total_sg as large as > > you want. > > That would be a spec violation though, even if it happens to > work o

Re: [PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.

2017-08-10 Thread Michael S. Tsirkin
On Thu, Aug 10, 2017 at 05:40:34PM +0100, Richard W.M. Jones wrote: > If using indirect descriptors, you can make the total_sg as large as > you want. That would be a spec violation though, even if it happens to work on current QEMU. The spec says: A driver MUST NOT create a descriptor ch

RE: [PATCH RESEND 0/6] hpsa: support legacy boards

2017-08-10 Thread Don Brace
> -Original Message- > From: Hannes Reinecke [mailto:h...@suse.de] > Sent: Thursday, August 10, 2017 9:11 AM > To: James Bottomley ; > Christoph Hellwig > Cc: Don Brace ; Martin K. Petersen > ; Meelis Roos ; linux- > s...@vger.kernel.org > Subject: Re: [PATCH RESEND 0/6] hpsa: support lega

Re: [PATCH 16/29] scsi: esas2r: constify pci_device_id.

2017-08-10 Thread Bradley Grove
Looks good. Acked-by: Bradley Grove On 07/30/2017 04:40 AM, Arvind Yadav wrote: pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav ---

[PATCH] sym53c8xx: Avoid undefined behaviour in drivers/scsi/sym53c8xx_2/sym_hipd.c:762

2017-08-10 Thread Helge Deller
On parisc I see this UBSAN warning with a sym53c896: UBSAN: Undefined behaviour in ./drivers/scsi/sym53c8xx_2/sym_hipd.c:762:24 index -1903078336 is out of range for type 'u32 [7]' Avoid this warning by switching to dev64_ul(). Signed-off-by: Helge Deller diff --git a/drivers/scsi/sym53c8xx_

[PATCH 7/7] smartpqi: change driver version to 1.1.2-125

2017-08-10 Thread Don Brace
From: Kevin Barnett Reviewed-by: Scott Benesh Signed-off-by: Kevin Barnett Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_

[PATCH 6/7] smartpqi: add in new controller ids

2017-08-10 Thread Don Brace
From: Kevin Barnett Update the driver’s PCI IDs to match the latest Microsemi controllers Reviewed-by: Scott Benesh Signed-off-by: Kevin Barnett Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 36 + 1 file changed, 14 insertions(+), 22 d

[PATCH 1/7] smartpqi: add pqi reset quiesce support

2017-08-10 Thread Don Brace
From: Kevin Barnett Reviewed-by: Scott Benesh Signed-off-by: Kevin Barnett Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi.h | 23 + drivers/scsi/smartpqi/smartpqi_init.c | 58 ++--- drivers/scsi/smartpqi/smartpqi_sis.c | 30

[PATCH 5/7] smartpqi: update kexec and power down support

2017-08-10 Thread Don Brace
From: Kevin Barnett add PQI reset to driver shutdown callback to work around controller bug. During an 1.) OS shutdown or 2.) kexec outside of a kdump, the Linux kernel will clear BME on our controller. If BME is cleared during a controller/host PCIe transfer, the controller will lock up. So w

[PATCH 4/7] smartpqi: cleanup doorbell register usage.

2017-08-10 Thread Don Brace
From: Kevin Barnett Reviewed-by: Scott Benesh Signed-off-by: Kevin Barnett Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 11 ++- drivers/scsi/smartpqi/smartpqi_sis.c | 105 +++-- drivers/scsi/smartpqi/smartpqi_sis.h |3 - 3 files cha

[PATCH 3/7] smartpqi: update pqi passthru ioctl

2017-08-10 Thread Don Brace
From: Kevin Barnett - make pass-thru requests bi-directional Reviewed-by: Scott Benesh Signed-off-by: Kevin Barnett Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/

[PATCH 2/7] smartpqi: enhance BMIC cache flush

2017-08-10 Thread Don Brace
From: Kevin Barnett - distinguish between shutdown and non-shutdown. Reviewed-by: Scott Benesh Signed-off-by: Kevin Barnett Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi.h | 21 +++-- drivers/scsi/smartpqi/smartpqi_init.c | 27 ++---

[PATCH 0/7] smartpqi updates

2017-08-10 Thread Don Brace
These patches are based on Linus's tree The changes are: - smartpqi-add-pqi-reset-quiesce-support - allow driver to confirm completion of a reset. - smartpqi-enhance-bmic-cache-flush - can now distinguish between shutdown and power management operation. - smartpqi-update-pqi-passthr

[PATCH] scsi-sysfs: correct errno for host_reset

2017-08-10 Thread weiping zhang
if scsi_host_template->host_reset is NULL, when user "echo adapter > /sys/class/scsi_host/hostx/host_reset", -EINVAL will return even string compare successfully. It make user confuse. change to: -EINVAL if string not match "adapter" / "firmware"; -EOPNOTSUPP if string match but not im

Re: SCSI Oops: Unable to handle kernel NULL ptr dereference

2017-08-10 Thread Bart Van Assche
On 08/10/17 10:05, man...@openmail.cc wrote: > I'd like to report this rare panic I experienced today. I've been on > 4.12.3 since it was released and got this panic totally unexpected, > probably when terminating my WL compositor. I attach to this message a > capture of the screen. The problem

Re: [PATCH v2 2/2] virtio: virtio_scsi: Set can_queue to the length of the virtqueue.

2017-08-10 Thread Paolo Bonzini
On 10/08/2017 18:56, Richard W.M. Jones wrote: > Since switching to blk-mq as the default in commit 5c279bd9e406 > ("scsi: default to scsi-mq"), virtio-scsi LUNs consume about 10x as > much kernel memory. > > qemu currently allocates a fixed 128 entry virtqueue. can_queue > currently is set to 10

[PATCH v2 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.

2017-08-10 Thread Richard W.M. Jones
If using indirect descriptors, you can make the total_sg as large as you want. If not, BUG is too serious because the function later returns -ENOSPC. Thanks Paolo Bonzini, Christoph Hellwig. Signed-off-by: Richard W.M. Jones Reviewed-by: Paolo Bonzini --- drivers/virtio/virtio_ring.c | 5 +++-

[PATCH v2 2/2] virtio: virtio_scsi: Set can_queue to the length of the virtqueue.

2017-08-10 Thread Richard W.M. Jones
Since switching to blk-mq as the default in commit 5c279bd9e406 ("scsi: default to scsi-mq"), virtio-scsi LUNs consume about 10x as much kernel memory. qemu currently allocates a fixed 128 entry virtqueue. can_queue currently is set to 1024. But with indirect descriptors, each command in the que

[PATCH v2 0/2] virtio_scsi: Set can_queue based on size of virtqueue.

2017-08-10 Thread Richard W.M. Jones
v1 was here: https://lkml.org/lkml/2017/8/10/689 v1 -> v2: Remove .can_queue field from the templates. Rich.

Re: [ezIX] #753: LSHW Causing Rewinds On LTO7 Drives

2017-08-10 Thread ezIX
#753: LSHW Causing Rewinds On LTO7 Drives --+- Reporter: a.richman@… | Owner: lyonel Type: defect | Status: new Priority: major| Milestone: Component: lshw |Version: Resolution: |

[ezIX] #753: LSHW Causing Rewinds On LTO7 Drives

2017-08-10 Thread ezIX
#753: LSHW Causing Rewinds On LTO7 Drives -+ Reporter: a.richman@… | Owner: lyonel Type: defect | Status: new Priority: major| Milestone: Component: lshw |Version: Keywords: lto lto7

Re: [PATCH 2/2] virtio: virtio_scsi: Set can_queue to the length of the virtqueue.

2017-08-10 Thread Paolo Bonzini
On 10/08/2017 18:40, Richard W.M. Jones wrote: > Since switching to blk-mq as the default in commit 5c279bd9e406 > ("scsi: default to scsi-mq"), virtio-scsi LUNs consume about 10x as > much kernel memory. > > qemu currently allocates a fixed 128 entry virtqueue. can_queue > currently is set to 10

Re: [PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.

2017-08-10 Thread Paolo Bonzini
On 10/08/2017 18:40, Richard W.M. Jones wrote: > If using indirect descriptors, you can make the total_sg as large as > you want. If not, BUG is too serious because the function later > returns -ENOSPC. > > Thanks Paolo Bonzini, Christoph Hellwig. > > Signed-off-by: Richard W.M. Jones > --- >

[PATCH 0/2] virtio_scsi: Set can_queue based on size of virtqueue.

2017-08-10 Thread Richard W.M. Jones
Earlier discussion: https://lkml.org/lkml/2017/8/4/601 "Increased memory usage with scsi-mq" Downstream bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1478201

[PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.

2017-08-10 Thread Richard W.M. Jones
If using indirect descriptors, you can make the total_sg as large as you want. If not, BUG is too serious because the function later returns -ENOSPC. Thanks Paolo Bonzini, Christoph Hellwig. Signed-off-by: Richard W.M. Jones --- drivers/virtio/virtio_ring.c | 5 +++-- 1 file changed, 3 inserti

[PATCH 2/2] virtio: virtio_scsi: Set can_queue to the length of the virtqueue.

2017-08-10 Thread Richard W.M. Jones
Since switching to blk-mq as the default in commit 5c279bd9e406 ("scsi: default to scsi-mq"), virtio-scsi LUNs consume about 10x as much kernel memory. qemu currently allocates a fixed 128 entry virtqueue. can_queue currently is set to 1024. But with indirect descriptors, each command in the que

Re: Increased memory usage with scsi-mq

2017-08-10 Thread Paolo Bonzini
On 10/08/2017 17:40, Richard W.M. Jones wrote: > OK this is looking a bit better now. > > With scsi-mq enabled: 175 disks > virtqueue_size=64: 318 disks * > virtqueue_size=16: 775 disks * > With scsi-mq disabled: 1755 disks > * = new results

Re: [PATCH] scsi-mq: Always unprepare before requeuing a request

2017-08-10 Thread Brian King
On 08/10/2017 10:26 AM, Bart Van Assche wrote: > On Thu, 2017-08-10 at 20:32 +1000, Michael Ellerman wrote: >> "Martin K. Petersen" writes: One of the two scsi-mq functions that requeue a request unprepares a request before requeueing (scsi_io_completion()) but the other function no

[PATCH 06/19] scsi: hisi_sas: remove repeated device config in v2 hw

2017-08-10 Thread John Garry
From: Xiang Chen This patch removes some repeated configurations: (1) The device id of the device is already set in the alloc function, so we don't need to modify in free device function. (2) Field dev_type and dev_status are configured in hisi_sas_dev_gone(), so there is no need for repeated con

[PATCH 05/19] scsi: hisi_sas: use array for v2 hw ECC errors

2017-08-10 Thread John Garry
The code to print ECC errors in v2 hw driver is very repetitive. This patch condensed the code by looping an array of errors. Signed-off-by: John Garry Signed-off-by: Shiju Jose --- drivers/scsi/hisi_sas/hisi_sas.h | 8 + drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 368 +---

[PATCH 08/19] scsi: hisi_sas: service interrupt ITCT_CLR interrupt in v2 hw

2017-08-10 Thread John Garry
From: Xiang Chen This patch is a fix related to free'ing a device in v2 hw driver. Before, we polled to ITCT CLR interrupt to check if a device is free. This was error prone, as if the interrupt doesn't occur in 10us, we miss processing it. To avoid this situation, service this interrupt and s

[PATCH 01/19] scsi: hisi_sas: fix reset and port ID refresh issues

2017-08-10 Thread John Garry
From: Xiaofei Tan This patch provides fixes for the following issues: 1. Fix issue of controller reset required to send commands. For reset process, it may be required to send commands to the controller, but not during soft reset. So add HISI_SAS_NOT_ACCEPT_CMD_BIT to prevent executing a task dur

[PATCH 03/19] scsi: hisi_sas: fix v2 hw underflow residual value

2017-08-10 Thread John Garry
From: Xiang Chen The value dw0 is the residual bytes when UNDERFLOW error happens, but we filled the residual with the value of dw3 before. So change the residual from dw3 to dw0. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 4 ++-- 1 file c

[PATCH 11/19] scsi: hisi_sas: Modify v3 hw STP_LINK_TIMER setting

2017-08-10 Thread John Garry
From: Xiang Chen Modify STP link timer from 10ms to 500ms. Also add the register address. Signed-off-by: Xiang Chen 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_sas/hisi_sas_v3_hw.c b/drivers/scs

[PATCH 14/19] scsi: hisi_sas: update some v3 register init settings

2017-08-10 Thread John Garry
From: Xiang Chen This patch updates some register setting according to recommendation from HW designer and experiment. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --

[PATCH 10/19] scsi: hisi_sas: add status and command buffer for internal abort

2017-08-10 Thread John Garry
From: Xiang Chen For v3 hw, internal abort function required status and command buffer to be set, so add necessary code for this. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-)

[PATCH 09/19] scsi: hisi_sas: support zone management commands

2017-08-10 Thread John Garry
From: Xiaofei Tan Add two ATA commands, ATA_CMD_ZAC_MGMT_IN and ATA_CMD_ZAC_MGMT_OUT in hisi_sas_get_ata_protocol(), to support SATA SMR disk. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/d

[PATCH 02/19] scsi: hisi_sas: avoid potential v2 hw interrupt issue

2017-08-10 Thread John Garry
From: Xiang Chen When some interrupts happen together, we need to process every interrupt one-by-one, and should not return immediately when one interrupt process is finished being processed. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 19 +

[PATCH 07/19] scsi: hisi_sas: add irq and tasklet cleanup in v2 hw

2017-08-10 Thread John Garry
From: Xiang Chen This patch adds support to clean-up allocated IRQs and kill tasklets when probe fails and for driver removal. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 96 +- 1 file changed, 49 insertions(

[PATCH 12/19] scsi: hisi_sas: fix v3 hw channel interrupt processing

2017-08-10 Thread John Garry
From: Xiang Chen The channel interrupt is to process all the interrupts except PHY UP/DOWN and broadcast interrupt. So we need to clear all the interrupts except those 3 interrupts after processing channel interrupts. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_s

[PATCH 04/19] scsi: hisi_sas: add v2 hw DFX feature

2017-08-10 Thread John Garry
From: Xiaofei Tan Add DFX feature for v2 hw. We are adding support for 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/scsi/hisi_sas/hisi_sas.h

[PATCH 17/19] scsi: hisi_sas: remove phy_down_v3_hw() res variable

2017-08-10 Thread John Garry
Variable res only holds value 0, so remove it. This cleans up a coccicheck warning. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas

[PATCH 13/19] scsi: hisi_sas: kill tasklet when destroying irq in v3 hw

2017-08-10 Thread John Garry
From: Xiang Chen This patch adds calls to kill CQ takslets v3 hw during probe failure. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi

[PATCH 19/19] scsi: hisi_sas: remove driver versioning

2017-08-10 Thread John Garry
The driver version is not updated with changes to the driver, so it has no value, so just get rid of it. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 2 -- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 - 3 files changed, 6 d

[PATCH 16/19] scsi: hisi_sas: add phy_set_linkrate_v3_hw()

2017-08-10 Thread John Garry
From: Xiang Chen Add function to set linkrate for v3 hw. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 39 ++ 1 file changed, 39 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scs

[PATCH 15/19] scsi: hisi_sas: add reset handler for v3 hw

2017-08-10 Thread John Garry
From: Xiang Chen Use ACPI "_RST" method to reset the controller, since FLR is not supported. Function hisi_sas_stop_phys() is introduced to remove some code duplication. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 2 + drivers/scsi/hisi_

[PATCH 18/19] scsi: hisi_sas: replace kfree with scsi_host_put

2017-08-10 Thread John Garry
Instances of kfree(shost) should be replaced with scsi_host_put(). In addition, a missing scsi_host_put() is added for error path in hisi_sas_shost_alloc_pci() and v3 driver removal. Signed-off-by: Pan Bian # For main.c changes Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.

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

2017-08-10 Thread John Garry
This patchset introduces an array of misc changes, most significantly including: - v2 hw reset function - core driver reset handler fixes - DFX feature - some interrupt/tasklet/probe+removal error path cleanup John Garry (4): scsi: hisi_sas: use array for v2 hw ECC errors scsi: hisi_sas: remov

Re: Increased memory usage with scsi-mq

2017-08-10 Thread Richard W.M. Jones
OK this is looking a bit better now. With scsi-mq enabled: 175 disks virtqueue_size=64: 318 disks * virtqueue_size=16: 775 disks * With scsi-mq disabled: 1755 disks * = new results I also ran the whole libguestfs test suite with virtqueue_si

Re: [PATCH] sd_zbc: Write unlock zone from sd_uninit_cmnd()

2017-08-10 Thread Bart Van Assche
On Thu, 2017-08-10 at 11:14 +0900, Damien Le Moal wrote: > I am currently trying different approaches for this. In the mean time, I > would like to see the unlock change patch be applied to fix the deadlock > problem. Hello Damien, That approach sounds fine to me. Bart.

Re: [PATCH] scsi-mq: Always unprepare before requeuing a request

2017-08-10 Thread Bart Van Assche
On Thu, 2017-08-10 at 20:32 +1000, Michael Ellerman wrote: > "Martin K. Petersen" writes: > > > One of the two scsi-mq functions that requeue a request unprepares a > > > request before requeueing (scsi_io_completion()) but the other > > > function not (__scsi_queue_insert()). Make sure that a req

Spurious DISK_EVENT_MEDIA_CHANGE on USB DVD hotplug?

2017-08-10 Thread Joe Lawrence
Hi Tejun, Kay, I'm investigating a customer report which manifests itself all the way up in gnome-session when a BMC hotplug-adds a simulated DVD device. The user logs into their server's BMC and enables "media redirection", an emulated DVD device + .iso is dynamically added to the bus... in the

Re: Increased memory usage with scsi-mq

2017-08-10 Thread Paolo Bonzini
On 10/08/2017 16:16, Richard W.M. Jones wrote: > On Thu, Aug 10, 2017 at 02:53:58PM +0200, Paolo Bonzini wrote: >> can_queue and cmd_per_lun are different. can_queue should be set to the >> value of vq->vring.num where vq is the command virtqueue (the first one >> is okay if there's >1). >> >> If

Re: [PATCH 1/3] scsi: allow state transition CREATED_BLOCK -> TRANSPORT_OFFLINE

2017-08-10 Thread James Bottomley
On Thu, 2017-08-10 at 09:05 +0200, Hannes Reinecke wrote: > scsi_internal_device_unblock_nowait() allows a state transition > SDEV_CREATED_BLOCK -> SDEV_TRANSPORT_OFFLINE/SDEV_OFFLINE, > scsi_device_set_state() does not. > So add the missing state transition to scsi_device_set_state(). > > Signed-

Re: Increased memory usage with scsi-mq

2017-08-10 Thread Richard W.M. Jones
On Thu, Aug 10, 2017 at 02:53:58PM +0200, Paolo Bonzini wrote: > can_queue and cmd_per_lun are different. can_queue should be set to the > value of vq->vring.num where vq is the command virtqueue (the first one > is okay if there's >1). > > If you want to change it, you'll have to do so in QEMU.

Re: [PATCH RESEND 0/6] hpsa: support legacy boards

2017-08-10 Thread Hannes Reinecke
On 08/10/2017 04:06 PM, James Bottomley wrote: > On Thu, 2017-08-10 at 09:09 +0200, Christoph Hellwig wrote: >> No device support in Linux is unsupported, sorry. I think we're >> getting into the corporate bullshit game a little too much here. > > I think there are two different definitions of su

Re: [PATCH RESEND 0/6] hpsa: support legacy boards

2017-08-10 Thread James Bottomley
On Thu, 2017-08-10 at 09:09 +0200, Christoph Hellwig wrote: > No device support in Linux is unsupported, sorry.  I think we're > getting into the corporate bullshit game a little too much here. I think there are two different definitions of supported here.  To us, any device to which the driver at

[PATCH] qedi: Limit number for CQ queues.

2017-08-10 Thread Manish Rangankar
[qed_sp_iscsi_func_start:189(host_7-0)]Cannot satisfy CQ amount. Queues requested 8, CQs available 4. Aborting function start Above condition will resolve as management firmware is capable of telling us the number of CQs available for a given PF, qed will communicate the same number to qedi, So th

Re: Increased memory usage with scsi-mq

2017-08-10 Thread Paolo Bonzini
On 10/08/2017 14:22, Richard W.M. Jones wrote: > On Wed, Aug 09, 2017 at 06:50:10PM +0200, Paolo Bonzini wrote: >> On 09/08/2017 18:01, Christoph Hellwig wrote: >>> On Mon, Aug 07, 2017 at 03:07:48PM +0200, Paolo Bonzini wrote: can_queue should depend on the virtqueue size, which unfortunately

Re: nvmf question - synchronization between target/initiator regarding partitions

2017-08-10 Thread Guilherme G. Piccoli
On 08/10/2017 06:16 AM, Christoph Hellwig wrote: > On Mon, Aug 07, 2017 at 02:29:47PM -0300, Guilherme G. Piccoli wrote: >> Thanks for your feedback Hannes, agreed! > > And btw, you'll see similar results with the SCSI target or nbd, > so it's not really nvme specific. Thanks, I agree - noticed t

Re: Increased memory usage with scsi-mq

2017-08-10 Thread Richard W.M. Jones
On Wed, Aug 09, 2017 at 06:50:10PM +0200, Paolo Bonzini wrote: > On 09/08/2017 18:01, Christoph Hellwig wrote: > > On Mon, Aug 07, 2017 at 03:07:48PM +0200, Paolo Bonzini wrote: > >> can_queue should depend on the virtqueue size, which unfortunately can > >> vary for each virtio-scsi device in theo

Re: [RFC PATCH 6/6] bsg: reduce unnecessary arguments for blk_complete_sgv4_hdr_rq()

2017-08-10 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [RFC PATCH 5/6] bsg: reduce unnecessary arguments for bsg_map_hdr()

2017-08-10 Thread Christoph Hellwig
On Wed, Aug 09, 2017 at 04:11:19PM +0200, Benjamin Block wrote: > Since struct bsg_command is now used in every calling case, we don't > need separation of arguments anymore that are contained in the same > bsg_command. > > Signed-off-by: Benjamin Block > --- > block/bsg.c | 13 ++--- >

Re: [RFC PATCH 4/6] bsg: refactor ioctl to use regular BSG-command infrastructure for SG_IO

2017-08-10 Thread Christoph Hellwig
On Thu, Aug 10, 2017 at 10:24:56AM +0200, Johannes Thumshirn wrote: > On Wed, Aug 09, 2017 at 04:11:18PM +0200, Benjamin Block wrote: > > + return 0 == (bc->hdr.flags & BSG_FLAG_Q_AT_TAIL); > > return !(bc->hdr.flags & BSG_FLAG_Q_AT_TAIL); and make the function return > bool? I have to admit, th

Re: [RFC PATCH 3/6] bsg: scsi-transport: add compile-tests to prevent reply-buffer overflows

2017-08-10 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [RFC PATCH 2/6] bsg: assign sense_len instead of fixed SCSI_SENSE_BUFFERSIZE

2017-08-10 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-10 Thread Christoph Hellwig
We can't use an on-stack buffer for the sense data, as drivers will dma to it. So we should reuse the SCSI init_rq_fn() for the BSG queues and/or implement the same scheme.

Re: [PATCH 3/3] scsi: make 'state' device attribute pollable

2017-08-10 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 2/3] scsi_lib: rework scsi_internal_device_unblock_nowait()

2017-08-10 Thread Christoph Hellwig
On Thu, Aug 10, 2017 at 09:05:30AM +0200, Hannes Reinecke wrote: > Rework scsi_internal_device_unblock_nowait() into using a > switch statement. > No functional changes. > > Signed-off-by: Hannes Reinecke > --- > drivers/scsi/scsi_lib.c | 18 -- > 1 file changed, 12 insertions(+)

  1   2   >