From 32408eb1f3ffef92f7218c317de1aff698acc8cc Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 10 Sep 2019 12:29:03 +0100 Subject: [PATCH] 4.4-stable patches added patches: alsa-hda-fix-potential-endless-loop-at-applying-quirks.patch alsa-hda-realtek-fix-overridden-device-specific-initialization.patch sched-fair-don-t-assign-runtime-for-throttled-cfs_rq.patch --- queue-4.14/series | 6 ++ queue-4.19/series | 10 +++ ...tial-endless-loop-at-applying-quirks.patch | 43 +++++++++++ ...idden-device-specific-initialization.patch | 69 ++++++++++++++++++ ...-assign-runtime-for-throttled-cfs_rq.patch | 73 +++++++++++++++++++ queue-4.4/series | 3 + queue-4.9/series | 5 ++ queue-5.2/series | 15 ++++ 8 files changed, 224 insertions(+) create mode 100644 queue-4.14/series create mode 100644 queue-4.19/series create mode 100644 queue-4.4/alsa-hda-fix-potential-endless-loop-at-applying-quirks.patch create mode 100644 queue-4.4/alsa-hda-realtek-fix-overridden-device-specific-initialization.patch create mode 100644 queue-4.4/sched-fair-don-t-assign-runtime-for-throttled-cfs_rq.patch create mode 100644 queue-4.4/series create mode 100644 queue-4.9/series create mode 100644 queue-5.2/series diff --git a/queue-4.14/series b/queue-4.14/series new file mode 100644 index 00000000000..d26f7116cb1 --- /dev/null +++ b/queue-4.14/series @@ -0,0 +1,6 @@ +alsa-hda-fix-potential-endless-loop-at-applying-quirks.patch +alsa-hda-realtek-fix-overridden-device-specific-initialization.patch +alsa-hda-realtek-fix-the-problem-of-two-front-mics-on-a-thinkcentre.patch +sched-fair-don-t-assign-runtime-for-throttled-cfs_rq.patch +drm-vmwgfx-fix-double-free-in-vmw_recv_msg.patch +powerpc-tm-fix-fp-vmx-unavailable-exceptions-inside-a-transaction.patch diff --git a/queue-4.19/series b/queue-4.19/series new file mode 100644 index 00000000000..ccc07356a78 --- /dev/null +++ b/queue-4.19/series @@ -0,0 +1,10 @@ +alsa-hda-fix-potential-endless-loop-at-applying-quirks.patch +alsa-hda-realtek-fix-overridden-device-specific-initialization.patch +alsa-hda-realtek-add-quirk-for-hp-pavilion-15.patch +alsa-hda-realtek-enable-internal-speaker-headset-mic-of-asus-ux431fl.patch +alsa-hda-realtek-fix-the-problem-of-two-front-mics-on-a-thinkcentre.patch +sched-fair-don-t-assign-runtime-for-throttled-cfs_rq.patch +drm-vmwgfx-fix-double-free-in-vmw_recv_msg.patch +vhost-test-fix-build-for-vhost-test.patch +vhost-test-fix-build-for-vhost-test-again.patch +powerpc-tm-fix-fp-vmx-unavailable-exceptions-inside-a-transaction.patch diff --git a/queue-4.4/alsa-hda-fix-potential-endless-loop-at-applying-quirks.patch b/queue-4.4/alsa-hda-fix-potential-endless-loop-at-applying-quirks.patch new file mode 100644 index 00000000000..4d3a524a72a --- /dev/null +++ b/queue-4.4/alsa-hda-fix-potential-endless-loop-at-applying-quirks.patch @@ -0,0 +1,43 @@ +From 333f31436d3db19f4286f8862a00ea1d8d8420a1 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 29 Aug 2019 09:52:02 +0200 +Subject: ALSA: hda - Fix potential endless loop at applying quirks + +From: Takashi Iwai + +commit 333f31436d3db19f4286f8862a00ea1d8d8420a1 upstream. + +Since the chained quirks via chained_before flag is applied before the +depth check, it may lead to the endless recursive calls, when the +chain were set up incorrectly. Fix it by moving the depth check at +the beginning of the loop. + +Fixes: 1f57825077dc ("ALSA: hda - Add chained_before flag to the fixup entry") +Cc: +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/hda_auto_parser.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/sound/pci/hda/hda_auto_parser.c ++++ b/sound/pci/hda/hda_auto_parser.c +@@ -827,6 +827,8 @@ static void apply_fixup(struct hda_codec + while (id >= 0) { + const struct hda_fixup *fix = codec->fixup_list + id; + ++ if (++depth > 10) ++ break; + if (fix->chained_before) + apply_fixup(codec, fix->chain_id, action, depth + 1); + +@@ -866,8 +868,6 @@ static void apply_fixup(struct hda_codec + } + if (!fix->chained || fix->chained_before) + break; +- if (++depth > 10) +- break; + id = fix->chain_id; + } + } diff --git a/queue-4.4/alsa-hda-realtek-fix-overridden-device-specific-initialization.patch b/queue-4.4/alsa-hda-realtek-fix-overridden-device-specific-initialization.patch new file mode 100644 index 00000000000..571645f1e46 --- /dev/null +++ b/queue-4.4/alsa-hda-realtek-fix-overridden-device-specific-initialization.patch @@ -0,0 +1,69 @@ +From 89781d0806c2c4f29072d3f00cb2dd4274aabc3d Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Fri, 30 Aug 2019 12:03:38 +0200 +Subject: ALSA: hda/realtek - Fix overridden device-specific initialization + +From: Takashi Iwai + +commit 89781d0806c2c4f29072d3f00cb2dd4274aabc3d upstream. + +The recent change to shuffle the codec initialization procedure for +Realtek via commit 607ca3bd220f ("ALSA: hda/realtek - EAPD turn on +later") caused the silent output on some machines. This change was +supposed to be safe, but it isn't actually; some devices have quirk +setups to override the EAPD via COEF or BTL in the additional verb +table, which is applied at the beginning of snd_hda_gen_init(). And +this EAPD setup is again overridden in alc_auto_init_amp(). + +For recovering from the regression, tell snd_hda_gen_init() not to +apply the verbs there by a new flag, then apply the verbs in +alc_init(). + +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204727 +Fixes: 607ca3bd220f ("ALSA: hda/realtek - EAPD turn on later") +Cc: +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/hda_generic.c | 3 ++- + sound/pci/hda/hda_generic.h | 1 + + sound/pci/hda/patch_realtek.c | 2 ++ + 3 files changed, 5 insertions(+), 1 deletion(-) + +--- a/sound/pci/hda/hda_generic.c ++++ b/sound/pci/hda/hda_generic.c +@@ -5826,7 +5826,8 @@ int snd_hda_gen_init(struct hda_codec *c + if (spec->init_hook) + spec->init_hook(codec); + +- snd_hda_apply_verbs(codec); ++ if (!spec->skip_verbs) ++ snd_hda_apply_verbs(codec); + + init_multi_out(codec); + init_extra_out(codec); +--- a/sound/pci/hda/hda_generic.h ++++ b/sound/pci/hda/hda_generic.h +@@ -236,6 +236,7 @@ struct hda_gen_spec { + unsigned int indep_hp_enabled:1; /* independent HP enabled */ + unsigned int have_aamix_ctl:1; + unsigned int hp_mic_jack_modes:1; ++ unsigned int skip_verbs:1; /* don't apply verbs at snd_hda_gen_init() */ + + /* additional mute flags (only effective with auto_mute_via_amp=1) */ + u64 mute_bits; +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -772,9 +772,11 @@ static int alc_init(struct hda_codec *co + if (spec->init_hook) + spec->init_hook(codec); + ++ spec->gen.skip_verbs = 1; /* applied in below */ + snd_hda_gen_init(codec); + alc_fix_pll(codec); + alc_auto_init_amp(codec, spec->init_amp); ++ snd_hda_apply_verbs(codec); /* apply verbs here after own init */ + + snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); + diff --git a/queue-4.4/sched-fair-don-t-assign-runtime-for-throttled-cfs_rq.patch b/queue-4.4/sched-fair-don-t-assign-runtime-for-throttled-cfs_rq.patch new file mode 100644 index 00000000000..15a633cbac5 --- /dev/null +++ b/queue-4.4/sched-fair-don-t-assign-runtime-for-throttled-cfs_rq.patch @@ -0,0 +1,73 @@ +From 5e2d2cc2588bd3307ce3937acbc2ed03c830a861 Mon Sep 17 00:00:00 2001 +From: Liangyan +Date: Mon, 26 Aug 2019 20:16:33 +0800 +Subject: sched/fair: Don't assign runtime for throttled cfs_rq + +From: Liangyan + +commit 5e2d2cc2588bd3307ce3937acbc2ed03c830a861 upstream. + +do_sched_cfs_period_timer() will refill cfs_b runtime and call +distribute_cfs_runtime to unthrottle cfs_rq, sometimes cfs_b->runtime +will allocate all quota to one cfs_rq incorrectly, then other cfs_rqs +attached to this cfs_b can't get runtime and will be throttled. + +We find that one throttled cfs_rq has non-negative +cfs_rq->runtime_remaining and cause an unexpetced cast from s64 to u64 +in snippet: + + distribute_cfs_runtime() { + runtime = -cfs_rq->runtime_remaining + 1; + } + +The runtime here will change to a large number and consume all +cfs_b->runtime in this cfs_b period. + +According to Ben Segall, the throttled cfs_rq can have +account_cfs_rq_runtime called on it because it is throttled before +idle_balance, and the idle_balance calls update_rq_clock to add time +that is accounted to the task. + +This commit prevents cfs_rq to be assgined new runtime if it has been +throttled until that distribute_cfs_runtime is called. + +Signed-off-by: Liangyan +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Valentin Schneider +Reviewed-by: Ben Segall +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Cc: shanpeic@linux.alibaba.com +Cc: stable@vger.kernel.org +Cc: xlpang@linux.alibaba.com +Fixes: d3d9dc330236 ("sched: Throttle entities exceeding their allowed bandwidth") +Link: https://lkml.kernel.org/r/20190826121633.6538-1-liangyan.peng@linux.alibaba.com +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/sched/fair.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/kernel/sched/fair.c ++++ b/kernel/sched/fair.c +@@ -3546,6 +3546,8 @@ static void __account_cfs_rq_runtime(str + if (likely(cfs_rq->runtime_remaining > 0)) + return; + ++ if (cfs_rq->throttled) ++ return; + /* + * if we're unable to extend our runtime we resched so that the active + * hierarchy can be throttled +@@ -3743,6 +3745,9 @@ static u64 distribute_cfs_runtime(struct + if (!cfs_rq_throttled(cfs_rq)) + goto next; + ++ /* By the above check, this should never be true */ ++ SCHED_WARN_ON(cfs_rq->runtime_remaining > 0); ++ + runtime = -cfs_rq->runtime_remaining + 1; + if (runtime > remaining) + runtime = remaining; diff --git a/queue-4.4/series b/queue-4.4/series new file mode 100644 index 00000000000..bf3767b79a0 --- /dev/null +++ b/queue-4.4/series @@ -0,0 +1,3 @@ +alsa-hda-fix-potential-endless-loop-at-applying-quirks.patch +alsa-hda-realtek-fix-overridden-device-specific-initialization.patch +sched-fair-don-t-assign-runtime-for-throttled-cfs_rq.patch diff --git a/queue-4.9/series b/queue-4.9/series new file mode 100644 index 00000000000..4228e5b287f --- /dev/null +++ b/queue-4.9/series @@ -0,0 +1,5 @@ +alsa-hda-fix-potential-endless-loop-at-applying-quirks.patch +alsa-hda-realtek-fix-overridden-device-specific-initialization.patch +sched-fair-don-t-assign-runtime-for-throttled-cfs_rq.patch +drm-vmwgfx-fix-double-free-in-vmw_recv_msg.patch +powerpc-tm-fix-fp-vmx-unavailable-exceptions-inside-a-transaction.patch diff --git a/queue-5.2/series b/queue-5.2/series new file mode 100644 index 00000000000..8c472b8c0f7 --- /dev/null +++ b/queue-5.2/series @@ -0,0 +1,15 @@ +gpio-pca953x-correct-type-of-reg_direction.patch +gpio-pca953x-use-pca953x_read_regs-instead-of-regmap_bulk_read.patch +alsa-hda-fix-potential-endless-loop-at-applying-quirks.patch +alsa-hda-realtek-fix-overridden-device-specific-initialization.patch +alsa-hda-realtek-add-quirk-for-hp-pavilion-15.patch +alsa-hda-realtek-enable-internal-speaker-headset-mic-of-asus-ux431fl.patch +alsa-hda-realtek-fix-the-problem-of-two-front-mics-on-a-thinkcentre.patch +sched-fair-don-t-assign-runtime-for-throttled-cfs_rq.patch +drm-vmwgfx-fix-double-free-in-vmw_recv_msg.patch +drm-nouveau-sec2-gp102-add-missing-module_firmwares.patch +vhost-test-fix-build-for-vhost-test.patch +vhost-test-fix-build-for-vhost-test-again.patch +powerpc-64e-drop-stale-call-to-smp_processor_id-which-hangs-smp-startup.patch +powerpc-tm-fix-fp-vmx-unavailable-exceptions-inside-a-transaction.patch +powerpc-tm-fix-restoring-fp-vmx-facility-incorrectly-on-interrupts.patch -- 2.47.3