[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] Dom0 ACPI: handle I/O access width that are not a multiple of 8 bits



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1221731055 -3600
# Node ID 5f3c40a4c21491b311b9837c0990ff833d4bf62b
# Parent  3161879fdf229fe9893e5dea7089aa0a926e86d0
Dom0 ACPI: handle I/O access width that are not a multiple of 8 bits

Back ported following patch from upstream to support 4-bit access
width which is required by T-state control.
Below are original commit comments from upstream.

commit 49fbabf56dc715bbb51e59742e82ba762790aac0
Author: Zhao Yakui <yakui.zhao@xxxxxxxxx>
Date:   Thu Nov 15 17:01:06 2007 +0800

    ACPI: Handle I/O access width requestst that are not a multiple of
    8 bits.

    We've run into BIOS that hand us 4-bit access width requests
    for T-state control when the code expected only multipls of
    8-bits.
    Round up.

    Signed-off-by: Zhao Yakui <yakui.zhao@xxxxxxxxx>
    Signed-off-by: Li Shaohua <shaohua.li@xxxxxxxxx>
    Signed-off-by: Len Brown <len.brown@xxxxxxxxx>

Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>
---
 drivers/acpi/osl.c |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)

diff -r 3161879fdf22 -r 5f3c40a4c214 drivers/acpi/osl.c
--- a/drivers/acpi/osl.c        Tue Sep 16 21:26:15 2008 +0900
+++ b/drivers/acpi/osl.c        Thu Sep 18 10:44:15 2008 +0100
@@ -337,17 +337,14 @@ acpi_status acpi_os_read_port(acpi_io_ad
        if (!value)
                value = &dummy;
 
-       switch (width) {
-       case 8:
+       *value = 0;
+       if (width <= 8) {
                *(u8 *) value = inb(port);
-               break;
-       case 16:
+       } else if (width <= 16) {
                *(u16 *) value = inw(port);
-               break;
-       case 32:
+       } else if (width <= 32) {
                *(u32 *) value = inl(port);
-               break;
-       default:
+       } else {
                BUG();
        }
 
@@ -358,17 +355,13 @@ EXPORT_SYMBOL(acpi_os_read_port);
 
 acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width)
 {
-       switch (width) {
-       case 8:
+       if (width <= 8) {
                outb(value, port);
-               break;
-       case 16:
+       } else if (width <= 16) {
                outw(value, port);
-               break;
-       case 32:
+       } else if (width <= 32) {
                outl(value, port);
-               break;
-       default:
+       } else {
                BUG();
        }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.