linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@nxp.com>
To: Felipe Balbi <balbi@kernel.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>, Jun Li <jun.li@nxp.com>,
	stable <stable@vger.kernel.org>
Subject: RE: [PATCH 1/1] usb: gadget: f_fs: set req->num_sgs as 0 for sync io mode
Date: Thu, 12 Dec 2019 08:09:55 +0000	[thread overview]
Message-ID: <VI1PR04MB532743340CE35C4F236FEAB68B550@VI1PR04MB5327.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <878snixcvg.fsf@kernel.org>

 
> Peter Chen <peter.chen@nxp.com> writes:
> > The UDC core uses req->num_sgs to judge if scatter buffer list is used.
> > Eg: usb_gadget_map_request_by_dev. For f_fs sync io mode, the request
> > is re-used for each request, so if the 1st request->length >
> > PAGE_SIZE, and the 2nd request->length is < PAGE_SIZE, the f_fs uses
> > the 1st
> > req->num_sgs for the 2nd request, it causes the UDC core get the wrong
> > req->num_sgs value (The 2nd request doesn't use sg).
> >
> > We set req->num_sgs as 0 for each request at non-sg transfer case to
> > fix it.
> 
> The patch, however, is *removing* initialization to 0...
> 
> > Cc: Jun Li <jun.li@nxp.com>
> > Cc: stable <stable@vger.kernel.org>
> > Fixes: 772a7a724f69 ("usb: gadget: f_fs: Allow scatter-gather
> > buffers")
> > Signed-off-by: Peter Chen <peter.chen@nxp.com>
> > ---
> >  drivers/usb/gadget/function/f_fs.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/usb/gadget/function/f_fs.c
> > b/drivers/usb/gadget/function/f_fs.c
> > index eedd926cc578..b5a1bfc2fc7e 100644
> > --- a/drivers/usb/gadget/function/f_fs.c
> > +++ b/drivers/usb/gadget/function/f_fs.c
> > @@ -1106,7 +1106,6 @@ static ssize_t ffs_epfile_io(struct file *file, struct
> ffs_io_data *io_data)
> >  			req->num_sgs = io_data->sgt.nents;
> >  		} else {
> >  			req->buf = data;
> > -			req->num_sgs = 0;
> 
> ... this doesn't seem to match your commit log. Care to explain?
> 

Sorry, I did not check the patch when I formatted it. I need to pay more attention to it next time.
I will send it again.

Peter

      reply	other threads:[~2019-12-12  8:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12  3:59 [PATCH 1/1] usb: gadget: f_fs: set req->num_sgs as 0 for sync io mode Peter Chen
2019-12-12  6:43 ` Felipe Balbi
2019-12-12  8:09   ` Peter Chen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR04MB532743340CE35C4F236FEAB68B550@VI1PR04MB5327.eurprd04.prod.outlook.com \
    --to=peter.chen@nxp.com \
    --cc=balbi@kernel.org \
    --cc=jun.li@nxp.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).