All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq-l0cyMroinI0@public.gmane.org>
To: Greg KH <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Cc: Alan Stern
	<stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>,
	balbi-l0cyMroinI0@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH 1/1] USB: ehci-omap: Reset dma_mask pointer on probe
Date: Tue, 4 Jun 2013 12:48:05 +0300	[thread overview]
Message-ID: <51ADB7D5.8070708@ti.com> (raw)
In-Reply-To: <20130603175108.GA11188-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>

On 06/03/2013 08:51 PM, Greg KH wrote:
> On Thu, May 23, 2013 at 05:46:44PM +0300, Roger Quadros wrote:
>> On 05/23/2013 05:11 PM, Alan Stern wrote:
>>> On Thu, 23 May 2013, Roger Quadros wrote:
>>>
>>>> Device tree probed devices don't get dma_mask set. Previously
>>>> we were setting the dma_mask pointer only if it was NULL.
>>>> However, the address of 'omap_ehci_dma_mask' would change
>>>> each time the module is unloaded and loaded back thus causing
>>>> the devices dma_mask pointer to be invalid on the next load.
>>>>
>>>> This will cause page faults if any driver tries to access the
>>>> old dma_mask pointer.
>>>>
>>>> Unconditionally re-setting the dma_mask pointer fixes this problem.
>>>
>>>> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
>>>> index 3d1491b..b33e306 100644
>>>> --- a/drivers/usb/host/ehci-omap.c
>>>> +++ b/drivers/usb/host/ehci-omap.c
>>>> @@ -146,8 +146,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
>>>>  	 * Since shared usb code relies on it, set it here for now.
>>>>  	 * Once we have dma capability bindings this can go away.
>>>>  	 */
>>>> -	if (!pdev->dev.dma_mask)
>>>> -		pdev->dev.dma_mask = &omap_ehci_dma_mask;
>>>> +	pdev->dev.dma_mask = &omap_ehci_dma_mask;
>>>
>>> Is this the solution that people have agreed on?  There has been a lot 
>>> of discussion on this topic.  In particular, there has been talk about 
>>> fixing it in the DT core.
>>
>> Fixing it in DT core would be best.
> 
> Then please do that.
>

It seems [1] went into 3.10-rc3 so this issue is fixed for 3.10.

[1] https://patchwork.kernel.org/patch/2537021/

cheers,
-roger
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Roger Quadros <rogerq@ti.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>, <balbi@ti.com>,
	<linux-usb@vger.kernel.org>, <linux-omap@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<devicetree-discuss@lists.ozlabs.org>, <swarren@nvidia.com>
Subject: Re: [PATCH 1/1] USB: ehci-omap: Reset dma_mask pointer on probe
Date: Tue, 4 Jun 2013 12:48:05 +0300	[thread overview]
Message-ID: <51ADB7D5.8070708@ti.com> (raw)
In-Reply-To: <20130603175108.GA11188@kroah.com>

On 06/03/2013 08:51 PM, Greg KH wrote:
> On Thu, May 23, 2013 at 05:46:44PM +0300, Roger Quadros wrote:
>> On 05/23/2013 05:11 PM, Alan Stern wrote:
>>> On Thu, 23 May 2013, Roger Quadros wrote:
>>>
>>>> Device tree probed devices don't get dma_mask set. Previously
>>>> we were setting the dma_mask pointer only if it was NULL.
>>>> However, the address of 'omap_ehci_dma_mask' would change
>>>> each time the module is unloaded and loaded back thus causing
>>>> the devices dma_mask pointer to be invalid on the next load.
>>>>
>>>> This will cause page faults if any driver tries to access the
>>>> old dma_mask pointer.
>>>>
>>>> Unconditionally re-setting the dma_mask pointer fixes this problem.
>>>
>>>> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
>>>> index 3d1491b..b33e306 100644
>>>> --- a/drivers/usb/host/ehci-omap.c
>>>> +++ b/drivers/usb/host/ehci-omap.c
>>>> @@ -146,8 +146,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
>>>>  	 * Since shared usb code relies on it, set it here for now.
>>>>  	 * Once we have dma capability bindings this can go away.
>>>>  	 */
>>>> -	if (!pdev->dev.dma_mask)
>>>> -		pdev->dev.dma_mask = &omap_ehci_dma_mask;
>>>> +	pdev->dev.dma_mask = &omap_ehci_dma_mask;
>>>
>>> Is this the solution that people have agreed on?  There has been a lot 
>>> of discussion on this topic.  In particular, there has been talk about 
>>> fixing it in the DT core.
>>
>> Fixing it in DT core would be best.
> 
> Then please do that.
>

It seems [1] went into 3.10-rc3 so this issue is fixed for 3.10.

[1] https://patchwork.kernel.org/patch/2537021/

cheers,
-roger

  parent reply	other threads:[~2013-06-04  9:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23 10:19 [PATCH 0/1] USB: ehci-omap: Fixes for 3.10 Roger Quadros
2013-05-23 10:19 ` Roger Quadros
     [not found] ` <1369304387-29610-1-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-05-23 10:19   ` [PATCH 1/1] USB: ehci-omap: Reset dma_mask pointer on probe Roger Quadros
2013-05-23 10:19     ` Roger Quadros
     [not found]     ` <1369304387-29610-2-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-05-23 14:11       ` Alan Stern
2013-05-23 14:11         ` Alan Stern
     [not found]         ` <Pine.LNX.4.44L0.1305231009230.1459-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-05-23 14:46           ` Roger Quadros
2013-05-23 14:46             ` Roger Quadros
2013-06-03 17:51             ` Greg KH
     [not found]               ` <20130603175108.GA11188-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2013-06-04  9:48                 ` Roger Quadros [this message]
2013-06-04  9:48                   ` Roger Quadros

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=51ADB7D5.8070708@ti.com \
    --to=rogerq-l0cymroini0@public.gmane.org \
    --cc=balbi-l0cyMroinI0@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org \
    --cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.