]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Apr 2023 08:50:11 +0000 (10:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Apr 2023 08:50:11 +0000 (10:50 +0200)
added patches:
alsa-hda-conexant-partial-revert-of-a-quirk-for-lenovo.patch
alsa-usb-audio-fix-regression-on-detection-of-roland-vs-100.patch
drm-etnaviv-fix-reference-leak-when-mmaping-imported-buffer.patch
pinctrl-at91-pio4-fix-domain-name-assignment.patch
xen-netback-don-t-do-grant-copy-across-page-boundary.patch

queue-4.14/alsa-hda-conexant-partial-revert-of-a-quirk-for-lenovo.patch [new file with mode: 0644]
queue-4.14/alsa-usb-audio-fix-regression-on-detection-of-roland-vs-100.patch [new file with mode: 0644]
queue-4.14/drm-etnaviv-fix-reference-leak-when-mmaping-imported-buffer.patch [new file with mode: 0644]
queue-4.14/pinctrl-at91-pio4-fix-domain-name-assignment.patch [new file with mode: 0644]
queue-4.14/series
queue-4.14/xen-netback-don-t-do-grant-copy-across-page-boundary.patch [new file with mode: 0644]

diff --git a/queue-4.14/alsa-hda-conexant-partial-revert-of-a-quirk-for-lenovo.patch b/queue-4.14/alsa-hda-conexant-partial-revert-of-a-quirk-for-lenovo.patch
new file mode 100644 (file)
index 0000000..f2be89d
--- /dev/null
@@ -0,0 +1,59 @@
+From b871cb971c683f7f212e7ca3c9a6709a75785116 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 20 Mar 2023 15:09:54 +0100
+Subject: ALSA: hda/conexant: Partial revert of a quirk for Lenovo
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit b871cb971c683f7f212e7ca3c9a6709a75785116 upstream.
+
+The recent commit f83bb2592482 ("ALSA: hda/conexant: Add quirk for
+LENOVO 20149 Notebook model") introduced a quirk for the device with
+17aa:3977, but this caused a regression on another model (Lenovo
+Ideadpad U31) with the very same PCI SSID.  And, through skimming over
+the net, it seems that this PCI SSID is used for multiple different
+models, so it's no good idea to apply the quirk with the SSID.
+
+Although we may take a different ID check (e.g. the codec SSID instead
+of the PCI SSID), unfortunately, the original patch author couldn't
+identify the hardware details any longer as the machine was returned,
+and we can't develop the further proper fix.
+
+In this patch, instead, we partially revert the change so that the
+quirk won't be applied as default for addressing the regression.
+Meanwhile, the quirk function itself is kept, and it's now made to be
+applicable via the explicit model=lenovo-20149 option.
+
+Fixes: f83bb2592482 ("ALSA: hda/conexant: Add quirk for LENOVO 20149 Notebook model")
+Reported-by: Jetro Jormalainen <jje-lxkl@jetro.fi>
+Link: https://lore.kernel.org/r/20230308215009.4d3e58a6@mopti
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20230320140954.31154-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/pci/hda/patch_conexant.c |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_conexant.c
++++ b/sound/pci/hda/patch_conexant.c
+@@ -986,7 +986,10 @@ static const struct snd_pci_quirk cxt506
+       SND_PCI_QUIRK(0x17aa, 0x3905, "Lenovo G50-30", CXT_FIXUP_STEREO_DMIC),
+       SND_PCI_QUIRK(0x17aa, 0x390b, "Lenovo G50-80", CXT_FIXUP_STEREO_DMIC),
+       SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC),
+-      SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_PINCFG_LENOVO_NOTEBOOK),
++      /* NOTE: we'd need to extend the quirk for 17aa:3977 as the same
++       * PCI SSID is used on multiple Lenovo models
++       */
++      SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC),
+       SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo G50-70", CXT_FIXUP_STEREO_DMIC),
+       SND_PCI_QUIRK(0x17aa, 0x397b, "Lenovo S205", CXT_FIXUP_STEREO_DMIC),
+       SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", CXT_FIXUP_THINKPAD_ACPI),
+@@ -1007,6 +1010,7 @@ static const struct hda_model_fixup cxt5
+       { .id = CXT_FIXUP_MUTE_LED_EAPD, .name = "mute-led-eapd" },
+       { .id = CXT_FIXUP_HP_DOCK, .name = "hp-dock" },
+       { .id = CXT_FIXUP_MUTE_LED_GPIO, .name = "mute-led-gpio" },
++      { .id = CXT_PINCFG_LENOVO_NOTEBOOK, .name = "lenovo-20149" },
+       {}
+ };
diff --git a/queue-4.14/alsa-usb-audio-fix-regression-on-detection-of-roland-vs-100.patch b/queue-4.14/alsa-usb-audio-fix-regression-on-detection-of-roland-vs-100.patch
new file mode 100644 (file)
index 0000000..7e811df
--- /dev/null
@@ -0,0 +1,46 @@
+From fa4e7a6fa12b1132340785e14bd439cbe95b7a5a Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Fri, 24 Mar 2023 08:50:05 +0100
+Subject: ALSA: usb-audio: Fix regression on detection of Roland VS-100
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit fa4e7a6fa12b1132340785e14bd439cbe95b7a5a upstream.
+
+It's been reported that the recent kernel can't probe the PCM devices
+on Roland VS-100 properly, and it turned out to be a regression by the
+recent addition of the bit shift range check for the format bits.
+In the old code, we just did bit-shift and it resulted in zero, which
+is then corrected to the standard PCM format, while the new code
+explicitly returns an error in such a case.
+
+For addressing the regression, relax the check and fallback to the
+standard PCM type (with the info output).
+
+Fixes: 43d5ca88dfcd ("ALSA: usb-audio: Fix potential out-of-bounds shift")
+Cc: <stable@vger.kernel.org>
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=217084
+Link: https://lore.kernel.org/r/20230324075005.19403-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/usb/format.c |    8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/sound/usb/format.c
++++ b/sound/usb/format.c
+@@ -52,8 +52,12 @@ static u64 parse_audio_format_i_type(str
+       case UAC_VERSION_1:
+       default: {
+               struct uac_format_type_i_discrete_descriptor *fmt = _fmt;
+-              if (format >= 64)
+-                      return 0; /* invalid format */
++              if (format >= 64) {
++                      usb_audio_info(chip,
++                                     "%u:%d: invalid format type %#x is detected, processed as PCM\n",
++                                     fp->iface, fp->altsetting, format);
++                      format = UAC_FORMAT_TYPE_I_PCM;
++              }
+               sample_width = fmt->bBitResolution;
+               sample_bytes = fmt->bSubframeSize;
+               format = 1 << format;
diff --git a/queue-4.14/drm-etnaviv-fix-reference-leak-when-mmaping-imported-buffer.patch b/queue-4.14/drm-etnaviv-fix-reference-leak-when-mmaping-imported-buffer.patch
new file mode 100644 (file)
index 0000000..cd9cd87
--- /dev/null
@@ -0,0 +1,41 @@
+From 963b2e8c428f79489ceeb058e8314554ec9cbe6f Mon Sep 17 00:00:00 2001
+From: Lucas Stach <l.stach@pengutronix.de>
+Date: Fri, 24 Feb 2023 18:21:54 +0100
+Subject: drm/etnaviv: fix reference leak when mmaping imported buffer
+
+From: Lucas Stach <l.stach@pengutronix.de>
+
+commit 963b2e8c428f79489ceeb058e8314554ec9cbe6f upstream.
+
+drm_gem_prime_mmap() takes a reference on the GEM object, but before that
+drm_gem_mmap_obj() already takes a reference, which will be leaked as only
+one reference is dropped when the mapping is closed. Drop the extra
+reference when dma_buf_mmap() succeeds.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
+Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c |   10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
++++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
+@@ -102,7 +102,15 @@ static void *etnaviv_gem_prime_vmap_impl
+ static int etnaviv_gem_prime_mmap_obj(struct etnaviv_gem_object *etnaviv_obj,
+               struct vm_area_struct *vma)
+ {
+-      return dma_buf_mmap(etnaviv_obj->base.dma_buf, vma, 0);
++      int ret;
++
++      ret = dma_buf_mmap(etnaviv_obj->base.dma_buf, vma, 0);
++      if (!ret) {
++              /* Drop the reference acquired by drm_gem_mmap_obj(). */
++              drm_gem_object_put(&etnaviv_obj->base);
++      }
++
++      return ret;
+ }
+ static const struct etnaviv_gem_ops etnaviv_gem_prime_ops = {
diff --git a/queue-4.14/pinctrl-at91-pio4-fix-domain-name-assignment.patch b/queue-4.14/pinctrl-at91-pio4-fix-domain-name-assignment.patch
new file mode 100644 (file)
index 0000000..2c4c03a
--- /dev/null
@@ -0,0 +1,39 @@
+From 7bb97e360acdd38b68ad0a1defb89c6e89c85596 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan+linaro@kernel.org>
+Date: Fri, 24 Feb 2023 14:08:28 +0100
+Subject: pinctrl: at91-pio4: fix domain name assignment
+
+From: Johan Hovold <johan+linaro@kernel.org>
+
+commit 7bb97e360acdd38b68ad0a1defb89c6e89c85596 upstream.
+
+Since commit d59f6617eef0 ("genirq: Allow fwnode to carry name
+information only") an IRQ domain is always given a name during
+allocation (e.g. used for the debugfs entry).
+
+Drop the no longer valid name assignment, which would lead to an attempt
+to free a string constant when removing the domain on late probe
+failures (e.g. probe deferral).
+
+Fixes: d59f6617eef0 ("genirq: Allow fwnode to carry name information only")
+Cc: stable@vger.kernel.org     # 4.13
+Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
+Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
+Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com> # on SAMA7G5
+Link: https://lore.kernel.org/r/20230224130828.27985-1-johan+linaro@kernel.org
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/pinctrl/pinctrl-at91-pio4.c |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/pinctrl/pinctrl-at91-pio4.c
++++ b/drivers/pinctrl/pinctrl-at91-pio4.c
+@@ -1035,7 +1035,6 @@ static int atmel_pinctrl_probe(struct pl
+               dev_err(dev, "can't add the irq domain\n");
+               return -ENODEV;
+       }
+-      atmel_pioctrl->irq_domain->name = "atmel gpio";
+       for (i = 0; i < atmel_pioctrl->npins; i++) {
+               int irq = irq_create_mapping(atmel_pioctrl->irq_domain, i);
index b18ae78fe465597830e94a316525fe4c12ee5830..9a85ef0b0505afa3e8a8b17cb14b895e6bf553d1 100644 (file)
@@ -54,3 +54,8 @@ can-bcm-bcm_tx_setup-fix-kmsan-uninit-value-in-vfs_w.patch
 i40e-fix-registers-dump-after-run-ethtool-adapter-se.patch
 input-focaltech-use-explicitly-signed-char-type.patch
 cifs-fix-dfs-traversal-oops-without-config_cifs_dfs_upcall.patch
+xen-netback-don-t-do-grant-copy-across-page-boundary.patch
+pinctrl-at91-pio4-fix-domain-name-assignment.patch
+alsa-hda-conexant-partial-revert-of-a-quirk-for-lenovo.patch
+alsa-usb-audio-fix-regression-on-detection-of-roland-vs-100.patch
+drm-etnaviv-fix-reference-leak-when-mmaping-imported-buffer.patch
diff --git a/queue-4.14/xen-netback-don-t-do-grant-copy-across-page-boundary.patch b/queue-4.14/xen-netback-don-t-do-grant-copy-across-page-boundary.patch
new file mode 100644 (file)
index 0000000..171069d
--- /dev/null
@@ -0,0 +1,118 @@
+From 05310f31ca74673a96567fb14637b7d5d6c82ea5 Mon Sep 17 00:00:00 2001
+From: Juergen Gross <jgross@suse.com>
+Date: Mon, 27 Mar 2023 10:36:45 +0200
+Subject: xen/netback: don't do grant copy across page boundary
+
+From: Juergen Gross <jgross@suse.com>
+
+commit 05310f31ca74673a96567fb14637b7d5d6c82ea5 upstream.
+
+Fix xenvif_get_requests() not to do grant copy operations across local
+page boundaries. This requires to double the maximum number of copy
+operations per queue, as each copy could now be split into 2.
+
+Make sure that struct xenvif_tx_cb doesn't grow too large.
+
+Cc: stable@vger.kernel.org
+Fixes: ad7f402ae4f4 ("xen/netback: Ensure protocol headers don't fall in the non-linear area")
+Signed-off-by: Juergen Gross <jgross@suse.com>
+Reviewed-by: Paul Durrant <paul@xen.org>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/xen-netback/common.h  |    2 +-
+ drivers/net/xen-netback/netback.c |   25 +++++++++++++++++++++++--
+ 2 files changed, 24 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/xen-netback/common.h
++++ b/drivers/net/xen-netback/common.h
+@@ -166,7 +166,7 @@ struct xenvif_queue { /* Per-queue data
+       struct pending_tx_info pending_tx_info[MAX_PENDING_REQS];
+       grant_handle_t grant_tx_handle[MAX_PENDING_REQS];
+-      struct gnttab_copy tx_copy_ops[MAX_PENDING_REQS];
++      struct gnttab_copy tx_copy_ops[2 * MAX_PENDING_REQS];
+       struct gnttab_map_grant_ref tx_map_ops[MAX_PENDING_REQS];
+       struct gnttab_unmap_grant_ref tx_unmap_ops[MAX_PENDING_REQS];
+       /* passed to gnttab_[un]map_refs with pages under (un)mapping */
+--- a/drivers/net/xen-netback/netback.c
++++ b/drivers/net/xen-netback/netback.c
+@@ -327,6 +327,7 @@ static int xenvif_count_requests(struct
+ struct xenvif_tx_cb {
+       u16 copy_pending_idx[XEN_NETBK_LEGACY_SLOTS_MAX + 1];
+       u8 copy_count;
++      u32 split_mask;
+ };
+ #define XENVIF_TX_CB(skb) ((struct xenvif_tx_cb *)(skb)->cb)
+@@ -354,6 +355,8 @@ static inline struct sk_buff *xenvif_all
+       struct sk_buff *skb =
+               alloc_skb(size + NET_SKB_PAD + NET_IP_ALIGN,
+                         GFP_ATOMIC | __GFP_NOWARN);
++
++      BUILD_BUG_ON(sizeof(*XENVIF_TX_CB(skb)) > sizeof(skb->cb));
+       if (unlikely(skb == NULL))
+               return NULL;
+@@ -389,11 +392,13 @@ static void xenvif_get_requests(struct x
+       nr_slots = shinfo->nr_frags + 1;
+       copy_count(skb) = 0;
++      XENVIF_TX_CB(skb)->split_mask = 0;
+       /* Create copy ops for exactly data_len bytes into the skb head. */
+       __skb_put(skb, data_len);
+       while (data_len > 0) {
+               int amount = data_len > txp->size ? txp->size : data_len;
++              bool split = false;
+               cop->source.u.ref = txp->gref;
+               cop->source.domid = queue->vif->domid;
+@@ -406,6 +411,13 @@ static void xenvif_get_requests(struct x
+               cop->dest.u.gmfn = virt_to_gfn(skb->data + skb_headlen(skb)
+                                              - data_len);
++              /* Don't cross local page boundary! */
++              if (cop->dest.offset + amount > XEN_PAGE_SIZE) {
++                      amount = XEN_PAGE_SIZE - cop->dest.offset;
++                      XENVIF_TX_CB(skb)->split_mask |= 1U << copy_count(skb);
++                      split = true;
++              }
++
+               cop->len = amount;
+               cop->flags = GNTCOPY_source_gref;
+@@ -413,7 +425,8 @@ static void xenvif_get_requests(struct x
+               pending_idx = queue->pending_ring[index];
+               callback_param(queue, pending_idx).ctx = NULL;
+               copy_pending_idx(skb, copy_count(skb)) = pending_idx;
+-              copy_count(skb)++;
++              if (!split)
++                      copy_count(skb)++;
+               cop++;
+               data_len -= amount;
+@@ -434,7 +447,8 @@ static void xenvif_get_requests(struct x
+                       nr_slots--;
+               } else {
+                       /* The copy op partially covered the tx_request.
+-                       * The remainder will be mapped.
++                       * The remainder will be mapped or copied in the next
++                       * iteration.
+                        */
+                       txp->offset += amount;
+                       txp->size -= amount;
+@@ -532,6 +546,13 @@ static int xenvif_tx_check_gop(struct xe
+               pending_idx = copy_pending_idx(skb, i);
+               newerr = (*gopp_copy)->status;
++
++              /* Split copies need to be handled together. */
++              if (XENVIF_TX_CB(skb)->split_mask & (1U << i)) {
++                      (*gopp_copy)++;
++                      if (!newerr)
++                              newerr = (*gopp_copy)->status;
++              }
+               if (likely(!newerr)) {
+                       /* The first frag might still have this slot mapped */
+                       if (i < copy_count(skb) - 1 || !sharedslot)