From: Greg Kroah-Hartman Date: Tue, 9 Oct 2012 23:49:37 +0000 (+0900) Subject: 3.0-stable patches X-Git-Tag: v3.0.46~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8f0fe46ed1b5ca865e36fb1b3b77a3c0bcce690;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: alsa-aloop-add-locking-to-timer-access.patch alsa-hda-limit-internal-mic-boost-for-asus-x202e.patch alsa-usb-disable-broken-hw-volume-for-tenx-tp6911.patch alsa-usb-support-for-original-xbox-communicator.patch asoc-wm9712-fix-name-of-capture-switch.patch mm-fix-invalidate_complete_page2-lock-ordering.patch mm-thp-fix-pmd_present-for-split_huge_page-and-prot_none-with-thp.patch --- diff --git a/queue-3.0/alsa-aloop-add-locking-to-timer-access.patch b/queue-3.0/alsa-aloop-add-locking-to-timer-access.patch new file mode 100644 index 00000000000..68c92e1779f --- /dev/null +++ b/queue-3.0/alsa-aloop-add-locking-to-timer-access.patch @@ -0,0 +1,69 @@ +From d4f1e48bd11e3df6a26811f7a1f06c4225d92f7d Mon Sep 17 00:00:00 2001 +From: Omair Mohammed Abdullah +Date: Sat, 29 Sep 2012 12:24:05 +0530 +Subject: ALSA: aloop - add locking to timer access + +From: Omair Mohammed Abdullah + +commit d4f1e48bd11e3df6a26811f7a1f06c4225d92f7d upstream. + +When the loopback timer handler is running, calling del_timer() (for STOP +trigger) will not wait for the handler to complete before deactivating the +timer. The timer gets rescheduled in the handler as usual. Then a subsequent +START trigger will try to start the timer using add_timer() with a timer pending +leading to a kernel panic. + +Serialize the calls to add_timer() and del_timer() using a spin lock to avoid +this. + +Signed-off-by: Omair Mohammed Abdullah +Signed-off-by: Vinod Koul +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/drivers/aloop.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/sound/drivers/aloop.c ++++ b/sound/drivers/aloop.c +@@ -119,6 +119,7 @@ struct loopback_pcm { + unsigned int period_size_frac; + unsigned long last_jiffies; + struct timer_list timer; ++ spinlock_t timer_lock; + }; + + static struct platform_device *devices[SNDRV_CARDS]; +@@ -169,6 +170,7 @@ static void loopback_timer_start(struct + unsigned long tick; + unsigned int rate_shift = get_rate_shift(dpcm); + ++ spin_lock(&dpcm->timer_lock); + if (rate_shift != dpcm->pcm_rate_shift) { + dpcm->pcm_rate_shift = rate_shift; + dpcm->period_size_frac = frac_pos(dpcm, dpcm->pcm_period_size); +@@ -181,12 +183,15 @@ static void loopback_timer_start(struct + tick = (tick + dpcm->pcm_bps - 1) / dpcm->pcm_bps; + dpcm->timer.expires = jiffies + tick; + add_timer(&dpcm->timer); ++ spin_unlock(&dpcm->timer_lock); + } + + static inline void loopback_timer_stop(struct loopback_pcm *dpcm) + { ++ spin_lock(&dpcm->timer_lock); + del_timer(&dpcm->timer); + dpcm->timer.expires = 0; ++ spin_unlock(&dpcm->timer_lock); + } + + #define CABLE_VALID_PLAYBACK (1 << SNDRV_PCM_STREAM_PLAYBACK) +@@ -658,6 +663,7 @@ static int loopback_open(struct snd_pcm_ + dpcm->substream = substream; + setup_timer(&dpcm->timer, loopback_timer_function, + (unsigned long)dpcm); ++ spin_lock_init(&dpcm->timer_lock); + + cable = loopback->cables[substream->number][dev]; + if (!cable) { diff --git a/queue-3.0/alsa-hda-limit-internal-mic-boost-for-asus-x202e.patch b/queue-3.0/alsa-hda-limit-internal-mic-boost-for-asus-x202e.patch new file mode 100644 index 00000000000..88a8b6345ca --- /dev/null +++ b/queue-3.0/alsa-hda-limit-internal-mic-boost-for-asus-x202e.patch @@ -0,0 +1,67 @@ +From 4b527b6516ab1f0af8aaedd02dbf71ee2c1180f4 Mon Sep 17 00:00:00 2001 +From: David Henningsson +Date: Tue, 18 Sep 2012 14:26:59 +0200 +Subject: ALSA: hda - limit internal mic boost for Asus X202E + +From: David Henningsson + +commit 4b527b6516ab1f0af8aaedd02dbf71ee2c1180f4 upstream. + +When the input gain for the internal mic is set to its maximum level, +the background noise becomes so high - and any relevant signal clipped - +that the setting becomes unusable. It is better to limit the amplification. + +BugLink: https://bugs.launchpad.net/bugs/1052460 +Signed-off-by: David Henningsson +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_via.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +--- a/sound/pci/hda/patch_via.c ++++ b/sound/pci/hda/patch_via.c +@@ -5724,6 +5724,32 @@ static void set_widgets_power_state_vt20 + AC_VERB_SET_POWER_STATE, AC_PWRST_D3); + } + ++/* ++ * pin fix-up ++ */ ++enum { ++ VIA_FIXUP_INTMIC_BOOST, ++}; ++ ++static void via_fixup_intmic_boost(struct hda_codec *codec, ++ const struct hda_fixup *fix, int action) ++{ ++ if (action == HDA_FIXUP_ACT_PRE_PROBE) ++ override_mic_boost(codec, 0x30, 0, 2, 40); ++} ++ ++static const struct hda_fixup via_fixups[] = { ++ [VIA_FIXUP_INTMIC_BOOST] = { ++ .type = HDA_FIXUP_FUNC, ++ .v.func = via_fixup_intmic_boost, ++ }, ++}; ++ ++static const struct snd_pci_quirk vt2002p_fixups[] = { ++ SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST), ++ {} ++}; ++ + /* patch for vt2002P */ + static int patch_vt2002P(struct hda_codec *codec) + { +@@ -5735,6 +5761,9 @@ static int patch_vt2002P(struct hda_code + if (spec == NULL) + return -ENOMEM; + ++ snd_hda_pick_fixup(codec, NULL, vt2002p_fixups, via_fixups); ++ snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); ++ + /* automatic parse from the BIOS config */ + err = vt2002P_parse_auto_config(codec); + if (err < 0) { diff --git a/queue-3.0/alsa-usb-disable-broken-hw-volume-for-tenx-tp6911.patch b/queue-3.0/alsa-usb-disable-broken-hw-volume-for-tenx-tp6911.patch new file mode 100644 index 00000000000..d2adbe86478 --- /dev/null +++ b/queue-3.0/alsa-usb-disable-broken-hw-volume-for-tenx-tp6911.patch @@ -0,0 +1,42 @@ +From c10514394ef9e8de93a4ad8c8904d71dcd82c122 Mon Sep 17 00:00:00 2001 +From: David Henningsson +Date: Thu, 20 Sep 2012 10:20:41 +0200 +Subject: ALSA: usb - disable broken hw volume for Tenx TP6911 + +From: David Henningsson + +commit c10514394ef9e8de93a4ad8c8904d71dcd82c122 upstream. + +While going through Ubuntu bugs, I discovered this patch being +posted and a confirmation that the patch works as expected. + +Finding out how the hw volume really works would be preferrable +to just disabling the broken one, but this would be better than +nothing. + +Credit: sndfnsdfin (qawsnews) +BugLink: https://bugs.launchpad.net/bugs/559939 +Signed-off-by: David Henningsson +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/mixer.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/sound/usb/mixer.c ++++ b/sound/usb/mixer.c +@@ -1246,6 +1246,13 @@ static int parse_audio_feature_unit(stru + /* disable non-functional volume control */ + master_bits &= ~UAC_CONTROL_BIT(UAC_FU_VOLUME); + break; ++ case USB_ID(0x1130, 0xf211): ++ snd_printk(KERN_INFO ++ "usbmixer: volume control quirk for Tenx TP6911 Audio Headset\n"); ++ /* disable non-functional volume control */ ++ channels = 0; ++ break; ++ + } + if (channels > 0) + first_ch_bits = snd_usb_combine_bytes(bmaControls + csize, csize); diff --git a/queue-3.0/alsa-usb-support-for-original-xbox-communicator.patch b/queue-3.0/alsa-usb-support-for-original-xbox-communicator.patch new file mode 100644 index 00000000000..3b4215d9ab5 --- /dev/null +++ b/queue-3.0/alsa-usb-support-for-original-xbox-communicator.patch @@ -0,0 +1,81 @@ +From c05fce586d4da2dfe0309bef3795a8586e967bc3 Mon Sep 17 00:00:00 2001 +From: Marko Friedemann +Date: Mon, 3 Sep 2012 10:12:40 +0200 +Subject: ALSA: USB: Support for (original) Xbox Communicator + +From: Marko Friedemann + +commit c05fce586d4da2dfe0309bef3795a8586e967bc3 upstream. + +Added support for Xbox Communicator to USB quirks. + +Signed-off-by: Marko Friedemann +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/quirks-table.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 53 insertions(+) + +--- a/sound/usb/quirks-table.h ++++ b/sound/usb/quirks-table.h +@@ -2581,6 +2581,59 @@ YAMAHA_DEVICE(0x7010, "UB99"), + } + }, + ++/* Microsoft XboxLive Headset/Xbox Communicator */ ++{ ++ USB_DEVICE(0x045e, 0x0283), ++ .bInterfaceClass = USB_CLASS_PER_INTERFACE, ++ .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { ++ .vendor_name = "Microsoft", ++ .product_name = "XboxLive Headset/Xbox Communicator", ++ .ifnum = QUIRK_ANY_INTERFACE, ++ .type = QUIRK_COMPOSITE, ++ .data = &(const struct snd_usb_audio_quirk[]) { ++ { ++ /* playback */ ++ .ifnum = 0, ++ .type = QUIRK_AUDIO_FIXED_ENDPOINT, ++ .data = &(const struct audioformat) { ++ .formats = SNDRV_PCM_FMTBIT_S16_LE, ++ .channels = 1, ++ .iface = 0, ++ .altsetting = 0, ++ .altset_idx = 0, ++ .attributes = 0, ++ .endpoint = 0x04, ++ .ep_attr = 0x05, ++ .rates = SNDRV_PCM_RATE_CONTINUOUS, ++ .rate_min = 22050, ++ .rate_max = 22050 ++ } ++ }, ++ { ++ /* capture */ ++ .ifnum = 1, ++ .type = QUIRK_AUDIO_FIXED_ENDPOINT, ++ .data = &(const struct audioformat) { ++ .formats = SNDRV_PCM_FMTBIT_S16_LE, ++ .channels = 1, ++ .iface = 1, ++ .altsetting = 0, ++ .altset_idx = 0, ++ .attributes = 0, ++ .endpoint = 0x85, ++ .ep_attr = 0x05, ++ .rates = SNDRV_PCM_RATE_CONTINUOUS, ++ .rate_min = 16000, ++ .rate_max = 16000 ++ } ++ }, ++ { ++ .ifnum = -1 ++ } ++ } ++ } ++}, ++ + { + /* + * Some USB MIDI devices don't have an audio control interface, diff --git a/queue-3.0/asoc-wm9712-fix-name-of-capture-switch.patch b/queue-3.0/asoc-wm9712-fix-name-of-capture-switch.patch new file mode 100644 index 00000000000..0fc76d6671d --- /dev/null +++ b/queue-3.0/asoc-wm9712-fix-name-of-capture-switch.patch @@ -0,0 +1,29 @@ +From 689185b78ba6fbe0042f662a468b5565909dff7a Mon Sep 17 00:00:00 2001 +From: Mark Brown +Date: Tue, 31 Jul 2012 18:37:29 +0100 +Subject: ASoC: wm9712: Fix name of Capture Switch + +From: Mark Brown + +commit 689185b78ba6fbe0042f662a468b5565909dff7a upstream. + +Help UIs associate it with the matching gain control. + +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/wm9712.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/soc/codecs/wm9712.c ++++ b/sound/soc/codecs/wm9712.c +@@ -144,7 +144,7 @@ SOC_SINGLE("Playback Attenuate (-6dB) Sw + SOC_SINGLE("Bass Volume", AC97_MASTER_TONE, 8, 15, 1), + SOC_SINGLE("Treble Volume", AC97_MASTER_TONE, 0, 15, 1), + +-SOC_SINGLE("Capture ADC Switch", AC97_REC_GAIN, 15, 1, 1), ++SOC_SINGLE("Capture Switch", AC97_REC_GAIN, 15, 1, 1), + SOC_ENUM("Capture Volume Steps", wm9712_enum[6]), + SOC_DOUBLE("Capture Volume", AC97_REC_GAIN, 8, 0, 63, 1), + SOC_SINGLE("Capture ZC Switch", AC97_REC_GAIN, 7, 1, 0), diff --git a/queue-3.0/mm-fix-invalidate_complete_page2-lock-ordering.patch b/queue-3.0/mm-fix-invalidate_complete_page2-lock-ordering.patch new file mode 100644 index 00000000000..a07cd77682b --- /dev/null +++ b/queue-3.0/mm-fix-invalidate_complete_page2-lock-ordering.patch @@ -0,0 +1,63 @@ +From ec4d9f626d5908b6052c2973f37992f1db52e967 Mon Sep 17 00:00:00 2001 +From: Hugh Dickins +Date: Mon, 8 Oct 2012 16:33:14 -0700 +Subject: mm: fix invalidate_complete_page2() lock ordering + +From: Hugh Dickins + +commit ec4d9f626d5908b6052c2973f37992f1db52e967 upstream. + +In fuzzing with trinity, lockdep protested "possible irq lock inversion +dependency detected" when isolate_lru_page() reenabled interrupts while +still holding the supposedly irq-safe tree_lock: + +invalidate_inode_pages2 + invalidate_complete_page2 + spin_lock_irq(&mapping->tree_lock) + clear_page_mlock + isolate_lru_page + spin_unlock_irq(&zone->lru_lock) + +isolate_lru_page() is correct to enable interrupts unconditionally: +invalidate_complete_page2() is incorrect to call clear_page_mlock() while +holding tree_lock, which is supposed to nest inside lru_lock. + +Both truncate_complete_page() and invalidate_complete_page() call +clear_page_mlock() before taking tree_lock to remove page from radix_tree. + I guess invalidate_complete_page2() preferred to test PageDirty (again) +under tree_lock before committing to the munlock; but since the page has +already been unmapped, its state is already somewhat inconsistent, and no +worse if clear_page_mlock() moved up. + +Reported-by: Sasha Levin +Deciphered-by: Andrew Morton +Signed-off-by: Hugh Dickins +Acked-by: Mel Gorman +Cc: Rik van Riel +Cc: Johannes Weiner +Cc: Michel Lespinasse +Cc: Ying Han +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/truncate.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/mm/truncate.c ++++ b/mm/truncate.c +@@ -398,11 +398,12 @@ invalidate_complete_page2(struct address + if (page_has_private(page) && !try_to_release_page(page, GFP_KERNEL)) + return 0; + ++ clear_page_mlock(page); ++ + spin_lock_irq(&mapping->tree_lock); + if (PageDirty(page)) + goto failed; + +- clear_page_mlock(page); + BUG_ON(page_has_private(page)); + __delete_from_page_cache(page); + spin_unlock_irq(&mapping->tree_lock); diff --git a/queue-3.0/mm-thp-fix-pmd_present-for-split_huge_page-and-prot_none-with-thp.patch b/queue-3.0/mm-thp-fix-pmd_present-for-split_huge_page-and-prot_none-with-thp.patch new file mode 100644 index 00000000000..b78dae6d444 --- /dev/null +++ b/queue-3.0/mm-thp-fix-pmd_present-for-split_huge_page-and-prot_none-with-thp.patch @@ -0,0 +1,72 @@ +From 027ef6c87853b0a9df53175063028edb4950d476 Mon Sep 17 00:00:00 2001 +From: Andrea Arcangeli +Date: Mon, 8 Oct 2012 16:33:27 -0700 +Subject: mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP + +From: Andrea Arcangeli + +commit 027ef6c87853b0a9df53175063028edb4950d476 upstream. + +In many places !pmd_present has been converted to pmd_none. For pmds +that's equivalent and pmd_none is quicker so using pmd_none is better. + +However (unless we delete pmd_present) we should provide an accurate +pmd_present too. This will avoid the risk of code thinking the pmd is non +present because it's under __split_huge_page_map, see the pmd_mknotpresent +there and the comment above it. + +If the page has been mprotected as PROT_NONE, it would also lead to a +pmd_present false negative in the same way as the race with +split_huge_page. + +Because the PSE bit stays on at all times (both during split_huge_page and +when the _PAGE_PROTNONE bit get set), we could only check for the PSE bit, +but checking the PROTNONE bit too is still good to remember pmd_present +must always keep PROT_NONE into account. + +This explains a not reproducible BUG_ON that was seldom reported on the +lists. + +The same issue is in pmd_large, it would go wrong with both PROT_NONE and +if it races with split_huge_page. + +Signed-off-by: Andrea Arcangeli +Acked-by: Rik van Riel +Cc: Johannes Weiner +Cc: Hugh Dickins +Cc: Mel Gorman +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/include/asm/pgtable.h | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +--- a/arch/x86/include/asm/pgtable.h ++++ b/arch/x86/include/asm/pgtable.h +@@ -146,8 +146,7 @@ static inline unsigned long pmd_pfn(pmd_ + + static inline int pmd_large(pmd_t pte) + { +- return (pmd_flags(pte) & (_PAGE_PSE | _PAGE_PRESENT)) == +- (_PAGE_PSE | _PAGE_PRESENT); ++ return pmd_flags(pte) & _PAGE_PSE; + } + + #ifdef CONFIG_TRANSPARENT_HUGEPAGE +@@ -415,7 +414,13 @@ static inline int pte_hidden(pte_t pte) + + static inline int pmd_present(pmd_t pmd) + { +- return pmd_flags(pmd) & _PAGE_PRESENT; ++ /* ++ * Checking for _PAGE_PSE is needed too because ++ * split_huge_page will temporarily clear the present bit (but ++ * the _PAGE_PSE flag will remain set at all times while the ++ * _PAGE_PRESENT bit is clear). ++ */ ++ return pmd_flags(pmd) & (_PAGE_PRESENT | _PAGE_PROTNONE | _PAGE_PSE); + } + + static inline int pmd_none(pmd_t pmd) diff --git a/queue-3.0/series b/queue-3.0/series index 69469e0ce49..5df85ff7579 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -47,3 +47,10 @@ pci-check-p2p-bridge-for-invalid-secondary-subordinate-range.patch ext4-online-defrag-is-not-supported-for-journaled-files.patch ext4-always-set-i_op-in-ext4_mknod.patch ext4-fix-fdatasync-for-files-with-only-i_size-changes.patch +asoc-wm9712-fix-name-of-capture-switch.patch +mm-fix-invalidate_complete_page2-lock-ordering.patch +mm-thp-fix-pmd_present-for-split_huge_page-and-prot_none-with-thp.patch +alsa-aloop-add-locking-to-timer-access.patch +alsa-hda-limit-internal-mic-boost-for-asus-x202e.patch +alsa-usb-disable-broken-hw-volume-for-tenx-tp6911.patch +alsa-usb-support-for-original-xbox-communicator.patch