Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1142374rwi; Mon, 10 Oct 2022 11:49:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5twI+K9l+oTh2kK/TF7k2YnxIOSbL2bZqHzbFAvKR+mxF+Kn59BBSmQu2AyZMhkvnT35WP X-Received: by 2002:a05:6402:190e:b0:45c:26f0:536 with SMTP id e14-20020a056402190e00b0045c26f00536mr4967550edz.44.1665427754564; Mon, 10 Oct 2022 11:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665427754; cv=none; d=google.com; s=arc-20160816; b=Xw08/jp9HdPLSmltYTRiS6XOKjm73ZYUqNJXh97piWrl00Y+UWG6hzcW7v68yrlptz a/BgKnRYXpCsUxclZK0Fm5cVbTLqVSOB6Z9NIYumcmqgcK1jJ3WgaBSOmEmXiA+s8Cc4 X9z/ohZgoDslQWXkJit8Hxy79I3XSp/PS61K6Pm2V+kCucte5MDaATOucWsv2i6CprDU Le9hdpjyc0R0xwtbK7Wyf6GA3O2PFV24aXLNZJhqpFgIWwEiVM1hwnyPujDGxpUYF7PR z6ay2acO8AH2O9B7GDH32EkuOjZrUy5+NK7klrJOaKhERdeuY7z4/ZYhMYBwyfeb0e4z Yapg== 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=EOsBZkjdrgM0kxNA6WQpV8zyME75lDOA7Zb6ef0+bSc=; b=sbSQWPJyipwvJHudkzApu5lsvW3wCC0HUjh8L98nZ8GMtT+Fxsy08c5uYe8PtxWGFE sUaQZY1UA3udzqNX49UC0uQIwnlG17Wj8C//pjFoIIyw8t47/SjLMCk1I0nR7tNn+agW yQETIwc9kX8yFIJN0isgKI79OYmNi/oxJxeeqI5CXzueb7EsYSHGknajembeMnlFqAu1 yU1kWgSjmz3aNudKCwWm/tUID9CH0TaKOiO5dtq3UK2OimQFJHJSL6VvDtb0af2LOxKl lmnbkEtMvirnxQhR8zdApUDJkJOi9KOb/MXYt9t36q4/7/345OcnVLk/SlqbgZYxiU9h 8MZQ== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga16-20020a1709070c1000b007815a44de91si12679131ejc.771.2022.10.10.11.48.48; Mon, 10 Oct 2022 11:49:14 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229545AbiJJS3V (ORCPT + 99 others); Mon, 10 Oct 2022 14:29:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbiJJS3T (ORCPT ); Mon, 10 Oct 2022 14:29:19 -0400 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDB9F74DC3; Mon, 10 Oct 2022 11:29:18 -0700 (PDT) Received: by mail-qk1-f173.google.com with SMTP id x13so4632083qkg.11; Mon, 10 Oct 2022 11:29:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EOsBZkjdrgM0kxNA6WQpV8zyME75lDOA7Zb6ef0+bSc=; b=n0bpyrpymFAVNlIjLCwU2e3RnGzG/hPkeo+EUa8TbNCgcBk1z9i0E5CVYvVT51cIO2 HKpT5IUByyGbF7OLqmOrhcoNYTVkeaUDN8eVEoretGpkqXj8Eiz7+w3GMGDtjwchv674 L5fBUUEHzUc90UYDkro9fkTBAcEfdzcVZyY+O+/mOdskhlSvLwQTphZ8kzmOMlStO15y UJCmW7E4/Z7jgSVzMt8cdHdtkV4Zj8nP2LFXQrtaOldHe42vBpysZoGAazW83z2t2LCL WOSAmzon5bz9G2TmTILCrXODHFJXgK8oKS+8J/EsO9qSZFn7B/pFL0Tvwp4ahLc2xvCQ ysBw== X-Gm-Message-State: ACrzQf1NGtUFBdQG5NoZUhmUdyyMzTcqTahxaEvHbDlPabbWsoU/kQeP +Ow0KqG/RoVOn/SKoQUKHh+Z30WUUxkkLCbtrvoOxb1wNII= X-Received: by 2002:ae9:e50e:0:b0:6e0:c985:6383 with SMTP id w14-20020ae9e50e000000b006e0c9856383mr13693142qkf.505.1665426558041; Mon, 10 Oct 2022 11:29:18 -0700 (PDT) MIME-Version: 1.0 References: <20221010141630.zfzi7mk7zvnmclzy@techsingularity.net> <20221010174526.3yi7nziokwwpr63s@techsingularity.net> In-Reply-To: <20221010174526.3yi7nziokwwpr63s@techsingularity.net> From: "Rafael J. Wysocki" Date: Mon, 10 Oct 2022 20:29:05 +0200 Message-ID: Subject: Re: Intermittent boot failure after 6492fed7d8c9 (v6.0-rc1) To: Mel Gorman Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , linux-rtc@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: multipart/mixed; boundary="00000000000064876605eab25638" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org --00000000000064876605eab25638 Content-Type: text/plain; charset="UTF-8" On Mon, Oct 10, 2022 at 7:50 PM Mel Gorman wrote: > > On Mon, Oct 10, 2022 at 04:47:50PM +0200, Rafael J. Wysocki wrote: > > Hi Mel, > > > > Thanks for the report! > > > > On Mon, Oct 10, 2022 at 4:25 PM Mel Gorman wrote: > > > > > > Hi Rafael, > > > > > > I'm seeing intermittent boot failures after 6492fed7d8c9 ("rtc: rtc-cmos: > > > Do not check ACPI_FADT_LOW_POWER_S0") due to a NULL pointer exception > > > early in boot. It fails to boot 5 times after 10 boot attempts and I've > > > only observed it on one machine so far. Either a revert or the patch below > > > fixes it but it's unlikely it is the correct fix. > > > > > > --- drivers/rtc/rtc-cmos.c.orig 2022-10-10 15:11:50.335756567 +0200 > > > +++ drivers/rtc/rtc-cmos.c 2022-10-10 15:11:53.211756691 +0200 > > > @@ -1209,7 +1209,7 @@ > > > * Or else, ACPI SCI is enabled during suspend/resume only, > > > * update rtc irq in that case. > > > */ > > > - if (cmos_use_acpi_alarm()) > > > + if (cmos_use_acpi_alarm() && cmos) > > > cmos_interrupt(0, (void *)cmos->rtc); > > > else { > > > /* Fix me: can we use cmos_interrupt() here as well? */ > > > > It looks like I've exposed a race condition there. > > > > Generally speaking, it is misguided to install an event handler that > > is not ready to handle the event at that time before making sure that > > the event is disabled. > > > > Does the attached patch help? > > > > It failed 3/10 times. This is still not acceptable. > That's less than the previous 5/10 failures but I > cannot be certain it helped without running a lot more boot tests. The > failure happens in the same function as before. I've overlooked the fact that acpi_install_fixed_event_handler() enables the event on success, so it is a bug to call it when the handler is not ready. It should help to only enable the event after running cmos_do_probe() where the driver data pointer is set, so please try the attached patch. --00000000000064876605eab25638 Content-Type: text/x-patch; charset="US-ASCII"; name="rtc-handler-wake-setup-debug.patch" Content-Disposition: attachment; filename="rtc-handler-wake-setup-debug.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l933xoba0 LS0tCiBkcml2ZXJzL3J0Yy9ydGMtY21vcy5jIHwgICAyNCArKysrKysrKysrKysrKysrKystLS0t LS0KIDEgZmlsZSBjaGFuZ2VkLCAxOCBpbnNlcnRpb25zKCspLCA2IGRlbGV0aW9ucygtKQoKSW5k ZXg6IGxpbnV4LXBtL2RyaXZlcnMvcnRjL3J0Yy1jbW9zLmMKPT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gbGludXgt cG0ub3JpZy9kcml2ZXJzL3J0Yy9ydGMtY21vcy5jCisrKyBsaW51eC1wbS9kcml2ZXJzL3J0Yy9y dGMtY21vcy5jCkBAIC0xMzUyLDcgKzEzNTIsNyBAQCBzdGF0aWMgdm9pZCBjbW9zX2NoZWNrX2Fj cGlfcnRjX3N0YXR1cyhzCiAKIHN0YXRpYyBpbnQgY21vc19wbnBfcHJvYmUoc3RydWN0IHBucF9k ZXYgKnBucCwgY29uc3Qgc3RydWN0IHBucF9kZXZpY2VfaWQgKmlkKQogewotCWNtb3Nfd2FrZV9z ZXR1cCgmcG5wLT5kZXYpOworCWludCByZXQ7CiAKIAlpZiAocG5wX3BvcnRfc3RhcnQocG5wLCAw KSA9PSAweDcwICYmICFwbnBfaXJxX3ZhbGlkKHBucCwgMCkpIHsKIAkJdW5zaWduZWQgaW50IGly cSA9IDA7CkBAIC0xMzY0LDEzICsxMzY0LDIwIEBAIHN0YXRpYyBpbnQgY21vc19wbnBfcHJvYmUo c3RydWN0IHBucF9kZXYKIAkJaWYgKG5yX2xlZ2FjeV9pcnFzKCkpCiAJCQlpcnEgPSBSVENfSVJR OwogI2VuZGlmCi0JCXJldHVybiB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