From: Greg Kroah-Hartman Date: Sat, 13 Mar 2021 13:44:13 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v4.4.262~61 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16cae5e1a3a72eea41bf9f212cead5086d3e9bf7;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: alsa-hda-avoid-spurious-unsol-event-handling-during-s3-s4.patch alsa-hda-drop-the-batch-workaround-for-amd-controllers.patch alsa-hda-hdmi-cancel-pending-works-before-suspend.patch alsa-usb-audio-fix-cannot-get-freq-eq-errors-on-dell-ae515-sound-bar.patch mmc-core-fix-partition-switch-time-for-emmc.patch revert-95ebabde382c-capabilities-don-t-allow-writing-ambiguous-v3-file-capabilities.patch s390-dasd-fix-hanging-dasd-driver-unbind.patch s390-dasd-fix-hanging-io-request-during-dasd-driver-unbind.patch --- diff --git a/queue-4.14/alsa-hda-avoid-spurious-unsol-event-handling-during-s3-s4.patch b/queue-4.14/alsa-hda-avoid-spurious-unsol-event-handling-during-s3-s4.patch new file mode 100644 index 00000000000..41d9d9b98cd --- /dev/null +++ b/queue-4.14/alsa-hda-avoid-spurious-unsol-event-handling-during-s3-s4.patch @@ -0,0 +1,44 @@ +From 5ff9dde42e8c72ed8102eb8cb62e03f9dc2103ab Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 10 Mar 2021 12:28:08 +0100 +Subject: ALSA: hda: Avoid spurious unsol event handling during S3/S4 + +From: Takashi Iwai + +commit 5ff9dde42e8c72ed8102eb8cb62e03f9dc2103ab upstream. + +When HD-audio bus receives unsolicited events during its system +suspend/resume (S3 and S4) phase, the controller driver may still try +to process events although the codec chips are already (or yet) +powered down. This might screw up the codec communication, resulting +in CORB/RIRB errors. Such events should be rather skipped, as the +codec chip status such as the jack status will be fully refreshed at +the system resume time. + +Since we're tracking the system suspend/resume state in codec +power.power_state field, let's add the check in the common unsol event +handler entry point to filter out such events. + +BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1182377 +Tested-by: Abhishek Sahu +Cc: # 183ab39eb0ea: ALSA: hda: Initialize power_state +Link: https://lore.kernel.org/r/20210310112809.9215-3-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/hda_bind.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/sound/pci/hda/hda_bind.c ++++ b/sound/pci/hda/hda_bind.c +@@ -46,6 +46,10 @@ static void hda_codec_unsol_event(struct + if (codec->bus->shutdown) + return; + ++ /* ignore unsol events during system suspend/resume */ ++ if (codec->core.dev.power.power_state.event != PM_EVENT_ON) ++ return; ++ + if (codec->patch_ops.unsol_event) + codec->patch_ops.unsol_event(codec, ev); + } diff --git a/queue-4.14/alsa-hda-drop-the-batch-workaround-for-amd-controllers.patch b/queue-4.14/alsa-hda-drop-the-batch-workaround-for-amd-controllers.patch new file mode 100644 index 00000000000..be785f346f4 --- /dev/null +++ b/queue-4.14/alsa-hda-drop-the-batch-workaround-for-amd-controllers.patch @@ -0,0 +1,46 @@ +From 28e96c1693ec1cdc963807611f8b5ad400431e82 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 8 Mar 2021 17:07:26 +0100 +Subject: ALSA: hda: Drop the BATCH workaround for AMD controllers + +From: Takashi Iwai + +commit 28e96c1693ec1cdc963807611f8b5ad400431e82 upstream. + +The commit c02f77d32d2c ("ALSA: hda - Workaround for crackled sound on +AMD controller (1022:1457)") introduced a few workarounds for the +recent AMD HD-audio controller, and one of them is the forced BATCH +PCM mode so that PulseAudio avoids the timer-based scheduling. This +was thought to cover for some badly working applications, but this +actually worsens for more others. In total, this wasn't a good idea +to enforce it. + +This is a partial revert of the commit above for dropping the PCM +BATCH enforcement part to recover from the regression again. + +Fixes: c02f77d32d2c ("ALSA: hda - Workaround for crackled sound on AMD controller (1022:1457)") +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=195303 +Cc: +Link: https://lore.kernel.org/r/20210308160726.22930-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/hda_controller.c | 7 ------- + 1 file changed, 7 deletions(-) + +--- a/sound/pci/hda/hda_controller.c ++++ b/sound/pci/hda/hda_controller.c +@@ -624,13 +624,6 @@ static int azx_pcm_open(struct snd_pcm_s + 20, + 178000000); + +- /* by some reason, the playback stream stalls on PulseAudio with +- * tsched=1 when a capture stream triggers. Until we figure out the +- * real cause, disable tsched mode by telling the PCM info flag. +- */ +- if (chip->driver_caps & AZX_DCAPS_AMD_WORKAROUND) +- runtime->hw.info |= SNDRV_PCM_INFO_BATCH; +- + if (chip->align_buffer_size) + /* constrain buffer sizes to be multiple of 128 + bytes. This is more efficient in terms of memory diff --git a/queue-4.14/alsa-hda-hdmi-cancel-pending-works-before-suspend.patch b/queue-4.14/alsa-hda-hdmi-cancel-pending-works-before-suspend.patch new file mode 100644 index 00000000000..7fd20550a23 --- /dev/null +++ b/queue-4.14/alsa-hda-hdmi-cancel-pending-works-before-suspend.patch @@ -0,0 +1,57 @@ +From eea46a0879bcca23e15071f9968c0f6e6596e470 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 10 Mar 2021 12:28:09 +0100 +Subject: ALSA: hda/hdmi: Cancel pending works before suspend + +From: Takashi Iwai + +commit eea46a0879bcca23e15071f9968c0f6e6596e470 upstream. + +The per_pin->work might be still floating at the suspend, and this may +hit the access to the hardware at an unexpected timing. Cancel the +work properly at the suspend callback for avoiding the buggy access. + +Note that the bug doesn't trigger easily in the recent kernels since +the work is queued only when the repoll count is set, and usually it's +only at the resume callback, but it's still possible to hit in +theory. + +BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1182377 +Reported-and-tested-by: Abhishek Sahu +Cc: +Link: https://lore.kernel.org/r/20210310112809.9215-4-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_hdmi.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -2324,6 +2324,18 @@ static void generic_hdmi_free(struct hda + } + + #ifdef CONFIG_PM ++static int generic_hdmi_suspend(struct hda_codec *codec) ++{ ++ struct hdmi_spec *spec = codec->spec; ++ int pin_idx; ++ ++ for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { ++ struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); ++ cancel_delayed_work_sync(&per_pin->work); ++ } ++ return 0; ++} ++ + static int generic_hdmi_resume(struct hda_codec *codec) + { + struct hdmi_spec *spec = codec->spec; +@@ -2347,6 +2359,7 @@ static const struct hda_codec_ops generi + .build_controls = generic_hdmi_build_controls, + .unsol_event = hdmi_unsol_event, + #ifdef CONFIG_PM ++ .suspend = generic_hdmi_suspend, + .resume = generic_hdmi_resume, + #endif + }; diff --git a/queue-4.14/alsa-usb-audio-fix-cannot-get-freq-eq-errors-on-dell-ae515-sound-bar.patch b/queue-4.14/alsa-usb-audio-fix-cannot-get-freq-eq-errors-on-dell-ae515-sound-bar.patch new file mode 100644 index 00000000000..79e932d267f --- /dev/null +++ b/queue-4.14/alsa-usb-audio-fix-cannot-get-freq-eq-errors-on-dell-ae515-sound-bar.patch @@ -0,0 +1,32 @@ +From fec60c3bc5d1713db2727cdffc638d48f9c07dc3 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 4 Mar 2021 09:30:21 +0100 +Subject: ALSA: usb-audio: Fix "cannot get freq eq" errors on Dell AE515 sound bar + +From: Takashi Iwai + +commit fec60c3bc5d1713db2727cdffc638d48f9c07dc3 upstream. + +Dell AE515 sound bar (413c:a506) spews the error messages when the +driver tries to read the current sample frequency, hence it needs to +be on the list in snd_usb_get_sample_rate_quirk(). + +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=211551 +Cc: +Link: https://lore.kernel.org/r/20210304083021.2152-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/quirks.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -1155,6 +1155,7 @@ bool snd_usb_get_sample_rate_quirk(struc + case USB_ID(0x1de7, 0x0114): /* Phoenix Audio MT202pcs */ + case USB_ID(0x21B4, 0x0081): /* AudioQuest DragonFly */ + case USB_ID(0x2912, 0x30c8): /* Audioengine D1 */ ++ case USB_ID(0x413c, 0xa506): /* Dell AE515 sound bar */ + return true; + } + return false; diff --git a/queue-4.14/mmc-core-fix-partition-switch-time-for-emmc.patch b/queue-4.14/mmc-core-fix-partition-switch-time-for-emmc.patch new file mode 100644 index 00000000000..f998da47754 --- /dev/null +++ b/queue-4.14/mmc-core-fix-partition-switch-time-for-emmc.patch @@ -0,0 +1,57 @@ +From 66fbacccbab91e6e55d9c8f1fc0910a8eb6c81f7 Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Wed, 3 Mar 2021 11:26:14 +0200 +Subject: mmc: core: Fix partition switch time for eMMC + +From: Adrian Hunter + +commit 66fbacccbab91e6e55d9c8f1fc0910a8eb6c81f7 upstream. + +Avoid the following warning by always defining partition switch time: + + [ 3.209874] mmc1: unspecified timeout for CMD6 - use generic + [ 3.222780] ------------[ cut here ]------------ + [ 3.233363] WARNING: CPU: 1 PID: 111 at drivers/mmc/core/mmc_ops.c:575 __mmc_switch+0x200/0x204 + +Reported-by: Paul Fertser +Fixes: 1c447116d017 ("mmc: mmc: Fix partition switch timeout for some eMMCs") +Signed-off-by: Adrian Hunter +Link: https://lore.kernel.org/r/168bbfd6-0c5b-5ace-ab41-402e7937c46e@intel.com +Cc: stable@vger.kernel.org +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/core/mmc.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +--- a/drivers/mmc/core/mmc.c ++++ b/drivers/mmc/core/mmc.c +@@ -426,10 +426,6 @@ static int mmc_decode_ext_csd(struct mmc + + /* EXT_CSD value is in units of 10ms, but we store in ms */ + card->ext_csd.part_time = 10 * ext_csd[EXT_CSD_PART_SWITCH_TIME]; +- /* Some eMMC set the value too low so set a minimum */ +- if (card->ext_csd.part_time && +- card->ext_csd.part_time < MMC_MIN_PART_SWITCH_TIME) +- card->ext_csd.part_time = MMC_MIN_PART_SWITCH_TIME; + + /* Sleep / awake timeout in 100ns units */ + if (sa_shift > 0 && sa_shift <= 0x17) +@@ -619,6 +615,17 @@ static int mmc_decode_ext_csd(struct mmc + card->ext_csd.data_sector_size = 512; + } + ++ /* ++ * GENERIC_CMD6_TIME is to be used "unless a specific timeout is defined ++ * when accessing a specific field", so use it here if there is no ++ * PARTITION_SWITCH_TIME. ++ */ ++ if (!card->ext_csd.part_time) ++ card->ext_csd.part_time = card->ext_csd.generic_cmd6_time; ++ /* Some eMMC set the value too low so set a minimum */ ++ if (card->ext_csd.part_time < MMC_MIN_PART_SWITCH_TIME) ++ card->ext_csd.part_time = MMC_MIN_PART_SWITCH_TIME; ++ + /* eMMC v5 or later */ + if (card->ext_csd.rev >= 7) { + memcpy(card->ext_csd.fwrev, &ext_csd[EXT_CSD_FIRMWARE_VERSION], diff --git a/queue-4.14/revert-95ebabde382c-capabilities-don-t-allow-writing-ambiguous-v3-file-capabilities.patch b/queue-4.14/revert-95ebabde382c-capabilities-don-t-allow-writing-ambiguous-v3-file-capabilities.patch new file mode 100644 index 00000000000..9344d036516 --- /dev/null +++ b/queue-4.14/revert-95ebabde382c-capabilities-don-t-allow-writing-ambiguous-v3-file-capabilities.patch @@ -0,0 +1,54 @@ +From 3b0c2d3eaa83da259d7726192cf55a137769012f Mon Sep 17 00:00:00 2001 +From: "Eric W. Biederman" +Date: Fri, 12 Mar 2021 15:07:09 -0600 +Subject: Revert 95ebabde382c ("capabilities: Don't allow writing ambiguous v3 file capabilities") + +From: Eric W. Biederman + +commit 3b0c2d3eaa83da259d7726192cf55a137769012f upstream. + +It turns out that there are in fact userspace implementations that +care and this recent change caused a regression. + +https://github.com/containers/buildah/issues/3071 + +As the motivation for the original change was future development, +and the impact is existing real world code just revert this change +and allow the ambiguity in v3 file caps. + +Cc: stable@vger.kernel.org +Fixes: 95ebabde382c ("capabilities: Don't allow writing ambiguous v3 file capabilities") +Signed-off-by: Eric W. Biederman +Signed-off-by: Greg Kroah-Hartman +--- + security/commoncap.c | 12 +----------- + 1 file changed, 1 insertion(+), 11 deletions(-) + +--- a/security/commoncap.c ++++ b/security/commoncap.c +@@ -507,8 +507,7 @@ int cap_convert_nscap(struct dentry *den + __u32 magic, nsmagic; + struct inode *inode = d_backing_inode(dentry); + struct user_namespace *task_ns = current_user_ns(), +- *fs_ns = inode->i_sb->s_user_ns, +- *ancestor; ++ *fs_ns = inode->i_sb->s_user_ns; + kuid_t rootid; + size_t newsize; + +@@ -531,15 +530,6 @@ int cap_convert_nscap(struct dentry *den + if (nsrootid == -1) + return -EINVAL; + +- /* +- * Do not allow allow adding a v3 filesystem capability xattr +- * if the rootid field is ambiguous. +- */ +- for (ancestor = task_ns->parent; ancestor; ancestor = ancestor->parent) { +- if (from_kuid(ancestor, rootid) == 0) +- return -EINVAL; +- } +- + newsize = sizeof(struct vfs_ns_cap_data); + nscap = kmalloc(newsize, GFP_ATOMIC); + if (!nscap) diff --git a/queue-4.14/s390-dasd-fix-hanging-dasd-driver-unbind.patch b/queue-4.14/s390-dasd-fix-hanging-dasd-driver-unbind.patch new file mode 100644 index 00000000000..dfee7225f85 --- /dev/null +++ b/queue-4.14/s390-dasd-fix-hanging-dasd-driver-unbind.patch @@ -0,0 +1,49 @@ +From 7d365bd0bff3c0310c39ebaffc9a8458e036d666 Mon Sep 17 00:00:00 2001 +From: Stefan Haberland +Date: Fri, 5 Mar 2021 13:54:38 +0100 +Subject: s390/dasd: fix hanging DASD driver unbind + +From: Stefan Haberland + +commit 7d365bd0bff3c0310c39ebaffc9a8458e036d666 upstream. + +In case of an unbind of the DASD device driver the function +dasd_generic_remove() is called which shuts down the device. +Among others this functions removes the int_handler from the cdev. +During shutdown the device cancels all outstanding IO requests and waits +for completion of the clear request. +Unfortunately the clear interrupt will never be received when there is no +interrupt handler connected. + +Fix by moving the int_handler removal after the call to the state machine +where no request or interrupt is outstanding. + +Cc: stable@vger.kernel.org +Signed-off-by: Stefan Haberland +Tested-by: Bjoern Walk +Reviewed-by: Jan Hoeppner +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/s390/block/dasd.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/s390/block/dasd.c ++++ b/drivers/s390/block/dasd.c +@@ -3489,8 +3489,6 @@ void dasd_generic_remove(struct ccw_devi + struct dasd_device *device; + struct dasd_block *block; + +- cdev->handler = NULL; +- + device = dasd_device_from_cdev(cdev); + if (IS_ERR(device)) { + dasd_remove_sysfs_files(cdev); +@@ -3509,6 +3507,7 @@ void dasd_generic_remove(struct ccw_devi + * no quite down yet. + */ + dasd_set_target_state(device, DASD_STATE_NEW); ++ cdev->handler = NULL; + /* dasd_delete_device destroys the device reference. */ + block = device->block; + dasd_delete_device(device); diff --git a/queue-4.14/s390-dasd-fix-hanging-io-request-during-dasd-driver-unbind.patch b/queue-4.14/s390-dasd-fix-hanging-io-request-during-dasd-driver-unbind.patch new file mode 100644 index 00000000000..28d3b983161 --- /dev/null +++ b/queue-4.14/s390-dasd-fix-hanging-io-request-during-dasd-driver-unbind.patch @@ -0,0 +1,40 @@ +From 66f669a272898feb1c69b770e1504aa2ec7723d1 Mon Sep 17 00:00:00 2001 +From: Stefan Haberland +Date: Fri, 5 Mar 2021 13:54:39 +0100 +Subject: s390/dasd: fix hanging IO request during DASD driver unbind + +From: Stefan Haberland + +commit 66f669a272898feb1c69b770e1504aa2ec7723d1 upstream. + +Prevent that an IO request is build during device shutdown initiated by +a driver unbind. This request will never be able to be processed or +canceled and will hang forever. This will lead also to a hanging unbind. + +Fix by checking not only if the device is in READY state but also check +that there is no device offline initiated before building a new IO request. + +Fixes: e443343e509a ("s390/dasd: blk-mq conversion") + +Cc: # v4.14+ +Signed-off-by: Stefan Haberland +Tested-by: Bjoern Walk +Reviewed-by: Jan Hoeppner +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/s390/block/dasd.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/s390/block/dasd.c ++++ b/drivers/s390/block/dasd.c +@@ -2998,7 +2998,8 @@ static blk_status_t do_dasd_request(stru + + basedev = block->base; + spin_lock_irq(&dq->lock); +- if (basedev->state < DASD_STATE_READY) { ++ if (basedev->state < DASD_STATE_READY || ++ test_bit(DASD_FLAG_OFFLINE, &basedev->flags)) { + DBF_DEV_EVENT(DBF_ERR, basedev, + "device not ready for request %p", req); + rc = BLK_STS_IOERR; diff --git a/queue-4.14/series b/queue-4.14/series index f16eee8394e..5219b91dc3f 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -38,3 +38,11 @@ pci-xgene-msi-fix-race-in-installing-chained-irq-han.patch pci-mediatek-add-missing-of_node_put-to-fix-referenc.patch s390-smp-__smp_rescan_cpus-move-cpumask-away-from-st.patch scsi-libiscsi-fix-iscsi_prep_scsi_cmd_pdu-error-hand.patch +alsa-hda-hdmi-cancel-pending-works-before-suspend.patch +alsa-hda-drop-the-batch-workaround-for-amd-controllers.patch +alsa-hda-avoid-spurious-unsol-event-handling-during-s3-s4.patch +alsa-usb-audio-fix-cannot-get-freq-eq-errors-on-dell-ae515-sound-bar.patch +revert-95ebabde382c-capabilities-don-t-allow-writing-ambiguous-v3-file-capabilities.patch +s390-dasd-fix-hanging-dasd-driver-unbind.patch +s390-dasd-fix-hanging-io-request-during-dasd-driver-unbind.patch +mmc-core-fix-partition-switch-time-for-emmc.patch