On Mon, Dec 13, 2010 at 03:15:00PM +0800, Wu, Hao wrote: > >> >> > >> >> + /* Notify OTG disconnect event, only for USB device which is > >> >> + * directly connected to root hub */ > >> >> + if (udev->parent && udev->parent->parent == NULL) > >> >> + otg_notify_event(USB_OTG_DISCON); > >> > > >> >I thought we went through this already, why not just use the _existing_ > >> >notification process? No need to create your own here. > >> > > >> > >> Hi Greg, > >> > >> Thanks for your help on code review. > >> > >> Could you help to tell me which existing notification process is > >> recommended for this purpose? > > > >What's wrong with the existing driver core bus notifiers? > > Do you mean the usb_notifier_list defined in usb/core/notify.c? That's one, there are others. > I think usb_notifier_list may not be the best one for below reasons: > # usb_notifier_list is used for USB devices or USB bus being added or removed. It seems for USB host case. > But the otg_notify_event function is defined as an unified interface for both USB host side and USB peripheral (gadget/udc) side. I don't understand, what is your objection here? > # usb_notifier_list is blocking_notifier and may not be time effective, not only OTG 1.3 but also OTG 2.0, there are a lot of timing requirement per spec. > For some case, we need the event notification happened asap. So I add an unified interface here and then let each otg implementation to bind its actual handler for these events. Sorry, but no, I really doubt your notification time limits are somehow not met with the existing notifiers. Please show me where they are out of range for your usage. > # usb_notifier_list is now used by wusb/mon/usbdev/usbfs, but I think none of them really needs OTG events from the notifier. No, do it the other way around, have your OTG core listen to these events. thanks, greg k-h -- 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