ibm_rtl fixes
cover ibm_rtl fixes
This pair of patches address two issues that were brought to my attention. The first is to remove the need for constantly updating the driver whenever a new machine with this capability is added. The second fixes a bug when run on a machine in UEFI mode.
--Vernon
ibm_rtl: Loosen the DMI criteria to all IBM machinesibm_rtl: _RTL_ is not available in UEFI mode
ibm_rtl.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-)
PATCH 1/2 ibm_rtl: Loosen the DMI criteria to all IBM machines
Allow all IBM machines to pass the DMI check so that we don't have to add them one by one to the driver. Any IBM machine that has the _RTL_ table in the EBDA will work.
--- drivers/platform/x86/ibm_rtl.c | 29 +++++------------------------ 1 files changed, 5 insertions(+), 24 deletions(-)
drivers/platform/x86/ibm_rtl.c +5 -24
@@ -220,32 +220,13 @@ static void rtl_teardown_sysfs(void) {sysdev_class_unregister (&class_rtl); } -static int dmi_check_cb (const struct dmi_system_id *id) -{ -RTL_DEBUG ("found IBM server '%s'\n" , id->ident); -return 0 ; -} - -#define ibm_dmi_entry (NAME ,TYPE ) \ -{ \ - .ident = NAME, \ - .matches = { \ - DMI_MATCH(DMI_SYS_VENDOR, "IBM"), \ - DMI_MATCH(DMI_PRODUCT_NAME, TYPE), \ - }, \ - .callback = dmi_check_cb \ -}static struct dmi_system_id __initdata ibm_rtl_dmi_table[] = { -ibm_dmi_entry ("BladeCenter LS21" ,"7971" ), -ibm_dmi_entry ("BladeCenter LS22" ,"7901" ), -ibm_dmi_entry ("BladeCenter HS21 XM" ,"7995" ), -ibm_dmi_entry ("BladeCenter HS22" ,"7870" ), -ibm_dmi_entry ("BladeCenter HS22V" ,"7871" ), -ibm_dmi_entry ("System x3550 M2" ,"7946" ), -ibm_dmi_entry ("System x3650 M2" ,"7947" ), -ibm_dmi_entry ("System x3550 M3" ,"7944" ), -ibm_dmi_entry ("System x3650 M3" ,"7945" ), + { \ + .matches = { \ +DMI_MATCH (DMI_SYS_VENDOR ,"IBM" ), \ + }, \ + }, { } };
Signature · 1 line
1.7.1
Matthew Garrett
AppliedRe: [PATCH 1/2] ibm_rtl: Loosen the DMI criteria to all IBM machines
Applied both of these, thanks.
Signature · 1 line
Matthew Garrett | [email protected]
PATCH 2/2 ibm_rtl: _RTL_ is not available in UEFI mode
In reply to Vernon MauerySome of the IBM servers that are supported by ibm_rtl can run in both Legacy mode (BIOS) and in UEFI mode. When running in UEFI mode, it is possible that the EBDA table exists but cannot be mapped and reports errors. We need to make sure that by default we don't try to probe the machines if they are running in UEFI mode.
--- drivers/platform/x86/ibm_rtl.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/platform/x86/ibm_rtl.c +2 -1
@@ -28,6 +28,7 @@#include <linux/io.h> #include <linux/sysdev.h> #include <linux/dmi.h> +#include <linux/efi.h> #include <linux/mutex.h> #include <asm/bios_ebda.h>
@@ -238,7 +239,7 @@ static int __init ibm_rtl_init(void) {if (force)pr_warning ("ibm-rtl: module loaded by force\n" );/* first ensure that we are running on IBM HW */ -else if (!dmi_check_system (ibm_rtl_dmi_table)) +else if (efi_enabled || !dmi_check_system (ibm_rtl_dmi_table))return -ENODEV ;/* Get the address for the Extended BIOS Data Area */
Signature · 1 line
1.7.1
I'll queue these up to be merged, but I'm going to have spotty availability for the next couple of weeks - so if you don't hear anything, don't panic and I'll catch up once I'm back.
Signature · 1 line
Matthew Garrett | [email protected]
PATCH 1/1 ibm_rtl: fix printk format warning
In reply to Vernon MaueryFrom: Randy Dunlap <[email protected]>
Fix printk format warning:
drivers/platform/x86/ibm_rtl.c:305:warning: format '%#llx' expects type 'long long unsigned int', but argument 2 has type 'phys_addr_t'
--- drivers/platform/x86/ibm_rtl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/ibm_rtl.c +1 -1
@@ -302,7 +302,7 @@ static int __init ibm_rtl_init(void) {RTL_DEBUG ("rtl_cmd_width = %u, rtl_cmd_type = %u\n" , rtl_cmd_width, rtl_cmd_type); addr =ioread32 (&rtl_table->cmd_port_address); -RTL_DEBUG ("addr = %#llx\n" , addr); +RTL_DEBUG ("addr = %#llx\n" , (unsigned long long )addr); plen = rtl_cmd_width/sizeof (char ); rtl_cmd_addr =rtl_port_map (addr, plen);RTL_DEBUG ("rtl_cmd_addr = %#llx\n" , (u64 )rtl_cmd_addr);
Re: [PATCH -resend] ibm_rtl: fix printk format warning
Quoted 11 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
Fix printk format warning:
drivers/platform/x86/ibm_rtl.c:305:warning: format '%#llx' expects type 'long long unsigned int', but argument 2 has type '
phys_addr_t'Signed-off-by Randy Dunlap <[email protected]>Cc Keith Mannthey <[email protected]>Cc Vernon Mauery <[email protected]>Cc Matthew Garrett <[email protected]>
--Vernon
Quoted 16 lines
---
drivers/platform/x86/ibm_rtl.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/platform/x86/ibm_rtl.c +1
-1@@ -302,7 +302,7 @@ static int __init ibm_rtl_init(void) {RTL_DEBUG ("rtl_cmd_width = %u, rtl_cmd_type = %u\n" , rtl_cmd_width, rtl_cmd_type); addr =ioread32 (&rtl_table->cmd_port_address); -RTL_DEBUG ("addr = %#llx\n" , addr); +RTL_DEBUG ("addr = %#llx\n" , (unsigned long long )addr); plen = rtl_cmd_width/sizeof (char ); rtl_cmd_addr =rtl_port_map (addr, plen);RTL_DEBUG ("rtl_cmd_addr = %#llx\n" , (u64 )rtl_cmd_addr);