Message ID | 5887691.lOV4Wx5bFT@kreacher |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp2048352wrs; Tue, 18 Oct 2022 09:30:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5h88GIXVWfDSskKwHMK7XshY9bnUzgtDVev/jYqNcIJVmS0pensGc4GKwZ+cyS3eHFzQTS X-Received: by 2002:aa7:de9a:0:b0:44d:8191:44c5 with SMTP id j26-20020aa7de9a000000b0044d819144c5mr3353042edv.232.1666110607134; Tue, 18 Oct 2022 09:30:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666110607; cv=none; d=google.com; s=arc-20160816; b=FMSmXSRNCSgfjD82jg/koYYYazZs3XmvYk43sKv+5gynTSRywSev5qpCpJbCnA+TD+ Rh03y/Q8gcGcXDaSgMj1KZdo4PTO1XmgAQMnaoNYcU2WEc+KknPvDhVB36B/dMvhp8Iy krKGKB524aEMFqn7zmzV8lFM93/PAotCWDyT5z1mkj+NZQzCr7IPKxd86KSi3+11SRYk LTF1juTl+Aq8dfLmOSNVsEEdxR8P5cIoXzIDGtwgkFyzEPZkLjXD6uHMt8uZkYau+Ou+ PfkeRZRqnvulVNh4oElylVM8K5rSBqNdx53gSJK0f74QfcGU/fyooOcCOPEIK+e6Bxiz I5bA== 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 :message-id:date:subject:cc:to:from; bh=tOxpnPyBl0pvea05JqVpGLfhly7wlMcSMVXCOgewxNc=; b=YnipNsf3hd1SLBLUDEyKACr1MOq891caBt0EQ1TCEgvbIgxB20vabND17bKEzqL5rr 99QfQ08gNCuzGs0waOIQNgtNNhkdG5yZ9JkXjdC0N3RzhHOssUtxPpYFkQpmxIFC2CG1 HbQs17zWg0nmtbelUP7fineQKZZeegKYV1/p35sSc37qA6lYAU4DDL7AdzHk6w53AXVf +q9iWK6uvTQvUr2J8IWYFMjg8SYdF/xzlZnQWGzIrNKipk/rRmLx4wgGJZLgD1YbUMVB 3xVvgoJ5TlXTY58Noca9fhirQnnC0WB8N6nVSIPt1laI9Tz19FuBVbCBZLnWJF9JFGIJ vZcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r23-20020aa7d597000000b00445f660de5asi10109677edq.141.2022.10.18.09.29.41; Tue, 18 Oct 2022 09:30:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229835AbiJRQJr (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Tue, 18 Oct 2022 12:09:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229852AbiJRQJo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Oct 2022 12:09:44 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 598BA22BFD; Tue, 18 Oct 2022 09:09:40 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.0.0) id 349dc4d4a828391b; Tue, 18 Oct 2022 18:09:37 +0200 Received: from kreacher.localnet (unknown [213.134.183.104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id BA45666695D; Tue, 18 Oct 2022 18:09:36 +0200 (CEST) From: "Rafael J. Wysocki" <rjw@rjwysocki.net> To: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Alessandro Zummo <a.zummo@towertech.it>, Mario Limonciello <mario.limonciello@amd.com>, linux-rtc@vger.kernel.org, Bjorn Helgaas <helgaas@kernel.org>, LKML <linux-kernel@vger.kernel.org>, Linux ACPI <linux-acpi@vger.kernel.org>, Linux PM <linux-pm@vger.kernel.org>, Mel Gorman <mgorman@techsingularity.net>, Zhang Rui <rui.zhang@intel.com>, Todd Brandt <todd.e.brandt@linux.intel.com> Subject: [PATCH] rtc: rtc-cmos: Fix wake alarm breakage Date: Tue, 18 Oct 2022 18:09:31 +0200 Message-ID: <5887691.lOV4Wx5bFT@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.183.104 X-CLIENT-HOSTNAME: 213.134.183.104 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrfeelvddgieejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepffffffekgfehheffleetieevfeefvefhleetjedvvdeijeejledvieehueevueffnecukfhppedvudefrddufeegrddukeefrddutdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekfedruddtgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepuddupdhrtghpthhtoheprghlvgigrghnughrvgdrsggvlhhlohhnihessghoohhtlhhinhdrtghomhdprhgtphhtthhopegrrdiiuhhmmhhosehtohifvghrthgvtghhrdhithdprhgtphhtthhopehmrghrihhordhlihhmohhntghivghllhhosegrmhgurdgtohhmpdhrtghpthhtoheplhhinhhugidqrhhttgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphht thhopehhvghlghgrrghssehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehmghhorhhmrghnsehtvggthhhsihhnghhulhgrrhhithihrdhnvghtpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomhdprhgtphhtthhopehtohguugdrvgdrsghrrghnughtsehlihhnuhigrdhinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=11 Fuz1=11 Fuz2=11 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747043595801079064?= X-GMAIL-MSGID: =?utf-8?q?1747043595801079064?= |
Series |
rtc: rtc-cmos: Fix wake alarm breakage
|
|
Commit Message
Rafael J. Wysocki
Oct. 18, 2022, 4:09 p.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Commit 4919d3eb2ec0 ("rtc: cmos: Fix event handler registration ordering issue") overlooked the fact that cmos_do_probe() depended on the preparations carried out by cmos_wake_setup() and the wake alarm stopped working after the ordering of them had been changed. Address this by partially reverting commit 4919d3eb2ec0 so that cmos_wake_setup() is called before cmos_do_probe() again and moving the rtc_wake_setup() invocation from cmos_wake_setup() directly to the callers of cmos_do_probe() where it will happen after a successful completion of the latter. Fixes: 4919d3eb2ec0 ("rtc: cmos: Fix event handler registration ordering issue") Reported-by: Zhang Rui <rui.zhang@intel.com> Reported-by: Todd Brandt <todd.e.brandt@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> --- @Bjorn: This is the minimum fix. Folding cmos_wake_setup() into cmos_do_probe() requires changes that are a bit intrusive for post-rc1, but I will do that later. --- drivers/rtc/rtc-cmos.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
Comments
On Tue, 18 Oct 2022 18:09:31 +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > Commit 4919d3eb2ec0 ("rtc: cmos: Fix event handler registration > ordering issue") overlooked the fact that cmos_do_probe() depended > on the preparations carried out by cmos_wake_setup() and the wake > alarm stopped working after the ordering of them had been changed. > > [...] Applied, thanks! [1/1] rtc: rtc-cmos: Fix wake alarm breakage commit: 0782b66ed2fbb035dda76111df0954515e417b24 Best regards,
Works for me! Tested-by: Len Brown <len.brown@intel.com> On Tue, Oct 18, 2022 at 6:39 PM Alexandre Belloni <alexandre.belloni@bootlin.com> wrote: > > On Tue, 18 Oct 2022 18:09:31 +0200, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > > > Commit 4919d3eb2ec0 ("rtc: cmos: Fix event handler registration > > ordering issue") overlooked the fact that cmos_do_probe() depended > > on the preparations carried out by cmos_wake_setup() and the wake > > alarm stopped working after the ordering of them had been changed. > > > > [...] > > Applied, thanks! > > [1/1] rtc: rtc-cmos: Fix wake alarm breakage > commit: 0782b66ed2fbb035dda76111df0954515e417b24 > > Best regards, > > -- > Alexandre Belloni, co-owner and COO, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com
On Tue, 2022-10-18 at 18:58 +0200, Len Brown wrote: > Works for me! > > Tested-by: Len Brown <len.brown@intel.com> > > On Tue, Oct 18, 2022 at 6:39 PM Alexandre Belloni Works for me too Tested-by: Todd Brandt <todd.e.brandt@intel.com> > <alexandre.belloni@bootlin.com> wrote: > > > > On Tue, 18 Oct 2022 18:09:31 +0200, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > > > > > Commit 4919d3eb2ec0 ("rtc: cmos: Fix event handler registration > > > ordering issue") overlooked the fact that cmos_do_probe() > > > depended > > > on the preparations carried out by cmos_wake_setup() and the wake > > > alarm stopped working after the ordering of them had been > > > changed. > > > > > > [...] > > > > Applied, thanks! > > > > [1/1] rtc: rtc-cmos: Fix wake alarm breakage > > commit: 0782b66ed2fbb035dda76111df0954515e417b24 > > > > Best regards, > > > > -- > > Alexandre Belloni, co-owner and COO, Bootlin > > Embedded Linux and Kernel engineering > > https://bootlin.com > > >
On Tue, Oct 18, 2022 at 6:39 PM Alexandre Belloni <alexandre.belloni@bootlin.com> wrote: > > On Tue, 18 Oct 2022 18:09:31 +0200, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > > > Commit 4919d3eb2ec0 ("rtc: cmos: Fix event handler registration > > ordering issue") overlooked the fact that cmos_do_probe() depended > > on the preparations carried out by cmos_wake_setup() and the wake > > alarm stopped working after the ordering of them had been changed. > > > > [...] > > Applied, thanks! > > [1/1] rtc: rtc-cmos: Fix wake alarm breakage > commit: 0782b66ed2fbb035dda76111df0954515e417b24 Thank you! However, there is a build fix on top of this which has just been posted: https://lore.kernel.org/linux-acpi/2677035.mvXUDI8C0e@kreacher/ Sorry about breaking it again.
On 19/10/2022 18:13:43+0200, Rafael J. Wysocki wrote: > On Tue, Oct 18, 2022 at 6:39 PM Alexandre Belloni > <alexandre.belloni@bootlin.com> wrote: > > > > On Tue, 18 Oct 2022 18:09:31 +0200, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > > > > > Commit 4919d3eb2ec0 ("rtc: cmos: Fix event handler registration > > > ordering issue") overlooked the fact that cmos_do_probe() depended > > > on the preparations carried out by cmos_wake_setup() and the wake > > > alarm stopped working after the ordering of them had been changed. > > > > > > [...] > > > > Applied, thanks! > > > > [1/1] rtc: rtc-cmos: Fix wake alarm breakage > > commit: 0782b66ed2fbb035dda76111df0954515e417b24 > > Thank you! > > However, there is a build fix on top of this which has just been posted: > > https://lore.kernel.org/linux-acpi/2677035.mvXUDI8C0e@kreacher/ > > Sorry about breaking it again. I had that in rtc-fixes: https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git/commit/?h=rtc-fixes
On Wed, Oct 19, 2022 at 8:16 PM Alexandre Belloni <alexandre.belloni@bootlin.com> wrote: > > On 19/10/2022 18:13:43+0200, Rafael J. Wysocki wrote: > > On Tue, Oct 18, 2022 at 6:39 PM Alexandre Belloni > > <alexandre.belloni@bootlin.com> wrote: > > > > > > On Tue, 18 Oct 2022 18:09:31 +0200, Rafael J. Wysocki wrote: > > > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > > > > > > > Commit 4919d3eb2ec0 ("rtc: cmos: Fix event handler registration > > > > ordering issue") overlooked the fact that cmos_do_probe() depended > > > > on the preparations carried out by cmos_wake_setup() and the wake > > > > alarm stopped working after the ordering of them had been changed. > > > > > > > > [...] > > > > > > Applied, thanks! > > > > > > [1/1] rtc: rtc-cmos: Fix wake alarm breakage > > > commit: 0782b66ed2fbb035dda76111df0954515e417b24 > > > > Thank you! > > > > However, there is a build fix on top of this which has just been posted: > > > > https://lore.kernel.org/linux-acpi/2677035.mvXUDI8C0e@kreacher/ > > > > Sorry about breaking it again. > > I had that in rtc-fixes: > > https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git/commit/?h=rtc-fixes Looks good, thanks!
On Tue, Oct 18, 2022 at 06:09:31PM +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > Commit 4919d3eb2ec0 ("rtc: cmos: Fix event handler registration > ordering issue") overlooked the fact that cmos_do_probe() depended > on the preparations carried out by cmos_wake_setup() and the wake > alarm stopped working after the ordering of them had been changed. > > Address this by partially reverting commit 4919d3eb2ec0 so that > cmos_wake_setup() is called before cmos_do_probe() again and moving > the rtc_wake_setup() invocation from cmos_wake_setup() directly to the > callers of cmos_do_probe() where it will happen after a successful > completion of the latter. > > Fixes: 4919d3eb2ec0 ("rtc: cmos: Fix event handler registration ordering issue") > Reported-by: Zhang Rui <rui.zhang@intel.com> > Reported-by: Todd Brandt <todd.e.brandt@linux.intel.com> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Boot test that previously hit NULL pointer exceptions also completed successfully.
On Tue, 2022-10-18 at 18:38 +0200, Alexandre Belloni wrote: > On Tue, 18 Oct 2022 18:09:31 +0200, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > > > Commit 4919d3eb2ec0 ("rtc: cmos: Fix event handler registration > > ordering issue") overlooked the fact that cmos_do_probe() depended > > on the preparations carried out by cmos_wake_setup() and the wake > > alarm stopped working after the ordering of them had been changed. > > > > [...] > > Applied, thanks! I did testing yesterday on the 6.1.0-rc2 build and this patch hasn't made it into rc2. This is an extreme inconvenience to anyone testing low power modes as the rtc wakealarm doesn't function. I'm a little surprised more people haven't complained. Please get this in 6.1.0-rc3. > [1/1] rtc: rtc-cmos: Fix wake alarm breakage > commit: 0782b66ed2fbb035dda76111df0954515e417b24 > > Best regards, >
Index: linux-pm/drivers/rtc/rtc-cmos.c =================================================================== --- linux-pm.orig/drivers/rtc/rtc-cmos.c +++ linux-pm/drivers/rtc/rtc-cmos.c @@ -1233,6 +1233,9 @@ static u32 rtc_handler(void *context) static inline void rtc_wake_setup(struct device *dev) { + if (acpi_disabled) + return; + acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, dev); /* * After the RTC handler is installed, the Fixed_RTC event should @@ -1286,7 +1289,6 @@ static void cmos_wake_setup(struct devic use_acpi_alarm_quirks(); - rtc_wake_setup(dev); acpi_rtc_info.wake_on = rtc_wake_on; acpi_rtc_info.wake_off = rtc_wake_off; @@ -1354,6 +1356,8 @@ static int cmos_pnp_probe(struct pnp_dev { int irq, ret; + cmos_wake_setup(&pnp->dev); + if (pnp_port_start(pnp, 0) == 0x70 && !pnp_irq_valid(pnp, 0)) { irq = 0; #ifdef CONFIG_X86 @@ -1372,7 +1376,7 @@ static int cmos_pnp_probe(struct pnp_dev if (ret) return ret; - cmos_wake_setup(&pnp->dev); + rtc_wake_setup(&pnp->dev); return 0; } @@ -1461,6 +1465,7 @@ static int __init cmos_platform_probe(st int irq, ret; cmos_of_init(pdev); + cmos_wake_setup(&pdev->dev); if (RTC_IOMAPPED) resource = platform_get_resource(pdev, IORESOURCE_IO, 0); @@ -1474,7 +1479,7 @@ static int __init cmos_platform_probe(st if (ret) return ret; - cmos_wake_setup(&pdev->dev); + rtc_wake_setup(&pdev->dev); return 0; }