Skip to content

Commit 8fdf0df

Browse files
committed
platform/x86: panasonic-laptop: Allocate 1 entry extra in the sinf array
JIRA: https://issues.redhat.com/browse/RHEL-55365 commit 33297ce Author: Hans de Goede <hdegoede@redhat.com> Date: Mon Sep 9 13:32:26 2024 +0200 platform/x86: panasonic-laptop: Allocate 1 entry extra in the sinf array Some DSDT-s have an off-by-one bug where the SINF package count is one higher than the SQTY reported value, allocate 1 entry extra. Also make the SQTY <-> SINF package count mismatch error more verbose to help debugging similar issues in the future. This fixes the panasonic-laptop driver failing to probe() on some devices with the following errors: [ 3.958887] SQTY reports bad SINF length SQTY: 37 SINF-pkg-count: 38 [ 3.958892] Couldn't retrieve BIOS data [ 3.983685] Panasonic Laptop Support - With Macros: probe of MAT0019:00 failed with error -5 Fixes: 709ee53 ("panasonic-laptop: add Panasonic Let's Note laptop extras driver v0.94") Cc: stable@vger.kernel.org Tested-by: James Harmison <jharmison@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20240909113227.254470-2-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: David Arcari <darcari@redhat.com>
1 parent e402608 commit 8fdf0df

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/platform/x86/panasonic-laptop.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc)
337337
}
338338

339339
if (pcc->num_sifr < hkey->package.count) {
340-
pr_err("SQTY reports bad SINF length\n");
340+
pr_err("SQTY reports bad SINF length SQTY: %lu SINF-pkg-count: %u\n",
341+
pcc->num_sifr, hkey->package.count);
341342
status = AE_ERROR;
342343
goto end;
343344
}
@@ -994,6 +995,12 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
994995
return -ENODEV;
995996
}
996997

998+
/*
999+
* Some DSDT-s have an off-by-one bug where the SINF package count is
1000+
* one higher than the SQTY reported value, allocate 1 entry extra.
1001+
*/
1002+
num_sifr++;
1003+
9971004
pcc = kzalloc(sizeof(struct pcc_acpi), GFP_KERNEL);
9981005
if (!pcc) {
9991006
pr_err("Couldn't allocate mem for pcc");

0 commit comments

Comments
 (0)