[PATCH -next] scsi: ufs: Use PTR_ERR_OR_ZERO in ufs_hisi_get_resource()

2018-11-13 Thread YueHaibing
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Signed-off-by: YueHaibing --- drivers/scsi/ufs/ufs-hisi.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/scsi/ufs/ufs-hisi.c b/drivers/scsi/ufs/ufs-hisi.c index 452e19f..6fdf059 100644 --- a/drivers/scsi/u

Re: [PATCH] qla2xxx: Add SysFS hook for FC-NVMe autoconnect

2018-11-13 Thread Bart Van Assche
On Tue, 2018-11-13 at 01:02 +, Madhani, Himanshu wrote: > I see other drivers also use similar information populated for NVMe > Connection at boot time. Hi Himanshu, Which other drivers are you referring to? Thanks, Bart.

Re: [PATCH] qla2xxx: Add SysFS hook for FC-NVMe autoconnect

2018-11-13 Thread Madhani, Himanshu
> On Nov 13, 2018, at 6:23 AM, Bart Van Assche wrote: > > External Email > > On Tue, 2018-11-13 at 01:02 +, Madhani, Himanshu wrote: >> I see other drivers also use similar information populated for NVMe >> Connection at boot time. > > Hi Himanshu, > > Which other drivers are you referri

Re: [PATCH] qla2xxx: Add SysFS hook for FC-NVMe autoconnect

2018-11-13 Thread Bart Van Assche
On Tue, 2018-11-13 at 17:38 +, Madhani, Himanshu wrote: > On Nov 13, 2018, at 6:23 AM, Bart Van Assche wrote: > > On Tue, 2018-11-13 at 01:02 +, Madhani, Himanshu wrote: > > > I see other drivers also use similar information populated for NVMe > > > Connection at boot time. > > > > Hi Him

Re: [PATCH] scsi: libsas: Remove pcidev reference

2018-11-13 Thread John Garry
On 12/11/2018 19:52, Joe Perches wrote: On Mon, 2018-11-12 at 19:31 +, John Garry wrote: On 12/11/2018 18:58, Joe Perches wrote: +#define pr_fmt(fmt) "sas: " fmt Some other subsystem may try to include this header, and gets its message prefix overwritten. Just a consequence for doing somet

Re: [PATCH 5/8] bsg: refactor bsg_ioctl

2018-11-13 Thread Benjamin Block
On Sun, Nov 11, 2018 at 02:32:08PM +0100, Christoph Hellwig wrote: > Move all actual functionality into helpers, just leaving the dispatch > in this function. > > Signed-off-by: Christoph Hellwig > --- > block/bsg.c | 158 > 1 file changed, 72

Re: [PATCH 6/8] bsg-lib: handle bidi requests without block layer help

2018-11-13 Thread Benjamin Block
On Sun, Nov 11, 2018 at 02:32:09PM +0100, Christoph Hellwig wrote: > We can just stash away the second request in struct bsg_job instead > of using the block layer req->next_rq field, allowing for the eventual > removal of the latter. > > Signed-off-by: Christoph Hellwig > --- > block/bsg-lib.c

[PATCH] drivers/scsi/fnic/fnic_trace.c: Use vzalloc

2018-11-13 Thread Sabyasachi Gupta
Replaced vmalloc + memset with vzalloc Signed-off-by: Sabyasachi Gupta --- drivers/scsi/fnic/fnic_trace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/fnic/fnic_trace.c b/drivers/scsi/fnic/fnic_trace.c index 8271785..129ab27 100644 --- a/drivers/scsi/fnic/

Re: [PATCH] scsi: libsas: Remove pcidev reference

2018-11-13 Thread Joe Perches
On Tue, 2018-11-13 at 13:38 +, John Garry wrote: > On 12/11/2018 19:52, Joe Perches wrote: > > On Mon, 2018-11-12 at 19:31 +, John Garry wrote: > > > On 12/11/2018 18:58, Joe Perches wrote: > > > > > > +#define pr_fmt(fmt) "sas: " fmt [] > > > > It also might useful to use the common debugg

