Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2086668rda; Tue, 24 Oct 2023 11:52:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHX0mU7pPDeqgSt1FGAb2zFZmPDRCC5ka/mN4O1gAdY76JBd1D8y/XZyyOpPtrxpfzC0wD9 X-Received: by 2002:a05:6a20:1455:b0:152:6b63:f1e7 with SMTP id a21-20020a056a20145500b001526b63f1e7mr4025184pzi.1.1698173539900; Tue, 24 Oct 2023 11:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698173539; cv=none; d=google.com; s=arc-20160816; b=NyE5cHuP8rjx316gPGUyvF6jGdFpEkZOY9G8C2Hjmf+AtZAZNu89AqydWxMOoWJ4xv NbP6weZl/onLKiVdJm7bE1Uw/ojkoFTaQRArxT0wOzWg+lwMvbAlLMEaEDWtQk7yYDMO 2bnJooFXnv3ntzVMUe5gWpRvsoijkXEW25m8orYhqhMEyNI8+Jv3bjYUUpQBJRqRcnX/ KzrTwfWaRCLsmgZlMC5H8YAq8x/KGn2CEeWXZ/tqNcOxR8XtvGqse9m8Zg28IHpiO3sq 3063sKPtCHP8hmFmZTt26Z+r4sWb/SLQgkM56u/thS9nFLyXcHQdJCBOkc7eKUuRnTpc jd4Q== 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=fVHntZIzVds0rp1CrYxO02QMOZXUmZAkoiMrjvASs6Q=; fh=AhvcbrqYPbVQ3SpP/DvDC1+jJVMiBksfj1bFLDu2wwk=; b=ejhC1ZmKOKHWWrCkZd65e8CMfgvCo9PEenUvjjciirIxC2NhG/hY1SlfU9uGMuoR5v VMQUKPMMECA7zVY0g+HAsaqveJm6pQowt5bCBmlc9UfY9i1o2FRLtNv4Bzhmw3laCry0 +lB7yw5bARkd4fb+/ciWWwr7mf0r8c46Ojk/IMEZ2rGBGbA1iJRCnGcozE1p1ORZxXiY vdBtQfknp6fyQainCC2Wtj8bTs6teXur7Nqpb/RHQFmM+WuevIHlCJy+kac5gbrrJjpH chXbNKvwSd+ZEcj/Ja3Pbq/L5+vdparYdQ2rB0Vob3dNIyOHuwvlqVzFs1P+jn0WE2+h 14JA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id k62-20020a638441000000b005acd0dd0da0si8635389pgd.70.2023.10.24.11.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 11:52:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 83D528077839; Tue, 24 Oct 2023 11:52:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343825AbjJXSwL convert rfc822-to-8bit (ORCPT + 99 others); Tue, 24 Oct 2023 14:52:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232357AbjJXSwK (ORCPT ); Tue, 24 Oct 2023 14:52:10 -0400 Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C063BA6; Tue, 24 Oct 2023 11:52:08 -0700 (PDT) Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-1ea1742c1a5so1380458fac.0; Tue, 24 Oct 2023 11:52:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698173528; x=1698778328; 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=b47eW1W1ZA3iY9fGQWptMYQkO14e99bJy5u+/oy5i2Y=; b=aZEwBny9h18y3Sexpm1gP6WTOHnyV+grEkCz6WuZVsCCwZ2JVuDM/GR3oH2n2MVgMD LMBQCQfVWdV92nSSvAl2DZXuMIyxyToOV8EuiEVpohVVvZZQs0wIDl6ntkLK/jEWlva3 6IaMeyzOO0loI1COrMmRKa6SzTehfiZeOoRb9o6Blu6BNbO8iPIjX1rX81lZ2h/R6yQK /YtksuEUYxoJM3KCIaW9z55oPKD1O5F1Hy8XmzvOgSxXYD/hBxQjZLeZiUqdr5cRlDV6 sBWjeBgQgbHpak/qLLWZ+7+6fbhI+pbyo9zyEbPFDDSXtrif6mpxwrR9gEt0qt4GYXSt iVVA== X-Gm-Message-State: AOJu0Yw04wr7yV0HId29biuCd9JJWS9GVl7/RWdLVvMRccapd6clWVIQ gL4fvXGmmZnXr4XK5ctYVGhDuJt0pUTfNjcawZg= X-Received: by 2002:a05:6870:9a98:b0:1e9:9e04:1d24 with SMTP id hp24-20020a0568709a9800b001e99e041d24mr16645138oab.5.1698173528060; Tue, 24 Oct 2023 11:52:08 -0700 (PDT) MIME-Version: 1.0 References: <20230712223448.145079-1-jeshuas@nvidia.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 24 Oct 2023 20:51:57 +0200 Message-ID: Subject: Re: [PATCH V2] ACPI: APEI: Use ERST timeout for slow devices To: Tony Luck , Jeshua Smith Cc: keescook@chromium.org, gpiccoli@igalia.com, rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, bp@alien8.de, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, linux-tegra@vger.kernel.org, treding@nvidia.com, jonathanh@nvidia.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 24 Oct 2023 11:52:17 -0700 (PDT) On Tue, Oct 24, 2023 at 5:27 PM Tony Luck wrote: > > On Wed, Jul 12, 2023 at 10:34:48PM +0000, Jeshua Smith wrote: > > Slow devices such as flash may not meet the default 1ms timeout value, > > so use the ERST max execution time value that they provide as the > > timeout if it is larger. > > > > Signed-off-by: Jeshua Smith > > > +/* ERST Exec max timings */ > > +#define ERST_EXEC_TIMING_MAX_MASK 0xFFFFFFFF00000000 > > +#define ERST_EXEC_TIMING_MAX_SHIFT 32 > > I've recently become a fan of I think this would > be easier on the eyes as: > > #define ERST_EXEC_TIMING_MAX GENMASK_ULL(63, 32) > > > +static inline u64 erst_get_timeout(void) > > +{ > > + u64 timeout = FIRMWARE_TIMEOUT; > > + > > + if (erst_erange.attr & ERST_RANGE_SLOW) { > > + timeout = ((erst_erange.timings & ERST_EXEC_TIMING_MAX_MASK) >> > > + ERST_EXEC_TIMING_MAX_SHIFT) * NSEC_PER_MSEC; > > then this becomes: > > timeout = FIELD_GET(ERST_EXEC_TIMING_MAX, erst_erange.timings) * > NSEC_PER_MSEC; > > > + if (timeout < FIRMWARE_TIMEOUT) > > + timeout = FIRMWARE_TIMEOUT; > > But that's just a matter of style. Otherwise the patch looks fine. > > Reviewed-by: Tony Luck Applied as 6.7 material, thanks!