mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: <balbi@ti.com>, <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>, <linux-omap@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <tony@atomide.com>,
	<notasas@gmail.com>
Subject: Re: [PATCH 2/4] usb: musb: gadget: do *unmap_dma_buffer* only for valid DMA addr
Date: Fri, 15 Mar 2013 16:30:24 +0200	[thread overview]
Message-ID: <20130315143023.GB23930@arwen.pp.htv.fi> (raw)
In-Reply-To: <1363354132-27523-2-git-send-email-kishon@ti.com>

[-- Attachment #1: Type: text/plain, Size: 1056 bytes --]

On Fri, Mar 15, 2013 at 06:58:50PM +0530, Kishon Vijay Abraham I wrote:
> musb does not use DMA buffer for ep0 but it uses the same giveback
> function *musb_g_giveback* for all endpoints (*musb_g_ep0_giveback* calls
> *musb_g_giveback*). So for ep0 case request.dma will be '0'
> and will result in kernel OOPS if tried to *unmap_dma_buffer* for requests in
> ep0. Fixed it by doing *unmap_dma_buffer* only for valid DMA addr.
> 
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
>  drivers/usb/musb/musb_gadget.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
> index c454375..ec3cf29 100644
> --- a/drivers/usb/musb/musb_gadget.c
> +++ b/drivers/usb/musb/musb_gadget.c
> @@ -107,7 +107,10 @@ __acquires(ep->musb->lock)
>  
>  	ep->busy = 1;
>  	spin_unlock(&musb->lock);
> -	unmap_dma_buffer(req, musb);
> +
> +	if (request->dma)

I have changed to if (!dma_mapping_error(request->dma)), is it alright ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-03-15 14:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-15 13:28 [PATCH 1/4] usb: Fix linker errors during build Kishon Vijay Abraham I
2013-03-15 13:28 ` [PATCH 2/4] usb: musb: gadget: do *unmap_dma_buffer* only for valid DMA addr Kishon Vijay Abraham I
2013-03-15 14:30   ` Felipe Balbi [this message]
2013-03-15 13:28 ` [PATCH 3/4] usb: otg: twl4030: use devres API for regulator get and request irq Kishon Vijay Abraham I
2013-03-15 13:28 ` [PATCH 4/4] usb: otg: twl4030: fix cold plug on OMAP3 Kishon Vijay Abraham I
2013-03-15 14:25 ` [PATCH 1/4] usb: Fix linker errors during build Felipe Balbi
2013-03-15 15:52   ` kishon

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=20130315143023.GB23930@arwen.pp.htv.fi \
    --to=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=notasas@gmail.com \
    --cc=tony@atomide.com \
    /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

all inboxes | Powered by JetHome®