Skip to contentSkip to conversation

ibm_rtl fixes

PATCH Applied Vernon Mauery 3 participants 7 messages Nov 2, 2010 – Nov 24, 2010 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

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 machines
ibm_rtl: _RTL_ is not available in UEFI mode

 ibm_rtl.c |   32 +++++++-------------------------
 1 file changed, 7 insertions(+), 25 deletions(-)
#1 lore raw

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
index 3c2c6b9..c5a0061 100644
@@ -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
#2 lore raw

Re: [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]
#3 lore raw

PATCH 2/2 ibm_rtl: _RTL_ is not available in UEFI mode

In reply to Vernon Mauery

Some 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
index c5a0061..3cff0e5 100644
@@ -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
#5 lore raw

PATCH 1/1 ibm_rtl: fix printk format warning

In reply to Vernon Mauery

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'

Cc Keith Mannthey <[email protected]>
Cc Vernon Mauery <[email protected]>
Cc Matthew Garrett <[email protected]>
---
 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);
author Acked-by on v1 1/1
#6 lore raw

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'

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);