Re: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-31 Thread Keith Busch
On Tue, May 30, 2017 at 02:58:06PM +0300, Sagi Grimberg wrote: > > So, the reason the state is changed when the work is running rather than > > queueing is for the window when the state may be set to NVME_CTRL_DELETING, > > and we don't want the reset work to proceed in that case. > > > > What do

Re: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-31 Thread Keith Busch
On Tue, May 30, 2017 at 02:58:06PM +0300, Sagi Grimberg wrote: > > So, the reason the state is changed when the work is running rather than > > queueing is for the window when the state may be set to NVME_CTRL_DELETING, > > and we don't want the reset work to proceed in that case. > > > > What do

Re: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-30 Thread Sagi Grimberg
Allowing multiple resets can result in multiple controller removal as well if different conditions inside nvme_reset_work fail and which might deadlock on device_release_driver. This patch makes sure that work queue item (reset_work) is added only if controller state != NVME_CTRL_RESETTING and

Re: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-30 Thread Sagi Grimberg
Allowing multiple resets can result in multiple controller removal as well if different conditions inside nvme_reset_work fail and which might deadlock on device_release_driver. This patch makes sure that work queue item (reset_work) is added only if controller state != NVME_CTRL_RESETTING and

Re: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-26 Thread Rakesh Pandit
On Thu, May 25, 2017 at 10:30:23AM +0200, Christoph Hellwig wrote: > > diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c > > index 4c2ff2b..ba54e2a 100644 > > --- a/drivers/nvme/host/pci.c > > +++ b/drivers/nvme/host/pci.c > > @@ -1903,9 +1903,6 @@ static void nvme_reset_work(struct

Re: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-26 Thread Rakesh Pandit
On Thu, May 25, 2017 at 10:30:23AM +0200, Christoph Hellwig wrote: > > diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c > > index 4c2ff2b..ba54e2a 100644 > > --- a/drivers/nvme/host/pci.c > > +++ b/drivers/nvme/host/pci.c > > @@ -1903,9 +1903,6 @@ static void nvme_reset_work(struct

Re: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-26 Thread Rakesh Pandit
Added Andy Lutomirski to CC (APST related issue) On Fri, May 26, 2017 at 06:06:14AM -0400, Keith Busch wrote: > On Wed, May 24, 2017 at 05:26:25PM +0300, Rakesh Pandit wrote: > > Commit c5f6ce97c1210 tries to address multiple resets but fails as > > work_busy doesn't involve any synchronization

Re: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-26 Thread Rakesh Pandit
Added Andy Lutomirski to CC (APST related issue) On Fri, May 26, 2017 at 06:06:14AM -0400, Keith Busch wrote: > On Wed, May 24, 2017 at 05:26:25PM +0300, Rakesh Pandit wrote: > > Commit c5f6ce97c1210 tries to address multiple resets but fails as > > work_busy doesn't involve any synchronization

Re: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-26 Thread Keith Busch
On Wed, May 24, 2017 at 05:26:25PM +0300, Rakesh Pandit wrote: > Commit c5f6ce97c1210 tries to address multiple resets but fails as > work_busy doesn't involve any synchronization and can fail. This is > reproducible easily as can be seen by WARNING below which is triggered > with line: > >

Re: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-26 Thread Keith Busch
On Wed, May 24, 2017 at 05:26:25PM +0300, Rakesh Pandit wrote: > Commit c5f6ce97c1210 tries to address multiple resets but fails as > work_busy doesn't involve any synchronization and can fail. This is > reproducible easily as can be seen by WARNING below which is triggered > with line: > >

Re: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-25 Thread Christoph Hellwig
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c > index 4c2ff2b..ba54e2a 100644 > --- a/drivers/nvme/host/pci.c > +++ b/drivers/nvme/host/pci.c > @@ -1903,9 +1903,6 @@ static void nvme_reset_work(struct work_struct *work) > bool was_suspend = !!(dev->ctrl.ctrl_config &

Re: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-25 Thread Christoph Hellwig
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c > index 4c2ff2b..ba54e2a 100644 > --- a/drivers/nvme/host/pci.c > +++ b/drivers/nvme/host/pci.c > @@ -1903,9 +1903,6 @@ static void nvme_reset_work(struct work_struct *work) > bool was_suspend = !!(dev->ctrl.ctrl_config &

[PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-24 Thread Rakesh Pandit
Commit c5f6ce97c1210 tries to address multiple resets but fails as work_busy doesn't involve any synchronization and can fail. This is reproducible easily as can be seen by WARNING below which is triggered with line: WARN_ON(dev->ctrl.state == NVME_CTRL_RESETTING) Allowing multiple resets can

[PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling

2017-05-24 Thread Rakesh Pandit
Commit c5f6ce97c1210 tries to address multiple resets but fails as work_busy doesn't involve any synchronization and can fail. This is reproducible easily as can be seen by WARNING below which is triggered with line: WARN_ON(dev->ctrl.state == NVME_CTRL_RESETTING) Allowing multiple resets can