Message ID | 20200901084454.28649-5-peter.chen@nxp.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | usb: cdns3: improve the sg use case | expand |
Hi, Peter Chen <peter.chen@nxp.com> writes: > For sg buffer list use case, we need to add ISP for each TRB, and > add CHAIN bit for each TRB except for the last TRB. > > Signed-off-by: Peter Chen <peter.chen@nxp.com> > --- > drivers/usb/cdns3/gadget.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c > index 25e3ff1cdf61..a308a694abc5 100644 > --- a/drivers/usb/cdns3/gadget.c > +++ b/drivers/usb/cdns3/gadget.c > @@ -1221,8 +1221,14 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep, > else > priv_req->trb->control = cpu_to_le32(control); > > - if (sg_supported) > + if (sg_supported) { > + trb->control |= TRB_ISP; > + /* Don't set chain bit for last TRB */ > + if (sg_iter < num_trb - 1) > + trb->control |= TRB_CHAIN; > + > s = sg_next(s); > + } is this a bugfix?
On 20-09-08 09:22:44, Felipe Balbi wrote: > > Hi, > > Peter Chen <peter.chen@nxp.com> writes: > > For sg buffer list use case, we need to add ISP for each TRB, and > > add CHAIN bit for each TRB except for the last TRB. > > > > Signed-off-by: Peter Chen <peter.chen@nxp.com> > > --- > > drivers/usb/cdns3/gadget.c | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c > > index 25e3ff1cdf61..a308a694abc5 100644 > > --- a/drivers/usb/cdns3/gadget.c > > +++ b/drivers/usb/cdns3/gadget.c > > @@ -1221,8 +1221,14 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep, > > else > > priv_req->trb->control = cpu_to_le32(control); > > > > - if (sg_supported) > > + if (sg_supported) { > > + trb->control |= TRB_ISP; > > + /* Don't set chain bit for last TRB */ > > + if (sg_iter < num_trb - 1) > > + trb->control |= TRB_CHAIN; > > + > > s = sg_next(s); > > + } > > is this a bugfix? > The support for sg list is not good at current code, it needs all changes in this patch series to let it work well, so it is better let the whole things in this series as improvement.
Hi, Peter Chen <peter.chen@nxp.com> writes: >> > For sg buffer list use case, we need to add ISP for each TRB, and >> > add CHAIN bit for each TRB except for the last TRB. >> > >> > Signed-off-by: Peter Chen <peter.chen@nxp.com> >> > --- >> > drivers/usb/cdns3/gadget.c | 8 +++++++- >> > 1 file changed, 7 insertions(+), 1 deletion(-) >> > >> > diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c >> > index 25e3ff1cdf61..a308a694abc5 100644 >> > --- a/drivers/usb/cdns3/gadget.c >> > +++ b/drivers/usb/cdns3/gadget.c >> > @@ -1221,8 +1221,14 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep, >> > else >> > priv_req->trb->control = cpu_to_le32(control); >> > >> > - if (sg_supported) >> > + if (sg_supported) { >> > + trb->control |= TRB_ISP; >> > + /* Don't set chain bit for last TRB */ >> > + if (sg_iter < num_trb - 1) >> > + trb->control |= TRB_CHAIN; >> > + >> > s = sg_next(s); >> > + } >> >> is this a bugfix? >> > > The support for sg list is not good at current code, it needs all > changes in this patch series to let it work well, so it is better > let the whole things in this series as improvement. Cool, thanks for clarifying :-)
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c index 25e3ff1cdf61..a308a694abc5 100644 --- a/drivers/usb/cdns3/gadget.c +++ b/drivers/usb/cdns3/gadget.c @@ -1221,8 +1221,14 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep, else priv_req->trb->control = cpu_to_le32(control); - if (sg_supported) + if (sg_supported) { + trb->control |= TRB_ISP; + /* Don't set chain bit for last TRB */ + if (sg_iter < num_trb - 1) + trb->control |= TRB_CHAIN; + s = sg_next(s); + } control = 0; ++sg_iter;
For sg buffer list use case, we need to add ISP for each TRB, and add CHAIN bit for each TRB except for the last TRB. Signed-off-by: Peter Chen <peter.chen@nxp.com> --- drivers/usb/cdns3/gadget.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)