From 3b5e31210e348e9864e10cbcd4aa9f088fe65d9e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 30 Jan 2021 16:36:55 +0100 Subject: [PATCH] 4.19-stable patches 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 --- ...cpi-sysfs-prefer-compatible-modalias.patch | 65 ++++++++++++++ ...round-generically-for-clevo-machines.patch | 35 ++++++++ ...operation-of-system_transition_mutex.patch | 49 +++++++++++ queue-4.19/series | 4 + ...rivcmd-allow-fetching-resource-sizes.patch | 87 +++++++++++++++++++ 5 files changed, 240 insertions(+) create mode 100644 queue-4.19/acpi-sysfs-prefer-compatible-modalias.patch create mode 100644 queue-4.19/alsa-hda-via-apply-the-workaround-generically-for-clevo-machines.patch create mode 100644 queue-4.19/kernel-kexec-remove-the-lock-operation-of-system_transition_mutex.patch create mode 100644 queue-4.19/xen-privcmd-allow-fetching-resource-sizes.patch 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 index 00000000000..89f79812120 --- /dev/null +++ b/queue-4.19/acpi-sysfs-prefer-compatible-modalias.patch @@ -0,0 +1,65 @@ +From 36af2d5c4433fb40ee2af912c4ac0a30991aecfc Mon Sep 17 00:00:00 2001 +From: Kai-Heng Feng +Date: Fri, 22 Jan 2021 20:53:02 +0800 +Subject: ACPI: sysfs: Prefer "compatible" modalias + +From: Kai-Heng Feng + +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 +Fixes: 8765c5ba1949 ("ACPI / scan: Rework modalias creation when "compatible" is present") +Signed-off-by: Kai-Heng Feng +Reviewed-by: Mika Westerberg +Reviewed-by: Greg Kroah-Hartman +Cc: 4.1+ # 4.1+ +[ rjw: Subject and changelog edits ] +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..6ff0ffbd34c --- /dev/null +++ b/queue-4.19/alsa-hda-via-apply-the-workaround-generically-for-clevo-machines.patch @@ -0,0 +1,35 @@ +From 4961167bf7482944ca09a6f71263b9e47f949851 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 26 Jan 2021 17:56:03 +0100 +Subject: ALSA: hda/via: Apply the workaround generically for Clevo machines + +From: Takashi Iwai + +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: +Link: https://lore.kernel.org/r/20210126165603.11683-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..57a4c9e4b10 --- /dev/null +++ b/queue-4.19/kernel-kexec-remove-the-lock-operation-of-system_transition_mutex.patch @@ -0,0 +1,49 @@ +From 56c91a18432b631ca18438841fd1831ef756cabf Mon Sep 17 00:00:00 2001 +From: Baoquan He +Date: Fri, 22 Jan 2021 15:42:14 +0800 +Subject: kernel: kexec: remove the lock operation of system_transition_mutex + +From: Baoquan He + +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 +Reported-by: Dan Carpenter +Reviewed-by: Pingfan Liu +Cc: 4.19+ # 4.19+ +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + 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 + diff --git a/queue-4.19/series b/queue-4.19/series index be330070051..7a0c051875a 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -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 index 00000000000..a945c031cf9 --- /dev/null +++ b/queue-4.19/xen-privcmd-allow-fetching-resource-sizes.patch @@ -0,0 +1,87 @@ +From ef3a575baf53571dc405ee4028e26f50856898e7 Mon Sep 17 00:00:00 2001 +From: Roger Pau Monne +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 + +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é +Reviewed-by: Juergen Gross +Tested-by: Andrew Cooper +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 +Signed-off-by: Greg Kroah-Hartman + +--- + 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); -- 2.47.3