lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdW0_9HNpqYJhJHpDvFcObYZx0MfKT6hmgqjZmwrtpTSzQ@mail.gmail.com>
Date:	Wed, 11 Mar 2015 23:14:05 +0100
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:	Eric Anholt <eric@...olt.net>, Kevin Hilman <khilman@...nel.org>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Tomasz Figa <tomasz.figa@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Linux PM list <linux-pm@...r.kernel.org>
Subject: Re: [PATCH] PM / Domains: If an OF node is found but no device probed
 yet, defer.

On Wed, Mar 11, 2015 at 11:08 PM, Rafael J. Wysocki <rjw@...ysocki.net> wrote:
> More CCes.
>
> On Wednesday, March 11, 2015 08:27:28 AM Eric Anholt wrote:
>> If we've declared a power domain in the OF, and the OF node is found
>> but the requested domain hasn't been registered on it yet, then we
>> probably have just tried to probe before the power domain driver has.
>> Defer our device's probe until it shows up.
>>
>> Signed-off-by: Eric Anholt <eric@...olt.net>
>
> Kevin, Ulf, any chance to have a look at this, please?
>
>> ---
>>
>> I ran into this when turning my ad-hoc code for BCM2835 (Raspberry Pi)
>> USB poweron support in the DWC2 controller to an OF-based power domain
>> declaration.

I guess you are initializing the PM domains from module_init()?

I use core_initcall() in arch/arm/mach-shmobile/pm-rmobile.c to make sure it's
initialized earlier, as e.g. the interrupt controller uses postcore_initcall().

>> drivers/base/power/domain.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
>> index ba4abbe..2b93c98 100644
>> --- a/drivers/base/power/domain.c
>> +++ b/drivers/base/power/domain.c
>> @@ -2064,7 +2064,7 @@ EXPORT_SYMBOL_GPL(of_genpd_del_provider);
>>  struct generic_pm_domain *of_genpd_get_from_provider(
>>                                       struct of_phandle_args *genpdspec)
>>  {
>> -     struct generic_pm_domain *genpd = ERR_PTR(-ENOENT);
>> +     struct generic_pm_domain *genpd = ERR_PTR(-EPROBE_DEFER);

Currently platform_drv_probe() just continues if dev_pm_domain_attach() returns
a different error than -EPROBE_DEFER, which is what you are seeing.

Your change does have the side effect that a new DT with PM domains won't
work on an older kernel that doesn't have the PM domain driver yet.

Whether this is a good or a bad thing depends on your bootloader. If all PM
domains are powered when Linux boots, it can work without PM domain driver.
Since DT PM domains are quite recent, I guess this is the case for most
existing SoCs.

>>       struct of_genpd_provider *provider;
>>
>>       mutex_lock(&of_genpd_mutex);

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