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: <c98b9b02c49b41c6e2493407f11c5eac@codeaurora.org>
Date:   Tue, 07 Apr 2020 15:59:59 -0700
From:   rishabhb@...eaurora.org
To:     Bjorn Andersson <bjorn.andersson@...aro.org>
Cc:     Siddharth Gupta <sidgup@...eaurora.org>, ohad@...ery.com,
        linux-remoteproc@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, tsoni@...eaurora.org,
        psodagud@...eaurora.org, linux-remoteproc-owner@...r.kernel.org
Subject: Re: [PATCH 2/2] remoteproc: core: Prevent sleep when rproc crashes

On 2020-04-07 15:29, Bjorn Andersson wrote:
> On Wed 19 Feb 18:11 PST 2020, Siddharth Gupta wrote:
> 
>> Remoteproc recovery should be fast and any delay will have an impact 
>> on the
>> user-experience. Use power management APIs (pm_stay_awake and 
>> pm_relax) to
>> ensure that the system does not go to sleep.
>> 
>> Signed-off-by: Siddharth Gupta <sidgup@...eaurora.org>
>> ---
>>  drivers/remoteproc/remoteproc_core.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/drivers/remoteproc/remoteproc_core.c 
>> b/drivers/remoteproc/remoteproc_core.c
>> index 5ab65a4..52e318c 100644
>> --- a/drivers/remoteproc/remoteproc_core.c
>> +++ b/drivers/remoteproc/remoteproc_core.c
>> @@ -1712,6 +1712,8 @@ static void rproc_crash_handler_work(struct 
>> work_struct *work)
>> 
>>  	if (!rproc->recovery_disabled)
>>  		rproc_trigger_recovery(rproc);
>> +
>> +	pm_relax(&rproc->dev);
>>  }
>> 
>>  /**
>> @@ -2242,6 +2244,8 @@ void rproc_report_crash(struct rproc *rproc, 
>> enum rproc_crash_type type)
>>  		return;
>>  	}
>> 
>> +	pm_stay_awake(&rproc->dev);
> 
> Following Mathieu's question I was expecting you to do this on
> rproc->dev.parent.
> 
> But looking at the implementation of pm_stay_awake(), it ends up being 
> a
> nop if dev->power.wakeup isn't specified. This in turn seems to come
> from device_wakeup_enable(), which will bail if dev->power.can_wakeup 
> is
> not set. But I don't see where this would be set for either the 
> platform
> driver or the remoteproc's struct device - and neither one of them have
> a "wakeup" attribute in sysfs.
> 
> Is there some additional plumbing needed for this?
We should be able to create a standalone wakeup source using 
wakeup_source_init.
Then we can use _pm_stay_awake and _pm_relax on it.
> 
> Regards,
> Bjorn
> 
>> +
>>  	dev_err(&rproc->dev, "crash detected in %s: type %s\n",
>>  		rproc->name, rproc_crash_to_string(type));
>> 
>> --
>> Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
>> a Linux Foundation Collaborative Project

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