> -----Original Message----- > From: Felipe Balbi [mailto:balbi@xxxxxx] > Sent: Friday, August 31, 2012 12:51 AM > To: Chanho Park > Cc: balbi@xxxxxx; linux-usb@xxxxxxxxxxxxxxx; gregkh@xxxxxxxxxxxxxxxxxxx; > 'Kyungmin Park' > Subject: Re: [PATCH] usb: dwc3: correct default value of maxburst > > On Thu, Aug 30, 2012 at 11:19:15AM +0900, Chanho Park wrote: > > > -----Original Message----- > > > From: Felipe Balbi [mailto:balbi@xxxxxx] > > > Sent: Thursday, August 30, 2012 1:15 AM > > > To: Chanho Park > > > Cc: balbi@xxxxxx; linux-usb@xxxxxxxxxxxxxxx; > > > gregkh@xxxxxxxxxxxxxxxxxxx; Kyungmin Park > > > Subject: Re: [PATCH] usb: dwc3: correct default value of maxburst > > > > > > Hi, > > > > > > On Wed, Aug 29, 2012 at 10:49:58AM +0900, Chanho Park wrote: > > > > This patch changes default value of maxburst to 1. When a > > > > connection is established to highspeed, the maxburst is set to 0. > > > > So, we need to check and change default value of the maxburst > > > > before setting up burst > > > size of ep. > > > > > > > > Signed-off-by: Chanho Park <chanho61.park@xxxxxxxxxxx> > > > > Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx> > > > > --- > > > > drivers/usb/dwc3/gadget.c | 3 +++ > > > > 1 file changed, 3 insertions(+) > > > > > > > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > > > > index 58fdfad..025a1bc 100644 > > > > --- a/drivers/usb/dwc3/gadget.c > > > > +++ b/drivers/usb/dwc3/gadget.c > > > > @@ -437,6 +437,9 @@ static int dwc3_gadget_set_ep_config(struct > > > > dwc3 *dwc, struct dwc3_ep *dep, > > > > > > > > memset(¶ms, 0x00, sizeof(params)); > > > > > > > > + if (!dep->endpoint.maxburst) > > > > + dep->endpoint.maxburst = 1; > > > > > > a better patch would be to only check maxburst if endpoint is > > > ss-capable. You can just check if comp_desc is a valid pointer (aka not > NULL). > > > > Thank you for your suggestion. > > I'll change the check routine like below: > > > > + if (!comp_desc) > > + dep->endpoint.maxburst = 1; > > not what I meant. What I mean is that maxburst doesn't exist in non-usb3 > mode, so we shouldn't even write that bitfield to the HW, meaning we > shouldn't forcefully initialize dep->endpoint.maxburst either. Although that > won't cause any issues today, we cannot initialize fields we shouldn't use in > the endpoint structure. > > Try to initialize that bitfield on params.param0 conditionally, instead of > hardcoding maxburst to some wrong value. I understand what you meant. I agree with your comment. I'll repost it after applying which you pointed out Thanks. Best regards, Chanho Park > > -- > balbi -- 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