platform/x86: dell-smbios: Accumulate supported commands across 0xDA tables
PATCH 1/1 platform/x86: dell-smbios: Accumulate supported commands across 0xDA tables
parse_da_table() runs once for every SMBIOS 0xDA structure and assigns da_supported_commands from each one, so the last structure wins. Some systems expose several 0xDA structures where only some fill in supportedCmds. On a Dell Precision M4800 there are seven: the first six report 0x40361f5f and the last reports 0, which leaves da_supported_commands at 0.
As a result dell_smbios_call_filter() rejects every call made through /dev/wmi/dell-smbios, even token reads from root:
dell-smbios ...: invalid command, supported commands: 0x 0
dell-smbios ...: Invalid call 0/0: 5c
and dell_smbios_class_is_supported(CLASS_INFO) returns false, so dell-pc refuses to load.
OR the field across all 0xDA structures instead. With this change the token read succeeds and dell-pc registers its cool/quiet/balanced/ performance platform profiles on the M4800.
--- drivers/platform/x86/dell/dell-smbios-base.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/platform/x86/dell/dell-smbios-base.c +6 -1
@@ -406,7 +406,12 @@ static void __init parse_da_table(const struct dmi_header *dm)if (dm->length <17 )return ; - da_supported_commands = table->supportedCmds; +/* +* Systems may expose several 0xDA structures, and not all of them +* fill in supportedCmds, so accumulate rather than letting the last +* one win. +*/ + da_supported_commands |= table->supportedCmds; new_da_tokens = krealloc(da_tokens, (da_num_tokens + tokens) * sizeof(struct calling_interface_token),
Signature · 1 line
2.56.1
Am 11.11.26 um 22:44 schrieb Rosen Penev:
Quoted 13 lines
parse_da_table()runs once for every SMBIOS0xDAstructure and assignsda_supported_commandsfrom each one, so the last structure wins. Some systems expose several0xDAstructures where only some fill in supportedCmds. On a Dell Precision M4800 there are seven: the first six report0x40361f5fand the last reports 0, which leavesda_supported_commandsat 0.As a result
dell_smbios_call_filter()rejects every call made through/dev/wmi/dell-smbios, even token reads from root:dell-smbios ...: invalid command, supported commands: 0x 0
dell-smbios ...: Invalid call 0/0: 5c
Quoted 6 lines
and
dell_smbios_class_is_supported(CLASS_INFO)returns false, so dell-pc refuses to load.OR the field across all
0xDAstructures instead. With this change the token read succeeds and dell-pc registers its cool/quiet/balanced/ performance platform profiles on the M4800.
Quoted 24 lines
Fixes 1f8543a5d602 ("platform/x86: dell-smbios: Add filtering support")Signed-off-by Rosen Penev <[email protected]>--- drivers/platform/x86/dell/dell-smbios-base.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/platform/x86/dell/dell-smbios-base.c +6
-1@@ -406,7 +406,12 @@ static void __init parse_da_table(const struct dmi_header *dm)if (dm->length <17 )return ; - da_supported_commands = table->supportedCmds; +/* +* Systems may expose several 0xDA structures, and not all of them +* fill in supportedCmds, so accumulate rather than letting the last +* one win. +*/ + da_supported_commands |= table->supportedCmds; new_da_tokens = krealloc(da_tokens, (da_num_tokens + tokens) * sizeof(struct calling_interface_token),
Ilpo Järvinen
maintainerQuoted 8 lines · Rosen Penev
parse_da_table()runs once for every SMBIOS0xDAstructure and assignsda_supported_commandsfrom each one, so the last structure wins. Some systems expose several0xDAstructures where only some fill in supportedCmds. On a Dell Precision M4800 there are seven: the first six report0x40361f5fand the last reports 0, which leavesda_supported_commandsat 0.[...]
Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.
FYI [if applicable to your patch], as per Linus' policy change, also fixes are mostly routed through for-next unless the fix is for a commit introduced in the most recent cycle or is clearly a regression fix.
The list of commits applied:
[1/1] platform/x86: dell-smbios: Accumulate supported commands across 0xDA tables
commit: e0b520a508b254a17cd8937cf832bf4befaa8624
--
i.