Re: [PATCH 2/2] scsi: core: fix dh and multipathing for SCSI hosts without request batching

2019-08-07 Thread kbuild test robot
Hi Steffen, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [cannot apply to v5.3-rc3 next-20190807] [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/Steffen

Re: [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without request batching

2019-08-07 Thread kbuild test robot
Hi Steffen, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [cannot apply to v5.3-rc3 next-20190807] [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/Steffen

Re: [PATCH 00/12] mpt3sas: Features and defect fixes.

2019-08-07 Thread Martin K. Petersen
Suganath, > This patch series includes below Enhancements and Bug fixes. Applied to 5.4/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without request batching

2019-08-07 Thread Martin K. Petersen
Ming, >> + .cleanup_rq = scsi_cleanup_rq, >> .busy = scsi_mq_lld_busy, >> .map_queues = scsi_map_queues, >> }; > > This one is a cross-tree thing, either scsi/5.4/scsi-queue needs to > pull for-5.4/block, or do it after both land linus tree. I'll set up

Re: [PATCH] lpfc: Fix crash when cpu count is 1 and null irq affinity mask

2019-08-07 Thread Martin K. Petersen
James, > When a configurations runs with a single cpu (such as a kdump kernel), > which causes the driver to request a single vector, when the driver > subsequently requests an irq affinity mask, the mask comes back null. > The driver currently does nothing in this scenario, which leaves > mappi

Re: [PATCH] scsi: ncr53c8xx: Mark expected switch fall-through

2019-08-07 Thread Martin K. Petersen
Helge, Applied to 5.4/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [RFC PATCH v2] target: tcmu: clean the nl_cmd of the udev when nl send fails

2019-08-07 Thread Martin K. Petersen
Li, > If the userspace process crashes while we send the nl msg, it is > possible that the cmd in curr_nl_cmd of tcmu_dev never gets reset to > 0, and and returns busy for other commands after the userspace process > is restartd. Applied to 5.4/scsi-queue, thanks! -- Martin K. Petersen O

Re: [PATCH v2 0/3] SCSI core patches for kernel v5.4

2019-08-07 Thread Martin K. Petersen
Bart, > The patches in this series address SCSI device blocking and unblocking > and fix a boot failure. Please consider these patches for kernel > version v5.4. Applied to 5.4/scsi-queue, thank you! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] megaraid_sas: change sdev queue depth max vs optimal

2019-08-07 Thread Martin K. Petersen
Chandrakanth, > This patch provides the module parameter and sysfs interface to switch > between the firmware provided (optimal) queue depth and controller > queue depth (can_queue). This smells a bit like a don't-be-broken flag. Why isn't the firmware-provided value optimal? -- Martin K. Pe

Re: [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without request batching

2019-08-07 Thread Ming Lei
On Wed, Aug 7, 2019 at 10:55 PM Steffen Maier wrote: > > This was missing from scsi_mq_ops_no_commit of linux-next commit > 8930a6c20791 ("scsi: core: add support for request batching") > from Martin's scsi/5.4/scsi-queue or James' scsi/misc. > > See also linux-next commit b7e9e1fb7a92 ("scsi: imp

Re: [PATCH 0/2] scsi: core: regression fixes for request batching

2019-08-07 Thread Bart Van Assche
On 8/7/19 7:49 AM, Steffen Maier wrote: Hi James, Martin, Paolo, Ming, multipathing with linux-next is broken since 20190723 in our CI. The patches fix a memleak and a severe dh/multipath functional regression. It would be nice if we could get them to 5.4/scsi-queue and also next. > I would ha

Re: [PATCH 0/2] scsi: core: regression fixes for request batching

2019-08-07 Thread Paolo Bonzini
On 07/08/19 16:49, Steffen Maier wrote: > Hi James, Martin, Paolo, Ming, > > multipathing with linux-next is broken since 20190723 in our CI. > The patches fix a memleak and a severe dh/multipath functional regression. > It would be nice if we could get them to 5.4/scsi-queue and also next. > > I

[PATCH 2/2] scsi: core: fix dh and multipathing for SCSI hosts without request batching

2019-08-07 Thread Steffen Maier
This was missing from scsi_device_from_queue() due to the introduction of another new scsi_mq_ops_no_commit of linux-next commit 8930a6c20791 ("scsi: core: add support for request batching") from Martin's scsi/5.4/scsi-queue or James' scsi/misc. Only devicehandler code seems to call scsi_device_fr

[PATCH 0/2] scsi: core: regression fixes for request batching

2019-08-07 Thread Steffen Maier
Hi James, Martin, Paolo, Ming, multipathing with linux-next is broken since 20190723 in our CI. The patches fix a memleak and a severe dh/multipath functional regression. It would be nice if we could get them to 5.4/scsi-queue and also next. I would have preferred if such a new feature had used i

[PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without request batching

2019-08-07 Thread Steffen Maier
This was missing from scsi_mq_ops_no_commit of linux-next commit 8930a6c20791 ("scsi: core: add support for request batching") from Martin's scsi/5.4/scsi-queue or James' scsi/misc. See also linux-next commit b7e9e1fb7a92 ("scsi: implement .cleanup_rq callback") from block/for-next. Signed-off-by

[PATCH v3 16/20] sg: expand sg_comm_wr_t

2019-08-07 Thread Douglas Gilbert
The internal struct sg_comm_wr_t was added when the number of arguments to sg_common_write() became excessive. Expand this idea so multiple calls to sg_fetch_cmnd() can be deferred until a scsi_request object is ready to receive the command. This saves a 252 byte stack allocation on every submit pa

[PATCH v3 03/20] sg: sg_log and is_enabled

2019-08-07 Thread Douglas Gilbert
Replace SCSI_LOG_TIMEOUT macros with SG_LOG macros across the driver. The definition of SG_LOG calls SCSI_LOG_TIMEOUT if given and derived pointers are non-zero, calls pr_info otherwise. SG_LOGS additionally prints the sg device name and the thread id. The thread id is very useful, even in single t

[PATCH v3 08/20] sg: speed sg_poll and sg_get_num_waiting

2019-08-07 Thread Douglas Gilbert
Track the number of submitted and waiting (for read/receive) requests on each file descriptor with two atomic integers. This speeds sg_poll() and ioctl(SG_GET_NUM_WAITING) which are oft used with the asynchronous (non-blocking) interfaces. Signed-off-by: Douglas Gilbert --- drivers/scsi/sg.c | 5

[PATCH v3 02/20] sg: remove typedefs, type+formatting cleanup

2019-08-07 Thread Douglas Gilbert
Typedefs for structure types are discouraged so those structures that are private to the driver have had their typedefs removed. This also means that most "camel" type variable names (i.e. mixed case) have been removed. Signed-off-by: Douglas Gilbert --- drivers/scsi/sg.c | 394

[PATCH v3 12/20] sg: sense buffer rework

2019-08-07 Thread Douglas Gilbert
The biggest single item in the sg_request object is the sense buffer array which is SCSI_SENSE_BUFFERSIZE bytes long. That constant started out at 18 bytes 20 years ago and is 96 bytes now and might grow in the future. On the other hand the sense buffer is only used by a small number of SCSI comman

[PATCH v3 19/20] sg: first debugfs support

2019-08-07 Thread Douglas Gilbert
Duplicate the semantics of 'cat /proc/scsi/sg/debug' on 'cat /sys/kernel/debug/scsi_generic/snapshot'. Make code that generates the snapshot conditional on either CONFIG_SCSI_PROC_FS or CONFIG_DEBUG_FS being defined. - Use "scsi_generic" in the debugfs path as "sg" may be confused with scatter ga

[PATCH v3 20/20] sg: bump version to 4.0.03

2019-08-07 Thread Douglas Gilbert
Now that the sg version 4 interface is supported: - with ioctl(SG_IO) for synchronous/blocking use - with ioctl(SG_IOSUBMIT) and ioctl(SG_IORECEIVE) for async/non-blocking use Plus new ioctl(SG_IOSUBMIT_V3) and ioctl(SG_IORECEIVE_V3) potentially replace write() and read() for the sg version

[PATCH v3 05/20] sg: bitops in sg_device

2019-08-07 Thread Douglas Gilbert
Introduce bitops in sg_device to replace an atomic, a bool and a char. That char (sgdebug) had been reduced to only two states. Add some associated macros to make the code a little clearer. Signed-off-by: Douglas Gilbert --- drivers/scsi/sg.c | 104 +++---

[PATCH v3 04/20] sg: rework sg_poll(), minor changes

2019-08-07 Thread Douglas Gilbert
Re-arrange code in sg_poll(). Rename sg_read_oxfer() to sg_rd_append(). In sg_start_req() rename rw to r0w. Plus associated changes demanded by checkpatch.pl Signed-off-by: Douglas Gilbert --- drivers/scsi/sg.c | 65 ++- 1 file changed, 30 insertions(+

[PATCH v3 17/20] sg: add sg_iosubmit_v3 and sg_ioreceive_v3 ioctls

2019-08-07 Thread Douglas Gilbert
Add ioctl(SG_IOSUBMIT_V3) and ioctl(SG_IORECEIVE_V3). These ioctls are meant to be (almost) drop-in replacements for the write()/read() async version 3 interface. They only accept the version 3 interface. See the webpage at: http://sg.danny.cz/sg/sg_v40.html specifically the table in the section t

[PATCH v3 07/20] sg: move header to uapi section

2019-08-07 Thread Douglas Gilbert
Move user interface part of scsi/sg.h into the new header file: include/uapi/scsi/sg.h . Since scsi/sg.h includes the new header, other code including scsi/sg.h should not be impacted. Signed-off-by: Douglas Gilbert Reported-by: kbuild test robot - kbuild noted a problem with including in incl

[PATCH v3 09/20] sg: sg_allow_if_err_recovery and renames

2019-08-07 Thread Douglas Gilbert
Add sg_allow_if_err_recover() to do checks common to several entry points. Replace retval with either res or ret. Rename sg_finish_rem_req() to sg_finish_scsi_blk_rq(). Rename sg_new_write() to sg_submit(). Other cleanups triggered by checkpatch.pl . Signed-off-by: Douglas Gilbert --- drivers/sc

[PATCH v3 00/20] sg: add v4 interface

2019-08-07 Thread Douglas Gilbert
This patchset extends the SCSI generic (sg) driver found in lk 5.3 . The sg driver has a version number which is visible via ioctl(SG_GET_VERSION_NUM) and is bumped from 3.5.36 to 4.0.03 by this patchset. The additions and changes are described in some detail in this long webpage: http://sg.da

[PATCH v3 10/20] sg: remove most access_ok functions

2019-08-07 Thread Douglas Gilbert
Since access_ok() has lost it direction (3rd) parameter there seems to be no benefit in calling access_ok() before __copy_{to|from}_user(). Simplify code by using the variant of these functions that do not start with "__". Signed-off-by: Douglas Gilbert --- drivers/scsi/sg.c | 50 +++

[PATCH v3 11/20] sg: replace rq array with lists

2019-08-07 Thread Douglas Gilbert
Remove the fixed size array of 16 request elements per file descriptor and replace with two linked lists per file descriptor. One list is for active commands, the other list is a free list. sg_request objects are now kept, available for re-use, until their owning file descriptor is closed. The sg_r

[PATCH v3 13/20] sg: add sg v4 interface support

2019-08-07 Thread Douglas Gilbert
Add support for the sg v4 interface based on struct sg_io_v4 found in include/uapi/linux/bsg.h and only previously supported by the bsg driver. Add ioctl(SG_IOSUBMIT) and ioctl(SG_IORECEIVE) for async (non-blocking) usage of the sg v4 interface. Do not accept the v3 interface with these ioctls. Do

[PATCH v3 14/20] sg: rework debug info

2019-08-07 Thread Douglas Gilbert
Since the version 2 driver, the state of the driver can be found with 'cat /proc/scsi/sg/debug'. As the driver becomes more threaded and IO faster (e.g. scsi_debug with a command timer of 5 microseconds), the existing state dump can become misleading as the state can change during the "snapshot". T

[PATCH v3 06/20] sg: make open count an atomic

2019-08-07 Thread Douglas Gilbert
Convert sg_device::open_cnt into an atomic. Also rename sg_tablesize into the more descriptive max_sgat_elems. Signed-off-by: Douglas Gilbert --- drivers/scsi/sg.c | 39 --- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/sg.c b/dr

[PATCH v3 15/20] sg: add 8 byte SCSI LUN to sg_scsi_id

2019-08-07 Thread Douglas Gilbert
The existing ioctl(SG_GET_SCSI_ID) fills a object of type struct sg_scsi_id whose last field is int unused[2]. Add an anonymous union with u8 scsi_lun[8] sharing those last 8 bytes. This patch will place the current device's full LUN in the scsi_lun array using T10's preferred LUN format (i.e. an a

[PATCH v3 01/20] sg: move functions around

2019-08-07 Thread Douglas Gilbert
Move main entry point functions around so submission code comes before completion code. Prior to this, the driver used the traditional open(), close(), read(), write(), ioctl() ordering however in this case that places completion code (i.e. sg_read()) before submission code (i.e. sg_write()). The m

[PATCH v3 18/20] sg: add some __must_hold macros

2019-08-07 Thread Douglas Gilbert
In the case of sg_wait_open_event() which calls mutex_unlock on sdp->open_rel_lock and later calls mutex_lock on the same lock; this macro is needed to stop sparse complaining. In other cases it is a reminder to the coder (a precondition). Signed-off-by: Douglas Gilbert --- drivers/scsi/sg.c | 7