Re: Deadlock in usb-storage error handling

2014-03-28 Thread James Bottomley
On Thu, 2014-03-20 at 15:49 -0400, Alan Stern wrote: > On Thu, 20 Mar 2014, James Bottomley wrote: > > > On Thu, 2014-03-20 at 12:34 -0400, Alan Stern wrote: > > > On Thu, 20 Mar 2014, James Bottomley wrote: > > > > > > > OK, so I think we have three things to do > > > > > > > > 1. Investig

Re: Deadlock in usb-storage error handling

2014-03-21 Thread Alan Stern
On Thu, 20 Mar 2014, James Bottomley wrote: > diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c > index 771c16b..c52bfb2 100644 > --- a/drivers/scsi/scsi_error.c > +++ b/drivers/scsi/scsi_error.c > @@ -145,14 +145,14 @@ scmd_eh_abort_handler(struct work_struct *work) >

Re: Deadlock in usb-storage error handling

2014-03-20 Thread Alan Stern
On Thu, 20 Mar 2014, James Bottomley wrote: > On Thu, 2014-03-20 at 15:59 -0400, Alan Stern wrote: > > On Thu, 20 Mar 2014, James Bottomley wrote: > > > > > OK, so I think we have three things to do > > > > > > 1. Investigate SCSI and fix it's abort state problem that's causing > > >

Re: Deadlock in usb-storage error handling

2014-03-20 Thread Alan Stern
On Thu, 20 Mar 2014, James Bottomley wrote: > > I tried this patch first, because fixing the earlier bug would mask > > this one. > > > > The patch sort of worked. But the first time I tried it, it failed in > > a rather amusing way. While the second retry was running and hung, > > scmd->result

Re: Deadlock in usb-storage error handling

2014-03-20 Thread James Bottomley
On Thu, 2014-03-20 at 15:59 -0400, Alan Stern wrote: > On Thu, 20 Mar 2014, James Bottomley wrote: > > > OK, so I think we have three things to do > > > > 1. Investigate SCSI and fix it's abort state problem that's causing > > it not to send the abort second time around > > 2. F

Re: Deadlock in usb-storage error handling

2014-03-20 Thread James Bottomley
On Thu, 2014-03-20 at 15:48 -0400, Alan Stern wrote: > On Thu, 20 Mar 2014, James Bottomley wrote: > > > On Thu, 2014-03-20 at 12:34 -0400, Alan Stern wrote: > > > On Thu, 20 Mar 2014, James Bottomley wrote: > > > > > > > OK, so I think we have three things to do > > > > > > > > 1. Investig

Re: Deadlock in usb-storage error handling

2014-03-20 Thread Alan Stern
On Thu, 20 Mar 2014, James Bottomley wrote: > OK, so I think we have three things to do > > 1. Investigate SCSI and fix it's abort state problem that's causing > it not to send the abort second time around > 2. Fix usb-storage to fail a reset it can't do (i.e. device reset >

Re: Deadlock in usb-storage error handling

2014-03-20 Thread Alan Stern
On Thu, 20 Mar 2014, James Bottomley wrote: > On Thu, 2014-03-20 at 12:34 -0400, Alan Stern wrote: > > On Thu, 20 Mar 2014, James Bottomley wrote: > > > > > OK, so I think we have three things to do > > > > > > 1. Investigate SCSI and fix it's abort state problem that's causing > > >

Re: Deadlock in usb-storage error handling

2014-03-20 Thread Alan Stern
On Thu, 20 Mar 2014, James Bottomley wrote: > On Thu, 2014-03-20 at 12:34 -0400, Alan Stern wrote: > > On Thu, 20 Mar 2014, James Bottomley wrote: > > > > > OK, so I think we have three things to do > > > > > > 1. Investigate SCSI and fix it's abort state problem that's causing > > >

Re: Deadlock in usb-storage error handling

2014-03-20 Thread James Bottomley
On Thu, 2014-03-20 at 12:34 -0400, Alan Stern wrote: > On Thu, 20 Mar 2014, James Bottomley wrote: > > > OK, so I think we have three things to do > > > > 1. Investigate SCSI and fix it's abort state problem that's causing > > it not to send the abort second time around > > 2. F

Re: Deadlock in usb-storage error handling

2014-03-20 Thread James Bottomley
On Thu, 2014-03-20 at 12:34 -0400, Alan Stern wrote: > On Thu, 20 Mar 2014, James Bottomley wrote: > > > OK, so I think we have three things to do > > > > 1. Investigate SCSI and fix it's abort state problem that's causing > > it not to send the abort second time around > > 2. F

Re: Deadlock in usb-storage error handling

2014-03-20 Thread Alan Stern
On Thu, 20 Mar 2014, James Bottomley wrote: > OK, so I think we have three things to do > > 1. Investigate SCSI and fix it's abort state problem that's causing > it not to send the abort second time around > 2. Fix usb-storage to fail a reset it can't do (i.e. device reset >

Re: Deadlock in usb-storage error handling

2014-03-20 Thread James Bottomley
On Thu, 2014-03-20 at 11:36 -0400, Alan Stern wrote: > On Wed, 19 Mar 2014, James Bottomley wrote: > > > > Basically, usb-storage deadlocks when the SCSI error handler invokes > > > the eh_device_reset_handler callback while a command is running. The > > > command has timed out and will never com

Re: Deadlock in usb-storage error handling

2014-03-20 Thread Alan Stern
On Wed, 19 Mar 2014, James Bottomley wrote: > > Basically, usb-storage deadlocks when the SCSI error handler invokes > > the eh_device_reset_handler callback while a command is running. The > > command has timed out and will never complete normally, because the > > device's firmware has crashed.

Re: Deadlock in usb-storage error handling

2014-03-19 Thread James Bottomley
On Wed, 2014-03-19 at 16:31 -0400, Alan Stern wrote: > On Wed, 19 Mar 2014, Andreas Reis wrote: > > > I've uploaded a dmesg with the new debugging patch to bugzilla: > > https://bugzilla.kernel.org/attachment.cgi?id=130041 > > Thanks. I have now managed to reproduce many of the features of this

Re: Deadlock in usb-storage error handling

2014-03-19 Thread Dan Williams
On Wed, Mar 19, 2014 at 1:31 PM, Alan Stern wrote: > On Wed, 19 Mar 2014, Andreas Reis wrote: > >> I've uploaded a dmesg with the new debugging patch to bugzilla: >> https://bugzilla.kernel.org/attachment.cgi?id=130041 > > Thanks. I have now managed to reproduce many of the features of this > pro

Deadlock in usb-storage error handling

2014-03-19 Thread Alan Stern
On Wed, 19 Mar 2014, Andreas Reis wrote: > I've uploaded a dmesg with the new debugging patch to bugzilla: > https://bugzilla.kernel.org/attachment.cgi?id=130041 Thanks. I have now managed to reproduce many of the features of this problem on my own computer. James, I will need your help (or hel