RE: [PATCH 2/3] platform/x86/intel/vsec: Fix inverted walk_header() test in get_features()

From: Ruhl, Michael J

Date: Fri Oct 02 2026 - 16:46:31 EST




>-----Original Message-----
>From: David E. Box <david.e.box@xxxxxxxxxxxxxxx>
>Sent: Thursday, October 1, 2026 6:04 PM
>To: ilpo.jarvinen@xxxxxxxxxxxxxxx; david.e.box@xxxxxxxxxxxxxxx; linux-
>kernel@xxxxxxxxxxxxxxx; platform-driver-x86@xxxxxxxxxxxxxxx; Vivi, Rodrigo
><rodrigo.vivi@xxxxxxxxx>; Ruhl, Michael J <michael.j.ruhl@xxxxxxxxx>; Siddiqui,
>Ayaz A <ayaz.siddiqui@xxxxxxxxx>; Muqthyar Ahmed, Syed Abdul
><syed.abdul.muqthyar.ahmed@xxxxxxxxx>; intel-xe@xxxxxxxxxxxxxxxxxxxxx;
>hansg@xxxxxxxxxx
>Cc: stable@xxxxxxxxxxxxxxx
>Subject: [PATCH 2/3] platform/x86/intel/vsec: Fix inverted walk_header() test
>in get_features()
>
>intel_vsec_walk_header() used to return a bool that was true when devices
>were found. It was converted to return 0 on success and a negative errno
>on failure, but the boolean test in intel_vsec_get_features() was left
>unchanged, so its meaning is now inverted.
>
>A successful walk returns 0 and leaves found set to false, while a failed
>walk returns an error that evaluates to true. When no other capabilities
>are present, intel_vsec_pci_init() then returns -ENODEV even though the
>auxiliary devices were created, and the driver core tears them back down.
>
>This affects platforms that have no DVSEC or VSEC capabilities and
>describe their features through device_data instead, which today means
>DG1. Test the return value for success explicitly.
>
>Fixes: a6ce8bf3c993 ("platform/x86/intel/vsec: Return real error codes from
>registration path")
>Cc: stable@xxxxxxxxxxxxxxx
>Assisted-by: LLM
>Signed-off-by: David E. Box <david.e.box@xxxxxxxxxxxxxxx>
>---
> drivers/platform/x86/intel/vsec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/platform/x86/intel/vsec.c
>b/drivers/platform/x86/intel/vsec.c
>index 5ab2215fdd7f..7d51f27f09bc 100644
>--- a/drivers/platform/x86/intel/vsec.c
>+++ b/drivers/platform/x86/intel/vsec.c
>@@ -641,7 +641,7 @@ static bool intel_vsec_get_features(struct pci_dev
>*pdev,
> found = true;
>
> if (info && (info->quirks & VSEC_QUIRK_NO_DVSEC) &&
>- intel_vsec_walk_header(&pdev->dev, info))
>+ !intel_vsec_walk_header(&pdev->dev, info))

Reviewed-by: Michael J. Ruhl <michael.j.ruhl@xxxxxxxxx>


m
> found = true;
>
> return found;
>--
>2.43.0