From: Felipe Balbi <balbi@kernel.org>
To: Roger Quadros <rogerq@ti.com>, Johan Hovold <johan@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alan Stern <stern@rowland.harvard.edu>,
linux-usb@vger.kernel.org
Subject: usb: dwc3: of-simple: fix use-after-free on remove
Date: Mon, 18 Jun 2018 15:21:43 +0300 [thread overview]
Message-ID: <87vaagxp2g.fsf@linux.intel.com> (raw)
Hi,
Roger Quadros <rogerq@ti.com> writes:
> On 18/06/18 12:51, Felipe Balbi wrote:
>>
>> Hi,
>>
>> Johan Hovold <johan@kernel.org> writes:
>>> On Mon, Jun 18, 2018 at 12:33:44PM +0300, Felipe Balbi wrote:
>>>
>>>> Johan Hovold <johan@kernel.org> writes:
>>>
>>>>> I suggest merging this fix for 4.18-rc, and then Roger can rework the
>>>>> driver so that it works also on OMAP.
>>>>
>>>> omap has its own glue layer for several reasons. If you're talking about
>>>> Keystone devices, then okay, I understand. But in that case, this would
>>>> mean Keystone is copying the same arguably broken PM domain design from
>>>> OMAP and it would be best not to propagate that idea.
>>>
>>> Maybe so. I'm not sure what Roger's use case is, but perhaps the omap
>>> glue driver could be used instead.
>>
>> unlikely. Keystone devices are very different from OMAP family. But
>> we'll see what Roger says.
>>
>
> Well, I was considering to use of-simple for the AM654 SoC [1] but now
> I'm of the opinion that it might be better to add a new glue layer driver
why isn't dwc3-keystone.c enough?
> for that because
> - it needs to poke a few registers in the wrapper region
dwc3-keystone.c does that already
> - it doesn't really need the driver to enable any clock
Seems to me you're trying to port omap_device to arm64...
> - it needs a pm_runtime_get_sync() to be done in probe
this really shouldn't be necessary. Keystone doesn't rely on all the
omap_device legacy. At least it didn't use to. Could it be that you're
just missing a struct dev_pm_domain definition for arm64?
I haven't seen how you guys implemented your PM for arm64 (is there a
publically accessible version somewhere?), but I'd say you should take
the opportunity to remove this relying on pm_runtime_get_sync() calls
from probe and just do what everybody else does; namely: enable clocks
on probe, pm_runtime_set_active, etc.
This helps drivers being able to make assumptions about devices being
enabled during probe. pm_runtime becomes easier to implement generically
too.
next reply other threads:[~2018-06-18 12:21 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-18 12:21 Felipe Balbi [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-06-21 15:15 usb: dwc3: of-simple: fix use-after-free on remove Alan Stern
2018-06-21 10:11 Johan Hovold
2018-06-21 9:52 Johan Hovold
2018-06-21 8:27 Johan Hovold
2018-06-21 8:17 Roger Quadros
2018-06-20 22:55 Rafael J. Wysocki
2018-06-20 22:32 Rafael J. Wysocki
2018-06-20 15:46 Johan Hovold
2018-06-20 12:54 Rafael J. Wysocki
2018-06-20 12:23 Johan Hovold
2018-06-20 12:17 Rafael J. Wysocki
2018-06-20 11:05 Felipe Balbi
2018-06-20 9:54 Rafael J. Wysocki
2018-06-20 9:27 Felipe Balbi
2018-06-20 9:16 Tony Lindgren
2018-06-20 4:34 Tony Lindgren
2018-06-19 12:10 Tero Kristo
2018-06-19 8:18 Felipe Balbi
2018-06-18 14:32 Roger Quadros
2018-06-18 11:11 Roger Quadros
2018-06-18 9:51 Felipe Balbi
2018-06-18 9:47 Johan Hovold
2018-06-18 9:33 Felipe Balbi
2018-06-18 8:34 Johan Hovold
2018-06-18 8:15 Felipe Balbi
2018-06-13 10:59 Johan Hovold
2018-06-13 9:39 Felipe Balbi
2018-06-13 8:34 Roger Quadros
2018-06-13 8:05 Felipe Balbi
2018-06-13 7:49 Roger Quadros
2018-05-31 14:58 Johan Hovold
2018-05-31 14:45 Johan Hovold
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=87vaagxp2g.fsf@linux.intel.com \
--to=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rogerq@ti.com \
--cc=stern@rowland.harvard.edu \
/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).