Re: [RFC PATCH 3/3] x86/cpu/amd: Fetch S5_RESET_STATUS from PHAT when supported

K Prateek Nayak <[email protected]> Fri, 5 Jun 2026 09:40:14 +0530
Newsgroups dev.linux.lists.acpica-devel,org.kernel.vger.linux-acpi,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hello Mario,

On 6/3/2026 7:56 PM, Mario Limonciello wrote:
>> +    record = (void *)acpi_phat_get_vendor_reset_reason(&guid);
>> +    if (!IS_ERR(record)) {
>> +        bool record_valid = false;
>> +
>> +        /* Sanity check before using the parsed record. */
>> +        if (record->header.length == sizeof(*record)) {
> 
> Why not do this sanity check in acpi_phat_get_vendor_reset_reason()
> directly?  Then we can always assume if something is returned it's
> valid and it's simpler here (and any other potential callers in future).

My intention here was to catch any changes to the PHAT record format
for this GUID. If we can reasonably assume that isn't going to happen,
we can skip this check entirely.

-- 
Thanks and Regards,
Prateek