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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 27 Oct 2015 15:40:50 +0100
From:	Tomeu Vizoso <tomeu.vizoso@...labora.com>
To:	Daniel Kurtz <djkurtz@...omium.org>
Cc:	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	Alan Stern <stern@...land.harvard.edu>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	martyn.welch@...labora.co.uk, Ulf Hansson <ulf.hansson@...aro.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Len Brown <len.brown@...el.com>,
	Kevin Hilman <khilman@...nel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Pavel Machek <pavel@....cz>,
	Derek Basehore <dbasehore@...gle.com>
Subject: Re: [PATCH v10 3/4] PM / sleep: Go direct_complete if driver has no callbacks

On 26 October 2015 at 13:56, Daniel Kurtz <djkurtz@...omium.org> wrote:
> Hi Tomeu,
>
> On Wed, Oct 21, 2015 at 11:34 PM, Tomeu Vizoso
> <tomeu.vizoso@...labora.com> wrote:
>> If a suitable prepare callback cannot be found for a given device and
>> its driver has no PM callbacks at all, assume that it can go direct to
>> complete when the system goes to sleep.
>>
>> The reason for this is that there's lots of devices in a system that do
>> no PM at all and there's no reason for them to prevent their ancestors
>> to do direct_complete if they can support it.
>>
>> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@...labora.com>
>> Reviewed-by: Ulf Hansson <ulf.hansson@...aro.org>
>> ---
>
> [snip...]
>
>> diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
>> index a70f8a5cdfd7..763eee24cb95 100644
>> --- a/drivers/base/power/common.c
>> +++ b/drivers/base/power/common.c
>> @@ -14,6 +14,8 @@
>>  #include <linux/acpi.h>
>>  #include <linux/pm_domain.h>
>>
>> +#include "power.h"
>> +
>>  /**
>>   * dev_pm_get_subsys_data - Create or refcount power.subsys_data for device.
>>   * @dev: Device to handle.
>> @@ -147,5 +149,6 @@ void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd)
>>         WARN(device_is_bound(dev),
>>              "PM domains can only be changed for unbound devices\n");
>>         dev->pm_domain = pd;
>> +       device_pm_check_callbacks(dev);
>
> device_pm_check_callbacks(dev) grabs spin_lock_irq(&dev->power.lock);
>
> But, one of the callers of dev_pm_domain_set() that you just added in
> the previous patch "PM / Domains: add setter for dev.pm_domain" also
> grabs this same spinlock:
>
> --------------------
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 16550c63d611..b75d02aa8d93 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -1240,7 +1240,7 @@  static struct generic_pm_domain_data
> *genpd_alloc_dev_data(struct device *dev,
>   }
>
>   dev->power.subsys_data->domain_data = &gpd_data->base;
> - dev->pm_domain = &genpd->domain;
> + dev_pm_domain_set(dev, &genpd->domain);
>
>   spin_unlock_irq(&dev->power.lock);
> --------------------
>
> At least on the board I am testing, this causes a deadlock on boot.

Thanks Daniel,

have moved in v11 the calls to dev_pm_domain_set in that file out from the lock.

Regards,

Tomeu
--
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