Message ID | 554c6d34c5936630bbe292114fad9c3322a7161e.1596767991.git.thinhn@synopsys.com |
---|---|
State | Superseded |
Headers | show |
Series | usb: dwc3: gadget: Fix TRB preparation | expand |
Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes: > The functions dwc3_prepare_one_trb_sg and dwc3_prepare_one_trb_linear > are not necessarily preparing "one" TRB, it can prepare multiple TRBs. > Rename these functions as follow: > > dwc3_prepare_one_trb_sg -> dwc3_prepare_trbs_sg > dwc3_prepare_one_trb_linear -> dwc3_prepare_trbs_linear > > Signed-off-by: Thinh Nguyen <thinhn@synopsys.com> Tried to apply on top of -rc6: checking file drivers/usb/dwc3/gadget.c Hunk #1 FAILED at 1161. Hunk #2 FAILED at 1231. Hunk #3 FAILED at 1266. Hunk #4 FAILED at 1294. 4 out of 4 hunks FAILED -- balbi
Hi Felipe, Felipe Balbi wrote: > Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes: > >> The functions dwc3_prepare_one_trb_sg and dwc3_prepare_one_trb_linear >> are not necessarily preparing "one" TRB, it can prepare multiple TRBs. >> Rename these functions as follow: >> >> dwc3_prepare_one_trb_sg -> dwc3_prepare_trbs_sg >> dwc3_prepare_one_trb_linear -> dwc3_prepare_trbs_linear >> >> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com> > Tried to apply on top of -rc6: > > checking file drivers/usb/dwc3/gadget.c > Hunk #1 FAILED at 1161. > Hunk #2 FAILED at 1231. > Hunk #3 FAILED at 1266. > Hunk #4 FAILED at 1294. > 4 out of 4 hunks FAILED > I'll rebase send out a new series with a bunch of fixes. Btw, the patches you just merged are not the latest: usb: dwc3: gadget: Resume pending requests after CLEAR_STALL usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command The latest are on your "testing/fixes" branch Thanks, Thinh
Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes: > Hi Felipe, > > Felipe Balbi wrote: >> Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes: >> >>> The functions dwc3_prepare_one_trb_sg and dwc3_prepare_one_trb_linear >>> are not necessarily preparing "one" TRB, it can prepare multiple TRBs. >>> Rename these functions as follow: >>> >>> dwc3_prepare_one_trb_sg -> dwc3_prepare_trbs_sg >>> dwc3_prepare_one_trb_linear -> dwc3_prepare_trbs_linear >>> >>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com> >> Tried to apply on top of -rc6: >> >> checking file drivers/usb/dwc3/gadget.c >> Hunk #1 FAILED at 1161. >> Hunk #2 FAILED at 1231. >> Hunk #3 FAILED at 1266. >> Hunk #4 FAILED at 1294. >> 4 out of 4 hunks FAILED >> > > I'll rebase send out a new series with a bunch of fixes. > > Btw, the patches you just merged are not the latest: > usb: dwc3: gadget: Resume pending requests after CLEAR_STALL > usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command > > The latest are on your "testing/fixes" branch Argh, nice catch. I'll fix it shortly. -- balbi
Hi, Felipe Balbi <balbi@kernel.org> writes: > Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes: > >> Hi Felipe, >> >> Felipe Balbi wrote: >>> Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes: >>> >>>> The functions dwc3_prepare_one_trb_sg and dwc3_prepare_one_trb_linear >>>> are not necessarily preparing "one" TRB, it can prepare multiple TRBs. >>>> Rename these functions as follow: >>>> >>>> dwc3_prepare_one_trb_sg -> dwc3_prepare_trbs_sg >>>> dwc3_prepare_one_trb_linear -> dwc3_prepare_trbs_linear >>>> >>>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com> >>> Tried to apply on top of -rc6: >>> >>> checking file drivers/usb/dwc3/gadget.c >>> Hunk #1 FAILED at 1161. >>> Hunk #2 FAILED at 1231. >>> Hunk #3 FAILED at 1266. >>> Hunk #4 FAILED at 1294. >>> 4 out of 4 hunks FAILED >>> >> >> I'll rebase send out a new series with a bunch of fixes. >> >> Btw, the patches you just merged are not the latest: >> usb: dwc3: gadget: Resume pending requests after CLEAR_STALL >> usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command >> >> The latest are on your "testing/fixes" branch > > Argh, nice catch. I'll fix it shortly. should be corrected now. Thanks
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 138f1b96bdf7..24cc4f2c2e1b 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1161,7 +1161,7 @@ static int dwc3_prepare_last_sg(struct dwc3_ep *dep, return 0; } -static int dwc3_prepare_one_trb_sg(struct dwc3_ep *dep, +static int dwc3_prepare_trbs_sg(struct dwc3_ep *dep, struct dwc3_request *req) { struct scatterlist *sg = req->start_sg; @@ -1231,7 +1231,7 @@ static int dwc3_prepare_one_trb_sg(struct dwc3_ep *dep, return 0; } -static int dwc3_prepare_one_trb_linear(struct dwc3_ep *dep, +static int dwc3_prepare_trbs_linear(struct dwc3_ep *dep, struct dwc3_request *req) { return dwc3_prepare_last_sg(dep, req, req->request.length, 0); @@ -1266,7 +1266,7 @@ static int dwc3_prepare_trbs(struct dwc3_ep *dep) */ list_for_each_entry(req, &dep->started_list, list) { if (req->num_pending_sgs > 0) { - ret = dwc3_prepare_one_trb_sg(dep, req); + ret = dwc3_prepare_trbs_sg(dep, req); if (ret) return ret; } @@ -1294,9 +1294,9 @@ static int dwc3_prepare_trbs(struct dwc3_ep *dep) req->num_pending_sgs = req->request.num_mapped_sgs; if (req->num_pending_sgs > 0) - ret = dwc3_prepare_one_trb_sg(dep, req); + ret = dwc3_prepare_trbs_sg(dep, req); else - ret = dwc3_prepare_one_trb_linear(dep, req); + ret = dwc3_prepare_trbs_linear(dep, req); if (ret) return ret;
The functions dwc3_prepare_one_trb_sg and dwc3_prepare_one_trb_linear are not necessarily preparing "one" TRB, it can prepare multiple TRBs. Rename these functions as follow: dwc3_prepare_one_trb_sg -> dwc3_prepare_trbs_sg dwc3_prepare_one_trb_linear -> dwc3_prepare_trbs_linear Signed-off-by: Thinh Nguyen <thinhn@synopsys.com> --- Changes in v2: - None drivers/usb/dwc3/gadget.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)