Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1967443rda; Tue, 24 Oct 2023 08:28:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqDPMPEkR1GTBtzU7hnUc2rZ4LPB5iWH8/yPSGgfAnqEG7tttoWqaTV2+gceXfyTBY3Tbp X-Received: by 2002:a05:6a00:189c:b0:6bd:254a:8876 with SMTP id x28-20020a056a00189c00b006bd254a8876mr11885816pfh.23.1698161291193; Tue, 24 Oct 2023 08:28:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698161291; cv=none; d=google.com; s=arc-20160816; b=EiW1ag6P9O2aQJLuVHYOkRBiqP9+s0jN5s9o8khMso3OasDlaVCiB7upnJ+NQr/UGe UhF9jtRBtbnFhGrRBAVWaCo5UQBUypXypmODopyMVajV/wyVSuC7EljRBQCotCwwNRI+ iIl5ledUYNXYsP2UMScy4CNwDU3soTugwcHfQayl0UtDSWjPIyY/ZjMivGAxAfesvfDh t/GbKNEqJFRK4ePSMh/h9ZMEp7uc5L05cFh4Dpme4P21xnydNy9I/Kw2NIWZR8JpR69C Gu8bgKRvvYjk65FobGFPETC6ACeFJRn3ZFADMUcMkxhDJ1sn9svahE+BhYdYvFR7obGq m2fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1gDE8fEGaowpskauImMdHS3Q6XEvK1wRGoWWMlRP2yc=; fh=vdZv/rBRj0l1DtzIfwvI8L1HZI8wfJa3Ru/hOkSV7So=; b=czELrD2tGuJAX2KeDZ9JGjEsdu7QJPq08eMxX0nbQwnA09gl2+uBIxv6LkmksolPHz dTrwCxcss8Afmwxef/rL4quAs2mxSJqJ6wu+Z8mB7WtyImK5YgaSgjxJ+hwFig2BRglZ i+sluzC5zVLOnsExf6tK7FzBu5jjmCwcMfwRTXwoYcXvPDDHIz+X+S1f4xhZNtc7kQ+Y PZLgle9jHm/K4nL8QH1D27aCQKJ1XlIR12F3mMg4F1w9wJV01BMIDVV8ZV+asBPlrflU eK0vJa+qsNm+eE5SsDDgS4QE0Gn3QJf2z5twCt7yCZubFOGKFEsN8N8mRsHx7d/FtK5b 9Oeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cRyadCB2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id s29-20020a63925d000000b005b8555564e2si8230461pgn.565.2023.10.24.08.28.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 08:28:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cRyadCB2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id B622F802BD4E; Tue, 24 Oct 2023 08:28:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234948AbjJXP16 (ORCPT + 99 others); Tue, 24 Oct 2023 11:27:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234953AbjJXP1t (ORCPT ); Tue, 24 Oct 2023 11:27:49 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9CEB1703; Tue, 24 Oct 2023 08:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698161267; x=1729697267; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=QFA2DdN62232OLAj/aEsT34+urZDgALMxgXqOKHV1s0=; b=cRyadCB2+L3BzeZ1iEy/80ZlB/UiecLmryAiLohfbzlO1QmQuDKNQbww jyfuhMkdCEVDd4IjqEMMlAhSHszPtVa5PtjbpfhO+7glxkIMug41CQ24Q oAmSr9IpAR49Ngw7Fx99WoJqG0Q6tu/yhGgluhBHhU/bBt/A5J7bscWnL 4WS2RNFC8Eo7HVurbuJW7adgmpMhlEv4GReeZTnhWC89sOy0QLU8ftSS/ RzsrlQe3CKNotq17bpAQB6CM9xhIyqCz+jYVSH0E44+YSZ6Pc+Sl3A1If Ag5HTL9YLxi4WlQlJJ+ZGT+2ghI4RVEpD1q2y/Nh03Nk/+qbOL6ZOx9V5 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10873"; a="451317466" X-IronPort-AV: E=Sophos;i="6.03,248,1694761200"; d="scan'208";a="451317466" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 08:24:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10873"; a="762127871" X-IronPort-AV: E=Sophos;i="6.03,248,1694761200"; d="scan'208";a="762127871" Received: from agluck-desk3.sc.intel.com (HELO agluck-desk3) ([172.25.222.74]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 08:24:22 -0700 Date: Tue, 24 Oct 2023 08:24:21 -0700 From: Tony Luck To: 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 Subject: Re: [PATCH V2] ACPI: APEI: Use ERST timeout for slow devices Message-ID: References: <20230712223448.145079-1-jeshuas@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230712223448.145079-1-jeshuas@nvidia.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 morse.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 (morse.vger.email [0.0.0.0]); Tue, 24 Oct 2023 08:28:08 -0700 (PDT) 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 -Tony