Hi, Peter Chen <peter.chen@xxxxxxx> writes: > Add sg support for WA2 case. what's WA2? Care to spell it out? > Signed-off-by: Peter Chen <peter.chen@xxxxxxx> > --- > drivers/usb/cdns3/gadget.c | 44 +++++++++++++++++++++++++++----------- > 1 file changed, 31 insertions(+), 13 deletions(-) > > diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c > index 6cb44c354f40..1fd36bc5c6db 100644 > --- a/drivers/usb/cdns3/gadget.c > +++ b/drivers/usb/cdns3/gadget.c > @@ -462,6 +462,36 @@ static int cdns3_start_all_request(struct cdns3_device *priv_dev, > (reg) |= EP_STS_EN_DESCMISEN; \ > } } while (0) > > +static void __cdns3_descmiss_copy_data(struct usb_request *request, > + struct usb_request *descmiss_req) > +{ > + int length = request->actual + descmiss_req->actual; > + struct scatterlist *s = request->sg; > + > + if (!s) { > + if (length <= request->length) { > + memcpy(&((u8 *)request->buf)[request->actual], memcpy(request->buf + request->actual, ... ? > + descmiss_req->buf, > + descmiss_req->actual); > + request->actual = length; > + } else { > + /* It should never occures */ ^^^^^^^ occur ps: famous last words :-) > + request->status = -ENOMEM; this is not documented as a valid status for usb request completion. Who's treating this -ENOMEM case? Which gadgets have you tested with this change? -- balbi
Attachment:
signature.asc
Description: PGP signature