From: Greg Kroah-Hartman Date: Sun, 16 Feb 2014 19:43:25 +0000 (-0800) Subject: 3.4-stable patches X-Git-Tag: v3.4.81~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=15f99b6510a1e5ad04aefe5c5349a273f1903367;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: alsa-hda-realtek-avoid-invalid-coefs-for-alc271x.patch mm-__set_page_dirty_nobuffers-uses-spin_lock_irqsave-instead-of-spin_lock_irq.patch mm-__set_page_dirty-uses-spin_lock_irqsave-instead-of-spin_lock_irq.patch x86-hweight-fix-bug-when-booting-with-config_gcov_profile_all-y.patch --- diff --git a/queue-3.4/alsa-hda-realtek-avoid-invalid-coefs-for-alc271x.patch b/queue-3.4/alsa-hda-realtek-avoid-invalid-coefs-for-alc271x.patch new file mode 100644 index 00000000000..c1d2d5c7bce --- /dev/null +++ b/queue-3.4/alsa-hda-realtek-avoid-invalid-coefs-for-alc271x.patch @@ -0,0 +1,38 @@ +From d3c56568f43807135f2c2a09582a69f809f0d8b7 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 3 Feb 2014 09:56:13 +0100 +Subject: ALSA: hda/realtek - Avoid invalid COEFs for ALC271X + +From: Takashi Iwai + +commit d3c56568f43807135f2c2a09582a69f809f0d8b7 upstream. + +We've seen often problems after suspend/resume on Acer Aspire One +AO725 with ALC271X codec as reported in kernel bugzilla, and it turned +out that some COEFs doesn't work and triggers the codec communication +stall. + +Since these magic COEF setups are specific to ALC269VB for some PLL +configurations, the machine works even without these manual +adjustment. So, let's simply avoid applying them for ALC271X. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=52181 +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -6260,6 +6260,9 @@ static void alc269_fill_coef(struct hda_ + + if (spec->codec_variant != ALC269_TYPE_ALC269VB) + return; ++ /* ALC271X doesn't seem to support these COEFs (bko#52181) */ ++ if (!strcmp(codec->chip_name, "ALC271X")) ++ return; + + if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { + alc_write_coef_idx(codec, 0xf, 0x960b); diff --git a/queue-3.4/mm-__set_page_dirty-uses-spin_lock_irqsave-instead-of-spin_lock_irq.patch b/queue-3.4/mm-__set_page_dirty-uses-spin_lock_irqsave-instead-of-spin_lock_irq.patch new file mode 100644 index 00000000000..b0f840662cb --- /dev/null +++ b/queue-3.4/mm-__set_page_dirty-uses-spin_lock_irqsave-instead-of-spin_lock_irq.patch @@ -0,0 +1,55 @@ +From 227d53b397a32a7614667b3ecaf1d89902fb6c12 Mon Sep 17 00:00:00 2001 +From: KOSAKI Motohiro +Date: Thu, 6 Feb 2014 12:04:28 -0800 +Subject: mm: __set_page_dirty uses spin_lock_irqsave instead of spin_lock_irq + +From: KOSAKI Motohiro + +commit 227d53b397a32a7614667b3ecaf1d89902fb6c12 upstream. + +To use spin_{un}lock_irq is dangerous if caller disabled interrupt. +During aio buffer migration, we have a possibility to see the following +call stack. + +aio_migratepage [disable interrupt] + migrate_page_copy + clear_page_dirty_for_io + set_page_dirty + __set_page_dirty_buffers + __set_page_dirty + spin_lock_irq + +This mean, current aio migration is a deadlockable. spin_lock_irqsave +is a safer alternative and we should use it. + +Signed-off-by: KOSAKI Motohiro +Reported-by: David Rientjes rientjes@google.com> +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/buffer.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/fs/buffer.c ++++ b/fs/buffer.c +@@ -613,14 +613,16 @@ EXPORT_SYMBOL(mark_buffer_dirty_inode); + static void __set_page_dirty(struct page *page, + struct address_space *mapping, int warn) + { +- spin_lock_irq(&mapping->tree_lock); ++ unsigned long flags; ++ ++ spin_lock_irqsave(&mapping->tree_lock, flags); + if (page->mapping) { /* Race with truncate? */ + WARN_ON_ONCE(warn && !PageUptodate(page)); + account_page_dirtied(page, mapping); + radix_tree_tag_set(&mapping->page_tree, + page_index(page), PAGECACHE_TAG_DIRTY); + } +- spin_unlock_irq(&mapping->tree_lock); ++ spin_unlock_irqrestore(&mapping->tree_lock, flags); + __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); + } + diff --git a/queue-3.4/mm-__set_page_dirty_nobuffers-uses-spin_lock_irqsave-instead-of-spin_lock_irq.patch b/queue-3.4/mm-__set_page_dirty_nobuffers-uses-spin_lock_irqsave-instead-of-spin_lock_irq.patch new file mode 100644 index 00000000000..63565c6d017 --- /dev/null +++ b/queue-3.4/mm-__set_page_dirty_nobuffers-uses-spin_lock_irqsave-instead-of-spin_lock_irq.patch @@ -0,0 +1,87 @@ +From a85d9df1ea1d23682a0ed1e100e6965006595d06 Mon Sep 17 00:00:00 2001 +From: KOSAKI Motohiro +Date: Thu, 6 Feb 2014 12:04:24 -0800 +Subject: mm: __set_page_dirty_nobuffers() uses spin_lock_irqsave() instead of spin_lock_irq() + +From: KOSAKI Motohiro + +commit a85d9df1ea1d23682a0ed1e100e6965006595d06 upstream. + +During aio stress test, we observed the following lockdep warning. This +mean AIO+numa_balancing is currently deadlockable. + +The problem is, aio_migratepage disable interrupt, but +__set_page_dirty_nobuffers unintentionally enable it again. + +Generally, all helper function should use spin_lock_irqsave() instead of +spin_lock_irq() because they don't know caller at all. + + other info that might help us debug this: + Possible unsafe locking scenario: + + CPU0 + ---- + lock(&(&ctx->completion_lock)->rlock); + + lock(&(&ctx->completion_lock)->rlock); + + *** DEADLOCK *** + + dump_stack+0x19/0x1b + print_usage_bug+0x1f7/0x208 + mark_lock+0x21d/0x2a0 + mark_held_locks+0xb9/0x140 + trace_hardirqs_on_caller+0x105/0x1d0 + trace_hardirqs_on+0xd/0x10 + _raw_spin_unlock_irq+0x2c/0x50 + __set_page_dirty_nobuffers+0x8c/0xf0 + migrate_page_copy+0x434/0x540 + aio_migratepage+0xb1/0x140 + move_to_new_page+0x7d/0x230 + migrate_pages+0x5e5/0x700 + migrate_misplaced_page+0xbc/0xf0 + do_numa_page+0x102/0x190 + handle_pte_fault+0x241/0x970 + handle_mm_fault+0x265/0x370 + __do_page_fault+0x172/0x5a0 + do_page_fault+0x1a/0x70 + page_fault+0x28/0x30 + +Signed-off-by: KOSAKI Motohiro +Cc: Larry Woodman +Cc: Rik van Riel +Cc: Johannes Weiner +Acked-by: David Rientjes +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/page-writeback.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/mm/page-writeback.c ++++ b/mm/page-writeback.c +@@ -1993,11 +1993,12 @@ int __set_page_dirty_nobuffers(struct pa + if (!TestSetPageDirty(page)) { + struct address_space *mapping = page_mapping(page); + struct address_space *mapping2; ++ unsigned long flags; + + if (!mapping) + return 1; + +- spin_lock_irq(&mapping->tree_lock); ++ spin_lock_irqsave(&mapping->tree_lock, flags); + mapping2 = page_mapping(page); + if (mapping2) { /* Race with truncate? */ + BUG_ON(mapping2 != mapping); +@@ -2006,7 +2007,7 @@ int __set_page_dirty_nobuffers(struct pa + radix_tree_tag_set(&mapping->page_tree, + page_index(page), PAGECACHE_TAG_DIRTY); + } +- spin_unlock_irq(&mapping->tree_lock); ++ spin_unlock_irqrestore(&mapping->tree_lock, flags); + if (mapping->host) { + /* !PageAnon && !swapper_space */ + __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); diff --git a/queue-3.4/series b/queue-3.4/series index 28db5b4d597..667adaf5eef 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -1 +1,5 @@ selinux-fix-kernel-bug-on-empty-security-contexts.patch +alsa-hda-realtek-avoid-invalid-coefs-for-alc271x.patch +mm-__set_page_dirty_nobuffers-uses-spin_lock_irqsave-instead-of-spin_lock_irq.patch +mm-__set_page_dirty-uses-spin_lock_irqsave-instead-of-spin_lock_irq.patch +x86-hweight-fix-bug-when-booting-with-config_gcov_profile_all-y.patch diff --git a/queue-3.4/x86-hweight-fix-bug-when-booting-with-config_gcov_profile_all-y.patch b/queue-3.4/x86-hweight-fix-bug-when-booting-with-config_gcov_profile_all-y.patch new file mode 100644 index 00000000000..51df1e38fc0 --- /dev/null +++ b/queue-3.4/x86-hweight-fix-bug-when-booting-with-config_gcov_profile_all-y.patch @@ -0,0 +1,46 @@ +From 6583327c4dd55acbbf2a6f25e775b28b3abf9a42 Mon Sep 17 00:00:00 2001 +From: Peter Oberparleiter +Date: Thu, 6 Feb 2014 15:58:20 +0100 +Subject: x86, hweight: Fix BUG when booting with CONFIG_GCOV_PROFILE_ALL=y + +From: Peter Oberparleiter + +commit 6583327c4dd55acbbf2a6f25e775b28b3abf9a42 upstream. + +Commit d61931d89b, "x86: Add optimized popcnt variants" introduced +compile flag -fcall-saved-rdi for lib/hweight.c. When combined with +options -fprofile-arcs and -O2, this flag causes gcc to generate +broken constructor code. As a result, a 64 bit x86 kernel compiled +with CONFIG_GCOV_PROFILE_ALL=y prints message "gcov: could not create +file" and runs into sproadic BUGs during boot. + +The gcc people indicate that these kinds of problems are endemic when +using ad hoc calling conventions. It is therefore best to treat any +file compiled with ad hoc calling conventions as an isolated +environment and avoid things like profiling or coverage analysis, +since those subsystems assume a "normal" calling conventions. + +This patch avoids the bug by excluding lib/hweight.o from coverage +profiling. + +Reported-by: Meelis Roos +Cc: Andrew Morton +Signed-off-by: Peter Oberparleiter +Link: http://lkml.kernel.org/r/52F3A30C.7050205@linux.vnet.ibm.com +Signed-off-by: H. Peter Anvin +Signed-off-by: Greg Kroah-Hartman + +--- + lib/Makefile | 1 + + 1 file changed, 1 insertion(+) + +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -41,6 +41,7 @@ obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock + lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o + lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o + ++GCOV_PROFILE_hweight.o := n + CFLAGS_hweight.o = $(subst $(quote),,$(CONFIG_ARCH_HWEIGHT_CFLAGS)) + obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o +