Re: [PATCH V3] ACPI: APEI: Use ERST timeout for slow devices

From: Borislav Petkov
Date: Sat Oct 28 2023 - 07:06:56 EST


On Fri, Oct 27, 2023 at 10:33:09PM +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 as the timeout if it is larger
> and if the ERST has the "slow" attribute set.
>
> Example:
> A NOR flash spec lists "Page program time (256 bytes)" as 120us typical,
> and 1800us max. A 32KB error log would be (32K/256) = 128 nor-flash
> pages. Writing those 128 nor-flash pages would then take
> 120us * 128 = 15ms typical, or 1800us * 128 = 230.4ms max.
>
> Without this change, when pstore calls APEI's ERST code to write a 32KB
> error log to the NOR flash in the example, the code will flag a timeout
> after 1ms and return an error to pstore. With this change, unless the
> max time value from the ERST table is exceeded, the code will not flag a
> timeout and will return success to pstore after the operation completes.
>
> Signed-off-by: Jeshua Smith <jeshuas@xxxxxxxxxx>
> ---

Reviewed-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette