RE: [RESEND PATCH 1/2] ehci: Support for Intel Moorestown MPH and OTG host

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

 



>-----Original Message-----
>From: Alan Stern [mailto:stern@xxxxxxxxxxxxxxxxxxx]
>Sent: Thursday, October 21, 2010 9:37 PM
>To: Wu, Hao
>Cc: USB list; gregkh@xxxxxxx; alan@xxxxxxxxxxxxxxx
>Subject: Re: [RESEND PATCH 1/2] ehci: Support for Intel Moorestown MPH and OTG
>host
>
>On Thu, 21 Oct 2010, Hao Wu wrote:
>
>> From: Alek Du <alek.du@xxxxxxxxx>
>>
>> The Intel Moorestown platform has EHCI MPH and EHCI OTG host. This patch adds
>> PCI probe part for them. The HNP part and SRAM part will be added in another
>> patch. This patch depends on the OTG transceive and OTG client patch from Hang
>> Yuan that should be accepted already.
>
>> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
>> index 84c1897..2e29931 100644
>> --- a/drivers/usb/core/hub.c
>> +++ b/drivers/usb/core/hub.c
>
>> @@ -1822,6 +1830,7 @@ int usb_new_device(struct usb_device *udev)
>>          * notifier chain (used by usbfs and possibly others).
>>          */
>>         err = device_add(&udev->dev);
>> +       otg_notify(udev, USB_DEVICE_ADD);
>>         if (err) {
>>                 dev_err(&udev->dev, "can't device_add, error %d\n", err);
>>                 goto fail;
>
>I just noticed this.  Do you really want to send the notification
>message even when device_add() fails?  It would make more sense to add
>this after the "if" statement.
>

Thanks for you comment.

The main purpose for otg_notify() function is that do notification to otg transceiver driver who maintains the OTG state machine.
For this case, otg_notify(udev, USB_DEVICE_ADD) notify USB device connect (b_conn) event to otg transceiver driver.
Even it is failed to device_add(), but it also needs such device connect event to make sure OTG works in correct state according to spec.

Hao
--
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