RE: [PATCH] usb: uas: fix a plug & unplug racing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



EJ Hsu wrote:

> Oliver Neukum wrote:
> 
> > > I just checked the code, and the reference count will be incremented
> > > in scsi_scan_host(), precisely speaking, in scsi_autopm_get_host().
> > > So, I still think we need to manually add reference count of interface here.
> > > Please correct me if there is anything wrong.
> >
> > AFAICT the generic power model will not suspend a parent while a child
> > is active. The includes SCSI children of USB parents. So I think we
> > are safe. Could you resubmit your patch without the PM counter
> > manipulation and we can fix any issue that may exist in theory later?
> >
> 
> The child_count of usb device should be incremented in the scsi_scan_host().
> I can simulate this situation by forcibly enable the autosuspend of uas driver
> and add a delay before scsi_scan_host() is called in asynchronous way.
> 
> But for now, as uas driver does not support autosuspend, it is indeed safe to
> remove the PM counter manipulation. If you have concern about it, it's OK to
> me to re-submit it.
> 

By the way, if autosuspend will be enabled in uas driver in the future, 
the PM counter manipulation should be added before scsi_add_host(), 
just as MSC driver did. Otherwise, the child_count of usb device might be
accidentally decremented. (the rpm "idle" message will be propagated
from scsi host to usb interface and usb device)

Thanks,
EJ
--nvpublic




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux