From 7e2f4c3e8d524213f7afaaba5a27c118774c9e8b Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 28 Apr 2011 03:46:55 +0200 Subject: [PATCH] linux: add some patches from fedora Signed-off-by: Stephan Raue --- .../linux-2.6.39-rc5-010-acpi_reboot.patch | 53 +++++++++++++++++++ ...x-2.6.39-rc5-031-usb-pci-autosuspend.patch | 22 ++++++++ 2 files changed, 75 insertions(+) create mode 100644 packages/linux/patches/linux-2.6.39-rc5-010-acpi_reboot.patch create mode 100644 packages/linux/patches/linux-2.6.39-rc5-031-usb-pci-autosuspend.patch diff --git a/packages/linux/patches/linux-2.6.39-rc5-010-acpi_reboot.patch b/packages/linux/patches/linux-2.6.39-rc5-010-acpi_reboot.patch new file mode 100644 index 0000000000..c67cf950bc --- /dev/null +++ b/packages/linux/patches/linux-2.6.39-rc5-010-acpi_reboot.patch @@ -0,0 +1,53 @@ +Improve our reboot handling for compatibility with Windows. Upstream in .38? + +diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c +index c495aa8..c770e66 100644 +--- a/arch/x86/kernel/reboot.c ++++ b/arch/x86/kernel/reboot.c +@@ -34,7 +34,7 @@ EXPORT_SYMBOL(pm_power_off); + + static const struct desc_ptr no_idt = {}; + static int reboot_mode; +-enum reboot_type reboot_type = BOOT_KBD; ++enum reboot_type reboot_type = BOOT_ACPI; + int reboot_force; + + #if defined(CONFIG_X86_32) && defined(CONFIG_SMP) +@@ -538,9 +538,23 @@ void __attribute__((weak)) mach_reboot_fixups(void) + { + } + ++/* ++ * Windows does the following on reboot: ++ * 1) If the FADT has the ACPI reboot register flag set, try it ++ * 2) If still alive, write to the keyboard controller ++ * 3) If still alive, write to the ACPI reboot register again ++ * 4) If still alive, write to the keyboard controller again ++ * ++ * If the machine is still alive at this stage, it gives up. We default to ++ * following the same pattern, except that if we're still alive after (4) we'll ++ * try to force a triple fault and then cycle between hitting the keyboard ++ * controller and doing that ++ */ + static void native_machine_emergency_restart(void) + { + int i; ++ int attempt = 0; ++ int orig_reboot_type = reboot_type; + + if (reboot_emergency) + emergency_vmx_disable_all(); +@@ -562,6 +576,13 @@ static void native_machine_emergency_restart(void) + outb(0xfe, 0x64); /* pulse reset low */ + udelay(50); + } ++ if (attempt == 0 && orig_reboot_type == BOOT_ACPI) { ++ attempt = 1; ++ reboot_type = BOOT_ACPI; ++ } else { ++ reboot_type = BOOT_TRIPLE; ++ } ++ break; + + case BOOT_TRIPLE: + load_idt(&no_idt); diff --git a/packages/linux/patches/linux-2.6.39-rc5-031-usb-pci-autosuspend.patch b/packages/linux/patches/linux-2.6.39-rc5-031-usb-pci-autosuspend.patch new file mode 100644 index 0000000000..610a7654d9 --- /dev/null +++ b/packages/linux/patches/linux-2.6.39-rc5-031-usb-pci-autosuspend.patch @@ -0,0 +1,22 @@ +commit 15d89120d03116adbbf3226a85fbd2fff0b12576 +Author: Matthew Garrett +Date: Fri Sep 17 11:09:12 2010 -0400 + + Enable USB PCI autosuspend by default + +diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c +index c3f9854..3c020e6 100644 +--- a/drivers/usb/core/hcd-pci.c ++++ b/drivers/usb/core/hcd-pci.c +@@ -248,8 +248,10 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) + goto err4; + set_hs_companion(dev, hcd); + +- if (pci_dev_run_wake(dev)) ++ if (pci_dev_run_wake(dev)) { + pm_runtime_put_noidle(&dev->dev); ++ pm_runtime_allow(&dev->dev); ++ } + return retval; + + err4: