Re: [PATCH] usb: chipidea: udc: first start device on pullup

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

 



On Tue, Nov 12, 2013 at 08:12:04PM +0800, Peter Chen wrote:
> On Tue, Nov 12, 2013 at 7:50 PM, Michael Grzeschik
> <m.grzeschik@xxxxxxxxxxxxxx> wrote:
> > Don't start hw_device_state on udc_start. The gadget framework has
> > the prepared pullup callback for this. This is necessary if we use gadgets
> > which need to be enabled after an userspace application got prepared, or
> > other delayed conditiions have passed.
> >
> > Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
> > ---
> >
> > Hi Peter,
> >
> > I checked ci_udc_start again and realized that one problem is
> > that we ignore the pullup call and start the device on udc_start.
> >
> > What do you think of the following patch? Any objections?
> >
> >  drivers/usb/chipidea/udc.c | 5 -----
> >  1 file changed, 5 deletions(-)
> >
> > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
> > index b34c819..e673263 100644
> > --- a/drivers/usb/chipidea/udc.c
> > +++ b/drivers/usb/chipidea/udc.c
> > @@ -1647,11 +1647,6 @@ static int ci_udc_start(struct usb_gadget *gadget,
> >                 return retval;
> >         }
> >
> > -       retval = hw_device_state(ci, ci->ep0out->qh.dma);
> > -       spin_unlock_irqrestore(&ci->lock, flags);
> > -       if (retval)
> > -               pm_runtime_put_sync(&ci->gadget.dev);
> > -
> >         return retval;
> >  }
> >
> Hi Michael,
>
> Your code base seems out of date.

I used linux/master.

> The reason why we need start controller(call hw_device_state) at ci_udc_start:
>
> - For vbus is already there before modprobe gadget, in that case, there
> is no vbus interrupt due to vbus has not changed during the initialization.

Don't we have another possibility to ask the hardware if the vbus is
connected. We could limit the enabled Interrupts in udc_start to
USBi_PCI. Will it than trigger an interrupt while having the cable
_already_ plugged?

> - For the platforms which have no vbus interrupt, it needs to start controller
> before connection otherwise the enumeration can't be started due to
> usbcmd.rs is 0.

Then we need to force to start the controller conditionally for those platforms.
IMHO this should not be the case for all platforms.

Michael

--
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
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