Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3011009pxb; Mon, 6 Sep 2021 10:11:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzITW/+HLfCWYoSGLliUPa+5oZcOWpiR+os28MQ9fekmTaYKjgHp0QzQY1/swJIbxfa3kHl X-Received: by 2002:a17:906:1806:: with SMTP id v6mr15161530eje.420.1630948296059; Mon, 06 Sep 2021 10:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630948296; cv=none; d=google.com; s=arc-20160816; b=F+xbLjHHcCAOWlmIEsH9ASWm2Y96gUbLyE8ke96H9otXonoiNLB8q/G9fFiUK+rNAt g/K7QedWl4cZPdVJt9BeWHEFcHftAMx/57fK1yNtYxDDgamcvD8jiJjig9mSdjPaiVI+ dR7l962lmZyksZelBFOZ1iGmjJ08xwn0OLY9fDAPdc1oiSaQUlwKpcVqUjIaE9PKp2Dd SuNptloBOZfjdJ+hudG2I86HHpDQM1fy2EZwinNHbV+GtL+X+QBx81k8y14FvgX0HirZ OFrhhxLYFOSQ9jvCrosgysgyEB/eMOcc2OVEION0KuIHtnmXYCOQqEk/vVOMsRBcJKD8 wBlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=++LIn4BzMT/yfmvrIHegIKxrKLsnvbzGkInouRJvYyc=; b=H4U83siHeoBmT1MvWB0dpE2wxvy3ev2nSSwFZBlqHT6gEP2eX0vHBoXiNoaD5YzcpQ jqx5KcE67EirhVhgDX8HhGTaDdQjGIzGDE5TmQ0mshN5YikVBVh5bdy6PaCpXx5ibBot t4YAmrY2Un6stqrKuZSd+A5XXKeiZSvR3u968nJKXQeZCrSLT+ZWtm3HGWSM2qqtiQ2Q dKOL4naDFbygGIeaTIJ4Edr+q7E0k/JtMZpytTZiwoRzuM4uBC2jzzYZ6J590JxntVvR UbxwdI9+pg9QJKdAfxeUikyV4HkGBUK7rEM8pUhpy2euAFoopU5O6GaYV+1wDaD/uG3T vv8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr12si9256790ejb.335.2021.09.06.10.11.01; Mon, 06 Sep 2021 10:11:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242978AbhIFRIz (ORCPT + 99 others); Mon, 6 Sep 2021 13:08:55 -0400 Received: from mail-ot1-f51.google.com ([209.85.210.51]:39632 "EHLO mail-ot1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231274AbhIFRIy (ORCPT ); Mon, 6 Sep 2021 13:08:54 -0400 Received: by mail-ot1-f51.google.com with SMTP id m7-20020a9d4c87000000b0051875f56b95so9471435otf.6; Mon, 06 Sep 2021 10:07:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=++LIn4BzMT/yfmvrIHegIKxrKLsnvbzGkInouRJvYyc=; b=sdOhagY2NnJFq9Zu4txDwO2MJasD0eDPshize9cDIkkrIHE5cIoM0Cy04k5qtXWGF4 HHLMPR8ATQ1Ao55yRVs4N2bDglCoYwJQFEoFBO9S9olI0pB3Hw5GjQrtpjKL7qyqKNcF Y72DhBq8Y2c12btnUMCZaX+zmBbAETZjfbOGkxS+Bjfyr7KS1PdHD8lrswbyk4QiQ4rZ zKFiZWWerYRBW7KrAX16GPO2sSaCzSd0QETsIa1P9O/B2oVRbvtjOS2/duhI0cUr9eBB qtNf102f61ZMoPmsfT7xCL0U2eLKiP8OhFjc+QOwa5jSHb/nexqStjGegsN1DcmLtXWV 60iA== X-Gm-Message-State: AOAM5301BCwx9jUbpCJliG5qtJAEDSmsoJVKTz91zOfbRkX47+3YRU89 S7F9tMu6H6pSF9Cfi+eEfAiZR91LuFo93/SW/9Q= X-Received: by 2002:a9d:4d93:: with SMTP id u19mr11579566otk.86.1630948068687; Mon, 06 Sep 2021 10:07:48 -0700 (PDT) MIME-Version: 1.0 References: <20210903084937.19392-1-jgross@suse.com> <20210903084937.19392-2-jgross@suse.com> <1b6a8f9c-2a5f-e97e-c89d-5983ceeb20e5@suse.com> In-Reply-To: <1b6a8f9c-2a5f-e97e-c89d-5983ceeb20e5@suse.com> From: "Rafael J. Wysocki" Date: Mon, 6 Sep 2021 19:07:37 +0200 Message-ID: Subject: Re: [PATCH 1/2] PM: base: power: don't try to use non-existing RTC for storing data To: Juergen Gross Cc: Greg Kroah-Hartman , xen-devel@lists.xenproject.org, Linux PM , Linux Kernel Mailing List , "Rafael J. Wysocki" , Len Brown , Pavel Machek , "Rafael J. Wysocki" , Stable Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 3, 2021 at 11:02 AM Juergen Gross 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: > >> Signed-off-by: Juergen Gross > >> --- > >> 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 > >> #include > >> #include > >> +#include > >> > >> #include > >> > >> @@ -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 to this patch or let me know if you want me to take it.