All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Restore reboot quirks by DMI, fix reboot on a number of systems
@ 2013-06-11 14:09 Ben Guthro
  2013-06-11 15:59 ` George Dunlap
  2013-06-21 10:34 ` [PATCH v2] " Jan Beulich
  0 siblings, 2 replies; 9+ messages in thread
From: Ben Guthro @ 2013-06-11 14:09 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Ben Guthro

The following patch ports the functionality following changeset from linux (from 2008) to xen:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=14d7ca5c
It implements an additional reboot quirk to do a PCI reset via port CF9.

This also restores some code dropped in the x86_32 target removal (changeset
5d1181a5ea5e0f11d481a94b16ed00d883f9726e) which sets some quirks based on DMI matching.

This will add reboot quirks on the following systems that are known to be necessary on linux:

    Dell E520
    Dell PowerEdge 1300
    Dell PowerEdge 300
    Dell OptiPlex 745
    Dell OptiPlex 745
    Dell OptiPlex 745
    Dell OptiPlex 330
    Dell OptiPlex 360
    Dell OptiPlex 760
    Dell PowerEdge 2400
    Dell Precision T5400
    Dell Precision T7400
    HP Compaq Laptop
    Dell XPS710
    Dell DXP061
    Sony VGN-Z540N
    ASUS P4S800
    Acer Aspire One A110
    Apple MacBook5
    Apple MacBookPro5
    Apple Macmini3,1
    Apple iMac9,1
    Dell Latitude E6320
    Dell Latitude E5420
    Dell Latitude E6220
    Dell Latitude E6420
    Dell OptiPlex 990
    Dell OptiPlex 990
    Dell Latitude E6520
    Dell OptiPlex 790
    Dell OptiPlex 990
    Dell OptiPlex 390
    Dell Latitude E6320
    Dell Latitude E6420
    Dell Latitude E6520

I clearly have not been able to test on all of these systems.
It does fix rebooting on the Dell 790, and should *not* change the reboot paths of systems not on this DMI match list.

Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
---
 xen/arch/x86/shutdown.c |  341 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 341 insertions(+)

diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c
index 7593191..bbe7472 100644
--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -32,6 +32,7 @@ enum reboot_type {
         BOOT_KBD = 'k',
         BOOT_ACPI = 'a',
         BOOT_BIOS = 'b',
+        BOOT_CF9 = 'p',
 };
 
 static long no_idt[2];
@@ -45,6 +46,7 @@ static int reboot_mode;
  * triple Force a triple fault (init)
  * kbd    Use the keyboard controller. cold reset (default)
  * acpi   Use the RESET_REG in the FADT
+ * pci    Use the so-called "PCI reset register", CF9
  */
 static enum reboot_type reboot_type = BOOT_ACPI;
 static void __init set_reboot_type(char *str)
@@ -66,6 +68,7 @@ static void __init set_reboot_type(char *str)
         case 'a':
         case 'k':
         case 't':
+        case 'p':
             reboot_type = *str;
             break;
         }
@@ -101,6 +104,334 @@ void machine_halt(void)
     __machine_halt(NULL);
 }
 
+static int __init set_bios_reboot(struct dmi_system_id *d)
+{
+    if ( reboot_type != BOOT_BIOS )
+    {
+        reboot_type = BOOT_BIOS;
+        printk("%s series board detected. "
+               "Selecting BIOS-method for reboots.\n", d->ident);
+    }
+    return 0;
+}
+
+static int __init set_pci_reboot(struct dmi_system_id *d)
+{
+    if ( reboot_type != BOOT_CF9 )
+    {
+        reboot_type = BOOT_CF9;
+        printk("%s series board detected. "
+               "Selecting pci-method for reboots.\n", d->ident);
+    }
+    return 0;
+}
+
+static int __init set_kbd_reboot(struct dmi_system_id *d)
+{
+    if (reboot_type != BOOT_KBD) {
+        reboot_type = BOOT_KBD;
+        printk("%s series board detected. Selecting KBD-method for reboot.\n",
+            d->ident);
+    }
+    return 0;
+}
+
+static struct dmi_system_id __initdata reboot_dmi_table[] = {
+    {    /* Handle problems with rebooting on Dell E520's */
+        .callback = set_bios_reboot,
+        .ident = "Dell E520",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell 1300's */
+        .callback = set_bios_reboot,
+        .ident = "Dell PowerEdge 1300",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell 300's */
+        .callback = set_bios_reboot,
+        .ident = "Dell PowerEdge 300",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 745's SFF */
+        .callback = set_bios_reboot,
+        .ident = "Dell OptiPlex 745",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 745's DFF */
+        .callback = set_bios_reboot,
+        .ident = "Dell OptiPlex 745",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
+            DMI_MATCH(DMI_BOARD_NAME, "0MM599"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 745 with 0KW626 */
+        .callback = set_bios_reboot,
+        .ident = "Dell OptiPlex 745",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
+            DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */
+        .callback = set_bios_reboot,
+        .ident = "Dell OptiPlex 330",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
+            DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */
+        .callback = set_bios_reboot,
+        .ident = "Dell OptiPlex 360",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"),
+            DMI_MATCH(DMI_BOARD_NAME, "0T656F"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell OptiPlex 760 with 0G919G */
+        .callback = set_bios_reboot,
+        .ident = "Dell OptiPlex 760",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 760"),
+            DMI_MATCH(DMI_BOARD_NAME, "0G919G"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell 2400's */
+        .callback = set_bios_reboot,
+        .ident = "Dell PowerEdge 2400",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell T5400's */
+        .callback = set_bios_reboot,
+        .ident = "Dell Precision T5400",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell T7400's */
+        .callback = set_bios_reboot,
+        .ident = "Dell Precision T7400",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400"),
+        },
+    },
+    {    /* Handle problems with rebooting on HP laptops */
+        .callback = set_bios_reboot,
+        .ident = "HP Compaq Laptop",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell XPS710 */
+        .callback = set_bios_reboot,
+        .ident = "Dell XPS710",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell DXP061 */
+        .callback = set_bios_reboot,
+        .ident = "Dell DXP061",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"),
+        },
+    },
+    {    /* Handle problems with rebooting on Sony VGN-Z540N */
+        .callback = set_bios_reboot,
+        .ident = "Sony VGN-Z540N",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
+        },
+    },
+    {    /* Handle problems with rebooting on ASUS P4S800 */
+        .callback = set_bios_reboot,
+        .ident = "ASUS P4S800",
+        .matches = {
+            DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+            DMI_MATCH(DMI_BOARD_NAME, "P4S800"),
+        },
+    },
+    {    /* Handle reboot issue on Acer Aspire one */
+        .callback = set_kbd_reboot,
+        .ident = "Acer Aspire One A110",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
+        },
+    },
+    {    /* Handle problems with rebooting on Apple MacBook5 */
+        .callback = set_pci_reboot,
+        .ident = "Apple MacBook5",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"),
+        },
+    },
+    {    /* Handle problems with rebooting on Apple MacBookPro5 */
+        .callback = set_pci_reboot,
+        .ident = "Apple MacBookPro5",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"),
+        },
+    },
+    {    /* Handle problems with rebooting on Apple Macmini3,1 */
+        .callback = set_pci_reboot,
+        .ident = "Apple Macmini3,1",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
+        },
+    },
+    {    /* Handle problems with rebooting on the iMac9,1. */
+        .callback = set_pci_reboot,
+        .ident = "Apple iMac9,1",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6320. */
+        .callback = set_pci_reboot,
+        .ident = "Dell Latitude E6320",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E5420. */
+        .callback = set_pci_reboot,
+        .ident = "Dell Latitude E5420",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420"),
+        },
+    },
+    {       /* Handle problems with rebooting on the Latitude E6220. */
+        .callback = set_pci_reboot,
+        .ident = "Dell Latitude E6220",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6220"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6420. */
+        .callback = set_pci_reboot,
+        .ident = "Dell Latitude E6420",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
+        },
+    },
+    {    /* Handle problems with rebooting on the OptiPlex 990. */
+        .callback = set_pci_reboot,
+        .ident = "Dell OptiPlex 990",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Precision M6600. */
+        .callback = set_pci_reboot,
+        .ident = "Dell OptiPlex 990",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6520. */
+        .callback = set_pci_reboot,
+        .ident = "Dell Latitude E6520",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
+        },
+    },
+    {       /* Handle problems with rebooting on the OptiPlex 790. */
+        .callback = set_pci_reboot,
+        .ident = "Dell OptiPlex 790",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 790"),
+        },
+    },
+    {    /* Handle problems with rebooting on the OptiPlex 990. */
+        .callback = set_pci_reboot,
+        .ident = "Dell OptiPlex 990",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
+        },
+    },
+    {    /* Handle problems with rebooting on the OptiPlex 390. */
+        .callback = set_pci_reboot,
+        .ident = "Dell OptiPlex 390",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 390"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6320. */
+        .callback = set_pci_reboot,
+        .ident = "Dell Latitude E6320",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6420. */
+        .callback = set_pci_reboot,
+        .ident = "Dell Latitude E6420",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6520. */
+        .callback = set_pci_reboot,
+        .ident = "Dell Latitude E6520",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
+        },
+    },
+    { }
+};
+
+static int __init reboot_init(void)
+{
+    dmi_check_system(reboot_dmi_table);
+    return 0;
+}
+__initcall(reboot_init);
+
 static void __machine_restart(void *pdelay)
 {
     machine_restart(*(unsigned int *)pdelay);
@@ -183,6 +514,16 @@ void machine_restart(unsigned int delay_millisecs)
             acpi_reboot();
             reboot_type = BOOT_KBD;
             break;
+        case BOOT_CF9:
+            {
+                u8 cf9 = inb(0xcf9) & ~6;
+                outb(cf9|2, 0xcf9); /* Request hard reset */
+                udelay(50);
+                outb(cf9|6, 0xcf9); /* Actually do the reset */
+                udelay(50);
+            }
+            reboot_type = BOOT_ACPI;
+            break;
         }
     }
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] x86: Restore reboot quirks by DMI, fix reboot on a number of systems
  2013-06-11 14:09 [PATCH] x86: Restore reboot quirks by DMI, fix reboot on a number of systems Ben Guthro
@ 2013-06-11 15:59 ` George Dunlap
  2013-06-11 16:03   ` Ben Guthro
  2013-06-21 10:34 ` [PATCH v2] " Jan Beulich
  1 sibling, 1 reply; 9+ messages in thread
From: George Dunlap @ 2013-06-11 15:59 UTC (permalink / raw)
  To: Ben Guthro; +Cc: Jan Beulich, xen-devel

On Tue, Jun 11, 2013 at 3:09 PM, Ben Guthro <benjamin.guthro@citrix.com> wrote:
> The following patch ports the functionality following changeset from linux (from 2008) to xen:
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=14d7ca5c
> It implements an additional reboot quirk to do a PCI reset via port CF9.

I think based on the fact that no one has complained in that time, we
should hold off on this until 4.3.1.

 -George

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] x86: Restore reboot quirks by DMI, fix reboot on a number of systems
  2013-06-11 15:59 ` George Dunlap
@ 2013-06-11 16:03   ` Ben Guthro
  2013-06-11 16:05     ` George Dunlap
  0 siblings, 1 reply; 9+ messages in thread
From: Ben Guthro @ 2013-06-11 16:03 UTC (permalink / raw)
  To: George Dunlap; +Cc: Jan Beulich, xen-devel



On 06/11/2013 11:59 AM, George Dunlap wrote:
> On Tue, Jun 11, 2013 at 3:09 PM, Ben Guthro <benjamin.guthro@citrix.com> wrote:
>> The following patch ports the functionality following changeset from linux (from 2008) to xen:
>> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=14d7ca5c
>> It implements an additional reboot quirk to do a PCI reset via port CF9.
>
> I think based on the fact that no one has complained in that time, we
> should hold off on this until 4.3.1.
>
>   -George

No complaints from me on that.

Will I need to re-submit it after the release, or will someone just flag 
it as something to come back to?

-Ben

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] x86: Restore reboot quirks by DMI, fix reboot on a number of systems
  2013-06-11 16:03   ` Ben Guthro
@ 2013-06-11 16:05     ` George Dunlap
  0 siblings, 0 replies; 9+ messages in thread
From: George Dunlap @ 2013-06-11 16:05 UTC (permalink / raw)
  To: Ben Guthro; +Cc: Jan Beulich, xen-devel

On 06/11/2013 05:03 PM, Ben Guthro wrote:
>
>
> On 06/11/2013 11:59 AM, George Dunlap wrote:
>> On Tue, Jun 11, 2013 at 3:09 PM, Ben Guthro
>> <benjamin.guthro@citrix.com> wrote:
>>> The following patch ports the functionality following changeset from
>>> linux (from 2008) to xen:
>>> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=14d7ca5c
>>>
>>> It implements an additional reboot quirk to do a PCI reset via port CF9.
>>
>> I think based on the fact that no one has complained in that time, we
>> should hold off on this until 4.3.1.
>>
>>   -George
>
> No complaints from me on that.
>
> Will I need to re-submit it after the release, or will someone just flag
> it as something to come back to?

I think ideally the maintainer would put it on his list of things to do. 
  But it's usually a good idea to help the maintainer out by keeping it 
on your own list as well, and pinging if it doesn't get applied. :-)

  -George

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] x86: Restore reboot quirks by DMI, fix reboot on a number of systems
  2013-06-11 14:09 [PATCH] x86: Restore reboot quirks by DMI, fix reboot on a number of systems Ben Guthro
  2013-06-11 15:59 ` George Dunlap
@ 2013-06-21 10:34 ` Jan Beulich
  2013-06-21 10:44   ` Ben Guthro
  2013-06-21 11:20   ` Keir Fraser
  1 sibling, 2 replies; 9+ messages in thread
From: Jan Beulich @ 2013-06-21 10:34 UTC (permalink / raw)
  To: xen-devel; +Cc: Ben Guthro, Keir Fraser

[-- Attachment #1: Type: text/plain, Size: 16742 bytes --]

The following patch ports the functionality following changeset from
Linux (from 2008) to xen:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=14d7ca5c 
It implements an additional reboot quirk to do a PCI reset via port
CF9.

This also restores some code dropped in the x86_32 target removal
(changeset 5d1181a5ea5e0f11d481a94b16ed00d883f9726e) which sets some
quirks based on DMI matching.

This will add reboot quirks on the following systems that are known to
be necessary on Linux:

    Dell E520
    Dell PowerEdge 1300
    Dell PowerEdge 300
    Dell OptiPlex 745
    Dell OptiPlex 745
    Dell OptiPlex 745
    Dell OptiPlex 330
    Dell OptiPlex 360
    Dell OptiPlex 760
    Dell PowerEdge 2400
    Dell Precision T5400
    Dell Precision T7400
    HP Compaq Laptop
    Dell XPS710
    Dell DXP061
    Sony VGN-Z540N
    ASUS P4S800
    Acer Aspire One A110
    Apple MacBook5
    Apple MacBookPro5
    Apple Macmini3,1
    Apple iMac9,1
    Dell Latitude E6320
    Dell Latitude E5420
    Dell Latitude E6220
    Dell Latitude E6420
    Dell OptiPlex 990
    Dell OptiPlex 990
    Dell Latitude E6520
    Dell OptiPlex 790
    Dell OptiPlex 990
    Dell OptiPlex 390
    Dell Latitude E6320
    Dell Latitude E6420
    Dell Latitude E6520

I clearly have not been able to test on all of these systems.
It does fix rebooting on the Dell 790, and should *not* change the
reboot paths of systems not on this DMI match list.

Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>

Use driver_data, thus requiring only a single handler function.

--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -32,6 +32,7 @@ enum reboot_type {
         BOOT_KBD = 'k',
         BOOT_ACPI = 'a',
         BOOT_BIOS = 'b',
+        BOOT_CF9 = 'p',
 };
 
 static long no_idt[2];
@@ -45,6 +46,7 @@ static int reboot_mode;
  * triple Force a triple fault (init)
  * kbd    Use the keyboard controller. cold reset (default)
  * acpi   Use the RESET_REG in the FADT
+ * pci    Use the so-called "PCI reset register", CF9
  */
 static enum reboot_type reboot_type = BOOT_ACPI;
 static void __init set_reboot_type(char *str)
@@ -66,6 +68,7 @@ static void __init set_reboot_type(char 
         case 'a':
         case 'k':
         case 't':
+        case 'p':
             reboot_type = *str;
             break;
         }
@@ -101,6 +104,358 @@ void machine_halt(void)
     __machine_halt(NULL);
 }
 
+static int __init override_reboot(struct dmi_system_id *d)
+{
+    enum reboot_type type = (long)d->driver_data;
+
+    if ( reboot_type != type )
+    {
+        static const char *__initdata msg[] =
+        {
+            [BOOT_BIOS] = "BIOS",
+            [BOOT_KBD]  = "keyboard controller",
+            [BOOT_CF9]  = "PCI",
+        };
+
+        reboot_type = type;
+        ASSERT(type >= 0 && type < ARRAY_SIZE(msg) && msg[type]);
+        printk("%s series board detected. Selecting %s reboot method.\n",
+               d->ident, msg[type]);
+    }
+    return 0;
+}
+
+static struct dmi_system_id __initdata reboot_dmi_table[] = {
+    {    /* Handle problems with rebooting on Dell E520's */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell E520",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell 1300's */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell PowerEdge 1300",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell 300's */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell PowerEdge 300",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 745's SFF */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell OptiPlex 745",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 745's DFF */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell OptiPlex 745",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
+            DMI_MATCH(DMI_BOARD_NAME, "0MM599"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 745 with 0KW626 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell OptiPlex 745",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
+            DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell OptiPlex 330",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
+            DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell OptiPlex 360",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"),
+            DMI_MATCH(DMI_BOARD_NAME, "0T656F"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell OptiPlex 760 with 0G919G */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell OptiPlex 760",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 760"),
+            DMI_MATCH(DMI_BOARD_NAME, "0G919G"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell 2400's */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell PowerEdge 2400",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell T5400's */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell Precision T5400",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell T7400's */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell Precision T7400",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400"),
+        },
+    },
+    {    /* Handle problems with rebooting on HP laptops */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "HP Compaq Laptop",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell XPS710 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell XPS710",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell DXP061 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell DXP061",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"),
+        },
+    },
+    {    /* Handle problems with rebooting on Sony VGN-Z540N */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Sony VGN-Z540N",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
+        },
+    },
+    {    /* Handle problems with rebooting on ASUS P4S800 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "ASUS P4S800",
+        .matches = {
+            DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+            DMI_MATCH(DMI_BOARD_NAME, "P4S800"),
+        },
+    },
+    {    /* Handle reboot issue on Acer Aspire one */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_KBD,
+        .ident = "Acer Aspire One A110",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
+        },
+    },
+    {    /* Handle problems with rebooting on Apple MacBook5 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Apple MacBook5",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"),
+        },
+    },
+    {    /* Handle problems with rebooting on Apple MacBookPro5 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Apple MacBookPro5",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"),
+        },
+    },
+    {    /* Handle problems with rebooting on Apple Macmini3,1 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Apple Macmini3,1",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
+        },
+    },
+    {    /* Handle problems with rebooting on the iMac9,1. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Apple iMac9,1",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6320. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6320",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E5420. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E5420",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420"),
+        },
+    },
+    {       /* Handle problems with rebooting on the Latitude E6220. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6220",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6220"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6420. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6420",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
+        },
+    },
+    {    /* Handle problems with rebooting on the OptiPlex 990. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell OptiPlex 990",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Precision M6600. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell OptiPlex 990",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6520. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6520",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
+        },
+    },
+    {       /* Handle problems with rebooting on the OptiPlex 790. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell OptiPlex 790",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 790"),
+        },
+    },
+    {    /* Handle problems with rebooting on the OptiPlex 990. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell OptiPlex 990",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
+        },
+    },
+    {    /* Handle problems with rebooting on the OptiPlex 390. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell OptiPlex 390",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 390"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6320. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6320",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6420. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6420",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6520. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6520",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
+        },
+    },
+    { }
+};
+
+static int __init reboot_init(void)
+{
+    dmi_check_system(reboot_dmi_table);
+    return 0;
+}
+__initcall(reboot_init);
+
 static void __machine_restart(void *pdelay)
 {
     machine_restart(*(unsigned int *)pdelay);
@@ -183,6 +538,16 @@ void machine_restart(unsigned int delay_
             acpi_reboot();
             reboot_type = BOOT_KBD;
             break;
+        case BOOT_CF9:
+            {
+                u8 cf9 = inb(0xcf9) & ~6;
+                outb(cf9|2, 0xcf9); /* Request hard reset */
+                udelay(50);
+                outb(cf9|6, 0xcf9); /* Actually do the reset */
+                udelay(50);
+            }
+            reboot_type = BOOT_ACPI;
+            break;
         }
     }
 }



[-- Attachment #2: x86-reboot-quirks --]
[-- Type: application/octet-stream, Size: 16397 bytes --]

x86: Restore reboot quirks by DMI, fix reboot on a number of systems

The following patch ports the functionality following changeset from
Linux (from 2008) to xen:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=14d7ca5c 
It implements an additional reboot quirk to do a PCI reset via port
CF9.

This also restores some code dropped in the x86_32 target removal
(changeset 5d1181a5ea5e0f11d481a94b16ed00d883f9726e) which sets some
quirks based on DMI matching.

This will add reboot quirks on the following systems that are known to
be necessary on Linux:

    Dell E520
    Dell PowerEdge 1300
    Dell PowerEdge 300
    Dell OptiPlex 745
    Dell OptiPlex 745
    Dell OptiPlex 745
    Dell OptiPlex 330
    Dell OptiPlex 360
    Dell OptiPlex 760
    Dell PowerEdge 2400
    Dell Precision T5400
    Dell Precision T7400
    HP Compaq Laptop
    Dell XPS710
    Dell DXP061
    Sony VGN-Z540N
    ASUS P4S800
    Acer Aspire One A110
    Apple MacBook5
    Apple MacBookPro5
    Apple Macmini3,1
    Apple iMac9,1
    Dell Latitude E6320
    Dell Latitude E5420
    Dell Latitude E6220
    Dell Latitude E6420
    Dell OptiPlex 990
    Dell OptiPlex 990
    Dell Latitude E6520
    Dell OptiPlex 790
    Dell OptiPlex 990
    Dell OptiPlex 390
    Dell Latitude E6320
    Dell Latitude E6420
    Dell Latitude E6520

I clearly have not been able to test on all of these systems.
It does fix rebooting on the Dell 790, and should *not* change the
reboot paths of systems not on this DMI match list.

Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>

Use driver_data, thus requiring only a single handler function.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -32,6 +32,7 @@ enum reboot_type {
         BOOT_KBD = 'k',
         BOOT_ACPI = 'a',
         BOOT_BIOS = 'b',
+        BOOT_CF9 = 'p',
 };
 
 static long no_idt[2];
@@ -45,6 +46,7 @@ static int reboot_mode;
  * triple Force a triple fault (init)
  * kbd    Use the keyboard controller. cold reset (default)
  * acpi   Use the RESET_REG in the FADT
+ * pci    Use the so-called "PCI reset register", CF9
  */
 static enum reboot_type reboot_type = BOOT_ACPI;
 static void __init set_reboot_type(char *str)
@@ -66,6 +68,7 @@ static void __init set_reboot_type(char 
         case 'a':
         case 'k':
         case 't':
+        case 'p':
             reboot_type = *str;
             break;
         }
@@ -101,6 +104,358 @@ void machine_halt(void)
     __machine_halt(NULL);
 }
 
+static int __init override_reboot(struct dmi_system_id *d)
+{
+    enum reboot_type type = (long)d->driver_data;
+
+    if ( reboot_type != type )
+    {
+        static const char *__initdata msg[] =
+        {
+            [BOOT_BIOS] = "BIOS",
+            [BOOT_KBD]  = "keyboard controller",
+            [BOOT_CF9]  = "PCI",
+        };
+
+        reboot_type = type;
+        ASSERT(type >= 0 && type < ARRAY_SIZE(msg) && msg[type]);
+        printk("%s series board detected. Selecting %s reboot method.\n",
+               d->ident, msg[type]);
+    }
+    return 0;
+}
+
+static struct dmi_system_id __initdata reboot_dmi_table[] = {
+    {    /* Handle problems with rebooting on Dell E520's */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell E520",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell 1300's */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell PowerEdge 1300",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell 300's */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell PowerEdge 300",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 745's SFF */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell OptiPlex 745",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 745's DFF */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell OptiPlex 745",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
+            DMI_MATCH(DMI_BOARD_NAME, "0MM599"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 745 with 0KW626 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell OptiPlex 745",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
+            DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell OptiPlex 330",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
+            DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell OptiPlex 360",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"),
+            DMI_MATCH(DMI_BOARD_NAME, "0T656F"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell OptiPlex 760 with 0G919G */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell OptiPlex 760",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 760"),
+            DMI_MATCH(DMI_BOARD_NAME, "0G919G"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell 2400's */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell PowerEdge 2400",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell T5400's */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell Precision T5400",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell T7400's */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell Precision T7400",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400"),
+        },
+    },
+    {    /* Handle problems with rebooting on HP laptops */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "HP Compaq Laptop",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell XPS710 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell XPS710",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"),
+        },
+    },
+    {    /* Handle problems with rebooting on Dell DXP061 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Dell DXP061",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"),
+        },
+    },
+    {    /* Handle problems with rebooting on Sony VGN-Z540N */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "Sony VGN-Z540N",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
+        },
+    },
+    {    /* Handle problems with rebooting on ASUS P4S800 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_BIOS,
+        .ident = "ASUS P4S800",
+        .matches = {
+            DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+            DMI_MATCH(DMI_BOARD_NAME, "P4S800"),
+        },
+    },
+    {    /* Handle reboot issue on Acer Aspire one */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_KBD,
+        .ident = "Acer Aspire One A110",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
+        },
+    },
+    {    /* Handle problems with rebooting on Apple MacBook5 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Apple MacBook5",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"),
+        },
+    },
+    {    /* Handle problems with rebooting on Apple MacBookPro5 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Apple MacBookPro5",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"),
+        },
+    },
+    {    /* Handle problems with rebooting on Apple Macmini3,1 */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Apple Macmini3,1",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
+        },
+    },
+    {    /* Handle problems with rebooting on the iMac9,1. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Apple iMac9,1",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6320. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6320",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E5420. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E5420",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420"),
+        },
+    },
+    {       /* Handle problems with rebooting on the Latitude E6220. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6220",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6220"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6420. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6420",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
+        },
+    },
+    {    /* Handle problems with rebooting on the OptiPlex 990. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell OptiPlex 990",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Precision M6600. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell OptiPlex 990",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6520. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6520",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
+        },
+    },
+    {       /* Handle problems with rebooting on the OptiPlex 790. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell OptiPlex 790",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 790"),
+        },
+    },
+    {    /* Handle problems with rebooting on the OptiPlex 990. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell OptiPlex 990",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
+        },
+    },
+    {    /* Handle problems with rebooting on the OptiPlex 390. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell OptiPlex 390",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 390"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6320. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6320",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6420. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6420",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
+        },
+    },
+    {    /* Handle problems with rebooting on the Latitude E6520. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_CF9,
+        .ident = "Dell Latitude E6520",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
+        },
+    },
+    { }
+};
+
+static int __init reboot_init(void)
+{
+    dmi_check_system(reboot_dmi_table);
+    return 0;
+}
+__initcall(reboot_init);
+
 static void __machine_restart(void *pdelay)
 {
     machine_restart(*(unsigned int *)pdelay);
@@ -183,6 +538,16 @@ void machine_restart(unsigned int delay_
             acpi_reboot();
             reboot_type = BOOT_KBD;
             break;
+        case BOOT_CF9:
+            {
+                u8 cf9 = inb(0xcf9) & ~6;
+                outb(cf9|2, 0xcf9); /* Request hard reset */
+                udelay(50);
+                outb(cf9|6, 0xcf9); /* Actually do the reset */
+                udelay(50);
+            }
+            reboot_type = BOOT_ACPI;
+            break;
         }
     }
 }

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] x86: Restore reboot quirks by DMI, fix reboot on a number of systems
  2013-06-21 10:34 ` [PATCH v2] " Jan Beulich
@ 2013-06-21 10:44   ` Ben Guthro
  2013-07-04  8:42     ` Jan Beulich
  2013-06-21 11:20   ` Keir Fraser
  1 sibling, 1 reply; 9+ messages in thread
From: Ben Guthro @ 2013-06-21 10:44 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Keir (Xen.org), xen-devel

v2 Acked-by: Ben Guthro <benjamin.guthro@citrix.com>

Thanks for taking a look

Ben

On Jun 21, 2013, at 6:34 AM, Jan Beulich <JBeulich@suse.com>
 wrote:

> The following patch ports the functionality following changeset from
> Linux (from 2008) to xen:
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=14d7ca5c 
> It implements an additional reboot quirk to do a PCI reset via port
> CF9.
> 
> This also restores some code dropped in the x86_32 target removal
> (changeset 5d1181a5ea5e0f11d481a94b16ed00d883f9726e) which sets some
> quirks based on DMI matching.
> 
> This will add reboot quirks on the following systems that are known to
> be necessary on Linux:
> 
>    Dell E520
>    Dell PowerEdge 1300
>    Dell PowerEdge 300
>    Dell OptiPlex 745
>    Dell OptiPlex 745
>    Dell OptiPlex 745
>    Dell OptiPlex 330
>    Dell OptiPlex 360
>    Dell OptiPlex 760
>    Dell PowerEdge 2400
>    Dell Precision T5400
>    Dell Precision T7400
>    HP Compaq Laptop
>    Dell XPS710
>    Dell DXP061
>    Sony VGN-Z540N
>    ASUS P4S800
>    Acer Aspire One A110
>    Apple MacBook5
>    Apple MacBookPro5
>    Apple Macmini3,1
>    Apple iMac9,1
>    Dell Latitude E6320
>    Dell Latitude E5420
>    Dell Latitude E6220
>    Dell Latitude E6420
>    Dell OptiPlex 990
>    Dell OptiPlex 990
>    Dell Latitude E6520
>    Dell OptiPlex 790
>    Dell OptiPlex 990
>    Dell OptiPlex 390
>    Dell Latitude E6320
>    Dell Latitude E6420
>    Dell Latitude E6520
> 
> I clearly have not been able to test on all of these systems.
> It does fix rebooting on the Dell 790, and should *not* change the
> reboot paths of systems not on this DMI match list.
> 
> Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
> 
> Use driver_data, thus requiring only a single handler function.
> 
> --- a/xen/arch/x86/shutdown.c
> +++ b/xen/arch/x86/shutdown.c
> @@ -32,6 +32,7 @@ enum reboot_type {
>         BOOT_KBD = 'k',
>         BOOT_ACPI = 'a',
>         BOOT_BIOS = 'b',
> +        BOOT_CF9 = 'p',
> };
> 
> static long no_idt[2];
> @@ -45,6 +46,7 @@ static int reboot_mode;
>  * triple Force a triple fault (init)
>  * kbd    Use the keyboard controller. cold reset (default)
>  * acpi   Use the RESET_REG in the FADT
> + * pci    Use the so-called "PCI reset register", CF9
>  */
> static enum reboot_type reboot_type = BOOT_ACPI;
> static void __init set_reboot_type(char *str)
> @@ -66,6 +68,7 @@ static void __init set_reboot_type(char 
>         case 'a':
>         case 'k':
>         case 't':
> +        case 'p':
>             reboot_type = *str;
>             break;
>         }
> @@ -101,6 +104,358 @@ void machine_halt(void)
>     __machine_halt(NULL);
> }
> 
> +static int __init override_reboot(struct dmi_system_id *d)
> +{
> +    enum reboot_type type = (long)d->driver_data;
> +
> +    if ( reboot_type != type )
> +    {
> +        static const char *__initdata msg[] =
> +        {
> +            [BOOT_BIOS] = "BIOS",
> +            [BOOT_KBD]  = "keyboard controller",
> +            [BOOT_CF9]  = "PCI",
> +        };
> +
> +        reboot_type = type;
> +        ASSERT(type >= 0 && type < ARRAY_SIZE(msg) && msg[type]);
> +        printk("%s series board detected. Selecting %s reboot method.\n",
> +               d->ident, msg[type]);
> +    }
> +    return 0;
> +}
> +
> +static struct dmi_system_id __initdata reboot_dmi_table[] = {
> +    {    /* Handle problems with rebooting on Dell E520's */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell E520",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell 1300's */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell PowerEdge 1300",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell 300's */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell PowerEdge 300",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell Optiplex 745's SFF */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell OptiPlex 745",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell Optiplex 745's DFF */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell OptiPlex 745",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
> +            DMI_MATCH(DMI_BOARD_NAME, "0MM599"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell Optiplex 745 with 0KW626 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell OptiPlex 745",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
> +            DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell OptiPlex 330",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
> +            DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell OptiPlex 360",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"),
> +            DMI_MATCH(DMI_BOARD_NAME, "0T656F"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell OptiPlex 760 with 0G919G */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell OptiPlex 760",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 760"),
> +            DMI_MATCH(DMI_BOARD_NAME, "0G919G"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell 2400's */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell PowerEdge 2400",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell T5400's */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell Precision T5400",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell T7400's */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell Precision T7400",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on HP laptops */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "HP Compaq Laptop",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell XPS710 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell XPS710",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell DXP061 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell DXP061",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Sony VGN-Z540N */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Sony VGN-Z540N",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on ASUS P4S800 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "ASUS P4S800",
> +        .matches = {
> +            DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
> +            DMI_MATCH(DMI_BOARD_NAME, "P4S800"),
> +        },
> +    },
> +    {    /* Handle reboot issue on Acer Aspire one */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_KBD,
> +        .ident = "Acer Aspire One A110",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Apple MacBook5 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Apple MacBook5",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Apple MacBookPro5 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Apple MacBookPro5",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Apple Macmini3,1 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Apple Macmini3,1",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the iMac9,1. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Apple iMac9,1",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E6320. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6320",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E5420. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E5420",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420"),
> +        },
> +    },
> +    {       /* Handle problems with rebooting on the Latitude E6220. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6220",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6220"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E6420. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6420",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the OptiPlex 990. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell OptiPlex 990",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Precision M6600. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell OptiPlex 990",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E6520. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6520",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
> +        },
> +    },
> +    {       /* Handle problems with rebooting on the OptiPlex 790. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell OptiPlex 790",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 790"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the OptiPlex 990. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell OptiPlex 990",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the OptiPlex 390. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell OptiPlex 390",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 390"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E6320. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6320",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E6420. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6420",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E6520. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6520",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
> +        },
> +    },
> +    { }
> +};
> +
> +static int __init reboot_init(void)
> +{
> +    dmi_check_system(reboot_dmi_table);
> +    return 0;
> +}
> +__initcall(reboot_init);
> +
> static void __machine_restart(void *pdelay)
> {
>     machine_restart(*(unsigned int *)pdelay);
> @@ -183,6 +538,16 @@ void machine_restart(unsigned int delay_
>             acpi_reboot();
>             reboot_type = BOOT_KBD;
>             break;
> +        case BOOT_CF9:
> +            {
> +                u8 cf9 = inb(0xcf9) & ~6;
> +                outb(cf9|2, 0xcf9); /* Request hard reset */
> +                udelay(50);
> +                outb(cf9|6, 0xcf9); /* Actually do the reset */
> +                udelay(50);
> +            }
> +            reboot_type = BOOT_ACPI;
> +            break;
>         }
>     }
> }
> 
> 
> <x86-reboot-quirks>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] x86: Restore reboot quirks by DMI, fix reboot on a number of systems
  2013-06-21 10:34 ` [PATCH v2] " Jan Beulich
  2013-06-21 10:44   ` Ben Guthro
@ 2013-06-21 11:20   ` Keir Fraser
  1 sibling, 0 replies; 9+ messages in thread
From: Keir Fraser @ 2013-06-21 11:20 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Ben Guthro

On 21/06/2013 11:34, "Jan Beulich" <JBeulich@suse.com> wrote:

> The following patch ports the functionality following changeset from
> Linux (from 2008) to xen:
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=14d7
> ca5c 
> It implements an additional reboot quirk to do a PCI reset via port
> CF9.
> 
> This also restores some code dropped in the x86_32 target removal
> (changeset 5d1181a5ea5e0f11d481a94b16ed00d883f9726e) which sets some
> quirks based on DMI matching.
> 
> This will add reboot quirks on the following systems that are known to
> be necessary on Linux:

> Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>

Acked-by: Keir Fraser <keir@xen.org

> Use driver_data, thus requiring only a single handler function.
> 
> --- a/xen/arch/x86/shutdown.c
> +++ b/xen/arch/x86/shutdown.c
> @@ -32,6 +32,7 @@ enum reboot_type {
>          BOOT_KBD = 'k',
>          BOOT_ACPI = 'a',
>          BOOT_BIOS = 'b',
> +        BOOT_CF9 = 'p',
>  };
>  
>  static long no_idt[2];
> @@ -45,6 +46,7 @@ static int reboot_mode;
>   * triple Force a triple fault (init)
>   * kbd    Use the keyboard controller. cold reset (default)
>   * acpi   Use the RESET_REG in the FADT
> + * pci    Use the so-called "PCI reset register", CF9
>   */
>  static enum reboot_type reboot_type = BOOT_ACPI;
>  static void __init set_reboot_type(char *str)
> @@ -66,6 +68,7 @@ static void __init set_reboot_type(char
>          case 'a':
>          case 'k':
>          case 't':
> +        case 'p':
>              reboot_type = *str;
>              break;
>          }
> @@ -101,6 +104,358 @@ void machine_halt(void)
>      __machine_halt(NULL);
>  }
>  
> +static int __init override_reboot(struct dmi_system_id *d)
> +{
> +    enum reboot_type type = (long)d->driver_data;
> +
> +    if ( reboot_type != type )
> +    {
> +        static const char *__initdata msg[] =
> +        {
> +            [BOOT_BIOS] = "BIOS",
> +            [BOOT_KBD]  = "keyboard controller",
> +            [BOOT_CF9]  = "PCI",
> +        };
> +
> +        reboot_type = type;
> +        ASSERT(type >= 0 && type < ARRAY_SIZE(msg) && msg[type]);
> +        printk("%s series board detected. Selecting %s reboot method.\n",
> +               d->ident, msg[type]);
> +    }
> +    return 0;
> +}
> +
> +static struct dmi_system_id __initdata reboot_dmi_table[] = {
> +    {    /* Handle problems with rebooting on Dell E520's */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell E520",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell 1300's */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell PowerEdge 1300",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell 300's */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell PowerEdge 300",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell Optiplex 745's SFF */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell OptiPlex 745",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell Optiplex 745's DFF */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell OptiPlex 745",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
> +            DMI_MATCH(DMI_BOARD_NAME, "0MM599"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell Optiplex 745 with 0KW626
> */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell OptiPlex 745",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
> +            DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561
> */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell OptiPlex 330",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
> +            DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell Optiplex 360 with 0T656F
> */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell OptiPlex 360",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"),
> +            DMI_MATCH(DMI_BOARD_NAME, "0T656F"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell OptiPlex 760 with 0G919G
> */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell OptiPlex 760",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 760"),
> +            DMI_MATCH(DMI_BOARD_NAME, "0G919G"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell 2400's */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell PowerEdge 2400",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell T5400's */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell Precision T5400",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell T7400's */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell Precision T7400",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on HP laptops */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "HP Compaq Laptop",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell XPS710 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell XPS710",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Dell DXP061 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Dell DXP061",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Sony VGN-Z540N */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "Sony VGN-Z540N",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on ASUS P4S800 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_BIOS,
> +        .ident = "ASUS P4S800",
> +        .matches = {
> +            DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
> +            DMI_MATCH(DMI_BOARD_NAME, "P4S800"),
> +        },
> +    },
> +    {    /* Handle reboot issue on Acer Aspire one */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_KBD,
> +        .ident = "Acer Aspire One A110",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Apple MacBook5 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Apple MacBook5",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Apple MacBookPro5 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Apple MacBookPro5",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on Apple Macmini3,1 */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Apple Macmini3,1",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the iMac9,1. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Apple iMac9,1",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E6320. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6320",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E5420. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E5420",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420"),
> +        },
> +    },
> +    {       /* Handle problems with rebooting on the Latitude E6220. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6220",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6220"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E6420. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6420",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the OptiPlex 990. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell OptiPlex 990",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Precision M6600. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell OptiPlex 990",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E6520. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6520",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
> +        },
> +    },
> +    {       /* Handle problems with rebooting on the OptiPlex 790. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell OptiPlex 790",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 790"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the OptiPlex 990. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell OptiPlex 990",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the OptiPlex 390. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell OptiPlex 390",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 390"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E6320. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6320",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E6420. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6420",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
> +        },
> +    },
> +    {    /* Handle problems with rebooting on the Latitude E6520. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_CF9,
> +        .ident = "Dell Latitude E6520",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"),
> +        },
> +    },
> +    { }
> +};
> +
> +static int __init reboot_init(void)
> +{
> +    dmi_check_system(reboot_dmi_table);
> +    return 0;
> +}
> +__initcall(reboot_init);
> +
>  static void __machine_restart(void *pdelay)
>  {
>      machine_restart(*(unsigned int *)pdelay);
> @@ -183,6 +538,16 @@ void machine_restart(unsigned int delay_
>              acpi_reboot();
>              reboot_type = BOOT_KBD;
>              break;
> +        case BOOT_CF9:
> +            {
> +                u8 cf9 = inb(0xcf9) & ~6;
> +                outb(cf9|2, 0xcf9); /* Request hard reset */
> +                udelay(50);
> +                outb(cf9|6, 0xcf9); /* Actually do the reset */
> +                udelay(50);
> +            }
> +            reboot_type = BOOT_ACPI;
> +            break;
>          }
>      }
>  }
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] x86: Restore reboot quirks by DMI, fix reboot on a number of systems
  2013-06-21 10:44   ` Ben Guthro
