Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp281437pxb; Fri, 3 Sep 2021 01:52:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7s21QBYNm86R+MWfFMD4dMwkKvlm6h8kdMoQeJ594k/lLV850+dY6SWJ7oFPtoX8/9cLh X-Received: by 2002:aa7:c88e:: with SMTP id p14mr2932054eds.174.1630659147248; Fri, 03 Sep 2021 01:52:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630659147; cv=none; d=google.com; s=arc-20160816; b=pmqx6ajMJ30gKPQ1Ho2Uem1+bGEdmQaaKqFecQRAXSLyATxfFRha4FpntJMIlFJq5x Byy8T1p+Ec/bp6K4egiVoSp5L3X68JnlHF67s4Zm3N2/afSIM7oHRxQI4M0tR/MhVdTe 4VbQPzW8R8FjdieOK3BcLMh8o+JBnEzLACsdARd4I3iNcYZLRMSosDg07jSqUJ/IX0W5 8h5rRFceHzCjPcZcQ4jD5sblANxuFjNadwGsvSJgLzOYov1aQBfVSUkNumdSdWDBUvUZ Bm4GnK2wfK5z1M1qe3nZyNaLFzou4BIaBz3ABbU0IrNN+q5eKGKG9t7vJa3dbbCgDBkt qg0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2A79ijv44MFRRI4yP9IKOdGZLkyzD6D8f46U5bOTMG8=; b=02mEfdE5gyWQHRANlOW9rVKe+G9dkwZ5eHvbEpreT7x/9SSlkm/YtLEs+jXNWVFghc LFNl9Ubj7mh05WDtl0WMKvGpPhEES0kMQpTSrnoF9XKVgh0Z1QNJNNqJ7cMTdB3myBg8 5Z30a04PfRFUA+EMj3EwMEIXeUwlI8cv9dmH0mFL5IkO5BNH6u/1X/fPNR62bxZ+ecuq QCnNf/snAeCwKGpyLWcwHBbGfyEUgfIanqrUFY+iyLz1tiiHs0g1QbMpk6kdmcwti9op yqN2veAW9i2nTYeJEousmdDbdDiggjPSF+cSmFKM4Nib4Y8PC/Q/c4uie0IjpBwzsSul Js2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=YaUyhefW; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z21si4408965eji.707.2021.09.03.01.52.04; Fri, 03 Sep 2021 01:52:27 -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; dkim=pass header.i=@suse.com header.s=susede1 header.b=YaUyhefW; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348432AbhICIun (ORCPT + 99 others); Fri, 3 Sep 2021 04:50:43 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:39272 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348411AbhICIul (ORCPT ); Fri, 3 Sep 2021 04:50:41 -0400 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 67AF722666; Fri, 3 Sep 2021 08:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1630658980; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2A79ijv44MFRRI4yP9IKOdGZLkyzD6D8f46U5bOTMG8=; b=YaUyhefWzsHHkhY9meNyZ+nn5OZODEbPW68xXVIYL/Z3GsIY0wJ6ADl0f1uKxP/ao0IOzf 7tkHLaKoHp2ra3Mq30rV0xmgUe0Zvl3BHYlchwLyMW2aH5QnXmYyUenSuhEv6x4NLizQQM xQiOoW4Iv3P3Ud7OZuNeMHRCHmstlzk= Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 1527913754; Fri, 3 Sep 2021 08:49:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id SD+dA6ThMWFjdAAAGKfGzw (envelope-from ); Fri, 03 Sep 2021 08:49:40 +0000 From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , "Rafael J. Wysocki" , stable@vger.kernel.org Subject: [PATCH 1/2] PM: base: power: don't try to use non-existing RTC for storing data Date: Fri, 3 Sep 2021 10:49:36 +0200 Message-Id: <20210903084937.19392-2-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210903084937.19392-1-jgross@suse.com> References: <20210903084937.19392-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; + user_hash_value = user % USERHASH; file_hash_value = hash_string(lineno, file, FILEHASH); set_magic_time(user_hash_value, file_hash_value, dev_hash_value); @@ -267,6 +271,9 @@ static struct notifier_block pm_trace_nb = { static int __init early_resume_init(void) { + if (!x86_platform.legacy.rtc) + return 0; + hash_value_early_read = read_magic_time(); register_pm_notifier(&pm_trace_nb); return 0; @@ -277,6 +284,9 @@ static int __init late_resume_init(void) unsigned int val = hash_value_early_read; unsigned int user, file, dev; + if (!x86_platform.legacy.rtc) + return 0; + user = val % USERHASH; val = val / USERHASH; file = val % FILEHASH; -- 2.26.2