Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp77098rwd; Mon, 12 Jun 2023 10:17:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/chZ3ZdauIT/YoP8oXH02JmYq4xrj4uHp4ohq0/Z3pNywVuzNQFBxDzy1jdRDeVLiVkJc X-Received: by 2002:a05:6a20:c18c:b0:117:6b17:104b with SMTP id bg12-20020a056a20c18c00b001176b17104bmr9517816pzb.20.1686590273164; Mon, 12 Jun 2023 10:17:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686590273; cv=none; d=google.com; s=arc-20160816; b=Fby8FFjxhHCpJD/F3c9veh8+mACuSycNf+2wCIKkjg8tB/xzGpe86zxKKVkki+aXCa UvY1ShguGILWAp57K/GxFGxD0tuYH3r5PDa5EB36kNLO379CCVlrV57VXKogDvMtjAUR u97/FAXO5797sKKzUCB/Lc11UaXYzrnykIV69WkCbdq6j5V5dXon/Ok4beobNmV336SS Sv5vpMUviEkpLVkLO/50TDKkgR50kLVdKul+vxNg6Jpjxzd/Q+2sl5vBTQpwxMtM7iOF 7/cdEQd3NRcG/F+EUwoGjMN9p46tqrfsegjxkVXJAaaW/+HTPDt4ZPi1VA31Slgdffzz 87zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=+P6smxK3VbU8P2BcNCnkj1w/C6NpV4oOP4rcptcsNQk=; b=RIPXawoXKLNrpruyaH/80TRQbvjvlZXpjybnbucY/fJD1misRT5hGy8JW82HzujC26 F5wV0yhOU8qGcs5pYDId5xVqUtWhXwoUlHabPoX5Qapqet3JliOdheZBEzkFR8trfwAY FU48An5uEaER30CcuaMgtu59vAmCC+p2g4lqjF266qBIczY5LzCJKOLOdfcWcxfcGA1L kKgOCHVT6SxrjVoahg4pR6EJwjK+4rJEiXCndwvPWDsqSTlw1qaPCCbPE/YIH3WZJmZ5 hp64VUd0mOGOp5lvd59fm5ixKTeQ7Bxck4U8cD8pBV4Z3NUFVSWSrly6iqgO80iNZeqE /Mqw== 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 a185-20020a6390c2000000b0053f25333ab6si7038734pge.450.2023.06.12.10.17.39; Mon, 12 Jun 2023 10:17:53 -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 S231175AbjFLQ5Q convert rfc822-to-8bit (ORCPT + 99 others); Mon, 12 Jun 2023 12:57:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjFLQ5P (ORCPT ); Mon, 12 Jun 2023 12:57:15 -0400 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DDD619C; Mon, 12 Jun 2023 09:57:14 -0700 (PDT) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-3f7364c2ed8so11397445e9.0; Mon, 12 Jun 2023 09:57:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686589032; x=1689181032; h=content-transfer-encoding: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=/fdthmW3uN8vm/z0fYcR0kZV9BTQdLtqnyjec8VowSA=; b=F8kPyM0WZj95oRzQx1yfLfDmF+pzHFQlKysPiMf6SUyd7ylmznWuLLqNNE7oj9susr OhEZBxV9uxpe2ZyrTFJDSKwx3iWcCX9akdoFvLHiO6gNyNEATb83eKqe+dAES3Sq9ztV JKyP2G+DYdhIGkJgWFYCbgTFPGop8TrkJDzKuqnUl5VolY4cKJo0kxtUcqCH8Ly3dro6 YEiNpgpQCPnvhK/srnkkMH129ln2Xov4im+ecLuIjDxkNumLvlP+5N2ZWTCy+CYsbvze Q0gvukLUILEvqxw90/z1kuJfdkg+G3YNWxWMhYxD1Rhb3rwjYzVTAjCsq01EQV3ayDQu cqxw== X-Gm-Message-State: AC+VfDxHHvKnNqkR4dYCr/CCoKgRx1la1K55NNtT5QXoYfY0q8JSIJCT N+f44BiRdvvna6sYrdtz0+WYJQwNeO5GQi+Ythu7+LVK X-Received: by 2002:adf:e9d2:0:b0:30c:fdac:ef57 with SMTP id l18-20020adfe9d2000000b0030cfdacef57mr6152290wrn.0.1686589032388; Mon, 12 Jun 2023 09:57:12 -0700 (PDT) MIME-Version: 1.0 References: <20230607034403.2885-1-james.liu@hpe.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Mon, 12 Jun 2023 18:57:01 +0200 Message-ID: Subject: Re: [PATCH v1] ACPI: reboot: Increase the delay to avoid racing after writing to ACPI RESET_REG on AMD Milan platforms. To: James Liu Cc: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, mlangsdo@redhat.com, craig.lamparter@hpe.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT 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, T_SCC_BODY_TEXT_LINE 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 On Thu, Jun 8, 2023 at 11:14 AM James Liu wrote: > > On Wed, Jun 07, 2023 at 01:19:42PM +0200, Rafael J. Wysocki wrote: > > On Wed, Jun 7, 2023 at 5:44 AM James Liu wrote: > > > > > > For AMD Milan platforms, the delay of 15ms is insufficient to avoid racing > > > of reboot mechanisms. That said, the AMD Milan processors don't reboot > > > in 15ms after invoking acpi_reset(). > > > > > > The proposed 50ms delay can effectively work around this issue. > > > This extended delay aligns better with ACPI v6.4 (i.e., sec. 4.8.4.6), > > > which indicates that ideally OSPM should execute spin loops on the CPUs > > > in the system following a write to this register. > > > > > > Signed-off-by: James Liu > > > > Why do you want to affect everyone (including guest kernels running in > > virtual machines AFAICS) in order to address a problem specific to one > > platform? > > I hoped to address this issue for any platform requiring a longer delay to > complete ACPI reset in time for any (maybe silicon-level) reasons. Some AMD Milan > platforms were the cases that we've found so far. Do you know about any other? > Except that, since ACPI spec indicates there should be a spin loop (long enough) > after the write instruction to Reset Register, I thought it should be no harms to > the other systems which well consider this spin loop when they claim to support > ACPI reboot. > > Btw, I am just curious, why is the virtual machine mentioned here? The new delay would be over 3 times larger, so some users might be surprised by it at least potentially. > is the 50ms delay in acpi_reboot() for a guest OS on VM so long that some > unexpected behavior might happen? > > > Wouldn't it be better to quirk that platform and document the quirk properly? > > Yeah, it could be. Actually we considered this, and we will consider it again. > > > > --- > > > drivers/acpi/reboot.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/acpi/reboot.c b/drivers/acpi/reboot.c > > > index b79b7c99c237..002f7c7814a1 100644 > > > --- a/drivers/acpi/reboot.c > > > +++ b/drivers/acpi/reboot.c > > > @@ -78,5 +78,5 @@ void acpi_reboot(void) > > > * The 15ms delay has been found to be long enough for the system > > > * to reboot on the affected platforms. > > > */ > > > - mdelay(15); > > > + mdelay(50); > > > } > > > --