From 5cf7109b709cd7e6b61afc1389a02f14ce826042 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 13 Mar 2021 14:43:10 +0100 Subject: [PATCH] 4.9-stable patches added patches: alsa-hda-avoid-spurious-unsol-event-handling-during-s3-s4.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 s390-dasd-fix-hanging-dasd-driver-unbind.patch scripts-recordmcount.-c-pl-support-ffunction-sections-.text.-section-names.patch --- ...us-unsol-event-handling-during-s3-s4.patch | 44 ++++++++++ ...-cancel-pending-works-before-suspend.patch | 57 +++++++++++++ ...eq-eq-errors-on-dell-ae515-sound-bar.patch | 32 +++++++ ...e-fix-partition-switch-time-for-emmc.patch | 57 +++++++++++++ ...-dasd-fix-hanging-dasd-driver-unbind.patch | 49 +++++++++++ ...nction-sections-.text.-section-names.patch | 84 +++++++++++++++++++ queue-4.9/series | 6 ++ 7 files changed, 329 insertions(+) create mode 100644 queue-4.9/alsa-hda-avoid-spurious-unsol-event-handling-during-s3-s4.patch create mode 100644 queue-4.9/alsa-hda-hdmi-cancel-pending-works-before-suspend.patch create mode 100644 queue-4.9/alsa-usb-audio-fix-cannot-get-freq-eq-errors-on-dell-ae515-sound-bar.patch create mode 100644 queue-4.9/mmc-core-fix-partition-switch-time-for-emmc.patch create mode 100644 queue-4.9/s390-dasd-fix-hanging-dasd-driver-unbind.patch create mode 100644 queue-4.9/scripts-recordmcount.-c-pl-support-ffunction-sections-.text.-section-names.patch diff --git a/queue-4.9/alsa-hda-avoid-spurious-unsol-event-handling-during-s3-s4.patch b/queue-4.9/alsa-hda-avoid-spurious-unsol-event-handling-during-s3-s4.patch new file mode 100644 index 00000000000..41d9d9b98cd --- /dev/null +++ b/queue-4.9/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.9/alsa-hda-hdmi-cancel-pending-works-before-suspend.patch b/queue-4.9/alsa-hda-hdmi-cancel-pending-works-before-suspend.patch new file mode 100644 index 00000000000..7852fbf38c8 --- /dev/null +++ b/queue-4.9/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 +@@ -2156,6 +2156,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; +@@ -2179,6 +2191,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.9/alsa-usb-audio-fix-cannot-get-freq-eq-errors-on-dell-ae515-sound-bar.patch b/queue-4.9/alsa-usb-audio-fix-cannot-get-freq-eq-errors-on-dell-ae515-sound-bar.patch new file mode 100644 index 00000000000..7d7e08d6832 --- /dev/null +++ b/queue-4.9/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 +@@ -1153,6 +1153,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.9/mmc-core-fix-partition-switch-time-for-emmc.patch b/queue-4.9/mmc-core-fix-partition-switch-time-for-emmc.patch new file mode 100644 index 00000000000..1ad2cd41216 --- /dev/null +++ b/queue-4.9/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 +@@ -423,10 +423,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) +@@ -610,6 +606,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.9/s390-dasd-fix-hanging-dasd-driver-unbind.patch b/queue-4.9/s390-dasd-fix-hanging-dasd-driver-unbind.patch new file mode 100644 index 00000000000..fcefa21ef51 --- /dev/null +++ b/queue-4.9/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 +@@ -3399,8 +3399,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); +@@ -3419,6 +3417,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.9/scripts-recordmcount.-c-pl-support-ffunction-sections-.text.-section-names.patch b/queue-4.9/scripts-recordmcount.-c-pl-support-ffunction-sections-.text.-section-names.patch new file mode 100644 index 00000000000..9fb2a75d92a --- /dev/null +++ b/queue-4.9/scripts-recordmcount.-c-pl-support-ffunction-sections-.text.-section-names.patch @@ -0,0 +1,84 @@ +From 9c8e2f6d3d361439cc6744a094f1c15681b55269 Mon Sep 17 00:00:00 2001 +From: Joe Lawrence +Date: Tue, 20 Nov 2018 15:19:18 -0500 +Subject: scripts/recordmcount.{c,pl}: support -ffunction-sections .text.* section names + +From: Joe Lawrence + +commit 9c8e2f6d3d361439cc6744a094f1c15681b55269 upstream. + +When building with -ffunction-sections, the compiler will place each +function into its own ELF section, prefixed with ".text". For example, +a simple test module with functions test_module_do_work() and +test_module_wq_func(): + + % objdump --section-headers test_module.o | awk '/\.text/{print $2}' + .text + .text.test_module_do_work + .text.test_module_wq_func + .init.text + .exit.text + +Adjust the recordmcount scripts to look for ".text" as a section name +prefix. This will ensure that those functions will be included in the +__mcount_loc relocations: + + % objdump --reloc --section __mcount_loc test_module.o + OFFSET TYPE VALUE + 0000000000000000 R_X86_64_64 .text.test_module_do_work + 0000000000000008 R_X86_64_64 .text.test_module_wq_func + 0000000000000010 R_X86_64_64 .init.text + +Link: http://lkml.kernel.org/r/1542745158-25392-2-git-send-email-joe.lawrence@redhat.com + +Signed-off-by: Joe Lawrence +Signed-off-by: Steven Rostedt (VMware) +[Manoj: Resolve conflict on 4.4.y/4.9.y because of missing 42c269c88dc1] +Signed-off-by: Manoj Gupta +Signed-off-by: Greg Kroah-Hartman + +--- + scripts/recordmcount.c | 2 +- + scripts/recordmcount.pl | 13 +++++++++++++ + 2 files changed, 14 insertions(+), 1 deletion(-) + +--- a/scripts/recordmcount.c ++++ b/scripts/recordmcount.c +@@ -362,7 +362,7 @@ static uint32_t (*w2)(uint16_t); + static int + is_mcounted_section_name(char const *const txtname) + { +- return strcmp(".text", txtname) == 0 || ++ return strncmp(".text", txtname, 5) == 0 || + strcmp(".ref.text", txtname) == 0 || + strcmp(".sched.text", txtname) == 0 || + strcmp(".spinlock.text", txtname) == 0 || +--- a/scripts/recordmcount.pl ++++ b/scripts/recordmcount.pl +@@ -140,6 +140,11 @@ my %text_sections = ( + ".text.unlikely" => 1, + ); + ++# Acceptable section-prefixes to record. ++my %text_section_prefixes = ( ++ ".text." => 1, ++); ++ + # Note: we are nice to C-programmers here, thus we skip the '||='-idiom. + $objdump = 'objdump' if (!$objdump); + $objcopy = 'objcopy' if (!$objcopy); +@@ -505,6 +510,14 @@ while () { + + # Only record text sections that we know are safe + $read_function = defined($text_sections{$1}); ++ if (!$read_function) { ++ foreach my $prefix (keys %text_section_prefixes) { ++ if (substr($1, 0, length $prefix) eq $prefix) { ++ $read_function = 1; ++ last; ++ } ++ } ++ } + # print out any recorded offsets + update_funcs(); + diff --git a/queue-4.9/series b/queue-4.9/series index 54ca373f6cd..b868c6a1a17 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -22,3 +22,9 @@ powerpc-perf-record-counter-overflow-always-if-sampl.patch pci-xgene-msi-fix-race-in-installing-chained-irq-han.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-avoid-spurious-unsol-event-handling-during-s3-s4.patch +alsa-usb-audio-fix-cannot-get-freq-eq-errors-on-dell-ae515-sound-bar.patch +s390-dasd-fix-hanging-dasd-driver-unbind.patch +mmc-core-fix-partition-switch-time-for-emmc.patch +scripts-recordmcount.-c-pl-support-ffunction-sections-.text.-section-names.patch -- 2.47.3