From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: balbi@ti.com, Mark Rutland <mark.rutland@arm.com>
Cc: "av.tikhomirov@samsung.com" <av.tikhomirov@samsung.com>,
Sathya Prakash M R <sathyap@ti.com>,
"tony@atomide.com" <tony@atomide.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
Pawel Moll <Pawel.Moll@arm.com>,
"paul@pwsan.com" <paul@pwsan.com>
Subject: Re: [PATCH v2 4/4] ARM: DTS: AM43x: Add DSS node
Date: Fri, 14 Mar 2014 18:34:19 +0200 [thread overview]
Message-ID: <53232F8B.5020708@ti.com> (raw)
In-Reply-To: <20140314160404.GC21379@saruman.home>
[-- Attachment #1: Type: text/plain, Size: 2209 bytes --]
On 14/03/14 18:04, Felipe Balbi wrote:
> On Fri, Mar 14, 2014 at 02:07:45PM +0000, Mark Rutland wrote:
>> On Fri, Mar 14, 2014 at 11:07:05AM +0000, Tomi Valkeinen wrote:
>>> On 14/03/14 12:19, Tomi Valkeinen wrote:
>>>> On 14/03/14 12:14, Mark Rutland wrote:
>>>>
>>>>> I can't see anything obviously wrong in platform_device_del. Do you have
>>>>> a backtrace?
>>>>
>>>> Yes, below.
>>>>
>>>> I can see at least drivers/usb/dwc3/dwc3-exynos.c doing the exact same thing
>>>> I do, so maybe I've got something wrong with the omapdss driver.
>>>
>>> Looks to me that the devices created by of_platform_populate() are not
>>> unregisterable in all cases. The address resource created via
>>> of_platform_populate() had NULL res->parent, which causes
>>> release_resource to crash.
>>
>> Hmm. I can't see that unregistering such devices ever works as you say,
>> given that __release_resource expects a non-NULL parent pointer. Either
>> we should be setting the parent pointer when initialising devices from
>> dt or we should teach __release_resource to not care. I'll have a go at
>> fixing that.
>>
>> It looks like drivers/usb/dwc3/dwc3-exynos.c only unregisters the
>> top-level device, not children. This top-level device has no
>> IORESOURCE_{IO,MEM} resources judging by
>> arch/arm/boot/dts/exynos5250.dtsi, which would explain why that driver
>> isn't exploding: __release_resource will never get called.
>>
>> Anton, Felipe:
>>
>> Does unregistering the parent ensure the children get cleaned up, or
>> does it leave them dangling in the dwc3-exynos driver?
>
> you should platform_device_unregister() for each children and
> dwc3-exynos does that just fine:
Yes, that's what I do also, and it crashes. What Mark said above about
unregistering never working for such devices is correct, but I don't
know why he said dwc3-exynos only unregisters the top level device.
"such devices" above meaning devices with a 'reg' defined in the DT
data, if I'm not mistaken.
So at the moment, I think of_platform_populate() and
platform_device_unregister() combination in a driver is a bit risky.
Work fine for certain cases, not for some other.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
next prev parent reply other threads:[~2014-03-14 16:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 8:58 [PATCH v2 0/4] Add Display support for AM43xx Sathya Prakash M R
2014-03-13 8:58 ` [PATCH v2 1/4] OMAPDSS: Add DSS features " Sathya Prakash M R
2014-03-13 8:58 ` [PATCH v2 2/4] ARM: AM43xx: fix dpll init in bypass mode Sathya Prakash M R
2014-03-13 10:24 ` Tomi Valkeinen
2014-03-13 10:32 ` Sathya Prakash
2014-03-13 8:58 ` [PATCH v2 3/4] ARM: OMAP2+: AM43xx DSS Hwmod Sathya Prakash M R
2014-03-13 8:58 ` [PATCH v2 4/4] ARM: DTS: AM43x: Add DSS node Sathya Prakash M R
2014-03-13 10:21 ` Tomi Valkeinen
2014-03-13 10:30 ` Sathya Prakash
2014-03-13 17:46 ` Mark Rutland
2014-03-13 18:22 ` Tomi Valkeinen
2014-03-14 9:10 ` Mark Rutland
2014-03-14 9:42 ` Tomi Valkeinen
2014-03-14 10:14 ` Mark Rutland
2014-03-14 10:19 ` Tomi Valkeinen
2014-03-14 11:07 ` Tomi Valkeinen
2014-03-14 14:07 ` Mark Rutland
2014-03-14 16:04 ` Felipe Balbi
2014-03-14 16:34 ` Tomi Valkeinen [this message]
2014-03-14 18:00 ` Mark Rutland
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=53232F8B.5020708@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=Pawel.Moll@arm.com \
--cc=av.tikhomirov@samsung.com \
--cc=balbi@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=paul@pwsan.com \
--cc=sathyap@ti.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 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.