All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Pantelis Antoniou
	<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>,
	Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Ricardo Ribalda Delgado
	<ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH 2/2] drivercore: Fix unregistration path of platform devices
Date: Mon, 15 Jun 2015 18:46:30 +0200	[thread overview]
Message-ID: <20150615164630.GC1583@katana> (raw)
In-Reply-To: <1433686811-12303-3-git-send-email-grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

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

On Sun, Jun 07, 2015 at 03:20:11PM +0100, Grant Likely wrote:
> The unregister path of platform_device is broken. On registration, it
> will register all resources with either a parent already set, or
> type==IORESOURCE_{IO,MEM}. However, on unregister it will release
> everything with type==IORESOURCE_{IO,MEM}, but ignore the others. There
> are also cases where resources don't get registered in the first place,
> like with devices created by of_platform_populate()*.
> 
> Fix the unregister path to be symmetrical with the register path by
> checking the parent pointer instead of the type field to decide which
> resources to unregister. This is safe because the upshot of the
> registration path algorithm is that registered resources have a parent
> pointer, and non-registered resources do not.
> 
> * It can be argued that of_platform_populate() should be registering
>   it's resources, and they argument has some merit. However, there are
>   quite a few platforms that end up broken if we try to do that due to
>   overlapping resources in the device tree. Until that is fixed, we need
>   to solve the immediate problem.
> 
> Cc: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> Cc: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
> Cc: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Cc: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
> Cc: Ricardo Ribalda Delgado <ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

Tested-by: Wolfram Sang <wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>


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

WARNING: multiple messages have this Message-ID (diff)
From: Wolfram Sang <wsa@the-dreams.de>
To: Grant Likely <grant.likely@linaro.org>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Pantelis Antoniou <pantelis.antoniou@konsulko.com>,
	Rob Herring <robh@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Subject: Re: [PATCH 2/2] drivercore: Fix unregistration path of platform devices
Date: Mon, 15 Jun 2015 18:46:30 +0200	[thread overview]
Message-ID: <20150615164630.GC1583@katana> (raw)
In-Reply-To: <1433686811-12303-3-git-send-email-grant.likely@linaro.org>

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