[GIT PULL] SCSI fixes for 4.20-rc2

2018-11-13 Thread James Bottomley
This is mostly a set of minor and obvious fixes (three in one of the new drivers). The only substantial change is to move the ufs to the blk-mq now that the merge window fixed the suspend/resume issues with blk-mq. The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/s

Re: [PATCH] drivers/scsi/fnic/fnic_trace.c: Use vzalloc

2018-11-13 Thread John Garry
On 13/11/2018 15:08, Sabyasachi Gupta wrote: Replaced vmalloc + memset with vzalloc Signed-off-by: Sabyasachi Gupta --- drivers/scsi/fnic/fnic_trace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/fnic/fnic_trace.c b/drivers/scsi/fnic/fnic_trace.c index 8

Re: [PATCH] drivers/scsi/fnic/fnic_trace.c: Use vzalloc

2018-11-13 Thread Johannes Thumshirn
On 13/11/2018 16:44, John Garry wrote: > On 13/11/2018 15:08, Sabyasachi Gupta wrote: >> Replaced vmalloc + memset with vzalloc >> >> Signed-off-by: Sabyasachi Gupta >> --- >>  drivers/scsi/fnic/fnic_trace.c | 4 ++-- >>  1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/sc

Re: [PATCH] drivers/scsi/fnic/fnic_trace.c: Use vzalloc

2018-11-13 Thread Sabyasachi Gupta
On Tue, Nov 13, 2018 at 9:23 PM Johannes Thumshirn wrote: > > On 13/11/2018 16:44, John Garry wrote: > > On 13/11/2018 15:08, Sabyasachi Gupta wrote: > >> Replaced vmalloc + memset with vzalloc > >> > >> Signed-off-by: Sabyasachi Gupta > >> --- > >> drivers/scsi/fnic/fnic_trace.c | 4 ++-- > >>

Re: [PATCH] drivers/scsi/fnic/fnic_trace.c: Use vzalloc

2018-11-13 Thread James Bottomley
On Tue, 2018-11-13 at 16:53 +0100, Johannes Thumshirn wrote: > On 13/11/2018 16:44, John Garry wrote: > > On 13/11/2018 15:08, Sabyasachi Gupta wrote: [...] > > > -fnic_trace_buf_p = (unsigned long)vmalloc((trace_max_pages * > > > PAGE_SIZE)); > > > +fnic_trace_buf_p = (unsigned long)vzallo

Re: [PATCH] drivers/scsi/fnic/fnic_trace.c: Use vzalloc

2018-11-13 Thread Johannes Thumshirn
On 13/11/2018 17:11, James Bottomley wrote: > This is incorrect advice: there's no need to cast it to other *pointer* > types, but if you cast it to a non-pointer type (which this is doing) > the compiler will complain if there is no explicit cast. Right, sorry for that and thanks for spotting it

Re: [PATCH] drivers/scsi/fnic/fnic_trace.c: Use vzalloc

2018-11-13 Thread Sabyasachi Gupta
On Tue, Nov 13, 2018 at 9:46 PM Johannes Thumshirn wrote: > > On 13/11/2018 17:11, James Bottomley wrote: > > This is incorrect advice: there's no need to cast it to other *pointer* > > types, but if you cast it to a non-pointer type (which this is doing) > > the compiler will complain if there is

Re: [PATCH] drivers/scsi/fnic/fnic_trace.c: Use vzalloc

2018-11-13 Thread Johannes Thumshirn
On 13/11/2018 17:22, Sabyasachi Gupta wrote: > On Tue, Nov 13, 2018 at 9:46 PM Johannes Thumshirn wrote: >> >> On 13/11/2018 17:11, James Bottomley wrote: >>> This is incorrect advice: there's no need to cast it to other *pointer* >>> types, but if you cast it to a non-pointer type (which this is

[PATCH 2/2] blk-mq: Simplify request completion state

