]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Jan 2021 15:36:55 +0000 (16:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Jan 2021 15:36:55 +0000 (16:36 +0100)
added patches:
acpi-sysfs-prefer-compatible-modalias.patch
alsa-hda-via-apply-the-workaround-generically-for-clevo-machines.patch
kernel-kexec-remove-the-lock-operation-of-system_transition_mutex.patch
xen-privcmd-allow-fetching-resource-sizes.patch

queue-4.19/acpi-sysfs-prefer-compatible-modalias.patch [new file with mode: 0644]
queue-4.19/alsa-hda-via-apply-the-workaround-generically-for-clevo-machines.patch [new file with mode: 0644]
queue-4.19/kernel-kexec-remove-the-lock-operation-of-system_transition_mutex.patch [new file with mode: 0644]
queue-4.19/series
queue-4.19/xen-privcmd-allow-fetching-resource-sizes.patch [new file with mode: 0644]

diff --git a/queue-4.19/acpi-sysfs-prefer-compatible-modalias.patch b/queue-4.19/acpi-sysfs-prefer-compatible-modalias.patch
new file mode 100644 (file)
index 0000000..89f7981
--- /dev/null
@@ -0,0 +1,65 @@
+From 36af2d5c4433fb40ee2af912c4ac0a30991aecfc Mon Sep 17 00:00:00 2001
+From: Kai-Heng Feng <kai.heng.feng@canonical.com>
+Date: Fri, 22 Jan 2021 20:53:02 +0800
+Subject: ACPI: sysfs: Prefer "compatible" modalias
+
+From: Kai-Heng Feng <kai.heng.feng@canonical.com>
+
+commit 36af2d5c4433fb40ee2af912c4ac0a30991aecfc upstream.
+
+Commit 8765c5ba1949 ("ACPI / scan: Rework modalias creation when
+"compatible" is present") may create two "MODALIAS=" in one uevent
+file if specific conditions are met.
+
+This breaks systemd-udevd, which assumes each "key" in one uevent file
+to be unique. The internal implementation of systemd-udevd overwrites
+the first MODALIAS with the second one, so its kmod rule doesn't load
+the driver for the first MODALIAS.
+
+So if both the ACPI modalias and the OF modalias are present, use the
+latter to ensure that there will be only one MODALIAS.
+
+Link: https://github.com/systemd/systemd/pull/18163
+Suggested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
+Fixes: 8765c5ba1949 ("ACPI / scan: Rework modalias creation when "compatible" is present")
+Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
+Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
+Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: 4.1+ <stable@vger.kernel.org> # 4.1+
+[ rjw: Subject and changelog edits ]
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/acpi/device_sysfs.c |   20 ++++++--------------
+ 1 file changed, 6 insertions(+), 14 deletions(-)
+
+--- a/drivers/acpi/device_sysfs.c
++++ b/drivers/acpi/device_sysfs.c
+@@ -259,20 +259,12 @@ int __acpi_device_uevent_modalias(struct
+       if (add_uevent_var(env, "MODALIAS="))
+               return -ENOMEM;
+-      len = create_pnp_modalias(adev, &env->buf[env->buflen - 1],
+-                                sizeof(env->buf) - env->buflen);
+-      if (len < 0)
+-              return len;
+-
+-      env->buflen += len;
+-      if (!adev->data.of_compatible)
+-              return 0;
+-
+-      if (len > 0 && add_uevent_var(env, "MODALIAS="))
+-              return -ENOMEM;
+-
+-      len = create_of_modalias(adev, &env->buf[env->buflen - 1],
+-                               sizeof(env->buf) - env->buflen);
++      if (adev->data.of_compatible)
++              len = create_of_modalias(adev, &env->buf[env->buflen - 1],
++                                       sizeof(env->buf) - env->buflen);
++      else
++              len = create_pnp_modalias(adev, &env->buf[env->buflen - 1],
++                                        sizeof(env->buf) - env->buflen);
+       if (len < 0)
+               return len;
diff --git a/queue-4.19/alsa-hda-via-apply-the-workaround-generically-for-clevo-machines.patch b/queue-4.19/alsa-hda-via-apply-the-workaround-generically-for-clevo-machines.patch
new file mode 100644 (file)
index 0000000..6ff0ffb
--- /dev/null
@@ -0,0 +1,35 @@
+From 4961167bf7482944ca09a6f71263b9e47f949851 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 26 Jan 2021 17:56:03 +0100
+Subject: ALSA: hda/via: Apply the workaround generically for Clevo machines
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 4961167bf7482944ca09a6f71263b9e47f949851 upstream.
+
+We've got another report indicating a similar problem wrt the
+power-saving behavior with VIA codec on Clevo machines.  Let's apply
+the existing workaround generically to all Clevo devices with VIA
+codecs to cover all in once.
+
+BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1181330
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20210126165603.11683-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_via.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_via.c
++++ b/sound/pci/hda/patch_via.c
+@@ -1056,7 +1056,7 @@ static const struct hda_fixup via_fixups
+ static const struct snd_pci_quirk vt2002p_fixups[] = {
+       SND_PCI_QUIRK(0x1043, 0x1487, "Asus G75", VIA_FIXUP_ASUS_G75),
+       SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST),
+-      SND_PCI_QUIRK(0x1558, 0x3501, "Clevo W35xSS_370SS", VIA_FIXUP_POWER_SAVE),
++      SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", VIA_FIXUP_POWER_SAVE),
+       {}
+ };
diff --git a/queue-4.19/kernel-kexec-remove-the-lock-operation-of-system_transition_mutex.patch b/queue-4.19/kernel-kexec-remove-the-lock-operation-of-system_transition_mutex.patch
new file mode 100644 (file)
index 0000000..57a4c9e
--- /dev/null
@@ -0,0 +1,49 @@
+From 56c91a18432b631ca18438841fd1831ef756cabf Mon Sep 17 00:00:00 2001
+From: Baoquan He <bhe@redhat.com>
+Date: Fri, 22 Jan 2021 15:42:14 +0800
+Subject: kernel: kexec: remove the lock operation of system_transition_mutex
+
+From: Baoquan He <bhe@redhat.com>
+
+commit 56c91a18432b631ca18438841fd1831ef756cabf upstream.
+
+Function kernel_kexec() is called with lock system_transition_mutex
+held in reboot system call. While inside kernel_kexec(), it will
+acquire system_transition_mutex agin. This will lead to dead lock.
+
+The dead lock should be easily triggered, it hasn't caused any
+failure report just because the feature 'kexec jump' is almost not
+used by anyone as far as I know. An inquiry can be made about who
+is using 'kexec jump' and where it's used. Before that, let's simply
+remove the lock operation inside CONFIG_KEXEC_JUMP ifdeffery scope.
+
+Fixes: 55f2503c3b69 ("PM / reboot: Eliminate race between reboot and suspend")
+Signed-off-by: Baoquan He <bhe@redhat.com>
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Reviewed-by: Pingfan Liu <kernelfans@gmail.com>
+Cc: 4.19+ <stable@vger.kernel.org> # 4.19+
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/kexec_core.c |    2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/kernel/kexec_core.c
++++ b/kernel/kexec_core.c
+@@ -1130,7 +1130,6 @@ int kernel_kexec(void)
+ #ifdef CONFIG_KEXEC_JUMP
+       if (kexec_image->preserve_context) {
+-              lock_system_sleep();
+               pm_prepare_console();
+               error = freeze_processes();
+               if (error) {
+@@ -1193,7 +1192,6 @@ int kernel_kexec(void)
+               thaw_processes();
+  Restore_console:
+               pm_restore_console();
+-              unlock_system_sleep();
+       }
+ #endif
index be3300700516cc056170ad897a19f292936ee0d8..7a0c051875aff873aab857b8ab1e315eed8ecb1b 100644 (file)
@@ -1 +1,5 @@
 nbd-freeze-the-queue-while-we-re-adding-connections.patch
+acpi-sysfs-prefer-compatible-modalias.patch
+kernel-kexec-remove-the-lock-operation-of-system_transition_mutex.patch
+xen-privcmd-allow-fetching-resource-sizes.patch
+alsa-hda-via-apply-the-workaround-generically-for-clevo-machines.patch
diff --git a/queue-4.19/xen-privcmd-allow-fetching-resource-sizes.patch b/queue-4.19/xen-privcmd-allow-fetching-resource-sizes.patch
new file mode 100644 (file)
index 0000000..a945c03
--- /dev/null
@@ -0,0 +1,87 @@
+From ef3a575baf53571dc405ee4028e26f50856898e7 Mon Sep 17 00:00:00 2001
+From: Roger Pau Monne <roger.pau@citrix.com>
+Date: Tue, 12 Jan 2021 12:53:58 +0100
+Subject: xen/privcmd: allow fetching resource sizes
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Roger Pau Monne <roger.pau@citrix.com>
+
+commit ef3a575baf53571dc405ee4028e26f50856898e7 upstream.
+
+Allow issuing an IOCTL_PRIVCMD_MMAP_RESOURCE ioctl with num = 0 and
+addr = 0 in order to fetch the size of a specific resource.
+
+Add a shortcut to the default map resource path, since fetching the
+size requires no address to be passed in, and thus no VMA to setup.
+
+This is missing from the initial implementation, and causes issues
+when mapping resources that don't have fixed or known sizes.
+
+Signed-off-by: Roger Pau MonnĂ© <roger.pau@citrix.com>
+Reviewed-by: Juergen Gross <jgross@suse.com>
+Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
+Cc: stable@vger.kernel.org # >= 4.18
+Link: https://lore.kernel.org/r/20210112115358.23346-1-roger.pau@citrix.com
+Signed-off-by: Juergen Gross <jgross@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/xen/privcmd.c |   25 +++++++++++++++++++------
+ 1 file changed, 19 insertions(+), 6 deletions(-)
+
+--- a/drivers/xen/privcmd.c
++++ b/drivers/xen/privcmd.c
+@@ -743,14 +743,15 @@ static int remap_pfn_fn(pte_t *ptep, pgt
+       return 0;
+ }
+-static long privcmd_ioctl_mmap_resource(struct file *file, void __user *udata)
++static long privcmd_ioctl_mmap_resource(struct file *file,
++                              struct privcmd_mmap_resource __user *udata)
+ {
+       struct privcmd_data *data = file->private_data;
+       struct mm_struct *mm = current->mm;
+       struct vm_area_struct *vma;
+       struct privcmd_mmap_resource kdata;
+       xen_pfn_t *pfns = NULL;
+-      struct xen_mem_acquire_resource xdata;
++      struct xen_mem_acquire_resource xdata = { };
+       int rc;
+       if (copy_from_user(&kdata, udata, sizeof(kdata)))
+@@ -760,6 +761,22 @@ static long privcmd_ioctl_mmap_resource(
+       if (data->domid != DOMID_INVALID && data->domid != kdata.dom)
+               return -EPERM;
++      /* Both fields must be set or unset */
++      if (!!kdata.addr != !!kdata.num)
++              return -EINVAL;
++
++      xdata.domid = kdata.dom;
++      xdata.type = kdata.type;
++      xdata.id = kdata.id;
++
++      if (!kdata.addr && !kdata.num) {
++              /* Query the size of the resource. */
++              rc = HYPERVISOR_memory_op(XENMEM_acquire_resource, &xdata);
++              if (rc)
++                      return rc;
++              return __put_user(xdata.nr_frames, &udata->num);
++      }
++
+       down_write(&mm->mmap_sem);
+       vma = find_vma(mm, kdata.addr);
+@@ -793,10 +810,6 @@ static long privcmd_ioctl_mmap_resource(
+       } else
+               vma->vm_private_data = PRIV_VMA_LOCKED;
+-      memset(&xdata, 0, sizeof(xdata));
+-      xdata.domid = kdata.dom;
+-      xdata.type = kdata.type;
+-      xdata.id = kdata.id;
+       xdata.frame = kdata.idx;
+       xdata.nr_frames = kdata.num;
+       set_xen_guest_handle(xdata.frame_list, pfns);