2010-11-02 20:08:38

by Vernon Mauery

[permalink] [raw]
Subject: [PATCH 0/2] 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.

Signed-off-by: Vernon Mauery <[email protected]>

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


2010-11-02 20:08:54

by Vernon Mauery

[permalink] [raw]
Subject: [PATCH 2/2] ibm_rtl: _RTL_ is not available in UEFI mode

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.

Signed-off-by: Vernon Mauery <[email protected]>
---
drivers/platform/x86/ibm_rtl.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c
index c5a0061..3cff0e5 100644
--- a/drivers/platform/x86/ibm_rtl.c
+++ b/drivers/platform/x86/ibm_rtl.c
@@ -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 */
--
1.7.1

2010-11-02 20:09:07

by Vernon Mauery

[permalink] [raw]
Subject: [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.

Signed-off-by: Vernon Mauery <[email protected]>
---
drivers/platform/x86/ibm_rtl.c | 29 +++++------------------------
1 files changed, 5 insertions(+), 24 deletions(-)

diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c
index 3c2c6b9..c5a0061 100644
--- a/drivers/platform/x86/ibm_rtl.c
+++ b/drivers/platform/x86/ibm_rtl.c
@@ -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"), \
+ }, \
+ },
{ }
};

--
1.7.1

2010-11-02 20:12:31

by Matthew Garrett

[permalink] [raw]
Subject: Re: [PATCH 0/2] ibm_rtl fixes

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.

--
Matthew Garrett | [email protected]

2010-11-02 20:18:27

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH -resend] ibm_rtl: fix printk format warning

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: [email protected]
Cc: Matthew Garrett <[email protected]>
---
drivers/platform/x86/ibm_rtl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20101022.orig/drivers/platform/x86/ibm_rtl.c
+++ linux-next-20101022/drivers/platform/x86/ibm_rtl.c
@@ -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);

2010-11-02 20:20:23

by Vernon Mauery

[permalink] [raw]
Subject: Re: [PATCH -resend] ibm_rtl: fix printk format warning

On 02-Nov-2010 01:17 PM, Randy Dunlap wrote:
>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: [email protected]
>Cc: Matthew Garrett <[email protected]>

Acked-by: Vernon Mauery <[email protected]>

--Vernon

>---
> drivers/platform/x86/ibm_rtl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>--- linux-next-20101022.orig/drivers/platform/x86/ibm_rtl.c
>+++ linux-next-20101022/drivers/platform/x86/ibm_rtl.c
>@@ -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);
>

2010-11-24 16:52:00

by Matthew Garrett

[permalink] [raw]
Subject: Re: [PATCH 1/2] ibm_rtl: Loosen the DMI criteria to all IBM machines

Applied both of these, thanks.

--
Matthew Garrett | [email protected]