2018-11-13 Thread Keith Busch
There are no more users relying on blk-mq request states to prevent double completions, so replace the relatively expensive cmpxchg operation with WRITE_ONCE. Signed-off-by: Keith Busch --- block/blk-mq.c | 4 +--- include/linux/blk-mq.h | 14 -- 2 files changed, 1 insertion

[PATCH 1/2] scsi: Do not rely on blk-mq for double completions

2018-11-13 Thread Keith Busch
The scsi timeout error handling had been directly updating the request state to prevent a natural completion and error handling from completing the same request twice. Fix this layering violation by having scsi control the fate of its commands with scsi owned flags rather than use blk-mq's. Signed

Re: [PATCH 1/2] scsi: Do not rely on blk-mq for double completions

2018-11-13 Thread Jens Axboe
On 11/13/18 11:57 AM, Keith Busch wrote: > The scsi timeout error handling had been directly updating the request > state to prevent a natural completion and error handling from completing > the same request twice. Fix this layering violation by having scsi > control the fate of its commands with s

Re: [PATCH 1/2] scsi: Do not rely on blk-mq for double completions

2018-11-13 Thread Keith Busch
On Tue, Nov 13, 2018 at 12:20:46PM -0700, Jens Axboe wrote: > On 11/13/18 11:57 AM, Keith Busch wrote: > > static void scsi_mq_done(struct scsi_cmnd *cmd) > > { > > + if (test_and_set_bit(__SCMD_COMPLETE, &cmd->flags)) > > + return; > > trace_scsi_dispatch_cmd_done(cmd); > > b

RE: scsi_set_medium_removal timeout issue

2018-11-13 Thread Zengtao (B)
Hi Alan: >-Original Message- >From: Alan Stern [mailto:st...@rowland.harvard.edu] >Sent: Monday, November 12, 2018 11:33 PM >To: Zengtao (B) >Cc: j...@linux.vnet.ibm.com; martin.peter...@oracle.com; >gre...@linuxfoundation.org; linux-scsi@vger.kernel.org; >linux-ker...@vger.kernel.org; li

[RFC PATCH] SCSI: fix queue cleanup race before queue is initialized done

2018-11-13 Thread Ming Lei
c2856ae2f315d ("blk-mq: quiesce queue before freeing queue") has already fixed this race, however the implied synchronize_rcu() in blk_mq_quiesce_queue() can slow down LUN probe a lot, so caused performance regression. Then 1311326cf4755c7 ("blk-mq: avoid to synchronize rcu inside blk_cleanup_que

Re: [PATCH 1/2] scsi: Do not rely on blk-mq for double completions

2018-11-13 Thread Jens Axboe
On 11/13/18 12:45 PM, Keith Busch wrote: > On Tue, Nov 13, 2018 at 12:20:46PM -0700, Jens Axboe wrote: >> On 11/13/18 11:57 AM, Keith Busch wrote: >>> static void scsi_mq_done(struct scsi_cmnd *cmd) >>> { >>> + if (test_and_set_bit(__SCMD_COMPLETE, &cmd->flags)) >>> + return; >>>

Re: [RFC PATCH] SCSI: fix queue cleanup race before queue is initialized done

2018-11-13 Thread jianchao.wang
On 11/14/18 12:35 PM, Ming Lei wrote: > c2856ae2f315d ("blk-mq: quiesce queue before freeing queue") has > already fixed this race, however the implied synchronize_rcu() > in blk_mq_quiesce_queue() can slow down LUN probe a lot, so caused > performance regression. > > Then 1311326cf4755c7 ("blk

Re: [RFC PATCH] SCSI: fix queue cleanup race before queue is initialized done

2018-11-13 Thread Ming Lei
On Wed, Nov 14, 2018 at 01:41:46PM +0800, jianchao.wang wrote: > > > On 11/14/18 12:35 PM, Ming Lei wrote: > > c2856ae2f315d ("blk-mq: quiesce queue before freeing queue") has > > already fixed this race, however the implied synchronize_rcu() > > in blk_mq_quiesce_queue() can slow down LUN probe