On Tue, Jan 21, 2014 at 01:21:51PM +0800, Peter Chen wrote:
> On Mon, Jan 20, 2014 at 09:13:11AM +0800, Peter Chen wrote:
> > The idea of this message is: the non-ep0 should not use ctrl
> > transfer. But it does not cover the ep0in which uses ctrl
> > transfer too.
> > 
> > This commit deletes the warning message at interrupt handler,
> > and adds judgement at ep_enable, if non-ep0 requests ctrl transfer,
> > it will indicate an error.
> > 
> > Reported-by: Michael Grzeschik <m...@pengutronix.de>
> > Signed-off-by: Peter Chen <peter.c...@freescale.com>
> > ---
> >  drivers/usb/chipidea/udc.c |   10 +++++-----
> >  1 files changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
> > index 09366b4..646d958 100644
> > --- a/drivers/usb/chipidea/udc.c
> > +++ b/drivers/usb/chipidea/udc.c
> > @@ -1001,11 +1001,6 @@ __acquires(ci->lock)
> >                 !hw_test_and_clear_setup_status(ci, i))
> >                     continue;
> >  
> > -           if (i != 0) {
> > -                   dev_warn(ci->dev, "ctrl traffic at endpoint %d\n", i);
> > -                   continue;
> > -           }
> > -
> >             /*
> >              * Flush data and handshake transactions of previous
> >              * setup packet.
> > @@ -1201,6 +1196,11 @@ static int ep_enable(struct usb_ep *ep,
> >             retval |= hw_ep_enable(hwep->ci, hwep->num, hwep->dir,
> >                                    hwep->type);
> >  
> > +   if (hwep->num != 0 && hwep->type == USB_ENDPOINT_XFER_CONTROL) {
> > +           dev_err(hwep->ci->dev, "Set control xfer at non-ep0\n");
> > +           retval = -EINVAL;
> > +   }
> > +
> >     spin_unlock_irqrestore(hwep->lock, flags);
> >     return retval;
> >  }
> > -- 
> > 1.7.8
> > 
> > 
> 
> Michael, this patch may not fix your problem totally, as a temp solution,
> you can use the matthieu's patch at your email thread.

Yes, I have seen it. But for this patch I partly agree. The check
in ep_enable should be done before calling hw_ep_enable.

Beside that:

Acked-by: Michael Grzeschik <mgrzesc...@pengutronix.de>

-- 
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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to