Re: Notifying Id/HNP status to HCD

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

 



On Wed, 8 Sep 2010, Pavan Kondeti wrote:

> > > > >  How can we avoid autosuspend/system suspend and intrusion from
> > > > > sysfs/debugfs without calling usb_remove_hcd?
> > > > 
> > > > The only way would be to have the HCD check whether or not the hardware
> > > > is in host mode before allowing it to do anything.  On the whole,
> > > > unregistering the host controller seems safer if it cannot operate
> > > > without interfering with the device controller.
> > > > 
> > > I agree. I am trying to submit the basic OTG driver (host/device role based on
> > > Id pin state) first. So I will stick to usb_add_hcd() and usb_remove_hcd().
> > 
> > If the HCD can be prevented from touching the hardware, do you think it 
> > is still necessary to add and remove the bus?
> > 
> If the API gaurantess to gaurd against system/runtime suspend and
> sysfs/debugfs/usbfs access, I can use this instead of
> usb_add_hcd/usb_remove_hcd methods.

debugfs access in ehci-hcd is read-only so it probably doesn't matter.  
Likewise for sysfs, with the exception of the "companion" file.  It
will be necessary to guard against access via ehci_bus_suspend,
ehci_bus_resume, ehci_hub_control, ehci_hub_status_data, and ehci_irq.  
Also, there could be a problem if somebody unloads ehci-hcd while the
controller is in device mode.  On the whole, unbinding the driver 
does seem safer.

At this point I'm not sure what is the best approach.  You still need 
some way to prevent the driver from touching the hardware before it is 
unbound.

Alan Stern

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


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

  Powered by Linux