From: Tony Luck <tony.luck@intel.com>
To: Jeshua Smith <jeshuas@nvidia.com>
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
Date: Tue, 24 Oct 2023 08:24:21 -0700 [thread overview]
Message-ID: <ZTfhpRRA4bga0qSI@agluck-desk3> (raw)
In-Reply-To: <20230712223448.145079-1-jeshuas@nvidia.com>
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 <jeshuas@nvidia.com>
> +/* 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 <linux/bitfield.h> 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.luck@intel.com>
-Tony
next prev parent reply other threads:[~2023-10-24 15:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 22:34 [PATCH V2] ACPI: APEI: Use ERST timeout for slow devices Jeshua Smith
2023-08-04 15:55 ` Jeshua Smith
2023-08-04 16:31 ` Luck, Tony
2023-08-05 1:04 ` Jeshua Smith
2023-08-18 16:50 ` Jeshua Smith
2023-09-11 16:15 ` Jeshua Smith
2023-10-02 16:10 ` Jeshua Smith
2023-10-23 15:45 ` Jeshua Smith
2023-10-24 14:32 ` Rafael J. Wysocki
2023-10-24 15:27 ` Borislav Petkov
2023-10-25 14:09 ` Jeshua Smith
2023-10-25 14:22 ` Borislav Petkov
2023-10-24 15:24 ` Tony Luck [this message]
2023-10-24 18:51 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZTfhpRRA4bga0qSI@agluck-desk3 \
--to=tony.luck@intel.com \
--cc=bp@alien8.de \
--cc=gpiccoli@igalia.com \
--cc=james.morse@arm.com \
--cc=jeshuas@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=keescook@chromium.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=treding@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox