Re: [PATCH 1/3] scsi: myrs: Fix a logical vs bitwise bug

2018-10-19 Thread Martin K. Petersen
Dan, > The || was supposed to be |. The original code just sets ->result to 1. Applied to 4.20/scsi-queue, thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 2/3] scsi: myrs: Fix the processor absent message in processor_show()

2018-10-19 Thread Martin K. Petersen
Dan, > If both processors are absent then it's supposed to print that, but > instead we print that just the second processor is absent. Applied to 4.20/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 3/3] scsi: myrs: prevent negatives in disable_enclosure_messages_store()

2018-10-19 Thread Martin K. Petersen
Dan, > We only want the value to be zero or one. > > It's not a big deal, but say we passed set value to INT_MIN, then > disable_enclosure_messages_show() would return that 12 bytes of "buf" > are initialized but actually only 3 are. I think there are tools like > KASAN which will trigger an

Re: [PATCH RESEND] scsi: qla2xxx: I/Os timing out on surprise removal of

2018-10-19 Thread Martin K. Petersen
Bill, > When doing a surprise removal of an adapter, some in flight I/Os can > get stuck and take a while to complete (they actually timeout and are > retried). We are not handling an early error exit from > qla2xxx_eh_abort properly. This doesn't apply to 4.20/scsi-queue and the surrounding

Re: [PATCH] scsi: myrs: fix build failure on 32 bit

2018-10-19 Thread Martin K. Petersen
James, > For 32 bit versions we have to be careful about divisions of 64 bit > quantities so use do_div() instead of a direct division. This fixes a > warning about _uldivmod being undefined in certain configurations Applied to 4.20/scsi-queue. -- Martin K. Petersen Oracle Linux

Re: [PATCH 5/8] sg: add free list, rework locking

2018-10-19 Thread kbuild test robot
Hi linux-scsi-owner, Thank you for the patch! Yet something to improve: [auto build test ERROR on mkp-scsi/for-next] [also build test ERROR on v4.19-rc8 next-20181019] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com

Re: [PATCH 5/8] sg: add free list, rework locking

2018-10-19 Thread Bart Van Assche
On Fri, 2018-10-19 at 15:55 -0400, Douglas Gilbert wrote: > On 2018-10-19 11:22 a.m., Bart Van Assche wrote: > > On Fri, 2018-10-19 at 02:24 -0400, Douglas Gilbert wrote: > > > static void > > > -sg_fill_request_table(struct sg_fd *sfp, struct sg_req_info *rinfo) > > >

[bug report] scsi: myrb: Add Mylex RAID controller (block interface)

2018-10-19 Thread Dan Carpenter
Hello Hannes Reinecke, The patch 081ff398c56c: "scsi: myrb: Add Mylex RAID controller (block interface)" from Oct 17, 2018, leads to the following static checker warning: drivers/scsi/myrb.c:1614 myrb_ldev_queuecommand() warn: assigning signed to unsigned: 'mbox->type5.sg_count =

Re: dma related cleanups for wd719x

2018-10-19 Thread Ondrej Zary
On Thursday 18 October 2018 15:01:14 Christoph Hellwig wrote: > Hi Ondrej, > > can you look over this series, which cleans up a few dma-related > bits in the wd719x driver? > This makes it work a bit (can detect drive and read partitions) but it hangs completely after hdparm -t. diff --git

Re: [PATCH 5/8] sg: add free list, rework locking

