From 449cda975178cdcdda422f6813e9f0f5eeda3157 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 29 Jun 2020 15:00:31 +0200 Subject: [PATCH] 4.4-stable patches added patches: alsa-usb-audio-fix-invalid-null-check-in-snd_emuusb_set_samplerate.patch pci-disable-msi-for-hisilicon-hip06-hip07-only-in-root-port-mode.patch --- ...l-check-in-snd_emuusb_set_samplerate.patch | 53 +++++++++++++++++++ ...n-hip06-hip07-only-in-root-port-mode.patch | 40 ++++++++++++++ queue-4.4/series | 2 + 3 files changed, 95 insertions(+) create mode 100644 queue-4.4/alsa-usb-audio-fix-invalid-null-check-in-snd_emuusb_set_samplerate.patch create mode 100644 queue-4.4/pci-disable-msi-for-hisilicon-hip06-hip07-only-in-root-port-mode.patch diff --git a/queue-4.4/alsa-usb-audio-fix-invalid-null-check-in-snd_emuusb_set_samplerate.patch b/queue-4.4/alsa-usb-audio-fix-invalid-null-check-in-snd_emuusb_set_samplerate.patch new file mode 100644 index 00000000000..7f7a1691717 --- /dev/null +++ b/queue-4.4/alsa-usb-audio-fix-invalid-null-check-in-snd_emuusb_set_samplerate.patch @@ -0,0 +1,53 @@ +From 6de3c9e3f6b3eaf66859e1379b3f35dda781416b Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 15 Aug 2019 11:41:06 +0200 +Subject: ALSA: usb-audio: Fix invalid NULL check in snd_emuusb_set_samplerate() + +From: Takashi Iwai + +commit 6de3c9e3f6b3eaf66859e1379b3f35dda781416b upstream. + +The quirk function snd_emuusb_set_samplerate() has a NULL check for +the mixer element, but this is useless in the current code. It used +to be a check against mixer->id_elems[unitid] but it was changed later +to the value after mixer_eleme_list_to_info() which is always non-NULL +due to the container_of() usage. + +This patch fixes the check before the conversion. + +While we're at it, correct a typo in the comment in the function, +too. + +Fixes: 8c558076c740 ("ALSA: usb-audio: Clean up mixer element list traverse") +Cc: +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/mixer_quirks.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/sound/usb/mixer_quirks.c ++++ b/sound/usb/mixer_quirks.c +@@ -1168,17 +1168,17 @@ void snd_emuusb_set_samplerate(struct sn + { + struct usb_mixer_interface *mixer; + struct usb_mixer_elem_info *cval; +- int unitid = 12; /* SamleRate ExtensionUnit ID */ ++ int unitid = 12; /* SampleRate ExtensionUnit ID */ + + list_for_each_entry(mixer, &chip->mixer_list, list) { +- cval = mixer_elem_list_to_info(mixer->id_elems[unitid]); +- if (cval) { ++ if (mixer->id_elems[unitid]) { ++ cval = mixer_elem_list_to_info(mixer->id_elems[unitid]); + snd_usb_mixer_set_ctl_value(cval, UAC_SET_CUR, + cval->control << 8, + samplerate_id); + snd_usb_mixer_notify_id(mixer, unitid); ++ break; + } +- break; + } + } + diff --git a/queue-4.4/pci-disable-msi-for-hisilicon-hip06-hip07-only-in-root-port-mode.patch b/queue-4.4/pci-disable-msi-for-hisilicon-hip06-hip07-only-in-root-port-mode.patch new file mode 100644 index 00000000000..0106ce5a740 --- /dev/null +++ b/queue-4.4/pci-disable-msi-for-hisilicon-hip06-hip07-only-in-root-port-mode.patch @@ -0,0 +1,40 @@ +From deb86999323661c019ef2740eb9d479d1e526b5c Mon Sep 17 00:00:00 2001 +From: Dongdong Liu +Date: Thu, 28 Dec 2017 17:53:32 +0800 +Subject: PCI: Disable MSI for HiSilicon Hip06/Hip07 only in Root Port mode + +From: Dongdong Liu + +commit deb86999323661c019ef2740eb9d479d1e526b5c upstream. + +HiSilicon Hip06/Hip07 can operate as either a Root Port or an Endpoint. It +always advertises an MSI capability, but it can only generate MSIs when in +Endpoint mode. + +The device has the same Vendor and Device IDs in both modes, so check the +Class Code and disable MSI only when operating as a Root Port. + +[bhelgaas: changelog] +Fixes: 72f2ff0deb87 ("PCI: Disable MSI for HiSilicon Hip06/Hip07 Root Ports") +Signed-off-by: Dongdong Liu +Signed-off-by: Bjorn Helgaas +Reviewed-by: Zhou Wang +Cc: stable@vger.kernel.org # v4.11+ +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/quirks.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/pci/quirks.c ++++ b/drivers/pci/quirks.c +@@ -1623,8 +1623,8 @@ static void quirk_pcie_mch(struct pci_de + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7520_MCH, quirk_pcie_mch); + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7320_MCH, quirk_pcie_mch); + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, quirk_pcie_mch); +-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_HUAWEI, 0x1610, quirk_pcie_mch); + ++DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_HUAWEI, 0x1610, PCI_CLASS_BRIDGE_PCI, 8, quirk_pcie_mch); + + /* + * It's possible for the MSI to get corrupted if shpc and acpi diff --git a/queue-4.4/series b/queue-4.4/series index 066f5711490..c7293b9b286 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -130,3 +130,5 @@ sunrpc-fixed-rollback-in-rpc_gssd_dummy_populate.patch sunrpc-properly-set-the-subbuf-parameter-of-xdr_buf_subsegment.patch pnfs-flexfiles-fix-list-corruption-if-the-mirror-count-changes.patch nfsv4-fix-close-not-waiting-for-direct-io-compeletion.patch +pci-disable-msi-for-hisilicon-hip06-hip07-only-in-root-port-mode.patch +alsa-usb-audio-fix-invalid-null-check-in-snd_emuusb_set_samplerate.patch -- 2.47.3