From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
Andrew Lunn <andrew@lunn.ch>, Jason Cooper <jason@lakedaemon.net>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Len Brown <len.brown@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Subject: Re: [PATCH 2/9] pm: domains: avoid potential oops in pm_genpd_remove_device()
Date: Fri, 13 Mar 2015 13:45:52 +0100 [thread overview]
Message-ID: <CAMuHMdWmVLPqKs2ZyLjZ2DA2UAjhqzrr1LEtsW2CRYSTh+uoeQ@mail.gmail.com> (raw)
In-Reply-To: <20150313092030.GC8656@n2100.arm.linux.org.uk>
On Fri, Mar 13, 2015 at 10:20 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Fri, Mar 13, 2015 at 09:56:02AM +0100, Ulf Hansson wrote:
>> On 12 March 2015 at 19:31, Russell King <rmk+kernel@arm.linux.org.uk> wrote:
>> > pm_genpd_remove_device() should only be called with valid and present
>> > pm domain. There are circumstances where we may end up with something
>> > that isn't a generic PM domain in dev->pm_domain (eg, vga_switcheroo
>> > stuff.)
>>
>> Could the "vga_switcheroo" code deal with this instead?
>
> How is there any possibility what so ever that vga_switcherroo could
> deal with this?
>
> The problem is if something which isn't a generic PM domain is registered
> in dev->pm_domain, pm_genpd_remove_device() will treat it as a generic PM
> domain, and try and de-reference it as if it were a generic PM domain.
>
> The problem is the generic PM domain code _assuming_ that whatever it
> finds in dev->pm_domain is always a generic PM domain. That is a broken
> assumption.
Indeed, currently it's not possible to know which derivative of dev_pm_domain
is used. For genpd, you have to look it up in the genpd list.
This also complicates adding debug code.
In addition, it can be statically or dynamically allocated. Hence sometimes %ps
can tell you the type, sometimes it can't.
Should we add a type field to struct dev_pm_domain?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2015-03-13 12:45 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-12 18:30 [FOR DISCUSSION 0/9] Dove PMU support Russell King - ARM Linux
2015-03-12 18:30 ` [PATCH 1/9] pm: domains: quieten down generic pm domains Russell King
2015-03-13 8:46 ` Ulf Hansson
2015-03-13 15:57 ` Kevin Hilman
2015-03-12 18:31 ` [PATCH 2/9] pm: domains: avoid potential oops in pm_genpd_remove_device() Russell King
2015-03-13 8:56 ` Ulf Hansson
2015-03-13 9:20 ` Russell King - ARM Linux
2015-03-13 12:45 ` Geert Uytterhoeven [this message]
2015-03-14 1:27 ` Rafael J. Wysocki
2015-03-13 13:23 ` Russell King - ARM Linux
2015-03-13 16:33 ` Kevin Hilman
2015-03-13 16:58 ` Russell King - ARM Linux
2015-03-12 18:31 ` [PATCH 3/9] pm: domains: sync runtime PM status with PM domains after probe Russell King
2015-03-12 23:25 ` Rafael J. Wysocki
2015-03-13 9:30 ` Ulf Hansson
2015-03-13 10:14 ` Russell King - ARM Linux
2015-03-13 10:42 ` Ulf Hansson
2015-03-13 13:39 ` Russell King - ARM Linux
2015-03-13 16:45 ` Kevin Hilman
2015-03-13 16:22 ` [FOR DISCUSSION 0/10] Dove PMU support Russell King - ARM Linux
2015-03-13 16:23 ` [PATCH 01/10] pm: domains: quieten down generic pm domains Russell King
2015-03-13 17:10 ` Kevin Hilman
2015-03-13 16:23 ` [PATCH 02/10] pm: domains: factor out code to get the generic PM domain from a struct device Russell King
2015-03-13 17:20 ` Kevin Hilman
2015-03-13 17:35 ` Russell King - ARM Linux
2015-03-13 16:23 ` [PATCH 03/10] pm: domains: avoid potential oops in pm_genpd_remove_device() Russell King
2015-03-13 17:28 ` Kevin Hilman
[not found] ` <20150312183020.GU8656-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-03-13 11:57 ` [FOR DISCUSSION 0/9] Dove PMU support Arnd Bergmann
2015-03-13 12:11 ` Russell King - ARM Linux
2015-03-13 12:26 ` Arnd Bergmann
2015-03-13 12:32 ` Russell King - ARM Linux
2015-03-13 12:47 ` Arnd Bergmann
2015-03-13 16:23 ` [PATCH 04/10] pm: domains: sync runtime PM status with PM domains after probe Russell King
[not found] ` <E1YWSN5-0006G5-Ld-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2015-03-13 17:33 ` Kevin Hilman
2015-03-19 21:59 ` [FOR DISCUSSION 0/9] Dove PMU support Rafael J. Wysocki
2015-03-19 22:02 ` Rafael J. Wysocki
2015-03-20 12:16 ` Russell King - ARM Linux
2015-03-20 12:44 ` Rafael J. Wysocki
2015-03-20 17:19 ` Russell King - ARM Linux
2015-03-20 17:20 ` [PATCH 1/3] pm: domains: quieten down generic pm domains Russell King
2015-03-20 17:20 ` [PATCH 2/3] pm: domains: factor out code to get the generic PM domain from a struct device Russell King
2015-03-23 13:28 ` Ulf Hansson
2015-03-23 15:17 ` Russell King - ARM Linux
2015-03-24 0:29 ` Rafael J. Wysocki
2015-03-26 15:20 ` Russell King - ARM Linux
2015-03-26 16:00 ` Russell King - ARM Linux
2015-03-20 17:20 ` [PATCH 3/3] pm: domains: avoid potential oops in pm_genpd_remove_device() Russell King
2015-03-23 13:32 ` Ulf Hansson
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=CAMuHMdWmVLPqKs2ZyLjZ2DA2UAjhqzrr1LEtsW2CRYSTh+uoeQ@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=andrew@lunn.ch \
--cc=gregkh@linuxfoundation.org \
--cc=jason@lakedaemon.net \
--cc=len.brown@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=rjw@rjwysocki.net \
--cc=sebastian.hesselbarth@gmail.com \
--cc=ulf.hansson@linaro.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 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).