From: Bin Liu <b-liu@ti.com>
To: Alexey Spirkov <AlexeiS@astrosoft.ru>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"andrew@ncrmnt.org" <andrew@ncrmnt.org>
Subject: Fix memory issue in non-DMA mode for MUSB gadget
Date: Thu, 2 Aug 2018 11:49:59 -0500 [thread overview]
Message-ID: <20180802164959.GD31129@uda0271908> (raw)
On Thu, Aug 02, 2018 at 11:14:32AM -0500, Bin Liu wrote:
> Hi,
>
> On Thu, Jul 26, 2018 at 12:52:57PM +0000, Alexey Spirkov wrote:
> > dma_mapping_error function unable to works in PowerPC arch
> > when MUSB do not use DMA (illegal memory access). Proposed
> > patch replace its usage to usual define for checking DMA mapping.
> >
> > Signed-off-by: Alexey Spirkov <alexeis@astrosoft.ru>
> > ---
> > drivers/usb/musb/musb_gadget.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
> > index eae8b1b..3bc7c25 100644
> > --- a/drivers/usb/musb/musb_gadget.c
> > +++ b/drivers/usb/musb/musb_gadget.c
> > @@ -140,7 +140,7 @@ __acquires(ep->musb->lock)
> > ep->busy = 1;
> > spin_unlock(&musb->lock);
> >
> > - if (!dma_mapping_error(&musb->g.dev, request->dma))
> > + if (req && is_buffer_mapped(req))
>
> unmap_dma_buffer() checks for is_buffer_mapped(), so this line can be
> dropped.
>
> > unmap_dma_buffer(req, musb);
> >
> > trace_musb_req_gb(req);
Please also fix the patch subject to "usb: musb: gadget: ..." in your
v2. I prefer
"usb: musb: gadget: fix illegal dma address check in non-DMA mode"
Regards,
-Bin.
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2018-08-02 16:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 16:49 Bin Liu [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-08-03 12:06 Fix memory issue in non-DMA mode for MUSB gadget Bin Liu
2018-08-03 6:25 Alexey Spirkov
2018-08-02 16:14 Bin Liu
2018-07-26 12:52 Alexey Spirkov
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=20180802164959.GD31129@uda0271908 \
--to=b-liu@ti.com \
--cc=AlexeiS@astrosoft.ru \
--cc=andrew@ncrmnt.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@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).