lkml.org 
[lkml]   [2021]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] PM: base: power: don't try to use non-existing RTC for storing data
From
Date
On 06.09.21 19:07, Rafael J. Wysocki wrote:
> On Fri, Sep 3, 2021 at 11:02 AM Juergen Gross <jgross@suse.com> wrote:
>>
>> On 03.09.21 10:56, Greg Kroah-Hartman wrote:
>>> On Fri, Sep 03, 2021 at 10:49:36AM +0200, Juergen Gross wrote:
>>>> In there is no legacy RTC device, don't try to use it for storing trace
>>>> data across suspend/resume.
>>>>
>>>> Cc: <stable@vger.kernel.org>
>>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>>> ---
>>>> drivers/base/power/trace.c | 10 ++++++++++
>>>> 1 file changed, 10 insertions(+)
>>>>
>>>> diff --git a/drivers/base/power/trace.c b/drivers/base/power/trace.c
>>>> index a97f33d0c59f..b7c80849455c 100644
>>>> --- a/drivers/base/power/trace.c
>>>> +++ b/drivers/base/power/trace.c
>>>> @@ -13,6 +13,7 @@
>>>> #include <linux/export.h>
>>>> #include <linux/rtc.h>
>>>> #include <linux/suspend.h>
>>>> +#include <linux/init.h>
>>>>
>>>> #include <linux/mc146818rtc.h>
>>>>
>>>> @@ -165,6 +166,9 @@ void generate_pm_trace(const void *tracedata, unsigned int user)
>>>> const char *file = *(const char **)(tracedata + 2);
>>>> unsigned int user_hash_value, file_hash_value;
>>>>
>>>> + if (!x86_platform.legacy.rtc)
>>>> + return 0;
>>>
>>> Why does the driver core code here care about a platform/arch-specific
>>> thing at all? Did you just break all other arches?
>>
>> This file is only compiled for x86. It depends on CONFIG_PM_TRACE_RTC,
>> which has a "depends on X86" attribute.
>
> This feature uses the CMOS RTC memory to store data, so if that memory
> is not present, it's better to avoid using it.
>
> Please feel free to add
>
> Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>

Thanks!

>
> to this patch or let me know if you want me to take it.
>

No, I can take it with the other patch of this small series, thanks.


Juergen
[unhandled content-type:application/pgp-keys][unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-09-07 06:19    [W:0.075 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site