On Fri, 16 Jan 2015, Oliver Neukum wrote:

> Hi,
> 
> I was looking at the CDC-WDM driver. It uses cancel_work_sync()
> in the pre_reset() method. I looked at the work and saw a GFP_KERNEL
> there.
> Now suppose a device has a wdm interface and a storage interface.
> 
> Is the following sequence possible?
> 
> kmalloc with GFP_KERNEL in the work
> VM layer decides to page to storage interface
> task blocks waiting for completion of IO
> 
> SCSI layer sees an error
> SCSI error handling starts
> SCSI layer requests a bus reset
> 
> USB layer calls pre_reset() of cdc-wdm
> wdm_pre_reset() calls cancel_work_sync()
> cancel_work_sync() waits for work to finish
> DEADLOCK
> 
> What do you think?

Yes, that could happen.  It seems unlikely but it is possible.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to