On Sun, Jun 07, 2015 at 03:20:11PM +0100, Grant Likely wrote:
> The unregister path of platform_device is broken. On registration, it
> will register all resources with either a parent already set, or
> type==IORESOURCE_{IO,MEM}. However, on unregister it will release
> everything with type==IORESOURCE_{IO,MEM}, but ignore the others. There
> are also cases where resources don't get registered in the first place,
> like with devices created by of_platform_populate()*.
> 
> Fix the unregister path to be symmetrical with the register path by
> checking the parent pointer instead of the type field to decide which
> resources to unregister. This is safe because the upshot of the
> registration path algorithm is that registered resources have a parent
> pointer, and non-registered resources do not.
> 
> * It can be argued that of_platform_populate() should be registering
>   it's resources, and they argument has some merit. However, there are
>   quite a few platforms that end up broken if we try to do that due to
>   overlapping resources in the device tree. Until that is fixed, we need
>   to solve the immediate problem.
> 
> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> Cc: Wolfram Sang <wsa@the-dreams.de>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> Signed-off-by: Grant Likely <grant.likely@linaro.org>

Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


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

  parent reply	other threads:[~2015-06-15 16:46 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-07 14:20 [PATCH 0/2] Fix oops in platform_device resource unregister Grant Likely
     [not found] ` <1433686811-12303-1-git-send-email-grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-06-07 14:20   ` [PATCH 1/2] of/unittest: Show broken behaviour in the platform bus Grant Likely
2015-06-07 14:20     ` Grant Likely
2015-06-08 20:16     ` Rob Herring
2015-06-09 11:05       ` Grant Likely
     [not found]     ` <1433686811-12303-2-git-send-email-grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-06-15 16:45       ` Wolfram Sang
2015-06-15 16:45         ` Wolfram Sang
2015-06-07 14:20   ` [PATCH 2/2] drivercore: Fix unregistration path of platform devices Grant Likely
2015-06-07 14:20     ` Grant Likely
2015-06-07 18:13     ` Ricardo Ribalda Delgado
     [not found]       ` <CAPybu_30jTDuwEW_WTGuu6pWwv86p6OqV0eRE1GbCwUVtBm7KA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-08  8:14         ` Pantelis Antoniou
2015-06-08  8:14           ` Pantelis Antoniou
2015-06-08  8:42           ` Ricardo Ribalda Delgado
2015-06-08 18:47         ` Grant Likely
2015-06-08 18:47           ` Grant Likely
     [not found]           ` <20150608184713.446B7C406AA-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2015-06-08 20:09             ` Ricardo Ribalda Delgado
2015-06-08 20:09               ` Ricardo Ribalda Delgado
     [not found]               ` <CAPybu_0FfD9dv55SLmy7905yMCV6Kqrr-v2aPUCx6sSikrF7gQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-08 20:47                 ` Ricardo Ribalda Delgado
2015-06-08 20:47                   ` Ricardo Ribalda Delgado
2015-06-09 11:00                 ` Grant Likely
2015-06-09 11:00                   ` Grant Likely
     [not found]                   ` <20150609110044.61031C40580-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2015-06-10  0:22                     ` Kevin Hilman
2015-06-10  0:22                       ` Kevin Hilman
2015-06-10  7:11                       ` Ricardo Ribalda Delgado
2015-06-10 14:03                         ` Rob Herring
     [not found]                           ` <CAL_Jsq+RyuiYszWSGF-XSL_fqKNWpR0VjFkJMdnW2QuaKNT-AA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-16  7:58                             ` Tony Lindgren
2015-06-16  7:58                               ` Tony Lindgren
2015-06-10 14:38                         ` Kevin Hilman
     [not found]                           ` <CAMAWPa-bGwVCnmv=H=8Zo-NCw-nOFBj3-XcVvb-0m0sNYtPO7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-10 14:46                             ` Ricardo Ribalda Delgado
2015-06-10 14:46                               ` Ricardo Ribalda Delgado
2015-06-10 15:34                               ` Greg Kroah-Hartman
2015-06-10 15:40                               ` Greg Kroah-Hartman
2015-06-10 17:11                                 ` Grant Likely
     [not found]                                   ` <CACxGe6ti6Kpski-Q3nv8kAHB4mr=pkQwco4WPJeaUFD1HNjaeg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-10 17:12                                     ` Pantelis Antoniou
2015-06-10 17:12                                       ` Pantelis Antoniou
2015-06-10 23:38                                     ` Wolfram Sang
2015-06-10 23:38                                       ` Wolfram Sang
     [not found]     ` <1433686811-12303-3-git-send-email-grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-06-12 14:00       ` Ricardo Ribalda Delgado
2015-06-12 14:00         ` Ricardo Ribalda Delgado
2015-06-15 16:46       ` Wolfram Sang [this message]
2015-06-15 16:46         ` Wolfram Sang
2015-06-23 17:12         ` Ricardo Ribalda Delgado
2015-06-23 17:12           ` Ricardo Ribalda Delgado
2015-07-16 20:33           ` Ricardo Ribalda Delgado
     [not found]             ` <CAPybu_0dYgQ_vKnXhZyOf-m5Z7DOnRKD4bB91dWk41pepmqDDA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-22 12:57               ` Ricardo Ribalda Delgado
2015-08-22 12:57                 ` Ricardo Ribalda Delgado
2015-08-23 21:52               ` Rob Herring
2015-08-23 21:52                 ` Rob Herring
2015-08-23 21:58                 ` Ricardo Ribalda Delgado

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=20150615164630.GC1583@katana \
    --to=wsa-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
    --cc=ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@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.