From: Greg Kroah-Hartman Date: Mon, 5 Jun 2017 12:47:01 +0000 (+0200) Subject: 3.18-stable patches X-Git-Tag: v3.18.56~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c233901c64eeb938333874a54b00a3729b4219ec;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: alsa-hda-apply-stac_9200_dell_m22-quirk-for-dell-latitude-d430.patch drm-gma500-psb-actually-use-vbt-mode-when-it-is-found.patch drm-radeon-ci-disable-mclk-switching-for-high-refresh-rates-v2.patch pcmcia-remove-left-over-z-format.patch slub-memcg-cure-the-brainless-abuse-of-sysfs-attributes.patch --- diff --git a/queue-3.18/alsa-hda-apply-stac_9200_dell_m22-quirk-for-dell-latitude-d430.patch b/queue-3.18/alsa-hda-apply-stac_9200_dell_m22-quirk-for-dell-latitude-d430.patch new file mode 100644 index 00000000000..d4af6d1997f --- /dev/null +++ b/queue-3.18/alsa-hda-apply-stac_9200_dell_m22-quirk-for-dell-latitude-d430.patch @@ -0,0 +1,34 @@ +From 1fc2e41f7af4572b07190f9dec28396b418e9a36 Mon Sep 17 00:00:00 2001 +From: Alexander Tsoy +Date: Mon, 22 May 2017 20:58:11 +0300 +Subject: ALSA: hda - apply STAC_9200_DELL_M22 quirk for Dell Latitude D430 + +From: Alexander Tsoy + +commit 1fc2e41f7af4572b07190f9dec28396b418e9a36 upstream. + +This model is actually called 92XXM2-8 in Windows driver. But since pin +configs for M22 and M28 are identical, just reuse M22 quirk. + +Fixes external microphone (tested) and probably docking station ports +(not tested). + +Signed-off-by: Alexander Tsoy +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_sigmatel.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -1537,6 +1537,8 @@ static const struct snd_pci_quirk stac92 + "Dell Inspiron 1501", STAC_9200_DELL_M26), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f6, + "unknown Dell", STAC_9200_DELL_M26), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0201, ++ "Dell Latitude D430", STAC_9200_DELL_M22), + /* Panasonic */ + SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC), + /* Gateway machines needs EAPD to be set on resume */ diff --git a/queue-3.18/drm-gma500-psb-actually-use-vbt-mode-when-it-is-found.patch b/queue-3.18/drm-gma500-psb-actually-use-vbt-mode-when-it-is-found.patch new file mode 100644 index 00000000000..121598ba83a --- /dev/null +++ b/queue-3.18/drm-gma500-psb-actually-use-vbt-mode-when-it-is-found.patch @@ -0,0 +1,64 @@ +From 82bc9a42cf854fdf63155759c0aa790bd1f361b0 Mon Sep 17 00:00:00 2001 +From: Patrik Jakobsson +Date: Tue, 18 Apr 2017 13:43:32 +0200 +Subject: drm/gma500/psb: Actually use VBT mode when it is found + +From: Patrik Jakobsson + +commit 82bc9a42cf854fdf63155759c0aa790bd1f361b0 upstream. + +With LVDS we were incorrectly picking the pre-programmed mode instead of +the prefered mode provided by VBT. Make sure we pick the VBT mode if +one is provided. It is likely that the mode read-out code is still wrong +but this patch fixes the immediate problem on most machines. + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78562 +Signed-off-by: Patrik Jakobsson +Link: http://patchwork.freedesktop.org/patch/msgid/20170418114332.12183-1-patrik.r.jakobsson@gmail.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/gma500/psb_intel_lvds.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c ++++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c +@@ -783,20 +783,23 @@ void psb_intel_lvds_init(struct drm_devi + if (scan->type & DRM_MODE_TYPE_PREFERRED) { + mode_dev->panel_fixed_mode = + drm_mode_duplicate(dev, scan); ++ DRM_DEBUG_KMS("Using mode from DDC\n"); + goto out; /* FIXME: check for quirks */ + } + } + + /* Failed to get EDID, what about VBT? do we need this? */ +- if (mode_dev->vbt_mode) ++ if (dev_priv->lfp_lvds_vbt_mode) { + mode_dev->panel_fixed_mode = +- drm_mode_duplicate(dev, mode_dev->vbt_mode); ++ drm_mode_duplicate(dev, dev_priv->lfp_lvds_vbt_mode); + +- if (!mode_dev->panel_fixed_mode) +- if (dev_priv->lfp_lvds_vbt_mode) +- mode_dev->panel_fixed_mode = +- drm_mode_duplicate(dev, +- dev_priv->lfp_lvds_vbt_mode); ++ if (mode_dev->panel_fixed_mode) { ++ mode_dev->panel_fixed_mode->type |= ++ DRM_MODE_TYPE_PREFERRED; ++ DRM_DEBUG_KMS("Using mode from VBT\n"); ++ goto out; ++ } ++ } + + /* + * If we didn't get EDID, try checking if the panel is already turned +@@ -813,6 +816,7 @@ void psb_intel_lvds_init(struct drm_devi + if (mode_dev->panel_fixed_mode) { + mode_dev->panel_fixed_mode->type |= + DRM_MODE_TYPE_PREFERRED; ++ DRM_DEBUG_KMS("Using pre-programmed mode\n"); + goto out; /* FIXME: check for quirks */ + } + } diff --git a/queue-3.18/drm-radeon-ci-disable-mclk-switching-for-high-refresh-rates-v2.patch b/queue-3.18/drm-radeon-ci-disable-mclk-switching-for-high-refresh-rates-v2.patch new file mode 100644 index 00000000000..4e6bc47bada --- /dev/null +++ b/queue-3.18/drm-radeon-ci-disable-mclk-switching-for-high-refresh-rates-v2.patch @@ -0,0 +1,42 @@ +From 58d7e3e427db1bd68f33025519a9468140280a75 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Thu, 11 May 2017 13:14:14 -0400 +Subject: drm/radeon/ci: disable mclk switching for high refresh rates (v2) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Alex Deucher + +commit 58d7e3e427db1bd68f33025519a9468140280a75 upstream. + +Even if the vblank period would allow it, it still seems to +be problematic on some cards. + +v2: fix logic inversion (Nils) + +bug: https://bugs.freedesktop.org/show_bug.cgi?id=96868 + +Acked-by: Christian König +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/ci_dpm.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/gpu/drm/radeon/ci_dpm.c ++++ b/drivers/gpu/drm/radeon/ci_dpm.c +@@ -732,6 +732,12 @@ bool ci_dpm_vblank_too_short(struct rade + u32 vblank_time = r600_dpm_get_vblank_time(rdev); + u32 switch_limit = pi->mem_gddr5 ? 450 : 300; + ++ /* disable mclk switching if the refresh is >120Hz, even if the ++ * blanking period would allow it ++ */ ++ if (r600_dpm_get_vrefresh(rdev) > 120) ++ return true; ++ + if (vblank_time < switch_limit) + return true; + else diff --git a/queue-3.18/pcmcia-remove-left-over-z-format.patch b/queue-3.18/pcmcia-remove-left-over-z-format.patch new file mode 100644 index 00000000000..5f8c82a002b --- /dev/null +++ b/queue-3.18/pcmcia-remove-left-over-z-format.patch @@ -0,0 +1,56 @@ +From ff5a20169b98d84ad8d7f99f27c5ebbb008204d6 Mon Sep 17 00:00:00 2001 +From: Nicolas Iooss +Date: Fri, 2 Jun 2017 14:46:28 -0700 +Subject: pcmcia: remove left-over %Z format + +From: Nicolas Iooss + +commit ff5a20169b98d84ad8d7f99f27c5ebbb008204d6 upstream. + +Commit 5b5e0928f742 ("lib/vsprintf.c: remove %Z support") removed some +usages of format %Z but forgot "%.2Zx". This makes clang 4.0 reports a +-Wformat-extra-args warning because it does not know about %Z. + +Replace %Z with %z. + +Link: http://lkml.kernel.org/r/20170520090946.22562-1-nicolas.iooss_linux@m4x.org +Signed-off-by: Nicolas Iooss +Cc: Harald Welte +Cc: Alexey Dobriyan +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/char/pcmcia/cm4040_cs.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/char/pcmcia/cm4040_cs.c ++++ b/drivers/char/pcmcia/cm4040_cs.c +@@ -374,7 +374,7 @@ static ssize_t cm4040_write(struct file + + rc = write_sync_reg(SCR_HOST_TO_READER_START, dev); + if (rc <= 0) { +- DEBUGP(5, dev, "write_sync_reg c=%.2Zx\n", rc); ++ DEBUGP(5, dev, "write_sync_reg c=%.2zx\n", rc); + DEBUGP(2, dev, "<- cm4040_write (failed)\n"); + if (rc == -ERESTARTSYS) + return rc; +@@ -387,7 +387,7 @@ static ssize_t cm4040_write(struct file + for (i = 0; i < bytes_to_write; i++) { + rc = wait_for_bulk_out_ready(dev); + if (rc <= 0) { +- DEBUGP(5, dev, "wait_for_bulk_out_ready rc=%.2Zx\n", ++ DEBUGP(5, dev, "wait_for_bulk_out_ready rc=%.2zx\n", + rc); + DEBUGP(2, dev, "<- cm4040_write (failed)\n"); + if (rc == -ERESTARTSYS) +@@ -403,7 +403,7 @@ static ssize_t cm4040_write(struct file + rc = write_sync_reg(SCR_HOST_TO_READER_DONE, dev); + + if (rc <= 0) { +- DEBUGP(5, dev, "write_sync_reg c=%.2Zx\n", rc); ++ DEBUGP(5, dev, "write_sync_reg c=%.2zx\n", rc); + DEBUGP(2, dev, "<- cm4040_write (failed)\n"); + if (rc == -ERESTARTSYS) + return rc; diff --git a/queue-3.18/series b/queue-3.18/series index a20a951f0be..664944bdb7d 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -15,3 +15,8 @@ ipv6-fix-out-of-bound-writes-in-__ip6_append_data.patch tcp-avoid-fastopen-api-to-be-used-on-af_unspec.patch sctp-fix-icmp-processing-if-skb-is-non-linear.patch i2c-i2c-tiny-usb-fix-buffer-not-being-dma-capable.patch +drm-radeon-ci-disable-mclk-switching-for-high-refresh-rates-v2.patch +pcmcia-remove-left-over-z-format.patch +alsa-hda-apply-stac_9200_dell_m22-quirk-for-dell-latitude-d430.patch +slub-memcg-cure-the-brainless-abuse-of-sysfs-attributes.patch +drm-gma500-psb-actually-use-vbt-mode-when-it-is-found.patch diff --git a/queue-3.18/slub-memcg-cure-the-brainless-abuse-of-sysfs-attributes.patch b/queue-3.18/slub-memcg-cure-the-brainless-abuse-of-sysfs-attributes.patch new file mode 100644 index 00000000000..aecb361ff63 --- /dev/null +++ b/queue-3.18/slub-memcg-cure-the-brainless-abuse-of-sysfs-attributes.patch @@ -0,0 +1,89 @@ +From 478fe3037b2278d276d4cd9cd0ab06c4cb2e9b32 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Fri, 2 Jun 2017 14:46:25 -0700 +Subject: slub/memcg: cure the brainless abuse of sysfs attributes + +From: Thomas Gleixner + +commit 478fe3037b2278d276d4cd9cd0ab06c4cb2e9b32 upstream. + +memcg_propagate_slab_attrs() abuses the sysfs attribute file functions +to propagate settings from the root kmem_cache to a newly created +kmem_cache. It does that with: + + attr->show(root, buf); + attr->store(new, buf, strlen(bug); + +Aside of being a lazy and absurd hackery this is broken because it does +not check the return value of the show() function. + +Some of the show() functions return 0 w/o touching the buffer. That +means in such a case the store function is called with the stale content +of the previous show(). That causes nonsense like invoking +kmem_cache_shrink() on a newly created kmem_cache. In the worst case it +would cause handing in an uninitialized buffer. + +This should be rewritten proper by adding a propagate() callback to +those slub_attributes which must be propagated and avoid that insane +conversion to and from ASCII, but that's too large for a hot fix. + +Check at least the return value of the show() function, so calling +store() with stale content is prevented. + +Steven said: + "It can cause a deadlock with get_online_cpus() that has been uncovered + by recent cpu hotplug and lockdep changes that Thomas and Peter have + been doing. + + Possible unsafe locking scenario: + + CPU0 CPU1 + ---- ---- + lock(cpu_hotplug.lock); + lock(slab_mutex); + lock(cpu_hotplug.lock); + lock(slab_mutex); + + *** DEADLOCK ***" + +Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1705201244540.2255@nanos +Signed-off-by: Thomas Gleixner +Reported-by: Steven Rostedt +Acked-by: David Rientjes +Cc: Johannes Weiner +Cc: Michal Hocko +Cc: Peter Zijlstra +Cc: Christoph Lameter +Cc: Pekka Enberg +Cc: Joonsoo Kim +Cc: Christoph Hellwig +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/slub.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/mm/slub.c ++++ b/mm/slub.c +@@ -4959,6 +4959,7 @@ static void memcg_propagate_slab_attrs(s + char mbuf[64]; + char *buf; + struct slab_attribute *attr = to_slab_attr(slab_attrs[i]); ++ ssize_t len; + + if (!attr || !attr->store || !attr->show) + continue; +@@ -4983,8 +4984,9 @@ static void memcg_propagate_slab_attrs(s + buf = buffer; + } + +- attr->show(root_cache, buf); +- attr->store(s, buf, strlen(buf)); ++ len = attr->show(root_cache, buf); ++ if (len > 0) ++ attr->store(s, buf, len); + } + + if (buffer)