@ 2013-07-04  8:42     ` Jan Beulich
  2013-07-04 11:05       ` Ben Guthro
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Beulich @ 2013-07-04  8:42 UTC (permalink / raw)
  To: Ben Guthro; +Cc: Keir (Xen.org), xen-devel

>>> On 21.06.13 at 12:44, Ben Guthro <Ben.Guthro@citrix.com> wrote:
> v2 Acked-by: Ben Guthro <benjamin.guthro@citrix.com>

By the way - only after committing I noticed that I should have
asked whether you did any verification that all the added table
entries actually refer to x86-64 capable machines. It's all
__initdata, so not a huge problem if not, but carrying useless
baggage isn't that nice either.

Jan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] x86: Restore reboot quirks by DMI, fix reboot on a number of systems
  2013-07-04  8:42     ` Jan Beulich
@ 2013-07-04 11:05       ` Ben Guthro
  0 siblings, 0 replies; 9+ messages in thread
From: Ben Guthro @ 2013-07-04 11:05 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Keir (Xen.org), Ben Guthro


On Jul 4, 2013, at 4:42 AM, Jan Beulich <jbeulich@suse.com> wrote:

>>>> On 21.06.13 at 12:44, Ben Guthro <Ben.Guthro@citrix.com> wrote:
>> v2 Acked-by: Ben Guthro <benjamin.guthro@citrix.com>
> 
> By the way - only after committing I noticed that I should have
> asked whether you did any verification that all the added table
> entries actually refer to x86-64 capable machines. It's all
> __initdata, so not a huge problem if not, but carrying useless
> baggage isn't that nice either.
> 

I didn't verify every one of them - I mostly lifted them from linux.
I primarily ported it, to get one particular system to start working:
The Dell 790

However, there are others on here that are certainly 64 bit...I just don't know if they all are.

Ben

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-07-04 11:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-11 14:09 [PATCH] x86: Restore reboot quirks by DMI, fix reboot on a number of systems Ben Guthro
2013-06-11 15:59 ` George Dunlap
2013-06-11 16:03   ` Ben Guthro
2013-06-11 16:05     ` George Dunlap
2013-06-21 10:34 ` [PATCH v2] " Jan Beulich
2013-06-21 10:44   ` Ben Guthro
2013-07-04  8:42     ` Jan Beulich
2013-07-04 11:05       ` Ben Guthro
2013-06-21 11:20   ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.