2018-10-19 Thread Douglas Gilbert
On 2018-10-19 11:22 a.m., Bart Van Assche wrote: On Fri, 2018-10-19 at 02:24 -0400, Douglas Gilbert wrote: static void -sg_fill_request_table(struct sg_fd *sfp, struct sg_req_info *rinfo) +sg_fill_request_table(struct sg_fd *sfp, struct sg_req_info *rinfo, + int max_num) {

Re: [PATCH 3/8] sg: split header, expand and correct descriptions

2018-10-19 Thread Douglas Gilbert
On 2018-10-19 4:31 a.m., Johannes Thumshirn wrote: On 19/10/18 08:24, Douglas Gilbert wrote: +/* Alternate style type names, "..._t" variants preferred */ +typedef struct sg_io_hdr Sg_io_hdr; +typedef struct sg_io_vec Sg_io_vec; +typedef struct sg_scsi_id Sg_scsi_id; +typedef struct sg_req_info

Re: [PATCH 1/5] ips: use lower_32_bits and upper_32_bits instead of reinventing them

2018-10-19 Thread Bart Van Assche
On Thu, 2018-10-18 at 15:03 +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig > --- > drivers/scsi/ips.c | 6 +++--- > drivers/scsi/ips.h | 3 --- > 2 files changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c > index

Re: [PATCH 2/8] sg: introduce sg_log macro

2018-10-19 Thread Douglas Gilbert
On 2018-10-19 3:45 a.m., Johannes Thumshirn wrote: On 19/10/18 08:24, Douglas Gilbert wrote: [..] +/* + * Kernel needs to be built with CONFIG_SCSI_LOGGING to see log messages. + * 'depth' is a number between 1 (most severe) and 7 (most noisy, most + * information). All messages are logged as

Re: [PATCH] scsi: myrs: fix build failure on 32 bit

2018-10-19 Thread Randy Dunlap
On 10/18/18 4:50 PM, James Bottomley wrote: > For 32 bit versions we have to be careful about divisions of 64 bit > quantities so use do_div() instead of a direct division. This fixes a > warning about _uldivmod being undefined in certain configurations on i386 it was: ERROR: "__udivdi3"

Re: [PATCH -next] scsi: qedf: remove set but not used variable 'fcport'

2018-10-19 Thread Ewan D. Milne
On Fri, 2018-10-19 at 12:12 +, YueHaibing wrote: > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/scsi/qedf/qedf_main.c: In function 'qedf_eh_abort': > drivers/scsi/qedf/qedf_main.c:619:21: warning: > variable 'fcport' set but not used [-Wunused-but-set-variable] > struct

Re: [PATCH 6/8] sg: complete locking changes on ioctl+debug

2018-10-19 Thread kbuild test robot
Hi linux-scsi-owner, Thank you for the patch! Yet something to improve: [auto build test ERROR on mkp-scsi/for-next] [also build test ERROR on v4.19-rc8 next-20181019] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com

RE: Looking for some help understanding error handling

2018-10-19 Thread Chris.Moore
> -Original Message- > From: linux-scsi-ow...@vger.kernel.org ow...@vger.kernel.org> On Behalf Of John Garry > Sent: Friday, October 19, 2018 2:19 AM > To: Chris Moore - C33997 ; h...@suse.de; > linux-scsi@vger.kernel.org; Jason Yan > Subject: Re: Looking for some help understanding

Re: [PATCH] bsg: convert to use blk-mq

2018-10-19 Thread Benjamin Block
On Fri, Oct 19, 2018 at 09:50:53AM -0600, Jens Axboe wrote: > On 10/19/18 9:01 AM, Benjamin Block wrote: > > On Wed, Oct 17, 2018 at 10:01:16AM -0600, Jens Axboe wrote: > >> On 10/17/18 9:55 AM, Benjamin Block wrote: > >>> On Tue, Oct 16, 2018 at 08:43:01AM -0600, Jens Axboe wrote: > Requires

Re: [PATCH] bsg: convert to use blk-mq

2018-10-19 Thread Jens Axboe
On 10/19/18 9:01 AM, Benjamin Block wrote: > On Wed, Oct 17, 2018 at 10:01:16AM -0600, Jens Axboe wrote: >> On 10/17/18 9:55 AM, Benjamin Block wrote: >>> On Tue, Oct 16, 2018 at 08:43:01AM -0600, Jens Axboe wrote: Requires a few changes to the FC transport class as well. Cc:

Re: [PATCH 5/8] sg: add free list, rework locking

2018-10-19 Thread Bart Van Assche
On Fri, 2018-10-19 at 10:38 -0400, Tony Battersby wrote: > Incidentally, I have been using my own home-grown target-mode SCSI > system for the past 16 years, but now I am starting to look into > switching to SCST. I was just reading about their "SGV cache": > >

Re: [PATCH 5/8] sg: add free list, rework locking

2018-10-19 Thread Bart Van Assche
On Fri, 2018-10-19 at 02:24 -0400, Douglas Gilbert wrote: > static void > -sg_fill_request_table(struct sg_fd *sfp, struct sg_req_info *rinfo) > +sg_fill_request_table(struct sg_fd *sfp, struct sg_req_info *rinfo, > + int max_num) > { > struct sg_request *srp; >

Re: [PATCH 4/8] sg: expand request states

2018-10-19 Thread Bart Van Assche
On Fri, 2018-10-19 at 02:24 -0400, Douglas Gilbert wrote: > +/* Following defines are states of sg_request::rq_state */ > +#define SG_RQ_INACTIVE 0/* request not in use (e.g. on fl) */ > +#define SG_RQ_INFLIGHT 1/* SCSI request issued, no response yet */ > +#define

Re: [PATCH] bsg: convert to use blk-mq

2018-10-19 Thread Benjamin Block
On Wed, Oct 17, 2018 at 10:01:16AM -0600, Jens Axboe wrote: > On 10/17/18 9:55 AM, Benjamin Block wrote: > > On Tue, Oct 16, 2018 at 08:43:01AM -0600, Jens Axboe wrote: > >> Requires a few changes to the FC transport class as well. > >> > >> Cc: Johannes Thumshirn > >> Cc: Benjamin Block > >>

Re: [PATCH 5/8] sg: add free list, rework locking

2018-10-19 Thread Tony Battersby
On 10/19/18 2:24 AM, Douglas Gilbert wrote: > + if (sfp->tot_fd_thresh) > + sfp->sum_fd_dlens += align_sz; > What lock protects sfp->sum_fd_dlens? > /* > @@ -2216,38 +2401,85 @@ sg_add_request(struct sg_fd *sfp) > * data length exceeds rem_sgat_thresh then the data (or sgat)

[PATCH -next] scsi: qedf: remove set but not used variable 'fcport'

2018-10-19 Thread YueHaibing
Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/qedf/qedf_main.c: In function 'qedf_eh_abort': drivers/scsi/qedf/qedf_main.c:619:21: warning: variable 'fcport' set but not used [-Wunused-but-set-variable] struct qedf_rport *fcport; It never used since introduction in commit

Re: [PATCH 5/8] sg: add free list, rework locking

2018-10-19 Thread kbuild test robot
Hi linux-scsi-owner, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on mkp-scsi/for-next] [also build test WARNING on v4.19-rc8 next-20181019] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https

[PATCH 3/3] scsi: myrs: prevent negatives in disable_enclosure_messages_store()

2018-10-19 Thread Dan Carpenter
We only want the value to be zero or one. It's not a big deal, but say we passed set value to INT_MIN, then disable_enclosure_messages_show() would return that 12 bytes of "buf" are initialized but actually only 3 are. I think there are tools like KASAN which will trigger an info leak warning

Re: Looking for some help understanding error handling

2018-10-19 Thread John Garry
On 05/10/2018 16:51, chris.mo...@microchip.com wrote: Thanks Hannes, After some pointers from Shane Seymour I found that the FC and SRP transport layers have a devloss timer, so that when a device disappears they hold on to the target information for a time waiting to see if it comes back.

[PATCH 2/3] scsi: myrs: Fix the processor absent message in processor_show()

2018-10-19 Thread Dan Carpenter
If both processors are absent then it's supposed to print that, but instead we print that just the second processor is absent. Fixes: 77266186397c ("scsi: myrs: Add Mylex RAID controller (SCSI interface)") Signed-off-by: Dan Carpenter --- drivers/scsi/myrs.c | 4 ++-- 1 file changed, 2

[PATCH 1/3] scsi: myrs: Fix a logical vs bitwise bug

2018-10-19 Thread Dan Carpenter
The || was supposed to be |. The original code just sets ->result to 1. Fixes: 77266186397c ("scsi: myrs: Add Mylex RAID controller (SCSI interface)") Signed-off-by: Dan Carpenter --- drivers/scsi/myrs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/myrs.c

Re: [PATCH 3/8] sg: split header, expand and correct descriptions

2018-10-19 Thread Johannes Thumshirn
On 19/10/18 08:24, Douglas Gilbert wrote: > +/* Alternate style type names, "..._t" variants preferred */ > +typedef struct sg_io_hdr Sg_io_hdr; > +typedef struct sg_io_vec Sg_io_vec; > +typedef struct sg_scsi_id Sg_scsi_id; > +typedef struct sg_req_info Sg_req_info; There are no _t variants for

Re: [PATCH 4/8] sg: expand request states

2018-10-19 Thread Johannes Thumshirn
Looks good (but the ifdefs are creepy), Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard,

Re: [PATCH 2/8] sg: introduce sg_log macro

2018-10-19 Thread Johannes Thumshirn
On 19/10/18 08:24, Douglas Gilbert wrote: [..] > +/* > + * Kernel needs to be built with CONFIG_SCSI_LOGGING to see log messages. > + * 'depth' is a number between 1 (most severe) and 7 (most noisy, most > + * information). All messages are logged as informational (KERN_INFO). In > + * the

Re: [PATCH 1/8] sg: types and naming cleanup

2018-10-19 Thread Johannes Thumshirn
On 19/10/18 08:24, Douglas Gilbert wrote: > Remove typedefs and use better type names like bool and u8 where > appropriate. Rename some variables and functions for clarity. > Adjust formatting (e.g. function definitions) to be more > consistent across the driver. Thanks a lot Doug, this is highly

Re: [PATCH] scsi: myrs: fix build failure on 32 bit

2018-10-19 Thread Hannes Reinecke
On 10/19/18 1:50 AM, James Bottomley wrote: For 32 bit versions we have to be careful about divisions of 64 bit quantities so use do_div() instead of a direct division. This fixes a warning about _uldivmod being undefined in certain configurations Fixes: 77266186397c ("scsi: myrs: Add Mylex

[PATCH 3/8] sg: split header, expand and correct descriptions

2018-10-19 Thread Douglas Gilbert
Split scsi/sg.h into a smaller scsi/sg.h which includes a new header: uapi/scsi/sg.h . Overall expand the twin header files with new functionality in this patchset and functionality to be added in the next patchset to implement SG_IOSUBMIT and friends. Adjust format to modern kernel conventions.

[PATCH 7/8] sg: rework ioctl handling

2018-10-19 Thread Douglas Gilbert
Rework ioctl handling, report clearly to the log which ioctl has been invoked. Add a new "IOWR" ioctl: SG_SET_GET_EXTENDED which permits several integer and boolean values to be "_SET_" (i.e. passed into the driver, potentially changing its actions) and/or read from the driver (the "_GET_" part)

[PATCH 5/8] sg: add free list, rework locking

2018-10-19 Thread Douglas Gilbert
Remove fixed 16 sg_request object array and replace with an active rq_list plus a request free list. Add finer grained spin lock to sg_request and do a major rework on locking. sg_request objects now are only de-allocated when the owning file descriptor is closed. This simplifies locking issues.

[PATCH 6/8] sg: complete locking changes on ioctl+debug

2018-10-19 Thread Douglas Gilbert
Complete the locking and structure changes of ioctl and debug ('cat /proc/scsi/sg/debug') handling. Signed-off-by: Douglas Gilbert --- This was the code that was "#if 0'-ed out 2 patches ago. It also shuts checkpatch.pl up as it doesn't like that technique but offers no viable substitute.

[PATCH 8/8] sg: user control for q_at_head or tail

2018-10-19 Thread Douglas Gilbert
Add a SG_SET_GET_EXTENDED ioctl control for whether commands will be queued_at_head or queued_at_tail by the block layer (together with the scsi mid-level). It has file scope. Signed-off-by: Douglas Gilbert --- The user can still override this setting on a per command basis with the

[PATCH 1/8] sg: types and naming cleanup

2018-10-19 Thread Douglas Gilbert
Remove typedefs and use better type names like bool and u8 where appropriate. Rename some variables and functions for clarity. Adjust formatting (e.g. function definitions) to be more consistent across the driver. Signed-off-by: Douglas Gilbert --- The intention is to move to sg_version_num

[PATCH 4/8] sg: expand request states

2018-10-19 Thread Douglas Gilbert
Introduce the new rq_state defines. SG_RQ_DATA_THRESHOLD is a default value that if the data length of a request exceeds then, after that request is completed, the data buffer will be freed up as the sg_request object is placed on the free list. SG_TOT_FD_THRESHOLD is a default, per file

[PATCH 0/8] sg: major cleanup, remove max_queue limit

2018-10-19 Thread Douglas Gilbert
The intention is to add two new ioctls as proposed by Linus Torvalds: SG_IOSUBMIT and SG_IORECEIVE to replace the write()/read() async interface. But first, clean up the driver and remove the SG_MAX_QUEUE limit of no more than 16 queued commands on a file descriptor at a time. A free list has

[PATCH 2/8] sg: introduce sg_log macro

2018-10-19 Thread Douglas Gilbert
Introduce the SG_LOG macro to replace long-winded 'SCSI_LOG_TIMEOUT(3, sg_printk ...' debug messages. Use __func__ wherever appropriate to make the debug messages more portable. Signed-off-by: Douglas Gilbert --- drivers/scsi/sg.c | 162 +- 1 file