From: Greg Kroah-Hartman Date: Wed, 23 Mar 2011 23:47:52 +0000 (-0700) Subject: .37 patches X-Git-Tag: v2.6.37.6~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5fb90b1457f01a6660d60aa2367b37e3c7cb30b4;p=thirdparty%2Fkernel%2Fstable-queue.git .37 patches --- diff --git a/queue-2.6.37/alsa-hda-fix-internal-mic-on-dell-e5420-e5520.patch b/queue-2.6.37/alsa-hda-fix-internal-mic-on-dell-e5420-e5520.patch new file mode 100644 index 00000000000..0e812728807 --- /dev/null +++ b/queue-2.6.37/alsa-hda-fix-internal-mic-on-dell-e5420-e5520.patch @@ -0,0 +1,76 @@ +From c6066ab342e8cb3e4e3ec74f7577f099d79465b3 Mon Sep 17 00:00:00 2001 +From: David Henningsson +Date: Tue, 22 Mar 2011 10:23:28 +0100 +Subject: ALSA: HDA: Fix internal mic on Dell E5420/E5520 + +From: David Henningsson + +This is a fixup for the 2.6.38 kernel, as the issue is being resolved +by upstream commits 699d899560cd7e72da39231e584412e7ac8114a4 and +094a42452abd5564429045e210281c6d22e67fca - which are too invasive +to reach 2.6.38. Instead make pin fixes as a workaround. + +BugLink: http://bugs.launchpad.net/bugs/740055 +Tested-by: Kent Baxley +Signed-off-by: David Henningsson +Acked-by: Takashi Iwai + +--- + sound/pci/hda/patch_sigmatel.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -94,6 +94,7 @@ enum { + STAC_92HD83XXX_REF, + STAC_92HD83XXX_PWR_REF, + STAC_DELL_S14, ++ STAC_DELL_E5520M, + STAC_92HD83XXX_HP, + STAC_HP_DV7_4000, + STAC_92HD83XXX_MODELS +@@ -1649,6 +1650,13 @@ static unsigned int dell_s14_pin_configs + 0x40f000f0, 0x40f000f0, + }; + ++/* Switch int mic from 0x20 to 0x11 */ ++static unsigned int dell_e5520m_pin_configs[10] = { ++ 0x04a11020, 0x0421101f, 0x400000f0, 0x90170110, ++ 0x23011050, 0x23a1102e, 0x400000f3, 0xd5a30130, ++ 0x400000f0, 0x40f000f0, ++}; ++ + static unsigned int hp_dv7_4000_pin_configs[10] = { + 0x03a12050, 0x0321201f, 0x40f000f0, 0x90170110, + 0x40f000f0, 0x40f000f0, 0x90170110, 0xd5a30140, +@@ -1659,6 +1667,7 @@ static unsigned int *stac92hd83xxx_brd_t + [STAC_92HD83XXX_REF] = ref92hd83xxx_pin_configs, + [STAC_92HD83XXX_PWR_REF] = ref92hd83xxx_pin_configs, + [STAC_DELL_S14] = dell_s14_pin_configs, ++ [STAC_DELL_E5520M] = dell_e5520m_pin_configs, + [STAC_HP_DV7_4000] = hp_dv7_4000_pin_configs, + }; + +@@ -1667,6 +1676,7 @@ static const char *stac92hd83xxx_models[ + [STAC_92HD83XXX_REF] = "ref", + [STAC_92HD83XXX_PWR_REF] = "mic-ref", + [STAC_DELL_S14] = "dell-s14", ++ [STAC_DELL_E5520M] = "dell-e5520m", + [STAC_92HD83XXX_HP] = "hp", + [STAC_HP_DV7_4000] = "hp-dv7-4000", + }; +@@ -1679,6 +1689,14 @@ static struct snd_pci_quirk stac92hd83xx + "DFI LanParty", STAC_92HD83XXX_REF), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ba, + "unknown Dell", STAC_DELL_S14), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x049a, ++ "Dell E5520", STAC_DELL_E5520M), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x049b, ++ "Dell E5420", STAC_DELL_E5520M), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x04eb, ++ "Dell E5420m", STAC_DELL_E5520M), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x04ec, ++ "Dell E5520m", STAC_DELL_E5520M), + SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x3600, + "HP", STAC_92HD83XXX_HP), + {} /* terminator */ diff --git a/queue-2.6.37/intel_idle-disable-atom-lincroft-hw-c-state-auto-demotion.patch b/queue-2.6.37/intel_idle-disable-atom-lincroft-hw-c-state-auto-demotion.patch new file mode 100644 index 00000000000..f387514a1c6 --- /dev/null +++ b/queue-2.6.37/intel_idle-disable-atom-lincroft-hw-c-state-auto-demotion.patch @@ -0,0 +1,50 @@ +From bfb53ccf1c734b1907df7189eef4c08489827951 Mon Sep 17 00:00:00 2001 +From: Len Brown +Date: Wed, 16 Feb 2011 01:32:48 -0500 +Subject: intel_idle: disable Atom/Lincroft HW C-state auto-demotion + +From: Len Brown + +commit bfb53ccf1c734b1907df7189eef4c08489827951 upstream. + +Just as we had to disable auto-demotion for NHM/WSM, +we need to do the same for Atom (Lincroft version). + +In particular, auto-demotion will prevent Lincroft +from entering the S0i3 idle power saving state. + +https://bugzilla.kernel.org/show_bug.cgi?id=25252 + +Signed-off-by: Len Brown +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/include/asm/msr-index.h | 1 + + drivers/idle/intel_idle.c | 4 ++++ + 2 files changed, 5 insertions(+) + +--- a/arch/x86/include/asm/msr-index.h ++++ b/arch/x86/include/asm/msr-index.h +@@ -39,6 +39,7 @@ + #define MSR_NHM_SNB_PKG_CST_CFG_CTL 0x000000e2 + #define NHM_C3_AUTO_DEMOTE (1UL << 25) + #define NHM_C1_AUTO_DEMOTE (1UL << 26) ++#define ATM_LNC_C6_AUTO_DEMOTE (1UL << 25) + + #define MSR_MTRRcap 0x000000fe + #define MSR_IA32_BBL_CR_CTL 0x00000119 +--- a/drivers/idle/intel_idle.c ++++ b/drivers/idle/intel_idle.c +@@ -340,8 +340,12 @@ static int intel_idle_probe(void) + break; + + case 0x1C: /* 28 - Atom Processor */ ++ cpuidle_state_table = atom_cstates; ++ break; ++ + case 0x26: /* 38 - Lincroft Atom Processor */ + cpuidle_state_table = atom_cstates; ++ auto_demotion_disable_flags = ATM_LNC_C6_AUTO_DEMOTE; + break; + + case 0x2A: /* SNB */ diff --git a/queue-2.6.37/intel_idle-disable-nhm-wsm-hw-c-state-auto-demotion.patch b/queue-2.6.37/intel_idle-disable-nhm-wsm-hw-c-state-auto-demotion.patch new file mode 100644 index 00000000000..6da8f7a6aa5 --- /dev/null +++ b/queue-2.6.37/intel_idle-disable-nhm-wsm-hw-c-state-auto-demotion.patch @@ -0,0 +1,98 @@ +From 14796fca2bd22acc73dd0887248d003b0f441d08 Mon Sep 17 00:00:00 2001 +From: Len Brown +Date: Tue, 18 Jan 2011 20:48:27 -0500 +Subject: intel_idle: disable NHM/WSM HW C-state auto-demotion + +From: Len Brown + +commit 14796fca2bd22acc73dd0887248d003b0f441d08 upstream. + +Hardware C-state auto-demotion is a mechanism where the HW overrides +the OS C-state request, instead demoting to a shallower state, +which is less expensive, but saves less power. + +Modern Linux should generally get exactly the states it requests. +In particular, when a CPU is taken off-line, it must not be demoted, else +it can prevent the entire package from reaching deep C-states. + +https://bugzilla.kernel.org/show_bug.cgi?id=25252 + +Signed-off-by: Len Brown +Signed-off-by: Greg Kroah-Hartman + + +--- + arch/x86/include/asm/msr-index.h | 4 ++++ + drivers/idle/intel_idle.c | 20 ++++++++++++++++++++ + 2 files changed, 24 insertions(+) + +--- a/arch/x86/include/asm/msr-index.h ++++ b/arch/x86/include/asm/msr-index.h +@@ -36,6 +36,10 @@ + #define MSR_IA32_PERFCTR1 0x000000c2 + #define MSR_FSB_FREQ 0x000000cd + ++#define MSR_NHM_SNB_PKG_CST_CFG_CTL 0x000000e2 ++#define NHM_C3_AUTO_DEMOTE (1UL << 25) ++#define NHM_C1_AUTO_DEMOTE (1UL << 26) ++ + #define MSR_MTRRcap 0x000000fe + #define MSR_IA32_BBL_CR_CTL 0x00000119 + +--- a/drivers/idle/intel_idle.c ++++ b/drivers/idle/intel_idle.c +@@ -62,6 +62,7 @@ + #include + #include + #include ++#include + + #define INTEL_IDLE_VERSION "0.4" + #define PREFIX "intel_idle: " +@@ -85,6 +86,12 @@ static int intel_idle(struct cpuidle_dev + static struct cpuidle_state *cpuidle_state_table; + + /* ++ * Hardware C-state auto-demotion may not always be optimal. ++ * Indicate which enable bits to clear here. ++ */ ++static unsigned long long auto_demotion_disable_flags; ++ ++/* + * States are indexed by the cstate number, + * which is also the index into the MWAIT hint array. + * Thus C0 is a dummy. +@@ -276,6 +283,15 @@ static struct notifier_block setup_broad + .notifier_call = setup_broadcast_cpuhp_notify, + }; + ++static void auto_demotion_disable(void *dummy) ++{ ++ unsigned long long msr_bits; ++ ++ rdmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits); ++ msr_bits &= ~auto_demotion_disable_flags; ++ wrmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits); ++} ++ + /* + * intel_idle_probe() + */ +@@ -319,6 +335,8 @@ static int intel_idle_probe(void) + case 0x25: /* Westmere */ + case 0x2C: /* Westmere */ + cpuidle_state_table = nehalem_cstates; ++ auto_demotion_disable_flags = ++ (NHM_C1_AUTO_DEMOTE | NHM_C3_AUTO_DEMOTE); + break; + + case 0x1C: /* 28 - Atom Processor */ +@@ -431,6 +449,8 @@ static int intel_idle_cpuidle_devices_in + return -EIO; + } + } ++ if (auto_demotion_disable_flags) ++ smp_call_function(auto_demotion_disable, NULL, 1); + + return 0; + } diff --git a/queue-2.6.37/pci-hotplug-acpiphp-set-current_state-to-d0-in-register_slot.patch b/queue-2.6.37/pci-hotplug-acpiphp-set-current_state-to-d0-in-register_slot.patch new file mode 100644 index 00000000000..1f301d52bcb --- /dev/null +++ b/queue-2.6.37/pci-hotplug-acpiphp-set-current_state-to-d0-in-register_slot.patch @@ -0,0 +1,65 @@ +From 47e9037ac16637cd7f12b8790ea7ce6680e42168 Mon Sep 17 00:00:00 2001 +From: Stefano Stabellini +Date: Mon, 28 Feb 2011 16:20:11 +0000 +Subject: PCI hotplug: acpiphp: set current_state to D0 in register_slot + +From: Stefano Stabellini + +commit 47e9037ac16637cd7f12b8790ea7ce6680e42168 upstream. + +If a device doesn't support power management (pm_cap == 0) but it is +acpi_pci_power_manageable() because there is a _PS0 method declared for +it and _EJ0 is also declared for the slot then nobody is going to set +current_state = PCI_D0 for this device. This is what I think it is +happening: + +pci_enable_device + | +__pci_enable_device_flags +/* here we do not set current_state because !pm_cap */ + | +do_pci_enable_device + | +pci_set_power_state + | +__pci_start_power_transition + | +pci_platform_power_transition +/* platform_pci_power_manageable() calls acpi_pci_power_manageable that + * returns true */ + | +platform_pci_set_power_state +/* acpi_pci_set_power_state gets called and does nothing because the + * acpi device has _EJ0, see the comment "If the ACPI device has _EJ0, + * ignore the device" */ + +at this point if we refer to the commit message that introduced the +comment above (10b3dcae0f275e2546e55303d64ddbb58cec7599), it is up to +the hotplug driver to set the state to D0. +However AFAICT the pci hotplug driver never does, in fact +drivers/pci/hotplug/acpiphp_glue.c:register_slot sets the slot flags to +(SLOT_ENABLED | SLOT_POWEREDON) but it does not set the pci device +current state to PCI_D0. + +So my proposed fix is also to set current_state = PCI_D0 in +register_slot. +Comments are very welcome. + +Signed-off-by: Stefano Stabellini +Signed-off-by: Jesse Barnes +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/hotplug/acpiphp_glue.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/pci/hotplug/acpiphp_glue.c ++++ b/drivers/pci/hotplug/acpiphp_glue.c +@@ -212,6 +212,7 @@ register_slot(acpi_handle handle, u32 lv + + pdev = pci_get_slot(pbus, PCI_DEVFN(device, function)); + if (pdev) { ++ pdev->current_state = PCI_D0; + slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON); + pci_dev_put(pdev); + } diff --git a/queue-2.6.37/prevent-rt_sigqueueinfo-and-rt_tgsigqueueinfo-from-spoofing-the-signal-code.patch b/queue-2.6.37/prevent-rt_sigqueueinfo-and-rt_tgsigqueueinfo-from-spoofing-the-signal-code.patch new file mode 100644 index 00000000000..db26a39df22 --- /dev/null +++ b/queue-2.6.37/prevent-rt_sigqueueinfo-and-rt_tgsigqueueinfo-from-spoofing-the-signal-code.patch @@ -0,0 +1,68 @@ +From da48524eb20662618854bb3df2db01fc65f3070c Mon Sep 17 00:00:00 2001 +From: Julien Tinnes +Date: Fri, 18 Mar 2011 15:05:21 -0700 +Subject: Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code + +From: Julien Tinnes + +commit da48524eb20662618854bb3df2db01fc65f3070c upstream. + +Userland should be able to trust the pid and uid of the sender of a +signal if the si_code is SI_TKILL. + +Unfortunately, the kernel has historically allowed sigqueueinfo() to +send any si_code at all (as long as it was negative - to distinguish it +from kernel-generated signals like SIGILL etc), so it could spoof a +SI_TKILL with incorrect siginfo values. + +Happily, it looks like glibc has always set si_code to the appropriate +SI_QUEUE, so there are probably no actual user code that ever uses +anything but the appropriate SI_QUEUE flag. + +So just tighten the check for si_code (we used to allow any negative +value), and add a (one-time) warning in case there are binaries out +there that might depend on using other si_code values. + +Signed-off-by: Julien Tinnes +Acked-by: Oleg Nesterov +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/signal.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +--- a/kernel/signal.c ++++ b/kernel/signal.c +@@ -2421,9 +2421,13 @@ SYSCALL_DEFINE3(rt_sigqueueinfo, pid_t, + return -EFAULT; + + /* Not even root can pretend to send signals from the kernel. +- Nor can they impersonate a kill(), which adds source info. */ +- if (info.si_code >= 0) ++ * Nor can they impersonate a kill()/tgkill(), which adds source info. ++ */ ++ if (info.si_code != SI_QUEUE) { ++ /* We used to allow any < 0 si_code */ ++ WARN_ON_ONCE(info.si_code < 0); + return -EPERM; ++ } + info.si_signo = sig; + + /* POSIX.1b doesn't mention process groups. */ +@@ -2437,9 +2441,13 @@ long do_rt_tgsigqueueinfo(pid_t tgid, pi + return -EINVAL; + + /* Not even root can pretend to send signals from the kernel. +- Nor can they impersonate a kill(), which adds source info. */ +- if (info->si_code >= 0) ++ * Nor can they impersonate a kill()/tgkill(), which adds source info. ++ */ ++ if (info->si_code != SI_QUEUE) { ++ /* We used to allow any < 0 si_code */ ++ WARN_ON_ONCE(info->si_code < 0); + return -EPERM; ++ } + info->si_signo = sig; + + return do_send_specific(tgid, pid, sig, info); diff --git a/queue-2.6.37/series b/queue-2.6.37/series index 0554bb388e6..b9cc97d0a68 100644 --- a/queue-2.6.37/series +++ b/queue-2.6.37/series @@ -13,3 +13,9 @@ mm-swap-unlock-swapfile-inode-mutex-before-closing-file-on-bad-swapfiles.patch oom-prevent-unnecessary-oom-kills-or-kernel-panics.patch oom-skip-zombies-when-iterating-tasklist.patch oom-avoid-deferring-oom-killer-if-exiting-task-is-being-traced.patch +pci-hotplug-acpiphp-set-current_state-to-d0-in-register_slot.patch +xen-set-max_pfn_mapped-to-the-last-pfn-mapped.patch +intel_idle-disable-nhm-wsm-hw-c-state-auto-demotion.patch +intel_idle-disable-atom-lincroft-hw-c-state-auto-demotion.patch +prevent-rt_sigqueueinfo-and-rt_tgsigqueueinfo-from-spoofing-the-signal-code.patch +alsa-hda-fix-internal-mic-on-dell-e5420-e5520.patch diff --git a/queue-2.6.37/xen-set-max_pfn_mapped-to-the-last-pfn-mapped.patch b/queue-2.6.37/xen-set-max_pfn_mapped-to-the-last-pfn-mapped.patch new file mode 100644 index 00000000000..e5dc0fdda8f --- /dev/null +++ b/queue-2.6.37/xen-set-max_pfn_mapped-to-the-last-pfn-mapped.patch @@ -0,0 +1,62 @@ +From 14988a4d350ce3b41ecad4f63c4f44c56f5ae34d Mon Sep 17 00:00:00 2001 +From: Stefano Stabellini +Date: Fri, 18 Feb 2011 11:32:40 +0000 +Subject: xen: set max_pfn_mapped to the last pfn mapped + +From: Stefano Stabellini + +commit 14988a4d350ce3b41ecad4f63c4f44c56f5ae34d upstream. + +Do not set max_pfn_mapped to the end of the initial memory mappings, +that also contain pages that don't belong in pfn space (like the mfn +list). + +Set max_pfn_mapped to the last real pfn mapped in the initial memory +mappings that is the pfn backing _end. + +Signed-off-by: Stefano Stabellini +Acked-by: Konrad Rzeszutek Wilk +LKML-Reference: +Signed-off-by: H. Peter Anvin +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/xen/mmu.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +--- a/arch/x86/xen/mmu.c ++++ b/arch/x86/xen/mmu.c +@@ -2027,9 +2027,6 @@ static __init void xen_map_identity_earl + for (pteidx = 0; pteidx < PTRS_PER_PTE; pteidx++, pfn++) { + pte_t pte; + +- if (pfn > max_pfn_mapped) +- max_pfn_mapped = pfn; +- + if (!pte_none(pte_page[pteidx])) + continue; + +@@ -2087,6 +2084,12 @@ __init pgd_t *xen_setup_kernel_pagetable + pud_t *l3; + pmd_t *l2; + ++ /* max_pfn_mapped is the last pfn mapped in the initial memory ++ * mappings. Considering that on Xen after the kernel mappings we ++ * have the mappings of some pages that don't exist in pfn space, we ++ * set max_pfn_mapped to the last real pfn mapped. */ ++ max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->mfn_list)); ++ + /* Zap identity mapping */ + init_level4_pgt[0] = __pgd(0); + +@@ -2191,9 +2194,7 @@ __init pgd_t *xen_setup_kernel_pagetable + initial_kernel_pmd = + extend_brk(sizeof(pmd_t) * PTRS_PER_PMD, PAGE_SIZE); + +- max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->pt_base) + +- xen_start_info->nr_pt_frames * PAGE_SIZE + +- 512*1024); ++ max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->mfn_list)); + + kernel_pmd = m2v(pgd[KERNEL_PGD_BOUNDARY].pgd); + memcpy(initial_kernel_pmd, kernel_pmd, sizeof(pmd_t) * PTRS_PER_PMD);