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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFqj8SuGhehR1e=qY-6fd3tPegdhaeBgAB61YjUkSVnzDg@mail.gmail.com>
Date:	Thu, 13 Nov 2014 10:03:08 +0100
From:	Ulf Hansson <ulf.hansson@...aro.org>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Krzysztof Kozlowski <k.kozlowski@...sung.com>
Cc:	Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
	Russell King <linux@....linux.org.uk>,
	Dan Williams <dan.j.williams@...el.com>,
	Vinod Koul <vinod.koul@...el.com>,
	Alan Stern <stern@...land.harvard.edu>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	dmaengine@...r.kernel.org, Kevin Hilman <khilman@...nel.org>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Kyungmin Park <kyungmin.park@...sung.com>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Subject: Re: [PATCH v11 5/6] dmaengine: pl330: Add PM sleep support

On 13 November 2014 02:37, Rafael J. Wysocki <rjw@...ysocki.net> wrote:
> On Wednesday, November 12, 2014 03:32:27 PM Krzysztof Kozlowski wrote:
>> Add system suspend/resume capabilities to the pl330 driver so the amba
>> bus clock could be also unprepared to conserve energy.
>>
>> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@...sung.com>
>> ---
>>  drivers/dma/pl330.c | 37 +++++++++++++++++++++++++++++++++++++
>>  1 file changed, 37 insertions(+)
>>
>> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
>> index c3bd3584f261..fd71777fc565 100644
>> --- a/drivers/dma/pl330.c
>> +++ b/drivers/dma/pl330.c
>> @@ -2627,6 +2627,42 @@ static int pl330_dma_device_slave_caps(struct dma_chan *dchan,
>>       return 0;
>>  }
>>
>> +/*
>> + * Runtime PM callbacks are provided by amba/bus.c driver.
>> + *
>> + * It is assumed here that IRQ safe runtime PM is chosen in probe and amba
>> + * bus driver will only disable/enable the clock in runtime PM callbacks.
>> + */
>> +static int __maybe_unused pl330_suspend(struct device *dev)
>> +{
>> +     struct amba_device *pcdev = to_amba_device(dev);
>> +
>> +     if (!pm_runtime_status_suspended(dev)) {
>
> It generally isn't safe to call that in .suspend(), because the status may still
> change in theory.  On the other hand, if you do that in .suspend_late(), you'll
> be safe from that.
>

Just to clarify that statement; it's safe in a ->suspend_late()
callback, because runtime PM has been disabled by the PM core.

That's also the reason why the pm_runtime_force_suspend() helper is
disabling runtime PM, such it may be used in some of the earlier
phases of the system PM callbacks.

Kind regards
Uffe
--
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