From a948dfad978c943a2a68faf8799d2477c589cc32 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Thu, 19 Sep 2019 17:36:19 -0400 Subject: [PATCH 001/178] Fix for dwc3 (rhbz 1753099) --- kernel.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel.spec b/kernel.spec index f1a9f2966..dba598462 100644 --- a/kernel.spec +++ b/kernel.spec @@ -578,6 +578,9 @@ Patch507: 0001-Drop-that-for-now.patch # Submitted upstream at https://lkml.org/lkml/2019/4/23/89 Patch508: KEYS-Make-use-of-platform-keyring-for-module-signature.patch +# rhbz 1753099 +Patch509: dwc3-fix.patch + # END OF PATCH DEFINITIONS %endif @@ -1779,6 +1782,9 @@ fi # # %changelog +* Thu Sep 19 2019 Laura Abbott +- Fix for dwc3 (rhbz 1753099) + * Mon Sep 16 2019 Laura Abbott - 5.3.0-1 - Linux v5.3 From 9f3562b7a073e0cce2c2dff00818d0717ad3cc2d Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Thu, 19 Sep 2019 17:41:06 -0400 Subject: [PATCH 002/178] Add the patch --- dwc3-fix.patch | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 dwc3-fix.patch diff --git a/dwc3-fix.patch b/dwc3-fix.patch new file mode 100644 index 000000000..d741b9e2e --- /dev/null +++ b/dwc3-fix.patch @@ -0,0 +1,80 @@ +From 4749e0e61241cc121de572520a39dab365b9ea1d Mon Sep 17 00:00:00 2001 +From: Thinh Nguyen +Date: Thu, 8 Aug 2019 16:39:42 -0700 +Subject: usb: dwc3: Update soft-reset wait polling rate + +Starting from DWC_usb31 version 1.90a and later, the DCTL.CSFRST bit +will not be cleared until after all the internal clocks are synchronized +during soft-reset. This may take a little more than 50ms. Set the +polling rate at 20ms instead. + +Signed-off-by: Thinh Nguyen +Signed-off-by: Felipe Balbi +--- + drivers/usb/dwc3/core.c | 23 ++++++++++++++++++----- + drivers/usb/dwc3/core.h | 2 ++ + 2 files changed, 20 insertions(+), 5 deletions(-) + +diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c +index 98bce85c29d0..252c397860ef 100644 +--- a/drivers/usb/dwc3/core.c ++++ b/drivers/usb/dwc3/core.c +@@ -252,12 +252,25 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc) + reg |= DWC3_DCTL_CSFTRST; + dwc3_writel(dwc->regs, DWC3_DCTL, reg); + ++ /* ++ * For DWC_usb31 controller 1.90a and later, the DCTL.CSFRST bit ++ * is cleared only after all the clocks are synchronized. This can ++ * take a little more than 50ms. Set the polling rate at 20ms ++ * for 10 times instead. ++ */ ++ if (dwc3_is_usb31(dwc) && dwc->revision >= DWC3_USB31_REVISION_190A) ++ retries = 10; ++ + do { + reg = dwc3_readl(dwc->regs, DWC3_DCTL); + if (!(reg & DWC3_DCTL_CSFTRST)) + goto done; + +- udelay(1); ++ if (dwc3_is_usb31(dwc) && ++ dwc->revision >= DWC3_USB31_REVISION_190A) ++ msleep(20); ++ else ++ udelay(1); + } while (--retries); + + phy_exit(dwc->usb3_generic_phy); +@@ -267,11 +280,11 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc) + + done: + /* +- * For DWC_usb31 controller, once DWC3_DCTL_CSFTRST bit is cleared, +- * we must wait at least 50ms before accessing the PHY domain +- * (synchronization delay). DWC_usb31 programming guide section 1.3.2. ++ * For DWC_usb31 controller 1.80a and prior, once DCTL.CSFRST bit ++ * is cleared, we must wait at least 50ms before accessing the PHY ++ * domain (synchronization delay). + */ +- if (dwc3_is_usb31(dwc)) ++ if (dwc3_is_usb31(dwc) && dwc->revision <= DWC3_USB31_REVISION_180A) + msleep(50); + + return 0; +diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h +index 3dd783b889cb..1c8b349379af 100644 +--- a/drivers/usb/dwc3/core.h ++++ b/drivers/usb/dwc3/core.h +@@ -1137,6 +1137,8 @@ struct dwc3 { + #define DWC3_USB31_REVISION_120A (0x3132302a | DWC3_REVISION_IS_DWC31) + #define DWC3_USB31_REVISION_160A (0x3136302a | DWC3_REVISION_IS_DWC31) + #define DWC3_USB31_REVISION_170A (0x3137302a | DWC3_REVISION_IS_DWC31) ++#define DWC3_USB31_REVISION_180A (0x3138302a | DWC3_REVISION_IS_DWC31) ++#define DWC3_USB31_REVISION_190A (0x3139302a | DWC3_REVISION_IS_DWC31) + + u32 version_type; + +-- +cgit 1.2-0.3.lf.el7 + From 06340ec1772854c5493f89de8e888fe5ab25059e Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Mon, 23 Sep 2019 08:19:02 -0400 Subject: [PATCH 003/178] Update to work with 5.x --- scripts/stable-update.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/scripts/stable-update.sh b/scripts/stable-update.sh index 2ea5fb78b..259a338c1 100755 --- a/scripts/stable-update.sh +++ b/scripts/stable-update.sh @@ -35,27 +35,29 @@ if [ -z $VERSION ]; then fi if [ ! -f patch-$1.xz ]; then - wget https://cdn.kernel.org/pub/linux/kernel/v4.x/patch-$1.xz + wget https://cdn.kernel.org/pub/linux/kernel/v5.x/patch-$1.xz if [ ! $? -eq 0 ]; then echo "Download fail" exit 1 fi fi -if [ ! -f "patch-$1.sign" ]; then - wget "https://cdn.kernel.org/pub/linux/kernel/v4.x/patch-$1.sign" - if [ ! $? -eq 0 ]; then - echo "Signature download failed" - exit 1 - fi -fi +# This all needs to be updated for the new generation system +# +# if [ ! -f "patch-$1.sign" ]; then +# wget "https://cdn.kernel.org/pub/linux/kernel/v4.x/patch-$1.sign" +# if [ ! $? -eq 0 ]; then +# echo "Signature download failed" +# exit 1 +# fi +# fi -xzcat "patch-$1.xz" | gpg2 --verify "patch-$1.sign" - -if [ ! $? -eq 0 ]; then - echo "Patch file has invalid or untrusted signature!" - echo "See https://www.kernel.org/category/signatures.html" - exit 1 -fi +# xzcat "patch-$1.xz" | gpg2 --verify "patch-$1.sign" - +# if [ ! $? -eq 0 ]; then +# echo "Patch file has invalid or untrusted signature!" +# echo "See https://www.kernel.org/category/signatures.html" +# exit 1 +# fi grep $1 sources &> /dev/null if [ ! $? -eq 0 ]; then From 0498fb5dc56cabea8f041a6d8d9562c7f6bdc1d1 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Mon, 23 Sep 2019 08:21:06 -0400 Subject: [PATCH 004/178] Linux v5.3.1 --- kernel.spec | 7 +++++-- sources | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel.spec b/kernel.spec index dba598462..0b6f2a9b8 100644 --- a/kernel.spec +++ b/kernel.spec @@ -44,7 +44,7 @@ Summary: The Linux kernel # For non-released -rc kernels, this will be appended after the rcX and # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3" # -%global baserelease 1 +%global baserelease 100 %global fedora_build %{baserelease} # base_sublevel is the kernel version we're starting with and patching @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 0 +%define stable_update 1 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -1782,6 +1782,9 @@ fi # # %changelog +* Mon Sep 23 2019 Laura Abbott - 5.3.1-100 +- Linux v5.3.1 + * Thu Sep 19 2019 Laura Abbott - Fix for dwc3 (rhbz 1753099) diff --git a/sources b/sources index 147e64fc4..04bf19e31 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d +SHA512 (patch-5.3.1.xz) = 7145c90530c49635a6270d3021f423b34f57d2058a3083f1d11b9ed1ab72cb4e5a30a3794bc490304d14423bd7e74b296f4027ade844f09d861d830449edc198 From e0ac22bfc21dcbac891f39a6eaae4464f933e9c4 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Tue, 24 Sep 2019 15:16:01 +0100 Subject: [PATCH 005/178] Upstream patch for iwlwifi 8000 series FW issues (rhbz: 1749949) --- ...POWER_LIMIT-command-to-FW-version-36.patch | 87 +++++++++++++++++++ kernel.spec | 12 ++- 2 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 iwlwifi-fw-don-t-send-GEO_TX_POWER_LIMIT-command-to-FW-version-36.patch diff --git a/iwlwifi-fw-don-t-send-GEO_TX_POWER_LIMIT-command-to-FW-version-36.patch b/iwlwifi-fw-don-t-send-GEO_TX_POWER_LIMIT-command-to-FW-version-36.patch new file mode 100644 index 000000000..f583a5b2d --- /dev/null +++ b/iwlwifi-fw-don-t-send-GEO_TX_POWER_LIMIT-command-to-FW-version-36.patch @@ -0,0 +1,87 @@ +From patchwork Tue Sep 24 10:30:57 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Luca Coelho +X-Patchwork-Id: 11158395 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62FF3112B + for ; + Tue, 24 Sep 2019 10:31:06 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 4AA4E214D9 + for ; + Tue, 24 Sep 2019 10:31:06 +0000 (UTC) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2409468AbfIXKbF (ORCPT + ); + Tue, 24 Sep 2019 06:31:05 -0400 +Received: from paleale.coelho.fi ([176.9.41.70]:44742 "EHLO + farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org + with ESMTP id S2387644AbfIXKbF (ORCPT + ); + Tue, 24 Sep 2019 06:31:05 -0400 +Received: from [91.156.6.193] (helo=redipa.ger.corp.intel.com) + by farmhouse.coelho.fi with esmtpsa + (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) + (Exim 4.92) + (envelope-from ) + id 1iCi63-0005Je-8E; Tue, 24 Sep 2019 13:31:03 +0300 +From: Luca Coelho +To: kvalo@codeaurora.org +Cc: linux-wireless@vger.kernel.org +Date: Tue, 24 Sep 2019 13:30:57 +0300 +Message-Id: <20190924103057.17147-1-luca@coelho.fi> +X-Mailer: git-send-email 2.23.0 +MIME-Version: 1.0 +X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on farmhouse.coelho.fi +X-Spam-Level: +X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, + URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 +Subject: [PATCH v5.4] iwlwifi: fw: don't send GEO_TX_POWER_LIMIT command to FW + version 36 +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +From: Luca Coelho + +The intention was to have the GEO_TX_POWER_LIMIT command in FW version +36 as well, but not all 8000 family got this feature enabled. The +8000 family is the only one using version 36, so skip this version +entirely. If we try to send this command to the firmwares that do not +support it, we get a BAD_COMMAND response from the firmware. + +This fixes https://bugzilla.kernel.org/show_bug.cgi?id=204151. + +Cc: stable@vger.kernel.org # 4.19+ +Signed-off-by: Luca Coelho +--- + drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +index 014eca6596e2..32a5e4e5461f 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +@@ -889,11 +889,13 @@ static bool iwl_mvm_sar_geo_support(struct iwl_mvm *mvm) + * firmware versions. Unfortunately, we don't have a TLV API + * flag to rely on, so rely on the major version which is in + * the first byte of ucode_ver. This was implemented +- * initially on version 38 and then backported to 36, 29 and +- * 17. ++ * initially on version 38 and then backported to29 and 17. ++ * The intention was to have it in 36 as well, but not all ++ * 8000 family got this feature enabled. The 8000 family is ++ * the only one using version 36, so skip this version ++ * entirely. + */ + return IWL_UCODE_SERIAL(mvm->fw->ucode_ver) >= 38 || +- IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 36 || + IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 29 || + IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 17; + } diff --git a/kernel.spec b/kernel.spec index 0b6f2a9b8..247e6291d 100644 --- a/kernel.spec +++ b/kernel.spec @@ -572,14 +572,17 @@ Patch332: arm64-dts-qcom-Add-Lenovo-Yoga-C630.patch Patch501: input-rmi4-remove-the-need-for-artifical-IRQ.patch # gcc9 fixes -Patch507: 0001-Drop-that-for-now.patch +Patch502: 0001-Drop-that-for-now.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1701096 # Submitted upstream at https://lkml.org/lkml/2019/4/23/89 -Patch508: KEYS-Make-use-of-platform-keyring-for-module-signature.patch +Patch503: KEYS-Make-use-of-platform-keyring-for-module-signature.patch # rhbz 1753099 -Patch509: dwc3-fix.patch +Patch504: dwc3-fix.patch + +# https://patchwork.kernel.org/patch/11158395/ +Patch505: iwlwifi-fw-don-t-send-GEO_TX_POWER_LIMIT-command-to-FW-version-36.patch # END OF PATCH DEFINITIONS @@ -1782,6 +1785,9 @@ fi # # %changelog +* Mon Sep 23 2019 Peter Robinson +- Upstream patch for iwlwifi 8000 series FW issues (rhbz: 1749949) + * Mon Sep 23 2019 Laura Abbott - 5.3.1-100 - Linux v5.3.1 From b07dd9aa6f3a8f3724cad575531aa8e59ecf234a Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Tue, 24 Sep 2019 21:38:30 +0100 Subject: [PATCH 006/178] build for iwlwifi fix --- kernel.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel.spec b/kernel.spec index 247e6291d..a8dc3e8a8 100644 --- a/kernel.spec +++ b/kernel.spec @@ -44,7 +44,7 @@ Summary: The Linux kernel # For non-released -rc kernels, this will be appended after the rcX and # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3" # -%global baserelease 100 +%global baserelease 300 %global fedora_build %{baserelease} # base_sublevel is the kernel version we're starting with and patching @@ -1785,7 +1785,7 @@ fi # # %changelog -* Mon Sep 23 2019 Peter Robinson +* Mon Sep 23 2019 Peter Robinson 5.3.1-300 - Upstream patch for iwlwifi 8000 series FW issues (rhbz: 1749949) * Mon Sep 23 2019 Laura Abbott - 5.3.1-100 From 138f36aa167cda45448f3cabbea24c5cc491f8c8 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Thu, 26 Sep 2019 16:21:16 -0400 Subject: [PATCH 007/178] bring in some x86 PCI ids --- ...CI-device-IDs-for-family-17h-model-7.patch | 92 +++++++++++++++++++ kernel.spec | 3 + 2 files changed, 95 insertions(+) create mode 100644 0001-x86-amd_nb-Add-PCI-device-IDs-for-family-17h-model-7.patch diff --git a/0001-x86-amd_nb-Add-PCI-device-IDs-for-family-17h-model-7.patch b/0001-x86-amd_nb-Add-PCI-device-IDs-for-family-17h-model-7.patch new file mode 100644 index 000000000..327789e50 --- /dev/null +++ b/0001-x86-amd_nb-Add-PCI-device-IDs-for-family-17h-model-7.patch @@ -0,0 +1,92 @@ +From af4e1c5eca95bed1192d8dc45c8ed63aea2209e8 Mon Sep 17 00:00:00 2001 +From: Marcel Bocu +Date: Mon, 22 Jul 2019 20:45:10 +0300 +Subject: [PATCH] x86/amd_nb: Add PCI device IDs for family 17h, model 70h + +The AMD Ryzen gen 3 processors came with a different PCI IDs for the +function 3 & 4 which are used to access the SMN interface. The root +PCI address however remained at the same address as the model 30h. + +Adding the F3/F4 PCI IDs respectively to the misc and link ids appear +to be sufficient for k10temp, so let's add them and follow up on the +patch if other functions need more tweaking. + +Vicki Pfau sent an identical patch after I checked that no-one had +written this patch. I would have been happy about dropping my patch but +unlike for his patch series, I had already Cc:ed the x86 people and +they already reviewed the changes. Since Vicki has not answered to +any email after his initial series, let's assume she is on vacation +and let's avoid duplication of reviews from the maintainers and merge +my series. To acknowledge Vicki's anteriority, I added her S-o-b to +the patch. + +v2, suggested by Guenter Roeck and Brian Woods: + - rename from 71h to 70h + +Signed-off-by: Vicki Pfau +Signed-off-by: Marcel Bocu +Tested-by: Marcel Bocu +Acked-by: Thomas Gleixner +Acked-by: Brian Woods +Acked-by: Bjorn Helgaas # pci_ids.h + +Cc: Thomas Gleixner +Cc: Ingo Molnar +Cc: Borislav Petkov +Cc: "H. Peter Anvin" +Cc: x86@kernel.org +Cc: "Woods, Brian" +Cc: Clemens Ladisch +Cc: Jean Delvare +Cc: Guenter Roeck +Cc: linux-hwmon@vger.kernel.org +Link: https://lore.kernel.org/r/20190722174510.2179-1-marcel.p.bocu@gmail.com +Signed-off-by: Guenter Roeck +--- + arch/x86/kernel/amd_nb.c | 3 +++ + include/linux/pci_ids.h | 1 + + 2 files changed, 4 insertions(+) + +diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c +index d63e63b7d1d9..251c795b4eb3 100644 +--- a/arch/x86/kernel/amd_nb.c ++++ b/arch/x86/kernel/amd_nb.c +@@ -21,6 +21,7 @@ + #define PCI_DEVICE_ID_AMD_17H_DF_F4 0x1464 + #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F4 0x15ec + #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F4 0x1494 ++#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F4 0x1444 + + /* Protect the PCI config register pairs used for SMN and DF indirect access. */ + static DEFINE_MUTEX(smn_mutex); +@@ -50,6 +51,7 @@ const struct pci_device_id amd_nb_misc_ids[] = { + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F3) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F3) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) }, ++ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) }, + {} + }; + EXPORT_SYMBOL_GPL(amd_nb_misc_ids); +@@ -63,6 +65,7 @@ static const struct pci_device_id amd_nb_link_ids[] = { + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_DF_F4) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F4) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F4) }, ++ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F4) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) }, + {} + }; +diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h +index c842735a4f45..4b97f427cc92 100644 +--- a/include/linux/pci_ids.h ++++ b/include/linux/pci_ids.h +@@ -548,6 +548,7 @@ + #define PCI_DEVICE_ID_AMD_17H_DF_F3 0x1463 + #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F3 0x15eb + #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F3 0x1493 ++#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F3 0x1443 + #define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703 + #define PCI_DEVICE_ID_AMD_LANCE 0x2000 + #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 +-- +2.21.0 + diff --git a/kernel.spec b/kernel.spec index a8dc3e8a8..5c96abad4 100644 --- a/kernel.spec +++ b/kernel.spec @@ -584,6 +584,9 @@ Patch504: dwc3-fix.patch # https://patchwork.kernel.org/patch/11158395/ Patch505: iwlwifi-fw-don-t-send-GEO_TX_POWER_LIMIT-command-to-FW-version-36.patch +# new ids +Patch506: 0001-x86-amd_nb-Add-PCI-device-IDs-for-family-17h-model-7.patch + # END OF PATCH DEFINITIONS %endif From 715d4067537b216ffb402b0feb5ac1c354f50601 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Mon, 30 Sep 2019 09:33:11 -0400 Subject: [PATCH 008/178] Fix for tpm crashes (rhbz 1752961) --- kernel.spec | 7 + ...s-event--count-when-it-isn-t-mapped..patch | 233 ++++++++++++++++++ ...e-after-successful-event-log-parsing.patch | 190 ++++++++++++++ 3 files changed, 430 insertions(+) create mode 100644 v2-1-2-efi-tpm-Don-t-access-event--count-when-it-isn-t-mapped..patch create mode 100644 v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-parsing.patch diff --git a/kernel.spec b/kernel.spec index 5c96abad4..88100335f 100644 --- a/kernel.spec +++ b/kernel.spec @@ -587,6 +587,10 @@ Patch505: iwlwifi-fw-don-t-send-GEO_TX_POWER_LIMIT-command-to-FW-version-36.patc # new ids Patch506: 0001-x86-amd_nb-Add-PCI-device-IDs-for-family-17h-model-7.patch +# rhbz 1752961 +Patch507: v2-1-2-efi-tpm-Don-t-access-event--count-when-it-isn-t-mapped..patch +Patch508: v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-parsing.patch + # END OF PATCH DEFINITIONS %endif @@ -1788,6 +1792,9 @@ fi # # %changelog +* Mon Sep 30 2019 Laura Abbott +- Fix for tpm crashes (rhbz 1752961) + * Mon Sep 23 2019 Peter Robinson 5.3.1-300 - Upstream patch for iwlwifi 8000 series FW issues (rhbz: 1749949) diff --git a/v2-1-2-efi-tpm-Don-t-access-event--count-when-it-isn-t-mapped..patch b/v2-1-2-efi-tpm-Don-t-access-event--count-when-it-isn-t-mapped..patch new file mode 100644 index 000000000..d0ec73a2a --- /dev/null +++ b/v2-1-2-efi-tpm-Don-t-access-event--count-when-it-isn-t-mapped..patch @@ -0,0 +1,233 @@ +From patchwork Wed Sep 25 10:16:18 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Jarkko Sakkinen +X-Patchwork-Id: 11160381 +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43E0E112B + for ; + Wed, 25 Sep 2019 10:16:35 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 2BB5521D7A + for ; + Wed, 25 Sep 2019 10:16:35 +0000 (UTC) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2389040AbfIYKQe (ORCPT + ); + Wed, 25 Sep 2019 06:16:34 -0400 +Received: from mga06.intel.com ([134.134.136.31]:40402 "EHLO mga06.intel.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1727141AbfIYKQe (ORCPT ); + Wed, 25 Sep 2019 06:16:34 -0400 +X-Amp-Result: SKIPPED(no attachment in message) +X-Amp-File-Uploaded: False +Received: from orsmga006.jf.intel.com ([10.7.209.51]) + by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; + 25 Sep 2019 03:16:33 -0700 +X-ExtLoop1: 1 +X-IronPort-AV: E=Sophos;i="5.64,547,1559545200"; + d="scan'208";a="193723106" +Received: from dariusvo-mobl.ger.corp.intel.com (HELO localhost) + ([10.249.39.150]) + by orsmga006.jf.intel.com with ESMTP; 25 Sep 2019 03:16:27 -0700 +From: Jarkko Sakkinen +To: linux-integrity@vger.kernel.org +Cc: Peter Jones , linux-efi@vger.kernel.org, + stable@vger.kernel.org, Lyude Paul , + Jarkko Sakkinen , + Matthew Garrett , + Ard Biesheuvel , + Roberto Sassu , + Bartosz Szczepanek , + linux-kernel@vger.kernel.org (open list) +Subject: [PATCH v2 1/2] efi+tpm: Don't access event->count when it isn't + mapped. +Date: Wed, 25 Sep 2019 13:16:18 +0300 +Message-Id: <20190925101622.31457-1-jarkko.sakkinen@linux.intel.com> +X-Mailer: git-send-email 2.20.1 +MIME-Version: 1.0 +Sender: linux-integrity-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-integrity@vger.kernel.org + +From: Peter Jones + +Some machines generate a lot of event log entries. When we're +iterating over them, the code removes the old mapping and adds a +new one, so once we cross the page boundary we're unmapping the page +with the count on it. Hilarity ensues. + +This patch keeps the info from the header in local variables so we don't +need to access that page again or keep track of if it's mapped. + +Fixes: 44038bc514a2 ("tpm: Abstract crypto agile event size calculations") +Cc: linux-efi@vger.kernel.org +Cc: linux-integrity@vger.kernel.org +Cc: stable@vger.kernel.org +Signed-off-by: Peter Jones +Tested-by: Lyude Paul +Reviewed-by: Jarkko Sakkinen +Acked-by: Matthew Garrett +Acked-by: Ard Biesheuvel +Signed-off-by: Jarkko Sakkinen +--- + include/linux/tpm_eventlog.h | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/include/linux/tpm_eventlog.h b/include/linux/tpm_eventlog.h +index 63238c84dc0b..12584b69a3f3 100644 +--- a/include/linux/tpm_eventlog.h ++++ b/include/linux/tpm_eventlog.h +@@ -170,6 +170,7 @@ static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, + u16 halg; + int i; + int j; ++ u32 count, event_type; + + marker = event; + marker_start = marker; +@@ -190,16 +191,22 @@ static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, + } + + event = (struct tcg_pcr_event2_head *)mapping; ++ /* ++ * the loop below will unmap these fields if the log is larger than ++ * one page, so save them here for reference. ++ */ ++ count = READ_ONCE(event->count); ++ event_type = READ_ONCE(event->event_type); + + efispecid = (struct tcg_efi_specid_event_head *)event_header->event; + + /* Check if event is malformed. */ +- if (event->count > efispecid->num_algs) { ++ if (count > efispecid->num_algs) { + size = 0; + goto out; + } + +- for (i = 0; i < event->count; i++) { ++ for (i = 0; i < count; i++) { + halg_size = sizeof(event->digests[i].alg_id); + + /* Map the digest's algorithm identifier */ +@@ -256,8 +263,9 @@ static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, + + event_field->event_size; + size = marker - marker_start; + +- if ((event->event_type == 0) && (event_field->event_size == 0)) ++ if (event_type == 0 && event_field->event_size == 0) + size = 0; ++ + out: + if (do_mapping) + TPM_MEMUNMAP(mapping, mapping_size); + +From patchwork Wed Sep 25 10:16:19 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Jarkko Sakkinen +X-Patchwork-Id: 11160383 +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 363B114DB + for ; + Wed, 25 Sep 2019 10:16:40 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 1DCE921D7C + for ; + Wed, 25 Sep 2019 10:16:40 +0000 (UTC) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2389138AbfIYKQj (ORCPT + ); + Wed, 25 Sep 2019 06:16:39 -0400 +Received: from mga18.intel.com ([134.134.136.126]:21948 "EHLO mga18.intel.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1727141AbfIYKQj (ORCPT ); + Wed, 25 Sep 2019 06:16:39 -0400 +X-Amp-Result: SKIPPED(no attachment in message) +X-Amp-File-Uploaded: False +Received: from orsmga004.jf.intel.com ([10.7.209.38]) + by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; + 25 Sep 2019 03:16:38 -0700 +X-ExtLoop1: 1 +X-IronPort-AV: E=Sophos;i="5.64,547,1559545200"; + d="scan'208";a="340366339" +Received: from dariusvo-mobl.ger.corp.intel.com (HELO localhost) + ([10.249.39.150]) + by orsmga004.jf.intel.com with ESMTP; 25 Sep 2019 03:16:35 -0700 +From: Jarkko Sakkinen +To: linux-integrity@vger.kernel.org +Cc: Peter Jones , linux-efi@vger.kernel.org, + stable@vger.kernel.org, Lyude Paul , + Jarkko Sakkinen , + Matthew Garrett , + Ard Biesheuvel , + linux-kernel@vger.kernel.org (open list) +Subject: [PATCH v2 2/2] efi+tpm: don't traverse an event log with no events +Date: Wed, 25 Sep 2019 13:16:19 +0300 +Message-Id: <20190925101622.31457-2-jarkko.sakkinen@linux.intel.com> +X-Mailer: git-send-email 2.20.1 +In-Reply-To: <20190925101622.31457-1-jarkko.sakkinen@linux.intel.com> +References: <20190925101622.31457-1-jarkko.sakkinen@linux.intel.com> +MIME-Version: 1.0 +Sender: linux-integrity-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-integrity@vger.kernel.org + +From: Peter Jones + +When there are no entries to put into the final event log, some machines +will return the template they would have populated anyway. In this case +the nr_events field is 0, but the rest of the log is just garbage. + +This patch stops us from trying to iterate the table with +__calc_tpm2_event_size() when the number of events in the table is 0. + +Fixes: c46f3405692d ("tpm: Reserve the TPM final events table") +Cc: linux-efi@vger.kernel.org +Cc: linux-integrity@vger.kernel.org +Cc: stable@vger.kernel.org +Signed-off-by: Peter Jones +Tested-by: Lyude Paul +Reviewed-by: Jarkko Sakkinen +Acked-by: Matthew Garrett +Acked-by: Ard Biesheuvel +Signed-off-by: Jarkko Sakkinen +--- + drivers/firmware/efi/tpm.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c +index 1d3f5ca3eaaf..b9ae5c6f9b9c 100644 +--- a/drivers/firmware/efi/tpm.c ++++ b/drivers/firmware/efi/tpm.c +@@ -75,11 +75,16 @@ int __init efi_tpm_eventlog_init(void) + goto out; + } + +- tbl_size = tpm2_calc_event_log_size((void *)efi.tpm_final_log +- + sizeof(final_tbl->version) +- + sizeof(final_tbl->nr_events), +- final_tbl->nr_events, +- log_tbl->log); ++ tbl_size = 0; ++ if (final_tbl->nr_events != 0) { ++ void *events = (void *)efi.tpm_final_log ++ + sizeof(final_tbl->version) ++ + sizeof(final_tbl->nr_events); ++ ++ tbl_size = tpm2_calc_event_log_size(events, ++ final_tbl->nr_events, ++ log_tbl->log); ++ } + memblock_reserve((unsigned long)final_tbl, + tbl_size + sizeof(*final_tbl)); + early_memunmap(final_tbl, sizeof(*final_tbl)); diff --git a/v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-parsing.patch b/v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-parsing.patch new file mode 100644 index 000000000..a828cb294 --- /dev/null +++ b/v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-parsing.patch @@ -0,0 +1,190 @@ +From patchwork Wed Sep 25 17:27:05 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Jerry Snitselaar +X-Patchwork-Id: 11161161 +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88B8A1747 + for ; + Wed, 25 Sep 2019 17:27:13 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 66F4F217F4 + for ; + Wed, 25 Sep 2019 17:27:13 +0000 (UTC) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2505171AbfIYR1J (ORCPT + ); + Wed, 25 Sep 2019 13:27:09 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:41496 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S2505170AbfIYR1J (ORCPT ); + Wed, 25 Sep 2019 13:27:09 -0400 +Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com + [10.5.11.22]) + (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mx1.redhat.com (Postfix) with ESMTPS id 4CE7C1056FB1; + Wed, 25 Sep 2019 17:27:08 +0000 (UTC) +Received: from cantor.redhat.com (ovpn-117-191.phx2.redhat.com [10.3.117.191]) + by smtp.corp.redhat.com (Postfix) with ESMTP id D081B1001B12; + Wed, 25 Sep 2019 17:27:07 +0000 (UTC) +From: Jerry Snitselaar +To: linux-efi@vger.kernel.org +Cc: linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, + stable@vger.kernel.org, Matthew Garrett , + Ard Biesheuvel , + Jarkko Sakkinen +Subject: [PATCH v3] tpm: only set efi_tpm_final_log_size after successful + event log parsing +Date: Wed, 25 Sep 2019 10:27:05 -0700 +Message-Id: <20190925172705.17358-1-jsnitsel@redhat.com> +MIME-Version: 1.0 +X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 +X-Greylist: Sender IP whitelisted, + not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); + Wed, 25 Sep 2019 17:27:08 +0000 (UTC) +Sender: linux-integrity-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-integrity@vger.kernel.org + +If __calc_tpm2_event_size fails to parse an event it will return 0, +resulting tpm2_calc_event_log_size returning -1. Currently there is +no check of this return value, and efi_tpm_final_log_size can end up +being set to this negative value resulting in a panic like the +the one given below. + +Also __calc_tpm2_event_size returns a size of 0 when it fails +to parse an event, so update function documentation to reflect this. + +[ 0.774340] BUG: unable to handle page fault for address: ffffbc8fc00866ad +[ 0.774788] #PF: supervisor read access in kernel mode +[ 0.774788] #PF: error_code(0x0000) - not-present page +[ 0.774788] PGD 107d36067 P4D 107d36067 PUD 107d37067 PMD 107d38067 PTE 0 +[ 0.774788] Oops: 0000 [#1] SMP PTI +[ 0.774788] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.3.0-0.rc2.1.elrdy.x86_64 #1 +[ 0.774788] Hardware name: LENOVO 20HGS22D0W/20HGS22D0W, BIOS N1WET51W (1.30 ) 09/14/2018 +[ 0.774788] RIP: 0010:memcpy_erms+0x6/0x10 +[ 0.774788] Code: 90 90 90 90 eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 a4 c3 0f 1f 80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38 fe +[ 0.774788] RSP: 0000:ffffbc8fc0073b30 EFLAGS: 00010286 +[ 0.774788] RAX: ffff9b1fc7c5b367 RBX: ffff9b1fc8390000 RCX: ffffffffffffe962 +[ 0.774788] RDX: ffffffffffffe962 RSI: ffffbc8fc00866ad RDI: ffff9b1fc7c5b367 +[ 0.774788] RBP: ffff9b1c10ca7018 R08: ffffbc8fc0085fff R09: 8000000000000063 +[ 0.774788] R10: 0000000000001000 R11: 000fffffffe00000 R12: 0000000000003367 +[ 0.774788] R13: ffff9b1fcc47c010 R14: ffffbc8fc0085000 R15: 0000000000000002 +[ 0.774788] FS: 0000000000000000(0000) GS:ffff9b1fce200000(0000) knlGS:0000000000000000 +[ 0.774788] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +[ 0.774788] CR2: ffffbc8fc00866ad CR3: 000000029f60a001 CR4: 00000000003606f0 +[ 0.774788] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +[ 0.774788] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 +[ 0.774788] Call Trace: +[ 0.774788] tpm_read_log_efi+0x156/0x1a0 +[ 0.774788] tpm_bios_log_setup+0xc8/0x190 +[ 0.774788] tpm_chip_register+0x50/0x1c0 +[ 0.774788] tpm_tis_core_init.cold.9+0x28c/0x466 +[ 0.774788] tpm_tis_plat_probe+0xcc/0xea +[ 0.774788] platform_drv_probe+0x35/0x80 +[ 0.774788] really_probe+0xef/0x390 +[ 0.774788] driver_probe_device+0xb4/0x100 +[ 0.774788] device_driver_attach+0x4f/0x60 +[ 0.774788] __driver_attach+0x86/0x140 +[ 0.774788] ? device_driver_attach+0x60/0x60 +[ 0.774788] bus_for_each_dev+0x76/0xc0 +[ 0.774788] ? klist_add_tail+0x3b/0x70 +[ 0.774788] bus_add_driver+0x14a/0x1e0 +[ 0.774788] ? tpm_init+0xea/0xea +[ 0.774788] ? do_early_param+0x8e/0x8e +[ 0.774788] driver_register+0x6b/0xb0 +[ 0.774788] ? tpm_init+0xea/0xea +[ 0.774788] init_tis+0x86/0xd8 +[ 0.774788] ? do_early_param+0x8e/0x8e +[ 0.774788] ? driver_register+0x94/0xb0 +[ 0.774788] do_one_initcall+0x46/0x1e4 +[ 0.774788] ? do_early_param+0x8e/0x8e +[ 0.774788] kernel_init_freeable+0x199/0x242 +[ 0.774788] ? rest_init+0xaa/0xaa +[ 0.774788] kernel_init+0xa/0x106 +[ 0.774788] ret_from_fork+0x35/0x40 +[ 0.774788] Modules linked in: +[ 0.774788] CR2: ffffbc8fc00866ad +[ 0.774788] ---[ end trace 42930799f8d6eaea ]--- +[ 0.774788] RIP: 0010:memcpy_erms+0x6/0x10 +[ 0.774788] Code: 90 90 90 90 eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 a4 c3 0f 1f 80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38 fe +[ 0.774788] RSP: 0000:ffffbc8fc0073b30 EFLAGS: 00010286 +[ 0.774788] RAX: ffff9b1fc7c5b367 RBX: ffff9b1fc8390000 RCX: ffffffffffffe962 +[ 0.774788] RDX: ffffffffffffe962 RSI: ffffbc8fc00866ad RDI: ffff9b1fc7c5b367 +[ 0.774788] RBP: ffff9b1c10ca7018 R08: ffffbc8fc0085fff R09: 8000000000000063 +[ 0.774788] R10: 0000000000001000 R11: 000fffffffe00000 R12: 0000000000003367 +[ 0.774788] R13: ffff9b1fcc47c010 R14: ffffbc8fc0085000 R15: 0000000000000002 +[ 0.774788] FS: 0000000000000000(0000) GS:ffff9b1fce200000(0000) knlGS:0000000000000000 +[ 0.774788] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +[ 0.774788] CR2: ffffbc8fc00866ad CR3: 000000029f60a001 CR4: 00000000003606f0 +[ 0.774788] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +[ 0.774788] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 +[ 0.774788] Kernel panic - not syncing: Fatal exception +[ 0.774788] Kernel Offset: 0x1d000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) +[ 0.774788] ---[ end Kernel panic - not syncing: Fatal exception ]--- + +The root cause of the issue that caused the failure of event parsing +in this case is resolved by Peter Jone's patchset dealing with large +event logs where crossing over a page boundary causes the page with +the event count to be unmapped. + +Fixes: c46f3405692de ("tpm: Reserve the TPM final events table") +Cc: linux-efi@vger.kernel.org +Cc: linux-integrity@vger.kernel.org +Cc: stable@vger.kernel.org +Cc: Matthew Garrett +Cc: Ard Biesheuvel +Cc: Jarkko Sakkinen +Signed-off-by: Jerry Snitselaar +Reviewed-by: +--- +v3: rebase on top of Peter Jone's patchset +v2: added FW_BUG to pr_err, and renamed label to out_calc. + Updated doc comment for __calc_tpm2_event_size. + + drivers/firmware/efi/tpm.c | 9 ++++++++- + include/linux/tpm_eventlog.h | 2 +- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c +index b9ae5c6f9b9c..703469c1ab8e 100644 +--- a/drivers/firmware/efi/tpm.c ++++ b/drivers/firmware/efi/tpm.c +@@ -85,11 +85,18 @@ int __init efi_tpm_eventlog_init(void) + final_tbl->nr_events, + log_tbl->log); + } ++ ++ if (tbl_size < 0) { ++ pr_err(FW_BUG "Failed to parse event in TPM Final Events Log\n"); ++ goto out_calc; ++ } ++ + memblock_reserve((unsigned long)final_tbl, + tbl_size + sizeof(*final_tbl)); +- early_memunmap(final_tbl, sizeof(*final_tbl)); + efi_tpm_final_log_size = tbl_size; + ++out_calc: ++ early_memunmap(final_tbl, sizeof(*final_tbl)); + out: + early_memunmap(log_tbl, sizeof(*log_tbl)); + return ret; +diff --git a/include/linux/tpm_eventlog.h b/include/linux/tpm_eventlog.h +index 12584b69a3f3..2dfdd63ac034 100644 +--- a/include/linux/tpm_eventlog.h ++++ b/include/linux/tpm_eventlog.h +@@ -152,7 +152,7 @@ struct tcg_algorithm_info { + * total. Once we've done this we know the offset of the data length field, + * and can calculate the total size of the event. + * +- * Return: size of the event on success, <0 on failure ++ * Return: size of the event on success, 0 on failure + */ + + static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, From e163d285354547e796f0cc0d906d8ba9c72260dc Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Tue, 1 Oct 2019 15:23:08 -0500 Subject: [PATCH 009/178] Linux v5.3.2 --- kernel.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel.spec b/kernel.spec index 88100335f..17d7ad0c3 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 1 +%define stable_update 2 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -1792,6 +1792,9 @@ fi # # %changelog +* Tue Oct 01 2019 Justin M. Forbes - 5.3.2-300 +- Linux v5.3.2 + * Mon Sep 30 2019 Laura Abbott - Fix for tpm crashes (rhbz 1752961) diff --git a/sources b/sources index 04bf19e31..6e4650fea 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.1.xz) = 7145c90530c49635a6270d3021f423b34f57d2058a3083f1d11b9ed1ab72cb4e5a30a3794bc490304d14423bd7e74b296f4027ade844f09d861d830449edc198 +SHA512 (patch-5.3.2.xz) = 3528b4355ebbf1a1cbc4ac7efd7cdd5b5dddb28c30e182e8c0f3119c61a97d6bc1fb07ec8f2cf0a78067b098c27535bc006485428c76d6c8fb653f215218dff3 From ac89b4ad914e2aea2d797fa77a72b46bfef2ca4f Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Wed, 2 Oct 2019 16:37:22 -0400 Subject: [PATCH 010/178] Fix up the lockdown sysrq patch Signed-off-by: Jeremy Cline --- efi-lockdown.patch | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/efi-lockdown.patch b/efi-lockdown.patch index c213cfce9..75d4b7ed7 100644 --- a/efi-lockdown.patch +++ b/efi-lockdown.patch @@ -1898,16 +1898,20 @@ index 573b2055173c..7cc95a8bdf8d 100644 op_p = __sysrq_get_key_op(key); if (op_p) { +- /* +- * Should we check for enabled operations (/proc/sysrq-trigger +- * should not) and is the invoked operation enabled? +- */ +- if (!check_mask || sysrq_on_mask(op_p->enable_mask)) { + /* Ban synthetic events from some sysrq functionality */ + if ((from == SYSRQ_FROM_PROC || from == SYSRQ_FROM_SYNTHETIC) && -+ op_p->enable_mask & SYSRQ_DISABLE_USERSPACE) ++ op_p->enable_mask & SYSRQ_DISABLE_USERSPACE) { + printk("This sysrq operation is disabled from userspace.\n"); - /* - * Should we check for enabled operations (/proc/sysrq-trigger - * should not) and is the invoked operation enabled? - */ -- if (!check_mask || sysrq_on_mask(op_p->enable_mask)) { -+ if (from == SYSRQ_FROM_KERNEL || sysrq_on_mask(op_p->enable_mask)) { ++ } else if (from == SYSRQ_FROM_KERNEL || sysrq_on_mask(op_p->enable_mask)) { ++ /* ++ * Should we check for enabled operations (/proc/sysrq-trigger ++ * should not) and is the invoked operation enabled? ++ */ pr_info("%s\n", op_p->action_msg); console_loglevel = orig_log_level; op_p->handler(key); From 6aef52e400f5ea1dfbc0a2cd287cbbe76b22ba4c Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Thu, 3 Oct 2019 12:34:44 -0500 Subject: [PATCH 011/178] Fix CVE-2019-17052 CVE-2019-17053 CVE-2019-17054 CVE-2019-17055 CVE-2019-17056 --- enforce-CAP_NET_RAW-for-raw-sockets.patch | 171 ++++++++++++++++++++++ kernel.spec | 8 + 2 files changed, 179 insertions(+) create mode 100644 enforce-CAP_NET_RAW-for-raw-sockets.patch diff --git a/enforce-CAP_NET_RAW-for-raw-sockets.patch b/enforce-CAP_NET_RAW-for-raw-sockets.patch new file mode 100644 index 000000000..f253a35af --- /dev/null +++ b/enforce-CAP_NET_RAW-for-raw-sockets.patch @@ -0,0 +1,171 @@ +From b91ee4aa2a2199ba4d4650706c272985a5a32d80 Mon Sep 17 00:00:00 2001 +From: Ori Nimron +Date: Fri, 20 Sep 2019 09:35:45 +0200 +Subject: mISDN: enforce CAP_NET_RAW for raw sockets + +When creating a raw AF_ISDN socket, CAP_NET_RAW needs to be checked +first. + +Signed-off-by: Ori Nimron +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: David S. Miller +--- + drivers/isdn/mISDN/socket.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c +index c6ba37df4b9d..dff4132b3702 100644 +--- a/drivers/isdn/mISDN/socket.c ++++ b/drivers/isdn/mISDN/socket.c +@@ -754,6 +754,8 @@ base_sock_create(struct net *net, struct socket *sock, int protocol, int kern) + + if (sock->type != SOCK_RAW) + return -ESOCKTNOSUPPORT; ++ if (!capable(CAP_NET_RAW)) ++ return -EPERM; + + sk = sk_alloc(net, PF_ISDN, GFP_KERNEL, &mISDN_proto, kern); + if (!sk) +-- +cgit 1.2-0.3.lf.el7 + + +From 6cc03e8aa36c51f3b26a0d21a3c4ce2809c842ac Mon Sep 17 00:00:00 2001 +From: Ori Nimron +Date: Fri, 20 Sep 2019 09:35:46 +0200 +Subject: appletalk: enforce CAP_NET_RAW for raw sockets + +When creating a raw AF_APPLETALK socket, CAP_NET_RAW needs to be checked +first. + +Signed-off-by: Ori Nimron +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: David S. Miller +--- + net/appletalk/ddp.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c +index 4072e9d394d6..b41375d4d295 100644 +--- a/net/appletalk/ddp.c ++++ b/net/appletalk/ddp.c +@@ -1023,6 +1023,11 @@ static int atalk_create(struct net *net, struct socket *sock, int protocol, + */ + if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM) + goto out; ++ ++ rc = -EPERM; ++ if (sock->type == SOCK_RAW && !kern && !capable(CAP_NET_RAW)) ++ goto out; ++ + rc = -ENOMEM; + sk = sk_alloc(net, PF_APPLETALK, GFP_KERNEL, &ddp_proto, kern); + if (!sk) +-- +cgit 1.2-0.3.lf.el7 + + +From 0614e2b73768b502fc32a75349823356d98aae2c Mon Sep 17 00:00:00 2001 +From: Ori Nimron +Date: Fri, 20 Sep 2019 09:35:47 +0200 +Subject: ax25: enforce CAP_NET_RAW for raw sockets + +When creating a raw AF_AX25 socket, CAP_NET_RAW needs to be checked +first. + +Signed-off-by: Ori Nimron +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: David S. Miller +--- + net/ax25/af_ax25.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c +index ca5207767dc2..bb222b882b67 100644 +--- a/net/ax25/af_ax25.c ++++ b/net/ax25/af_ax25.c +@@ -855,6 +855,8 @@ static int ax25_create(struct net *net, struct socket *sock, int protocol, + break; + + case SOCK_RAW: ++ if (!capable(CAP_NET_RAW)) ++ return -EPERM; + break; + default: + return -ESOCKTNOSUPPORT; +-- +cgit 1.2-0.3.lf.el7 + + +From e69dbd4619e7674c1679cba49afd9dd9ac347eef Mon Sep 17 00:00:00 2001 +From: Ori Nimron +Date: Fri, 20 Sep 2019 09:35:48 +0200 +Subject: ieee802154: enforce CAP_NET_RAW for raw sockets + +When creating a raw AF_IEEE802154 socket, CAP_NET_RAW needs to be +checked first. + +Signed-off-by: Ori Nimron +Signed-off-by: Greg Kroah-Hartman +Acked-by: Stefan Schmidt +Signed-off-by: David S. Miller +--- + net/ieee802154/socket.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/ieee802154/socket.c b/net/ieee802154/socket.c +index badc5cfe4dc6..d93d4531aa9b 100644 +--- a/net/ieee802154/socket.c ++++ b/net/ieee802154/socket.c +@@ -1008,6 +1008,9 @@ static int ieee802154_create(struct net *net, struct socket *sock, + + switch (sock->type) { + case SOCK_RAW: ++ rc = -EPERM; ++ if (!capable(CAP_NET_RAW)) ++ goto out; + proto = &ieee802154_raw_prot; + ops = &ieee802154_raw_ops; + break; +-- +cgit 1.2-0.3.lf.el7 + + +From 3a359798b176183ef09efb7a3dc59abad1cc7104 Mon Sep 17 00:00:00 2001 +From: Ori Nimron +Date: Fri, 20 Sep 2019 09:35:49 +0200 +Subject: nfc: enforce CAP_NET_RAW for raw sockets + +When creating a raw AF_NFC socket, CAP_NET_RAW needs to be checked +first. + +Signed-off-by: Ori Nimron +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: David S. Miller +--- + net/nfc/llcp_sock.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c +index 9b8742947aff..8dfea26536c9 100644 +--- a/net/nfc/llcp_sock.c ++++ b/net/nfc/llcp_sock.c +@@ -1004,10 +1004,13 @@ static int llcp_sock_create(struct net *net, struct socket *sock, + sock->type != SOCK_RAW) + return -ESOCKTNOSUPPORT; + +- if (sock->type == SOCK_RAW) ++ if (sock->type == SOCK_RAW) { ++ if (!capable(CAP_NET_RAW)) ++ return -EPERM; + sock->ops = &llcp_rawsock_ops; +- else ++ } else { + sock->ops = &llcp_sock_ops; ++ } + + sk = nfc_llcp_sock_alloc(sock, sock->type, GFP_ATOMIC, kern); + if (sk == NULL) +-- +cgit 1.2-0.3.lf.el7 + diff --git a/kernel.spec b/kernel.spec index 17d7ad0c3..3da9121d2 100644 --- a/kernel.spec +++ b/kernel.spec @@ -591,6 +591,10 @@ Patch506: 0001-x86-amd_nb-Add-PCI-device-IDs-for-family-17h-model-7.patch Patch507: v2-1-2-efi-tpm-Don-t-access-event--count-when-it-isn-t-mapped..patch Patch508: v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-parsing.patch +# CVE-2019-17052 CVE-2019-17053 CVE-2019-17054 CVE-2019-17055 CVE-2019-17056 +# rhbz 1758239 1758240 1758242 1758243 1758245 1758246 1758248 1758249 1758256 1758257 +Patch509: enforce-CAP_NET_RAW-for-raw-sockets.patch + # END OF PATCH DEFINITIONS %endif @@ -1792,6 +1796,10 @@ fi # # %changelog +* Wed Oct 03 2019 Justin M. Forbes +- Fix CVE-2019-17052 CVE-2019-17053 CVE-2019-17054 CVE-2019-17055 CVE-2019-17056 + (rhbz 1758239 1758240 1758242 1758243 1758245 1758246 1758248 1758249 1758256 1758257) + * Tue Oct 01 2019 Justin M. Forbes - 5.3.2-300 - Linux v5.3.2 From 36123dbc39da08145e8989d72d817274f115bd8e Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 6 Oct 2019 14:53:10 +0100 Subject: [PATCH 012/178] arm64: fixes for RockPro64 --- ...RockPro64-vdd-log-regulator-settings.patch | 516 ++++++++++++++++++ ...p-fix-Rockpro64-RK808-interrupt-line.patch | 176 ++++++ kernel.spec | 8 + 3 files changed, 700 insertions(+) create mode 100644 arm64-dts-rockchip-fix-RockPro64-vdd-log-regulator-settings.patch create mode 100644 arm64-dts-rockchip-fix-Rockpro64-RK808-interrupt-line.patch diff --git a/arm64-dts-rockchip-fix-RockPro64-vdd-log-regulator-settings.patch b/arm64-dts-rockchip-fix-RockPro64-vdd-log-regulator-settings.patch new file mode 100644 index 000000000..73be35378 --- /dev/null +++ b/arm64-dts-rockchip-fix-RockPro64-vdd-log-regulator-settings.patch @@ -0,0 +1,516 @@ +From patchwork Thu Oct 3 21:50:34 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: =?utf-8?q?S=C3=B6ren_Moch?= +X-Patchwork-Id: 11173461 +Return-Path: + +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FDE613B1 + for ; + Thu, 3 Oct 2019 21:51:01 +0000 (UTC) +Received: from bombadil.infradead.org (bombadil.infradead.org + [198.137.202.133]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) + (No client certificate requested) + by mail.kernel.org (Postfix) with ESMTPS id 7B69C2086A + for ; + Thu, 3 Oct 2019 21:51:01 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="urDY/XN+"; + dkim=fail reason="signature verification failed" (1024-bit key) + header.d=web.de header.i=@web.de header.b="mtJWe9Bf" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B69C2086A +Authentication-Results: mail.kernel.org; + dmarc=none (p=none dis=none) header.from=web.de +Authentication-Results: mail.kernel.org; + spf=none + smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=lists.infradead.org; s=bombadil.20170209; h=Sender: + Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: + List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: + Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: + Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: + References:List-Owner; bh=lFYiMYcBMxmyphhrNw72C/NN1znHxWUoCJiED50SPC4=; b=urD + Y/XN+2WA8vvyESWBs6m/bzLBWZSG2TrdRGIEtY0TIXn9YXWd7vRkAWVm8GrT8FCC0eFXXfrnpBljO + x9URr69wRs5c3rgbhPO2Ayx1T0WcHFNAzIW6SffEJKnrsbUPYUE1wQ5BrAaUEVHCv0XWcTeKzg26J + mnIJaqoHpew22YkkB/8M4LGCJVaZxeX/gAd7I2FeB6tBzmBgKvKvb3P1010X4zK2POVVxtd8dAlLb + lRKl+Vj0dcjGL/WOqrDIy3vABg5Av25akdGM3SrWI0y/YOVGtSi/glUyQ7gI8pDR3uR/456zEGRjy + cVc9Y8QganXtR/CoNbBCIpll/ZAGZng==; +Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) + by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) + id 1iG8zx-0004iz-UO; Thu, 03 Oct 2019 21:50:57 +0000 +Received: from mout.web.de ([217.72.192.78]) + by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) + id 1iG8zt-0004gY-Sh; Thu, 03 Oct 2019 21:50:55 +0000 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; + s=dbaedf251592; t=1570139445; + bh=+slu9oigrifofLBmSnoGBXNUCdUs8UMw+gAQMYZR/OU=; + h=X-UI-Sender-Class:From:To:Cc:Subject:Date; + b=mtJWe9BfGLpk166deIOWv6NwNSVtqNu4zEFmltWTZO+Quufhq50MugB4t3PI53Dij + P75Ixq7hozzbk0+FHdq9w1smAfhLlT6WCPVlEGLVmzgVIbWf+qdMbLNHxgkPW11OH5 + mvpxatuhvRgzbIbSTYrf6MF+3Mcs9GpROLzrOyrI= +X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 +Received: from platinum.fritz.box ([89.14.73.200]) by smtp.web.de (mrweb103 + [213.165.67.124]) with ESMTPSA (Nemesis) id 0LdVza-1hpIko3M5i-00ikbu; Thu, 03 + Oct 2019 23:50:44 +0200 +From: Soeren Moch +To: Heiko Stuebner +Subject: [PATCH 1/3] arm64: dts: rockchip: fix RockPro64 vdd-log regulator + settings +Date: Thu, 3 Oct 2019 23:50:34 +0200 +Message-Id: <20191003215036.15023-1-smoch@web.de> +X-Mailer: git-send-email 2.17.1 +X-Provags-ID: V03:K1:sVWSznPIdgTeGmxS0/KuK5sR3zlLN0yEjQwtifgjotr6sUlPGeX + SCaKNvjkY2xrsa2JwfaH4KWsSiYOkozaZoxo4JmqSc/EwguMpI45EebjNI3cQkwrCfPim6b + 02b5Xj+b3kuMwjLS4tqXGFCniDNAIH3qhHOEWovdeCy4yOGDuzQye7qcb011wpp5K3Y+zv3 + u+KYJmttKbwcJdT8JijcQ== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:vCe5hpyJPR8=:disR8f0omoqst11p1fIKAh + iBAK1nFXc7AmOcAiFW44MeJNXdocthJHRd3VEcy9/B9yqK/hTjhNCgBGLXvhk3UzVzVTDK802 + kBf9cEBdt34sF6mLB40sUD5CXT7PaMoPa78w45lA9C3+dF/9UxU09+6fr6SVTgU3mu6Hn2JqJ + nvfqFZiqINBWoePt9nqRkkTUrqgEyMT6qHHfJUTadp6PJeCXCeirRPUqFqdJ8vx+tsSMrD+G5 + fmZlzpPnl8Ky3j1gtFkLLcEAOMtAgzPfeEONvZiwK5J6n5MxwprBNRT7E07hW+xDfcQbQE0rD + 8RGbx1mkzr2V92lpYcIRTNqde+Oh+/V4C4s6rQGxN+x/xws7iNpUeU9Rpv65WHyiheHZUcHs6 + 4n7JmhPiZXUCFzWUrmM6oJB7O70rL8WobnNCWQmNtYRuiqGautEew+TItXYvKBCtvFrALXdM+ + vb1+FrU03VriEuoHeRWwPEsO45SGVwhYIsolu6CRDFU9G4a0WdORqWZVYVP+0JvpMOe/lA2zY + 2rl2QFH53x1+BtBVK20hHOh7W3xtLH+WzZFsAzmnNe3+61mRhxIzHfDY3otUHd7hUG+pyyhXw + 6RI9YNTvxF2AQ1rzSvvCNNtPkovfmdPvPTfO2Sqig4TRyAE9/Un4zf1wnoho8+Hqw2w2gvh2g + lFdajNupo7PiibkssZMeWpi2Yyw+Ql484vPZldLOBFiuDXWRwYHJA7n3CWPRqu4FkvqZI0woF + iWwuOPIyYV09g8L2UPq4YiXXvNXKdJWpQh/x59dBhs26HHmbaZxBvFHrUY7FWo9HRjA0t8hvE + oDTTozWqTW6xzbFzIwp0E29Vp6mciCpjiqoLv7MMTbg0U9pPnAQecIk11U33l0ZqVQyKSxq8G + Fdwl4gLqiQcP6Y/Zm2wBLvnsSffYrkTmqpiQ6RjPOPPy9GxZHTglNZP6Cr4a5N3lHKv4+rvUV + pKvy7jWH6ub53Ne6v/8q//sL+wQIbqfuTNNpvc+MI28YX7YthEldq1GRyRKJ5k4z6o2nrqUik + oRx5AuvdO3oPcAIsUwKaeuXqRrTtC9M6kdubTFXOZ8EZzZtj1unz7h3zRztMQu37AvKSyHhxt + k56zCWlbMOjoKO97tb/lVKVF80M81PnaiIOXQ9I9E3UIF2s95Wg/VbtVzkWi4oF6WwrqqO44y + sthchBfNPGC/jUAm3c9UeqBDY4lM5Ilus4dUpjvn4gcHDKMGS6iu/KEEMEuL56mRaMcwg/xXM + L5sIsGmzM7HYTjE4fJFm35NicLPlNwOqZLoaMsg== +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20191003_145054_230248_23AC2987 +X-CRM114-Status: UNSURE ( 9.25 ) +X-CRM114-Notice: Please train this message. +X-Spam-Score: -0.9 (/) +X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: + Content analysis details: (-0.9 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider (smoch[at]web.de) + -0.0 SPF_PASS SPF: sender matches SPF record + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature + -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from + author's domain + -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from + envelope-from domain + 0.1 DKIM_SIGNED Message has a DKIM or DK signature, + not necessarily + valid + -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, + low trust [217.72.192.78 listed in list.dnswl.org] +X-BeenThere: linux-arm-kernel@lists.infradead.org +X-Mailman-Version: 2.1.29 +Precedence: list +List-Id: +List-Unsubscribe: + , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: + , + +Cc: linux-rockchip@lists.infradead.org, Soeren Moch , + linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org +MIME-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Sender: "linux-arm-kernel" +Errors-To: + linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org + +The RockPro64 schematic [1] page 18 states a min voltage of 0.8V and a +max voltage of 1.4V for the VDD_LOG pwm regulator. However, there is an +additional note that the pwm parameter needs to be modified. +From the schematics a voltage range of 0.8V to 1.7V can be calculated. +Additional voltage measurements on the board show that this fix indeed +leads to the correct voltage, while without this fix the voltage was set +too high. + +[1] http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf + +Fixes: e4f3fb490967 ("arm64: dts: rockchip: add initial dts support for Rockpro64") +Signed-off-by: Soeren Moch +--- +Cc: Heiko Stuebner +Cc: linux-rockchip@lists.infradead.org +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-kernel@vger.kernel.org +--- + arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +-- +2.17.1 + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +index 0401d4ec1f45..845eb070b5b0 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +@@ -173,7 +173,7 @@ + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <800000>; +- regulator-max-microvolt = <1400000>; ++ regulator-max-microvolt = <1700000>; + vin-supply = <&vcc5v0_sys>; + }; + }; + +From patchwork Thu Oct 3 21:50:35 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: =?utf-8?q?S=C3=B6ren_Moch?= +X-Patchwork-Id: 11173469 +Return-Path: + +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5975A76 + for ; + Thu, 3 Oct 2019 21:51:41 +0000 (UTC) +Received: from bombadil.infradead.org (bombadil.infradead.org + [198.137.202.133]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) + (No client certificate requested) + by mail.kernel.org (Postfix) with ESMTPS id E5CD92133F + for ; + Thu, 3 Oct 2019 21:51:40 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="aIzQ/7Xd"; + dkim=fail reason="signature verification failed" (1024-bit key) + header.d=web.de header.i=@web.de header.b="cmtE0euk" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E5CD92133F +Authentication-Results: mail.kernel.org; + dmarc=none (p=none dis=none) header.from=web.de +Authentication-Results: mail.kernel.org; + spf=none + smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=lists.infradead.org; s=bombadil.20170209; h=Sender: + Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: + List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: + In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: + Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc + :Resent-Message-ID:List-Owner; + bh=1Ja1XJBYc2rMTJo1j3aWlo4ggxMpTccXfhnANJoFXgY=; b=aIzQ/7XdT4Dm/qBnxRPzUbll2w + +n6AExDbccfUt23EF39R3wxjN3Y1Apw4+gGY7pruuVEJUqZtMi/llXHhDQ8hfCughA/ul1Tw1OOuw + MdhrxvxV35qrfTIRGY5ZWD1bXE2jh5w65I6NUHqvoXdC8pXxgd55P2RS4TCGPlqt9mo+0i+/E/wmN + 11Za83+GgoXTvJdukL/nDZOY19RYk1SmkjyvMwU3JHraN2osMq9ct+NQMZWalPOMgC6SrU7+eEvMC + Gxip1cUJ1f6bIUhuIikgD83hJeX+xmzblFy8fdqxostMpqcn+bhQfyeIAzwRGCFIWjQyNtmnlC5n+ + UXRYljnQ==; +Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) + by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) + id 1iG90Y-0005J7-RT; Thu, 03 Oct 2019 21:51:34 +0000 +Received: from mout.web.de ([212.227.17.11]) + by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) + id 1iG8zv-0004gv-AV; Thu, 03 Oct 2019 21:50:57 +0000 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; + s=dbaedf251592; t=1570139445; + bh=Kn0TuCilrYfaGPMHgSwOwV8cx+fxujsxvbyRlPzXJ8o=; + h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; + b=cmtE0euk/irI14sTr6wSajU7DkGxBMrgNowkeu6VcNZvW3f0N4hhG8ItwhpI0YpTh + 8lzeG8VnZoKFq/TjpSg5uwCrqPWpS10ZdCAyg2gD2AFDHFNrJYOXdAz36LgORPmGbW + V5MeWcSytSaC+XTNGoV1tvq3jSY9Mv9Bl83T95nw= +X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 +Received: from platinum.fritz.box ([89.14.73.200]) by smtp.web.de (mrweb103 + [213.165.67.124]) with ESMTPSA (Nemesis) id 0MfYj1-1iVD2M15x5-00P6D9; Thu, 03 + Oct 2019 23:50:45 +0200 +From: Soeren Moch +To: Heiko Stuebner +Subject: [PATCH 2/3] arm64: dts: rockchip: fix RockPro64 sdhci settings +Date: Thu, 3 Oct 2019 23:50:35 +0200 +Message-Id: <20191003215036.15023-2-smoch@web.de> +X-Mailer: git-send-email 2.17.1 +In-Reply-To: <20191003215036.15023-1-smoch@web.de> +References: <20191003215036.15023-1-smoch@web.de> +X-Provags-ID: V03:K1:B7ZztmDbKfGYru8Phbjqw2pez33XX2FSpU8BwevUN/gNPgO8fUz + Mai6ERMM+Am8U/N9uGjHbwMNeghFPQW7/5jXUjBypLLZwSwWLX/bmfozsCdhRyF473wRV6y + spAcVmzJIceDsbk8eJUfuek7itb3S1FXU0GIz+J8Kq+NUgmS2uain/rtAWa5uIY4abpsNPZ + xoT1S8+2Brauk0we7S4Yw== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:Fx3wTDvJkB4=:V0/tzMx03qqKbK8T7SQOWI + 9oNjxL17k927PeGDNqyW09+kBTsivpZYFEY55iOLZQv/pcGoOi5Xb6AcCBYKMiTRyhraVXwye + XKQOQIxWQimyx0etxkPkyvp/uyl2YBSavT6nSF+kTgN7t+SgVJNTyrLv+eMPwmzkEkIJQdCU5 + V1mtMudj13veu2CM7XQHE0kPcRVBw26Tay25FSXUsMl40Ha8HuKe+8mnjZQsVgdcSVG8xSVQ3 + jZmjAH1ehBHemYGNbgyMUp4e1f4HcPWsLUuWF7UKPu9TbSACPtxiuV32C66ptioz4kPPQ5siy + ectJM+L471sJFLXv55j5x/Nkgj3PfaxjEVTdSm+P4K/6H5hfWWRp82n3BenrB1d+6VFEhsO+u + JnBewMKGVVfdh5O5JtioJ0k+pSM0S42OwzaNZd/cNJ9dAIKjhMH2vyEvbZezZocTcofxDukVp + gjfr4Mm1dVwDaazXLJEkMEToo5SOcAmmV6FsW/ivupt+fLuexl4Oo6lD4BIV1OKMoVIpr1dBn + kMgHVJneAh+yrmtQvAzjUwD5AC8O9qu5jZf+j/jmDX+rL6TANZS3ia8aI9JMpxtGKjzii+6iD + U3WMamIS9EBYCuXWR0fUXwzkylZVpKJj8OLQyl4z4hBJ1mYflKFVTDvqir/+XPgIgMB0W62oA + jjHIRSmMdnYgJBjR2DmfERbvRA+CoadWdHgQCy9O7RysmAZL++rd9wX+HfiOgKhPho8G66nvR + mz3xPqQHcPpbLXgz2xr3tF3itCBwtwuC1YVf1AN0cg7UdiskrXLDx2UesrDqApECFUNx3vPYD + Fknt9SE0EqaerIgseAeXAAJcmIn4pvUio9sTKyC1oKt0ojx0CpOhF2/alKQx9sLCfNJpqSSLx + Nn0sPBZCgbq0fI3Y+qGctkGUZCbS/yode78mXh4C/fHyf0VA1gJLGVo8R18or9Zpk5asg1hBp + gLIG+YYUC0a1HSlF0zIeTiYeXkOeLiEBn65QzM0DJSLVcPG5G5HR8/s0AbXXpAsX62BRHA4jk + yWxcY7I9ZJ8iKPjZgyr1+Q5dqidladBAq1qWsHy7X0xQTJn+CC4y2jrpjxYOsym5sLnj76U90 + CHjUybKWdmPaaENk6I/jdwCrzqRU3MJERrz9IdsxepZZYpwXIWpH6KBrNOX4zm1FINpUtxgdx + 9VajcWzh3pSIG5rAfJiTartXpAvyOMcZeG6dJkNoUWslE74gCsm4LFbqAGrsdx7oExx57Guae + 1ASgkma3Lp4s45yCKgQP7X/0hLVXqE1uQeloYqg== +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20191003_145055_661636_5577849E +X-CRM114-Status: UNSURE ( 9.52 ) +X-CRM114-Notice: Please train this message. +X-Spam-Score: -0.9 (/) +X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: + Content analysis details: (-0.9 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, + low trust [212.227.17.11 listed in list.dnswl.org] + 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider (smoch[at]web.de) + -0.0 SPF_PASS SPF: sender matches SPF record + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature + -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from + author's domain + -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from + envelope-from domain + 0.1 DKIM_SIGNED Message has a DKIM or DK signature, + not necessarily + valid +X-BeenThere: linux-arm-kernel@lists.infradead.org +X-Mailman-Version: 2.1.29 +Precedence: list +List-Id: +List-Unsubscribe: + , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: + , + +Cc: linux-rockchip@lists.infradead.org, Soeren Moch , + linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org +MIME-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Sender: "linux-arm-kernel" +Errors-To: + linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org + +The RockPro64 schematics [1], [2] show that the rk3399 EMMC_STRB pin is +connected to the RESET pin instead of the DATA_STROBE pin of the eMMC module. +So the data strobe cannot be used for its intended purpose on this board, +and so the HS400 eMMC mode is not functional. Limit the controller to HS200. + +[1] http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf +[2] http://files.pine64.org/doc/rock64/PINE64_eMMC_Module_20170719.pdf + +Fixes: e4f3fb490967 ("arm64: dts: rockchip: add initial dts support for Rockpro64") +Signed-off-by: Soeren Moch +--- +Cc: Heiko Stuebner +Cc: linux-rockchip@lists.infradead.org +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-kernel@vger.kernel.org +--- + arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +-- +2.17.1 + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +index 845eb070b5b0..2e44dae4865a 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +@@ -636,8 +636,7 @@ + + &sdhci { + bus-width = <8>; +- mmc-hs400-1_8v; +- mmc-hs400-enhanced-strobe; ++ mmc-hs200-1_8v; + non-removable; + status = "okay"; + }; + +From patchwork Fri Oct 4 20:32:13 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: =?utf-8?q?S=C3=B6ren_Moch?= +X-Patchwork-Id: 11175275 +Return-Path: + +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB53776 + for ; + Fri, 4 Oct 2019 20:32:36 +0000 (UTC) +Received: from bombadil.infradead.org (bombadil.infradead.org + [198.137.202.133]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) + (No client certificate requested) + by mail.kernel.org (Postfix) with ESMTPS id B885821D81 + for ; + Fri, 4 Oct 2019 20:32:36 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="Kyzudsgx"; + dkim=fail reason="signature verification failed" (1024-bit key) + header.d=web.de header.i=@web.de header.b="LF1if5y/" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B885821D81 +Authentication-Results: mail.kernel.org; + dmarc=none (p=none dis=none) header.from=web.de +Authentication-Results: mail.kernel.org; + spf=none + smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=lists.infradead.org; s=bombadil.20170209; h=Sender: + Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: + List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: + Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: + Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: + References:List-Owner; bh=dHmD7+pyTraHtU6tNX3vZnXR737wGLCZLdWRfkYFpi0=; b=Kyz + udsgxHfoJqpjf89AdGuslY1w4pUpYO7aJ6+VJuDnsGLufBp9F4+yxX7UHhyIbWqlaegelJ+Z3a0CN + vdb7065nXi+ggnq64pCIXY8ZyS13Nc+lpmpFoEMEyvxgrNdu38SJaLj5s8LUMJdZENP1j8kLESEa4 + 8VbV9r7X+GwBf2aBERsF9+vxV3D+49ULxCaDv5mLVRX+5nM8d/AEPJqyBnLYh/i7j/31rk6aH26dY + 4TdVsdvTnm2Ck6zIcHEDX22Eq2vlcw1U8WdctFzzfHSDsWFGAvVvWPwnSe0h7niizqbqLO3cC2WOT + 2ttragRnBvdMCd1TD/sRdBnoOj946RQ==; +Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) + by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) + id 1iGUFf-0002b8-O6; Fri, 04 Oct 2019 20:32:35 +0000 +Received: from mout.web.de ([217.72.192.78]) + by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) + id 1iGUFc-0002ac-RO; Fri, 04 Oct 2019 20:32:34 +0000 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; + s=dbaedf251592; t=1570221145; + bh=x/DBaa+r9mxjwAjUssLHup4baAiO0UG/yVrLOutxWsg=; + h=X-UI-Sender-Class:From:To:Cc:Subject:Date; + b=LF1if5y/7T4QYPyiawCf94aYJcnXUc1aL405rucwF10cabjCghlaJXN/uO8vszdOl + pJS9oYcF8l9BmR4yT8PVrUWeMZYyAGpt9jc7syVqksEP91IhyUph/X/QnrJzecxDXx + 1vehZNdcbWFN/q59sUmwmzsDfjka3LhL7znEDfv0= +X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 +Received: from platinum.fritz.box ([77.191.3.29]) by smtp.web.de (mrweb103 + [213.165.67.124]) with ESMTPSA (Nemesis) id 0LetQh-1hlnfS19m3-00qhBK; Fri, 04 + Oct 2019 22:32:25 +0200 +From: Soeren Moch +To: Heiko Stuebner +Subject: [PATCH v2] arm64: dts: rockchip: fix RockPro64 sdmmc settings +Date: Fri, 4 Oct 2019 22:32:13 +0200 +Message-Id: <20191004203213.4995-1-smoch@web.de> +X-Mailer: git-send-email 2.17.1 +X-Provags-ID: V03:K1:1I5fDQkIZVn2LdNRnwDfp8md+rO+2Vp/TSL6bgE19S+U7e8RlmF + EhFJGxdLBOeBh6Du3qsKPexxIxstJER4ErQMtp1m6HJoiQsEne8w+BrsSwO0Wh30laTuPec + sK6/onl3zLo9YFphxcEW9zEFFPKS60lWUADP6OIr07s0FyO6OanEsEx+RHULWedKrDDKbbW + 4W1V/uNb/1JyOY4IW4Qow== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:ICsnY7aMJQ4=:5/WFKM85bWZHZp/krlqXXa + JGKxGv3pOO7ubUb+8TvRSP6RJu3y4QxXOJWL/6bmP5fpRZvWD3UZl7gdjPlA+nLBC8i2W/+dO + zdVsBndquXxgZt1sQulCc5ZMhkMIh6ThPnQnHBB+oy1YPivo6dPcxncbjvbgb0+O0i7ydHoXj + 9ZiON6aJCfh7U6zRf7GSQSUu25BEz2Oyo8z8ITYVI+YANji74gj8tiobps8fVES9iDrL6irbj + dhL1JHZOJxr/fK6Z51SzaBX3usndL2ldDDzJI/TWTeKygsqRVom91DOy93TS2/y3+qdVSvYHG + Ohp2hB9xJxVXu2IJoD0BlEEMMMLGLXsi9R8z0GYiCaG43z0zSRDzc0SdumQ7fznh8D2k2mmMR + FPMSML/uY/JqWBSj1nTV4nmpdVeLGEuANsCwJoXq+NOlXAaU2K5vXwSSoNPY9+ned+268R90G + 28MCRcCSpFU0YrPun9sMM9fy/3pD3PKjGmTMDoOQHOlF7mYi796LT/8J7kAw2TK7XILqRP0/V + 2RJz031b8L1r3Hptl0OD20z+eYtpFmPPsa7q2+CmsKLprUxrdBx+xgC4poof91mOYwsQAqLBc + X6ljlMxZ+BwxkNf4QTipd4dhMcUuTrIO5BxXx02nG9XMwrHIx5zHBaMz9KAnyxHt7Q1BVocqi + Wv4JyFhARvR526ogFn1aXu7KJxyBeM87BW5J2a4fsaeGrQlrMViuc6VzaSV/jHDJ8Hu1i+i6O + Mfgqc4+EEuoFxKT4vfCmaYNX+2Jn2t1jXf1Km1+AE05VCFEkhmo4ogflTJ1fsf5NrX4fyoZcU + vFlEQyR6Msy3TXJGZfVmHSdTV1BnTSIMMDUfgJHO+Gwuw3t0J0xITHeF/6VebU/APujrOpRqS + bvEoHl729Odz0/0o7HK+5fctl7UktilntlJkCQnUzVl12NrTOrdFeZNU8jvm/PyK7U6UlWVva + iIjHQxfZqOOCb7no9+gZ0+OXFguVTBdHUsDbdI8rMTY3l1xXsLKc0wZoBvGtJkydtkZxQ7K8r + yvGgesqk8DaEJSzOL1rSStkQBqE7gHuApTovSRLe9nn2uA0UNabEYbwP3mmZ2A8X02EZ3m7Yu + SjpYxwom+3lHLwSTaYCSoGEe/zKKwZBQ/I3sRnuKEGJwMT2Ph7UWe/OohBaLf5VDopnWXL3iP + D5waU3h0q0iVYGMjc75FAtIpG/uPJAVIAouxPQa4k0aoqU7IzGd2dCky/LxxSob/H7k4Bu4Vq + sjEKSF7D5Grbp7B0vKAQvqgdUg6ohIjG5LGVLRQ== +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20191004_133233_182966_B73EA9A6 +X-CRM114-Status: UNSURE ( 6.77 ) +X-CRM114-Notice: Please train this message. +X-Spam-Score: -0.9 (/) +X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: + Content analysis details: (-0.9 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider (smoch[at]web.de) + -0.0 SPF_PASS SPF: sender matches SPF record + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature + -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from + author's domain + -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from + envelope-from domain + 0.1 DKIM_SIGNED Message has a DKIM or DK signature, + not necessarily + valid + -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, + low trust [217.72.192.78 listed in list.dnswl.org] +X-BeenThere: linux-arm-kernel@lists.infradead.org +X-Mailman-Version: 2.1.29 +Precedence: list +List-Id: +List-Unsubscribe: + , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: + , + +Cc: linux-rockchip@lists.infradead.org, Soeren Moch , + linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org +MIME-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Sender: "linux-arm-kernel" +Errors-To: + linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org + +According to the RockPro64 schematic [1] the rk3399 sdmmc controller is +connected to a microSD (TF card) slot. Remove the cap-mmc-highspeed +property of the sdmmc controller, since no mmc card can be connected here. + +[1] http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf + +Fixes: e4f3fb490967 ("arm64: dts: rockchip: add initial dts support for Rockpro64") +Signed-off-by: Soeren Moch +--- +Cc: Heiko Stuebner +Cc: linux-rockchip@lists.infradead.org +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-kernel@vger.kernel.org +--- + arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 1 - + 1 file changed, 1 deletion(-) + +-- +2.17.1 + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +index 2e44dae4865a..6ec4d273a39b 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +@@ -624,7 +624,6 @@ + + &sdmmc { + bus-width = <4>; +- cap-mmc-highspeed; + cap-sd-highspeed; + cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + disable-wp; diff --git a/arm64-dts-rockchip-fix-Rockpro64-RK808-interrupt-line.patch b/arm64-dts-rockchip-fix-Rockpro64-RK808-interrupt-line.patch new file mode 100644 index 000000000..439a46cef --- /dev/null +++ b/arm64-dts-rockchip-fix-Rockpro64-RK808-interrupt-line.patch @@ -0,0 +1,176 @@ +From patchwork Sat Sep 21 13:14:57 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Hugh Cole-Baker +X-Patchwork-Id: 11155461 +Return-Path: + +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E1D6015E6 + for ; + Sat, 21 Sep 2019 13:15:24 +0000 (UTC) +Received: from bombadil.infradead.org (bombadil.infradead.org + [198.137.202.133]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) + (No client certificate requested) + by mail.kernel.org (Postfix) with ESMTPS id B3213208C0 + for ; + Sat, 21 Sep 2019 13:15:24 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="W5WNb2TT"; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="aEQ/uRYv" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3213208C0 +Authentication-Results: mail.kernel.org; + dmarc=fail (p=none dis=none) header.from=gmail.com +Authentication-Results: mail.kernel.org; + spf=none + smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=lists.infradead.org; s=bombadil.20170209; h=Sender: + Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: + List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: + Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: + Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: + References:List-Owner; bh=QLfO79ztbvlytyrABYnU/Ie8WNhDlpOUcFlxv1bWAE0=; b=W5W + Nb2TTjjSFXpARxovU0gOdO72UtLrMdXbc9I5OSMOqQEbYRXyDnfj5yxtTPyEDEdPNIP0C+CINfgqP + i7tvTWHEJ+WLQl6W5x9rWLoj02r3L2huGNpc5wjq+YZe20bFzs9eRe1leAnmghM8UAnvP496rcA18 + haBwaAQzZoECuKW3x+uDJ5eehlnL9OhnPUXpYYaOLBBiBg0jOPFlA/FIMUzY7IXRQrlzgSVcAN6pR + Ls+x5RBZZyQQqm9RfmChVRfa2NKhWD/TjnjLEfCYB0IovxrY3ar4mLmYeGm9ladShqqfLX8zhY0+8 + OaTRBY64J4Yfk8owMuN7Rr+D4O12ndQ==; +Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) + by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) + id 1iBfEN-0002Op-RP; Sat, 21 Sep 2019 13:15:19 +0000 +Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) + by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) + id 1iBfEL-0002O9-AK; Sat, 21 Sep 2019 13:15:18 +0000 +Received: by mail-wm1-x341.google.com with SMTP id p7so5200464wmp.4; + Sat, 21 Sep 2019 06:15:14 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=CUIiObmZUoLOjlcmGuE4Z8qsrk1peXb9nnaXkFScf1o=; + b=aEQ/uRYvCsbX944pwrZC5Zi5+pI6s/P143IvpXdlQXMblp/gr0TEwvb4/jIY8KcTPb + h+OCadPSshMmMPvaxG+aDklS4bI+8UV1JUuif5+/cH6ND7u1pCPlRypNjKUUSwZlcfVY + fmOmGc8jEjdrmt2rxdLStr2mvlAdNsGDr/SrNSboflvindXVGUKuxoMwkhXbfAgD7kXD + ds2xaFd7dONWCaZm0mLYpGcfY18vZi6cbUNr7JCDZAZ7y8bfR+bZaJZLCL3MaN0W9/8b + tqoH4C7+jAVoy4HWXeff+DTBMlGe4VHPROBfJn0KzOOWdKjEpBrMct/Vjc06IqQSo+hy + Tt8g== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=CUIiObmZUoLOjlcmGuE4Z8qsrk1peXb9nnaXkFScf1o=; + b=h+cy8eJs/UTeiJzt803DJY4bgVbfMVP/Z49o/wr03kqhpNI9ydIH+ar2zzI2iWexpM + ZzgUMv/1GPmqL5YPESh7p9gigoIQ5a7lDX7pO7mqxC0PNyeyZKSsrNhMZLKEZkErPY1f + 8IhO3DYPn2TROfHNhrKazqoojHc845188c8sTkxVvAf6AmfwYAMl9ca12NZBmVQR36NN + XhN4VYehR2XAzE9AcGOTZvyBa9ebhSMG7u5Q/OiSAckDPmZ6B26Px96jwwRvRW/PBfPB + yiXMvWNnRqBaIx9cdHDFXEMccoB/3RNR//uNJmlHwCy6Kn0F7toMgVi8AauCtbUQsgwQ + cIpg== +X-Gm-Message-State: APjAAAVE1l4BxwL8Z1YLGXAhzhm5VGSZTLQmSXQg6+3ibumsSm+bxwaN + BBaU69sXBc8Y2h20jUfrC6I= +X-Google-Smtp-Source: + APXvYqwjrERzxUIeZTPWyTYAXdg1ZTPDKGaLOeQoXI2vdua+67gV4Ml3mGFKjPE7ijQS8GUVUSa4Hw== +X-Received: by 2002:a05:600c:295d:: with SMTP id + n29mr6713359wmd.36.1569071712994; + Sat, 21 Sep 2019 06:15:12 -0700 (PDT) +Received: from apple.sigmaris.info ([84.93.172.212]) + by smtp.gmail.com with ESMTPSA id g11sm5676349wmh.45.2019.09.21.06.15.11 + (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); + Sat, 21 Sep 2019 06:15:12 -0700 (PDT) +From: Hugh Cole-Baker +To: devicetree@vger.kernel.org +Subject: [PATCH] arm64: dts: rockchip: fix Rockpro64 RK808 interrupt line +Date: Sat, 21 Sep 2019 14:14:57 +0100 +Message-Id: <20190921131457.36258-1-sigmaris@gmail.com> +X-Mailer: git-send-email 2.17.2 (Apple Git-113) +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20190921_061517_383773_FFE10321 +X-CRM114-Status: GOOD ( 13.01 ) +X-Spam-Score: -0.2 (/) +X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: + Content analysis details: (-0.2 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, + no trust [2a00:1450:4864:20:0:0:0:341 listed in] + [list.dnswl.org] + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider (sigmaris[at]gmail.com) + -0.0 SPF_PASS SPF: sender matches SPF record + -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from + author's domain + 0.1 DKIM_SIGNED Message has a DKIM or DK signature, + not necessarily + valid + -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature + -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from + envelope-from domain +X-BeenThere: linux-arm-kernel@lists.infradead.org +X-Mailman-Version: 2.1.29 +Precedence: list +List-Id: +List-Unsubscribe: + , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: + , + +Cc: Mark Rutland , Heiko Stuebner , + Akash Gajjar , linux-kernel@vger.kernel.org, + linux-rockchip@lists.infradead.org, Rob Herring , + Hugh Cole-Baker , linux-arm-kernel@lists.infradead.org +MIME-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Sender: "linux-arm-kernel" +Errors-To: + linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org + +Fix the pinctrl and interrupt specifier for RK808 to use GPIO3_B2. On the +Rockpro64 schematic [1] page 16, it shows GPIO3_B2 used for the interrupt +line PMIC_INT_L from the RK808, and there's a note which translates as: +"PMU termination GPIO1_C5 changed to this". + +Tested by setting an RTC wakealarm and checking /proc/interrupts counters. +Without this patch, neither the rockchip_gpio_irq counter for the RK808, +nor the RTC alarm counter increment when the alarm time is reached. +With this patch, both interrupt counters increment by 1 as expected. + +[1] http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf + +Fixes: e4f3fb4 ("arm64: dts: rockchip: add initial dts support for Rockpro64") +Signed-off-by: Hugh Cole-Baker +--- + arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +index 0401d4ec1f45..c27d8a6ae1c5 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +@@ -247,8 +247,8 @@ + rk808: pmic@1b { + compatible = "rockchip,rk808"; + reg = <0x1b>; +- interrupt-parent = <&gpio1>; +- interrupts = <21 IRQ_TYPE_LEVEL_LOW>; ++ interrupt-parent = <&gpio3>; ++ interrupts = <10 IRQ_TYPE_LEVEL_LOW>; + #clock-cells = <1>; + clock-output-names = "xin32k", "rk808-clkout2"; + pinctrl-names = "default"; +@@ -574,7 +574,7 @@ + + pmic { + pmic_int_l: pmic-int-l { +- rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; ++ rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>; + }; + + vsel1_gpio: vsel1-gpio { diff --git a/kernel.spec b/kernel.spec index 3da9121d2..0e08534ff 100644 --- a/kernel.spec +++ b/kernel.spec @@ -554,6 +554,11 @@ Patch305: ARM-tegra-usb-no-reset.patch # https://patchwork.kernel.org/project/linux-mmc/list/?submitter=71861 Patch306: arm-sdhci-esdhc-imx-fixes.patch +# https://patchwork.kernel.org/patch/11173461/ +Patch307: arm64-dts-rockchip-fix-RockPro64-vdd-log-regulator-settings.patch +# https://patchwork.kernel.org/patch/11155461/ +Patch308: arm64-dts-rockchip-fix-Rockpro64-RK808-interrupt-line.patch + # Tegra bits Patch320: arm64-tegra-jetson-tx1-fixes.patch # https://www.spinics.net/lists/linux-tegra/msg43110.html @@ -1796,6 +1801,9 @@ fi # # %changelog +* Sun Oct 6 2019 Peter Robinson +- Fixes for RockPro64 + * Wed Oct 03 2019 Justin M. Forbes - Fix CVE-2019-17052 CVE-2019-17053 CVE-2019-17054 CVE-2019-17055 CVE-2019-17056 (rhbz 1758239 1758240 1758242 1758243 1758245 1758246 1758248 1758249 1758256 1758257) From 7110e42ccfea7d6b3cbce083f867283ba30b37bc Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 6 Oct 2019 14:56:29 +0100 Subject: [PATCH 013/178] Fixes for Jetson-TX series devices --- arm64-tegra186-enable-USB-on-Jetson-TX2.patch | 51 + drm-nouveau-Enable-GP10B-by-default.patch | 1275 +++++++++++++++++ ...-Use-correct-unit-for-debounce-times.patch | 586 ++++++++ kernel.spec | 9 + ...ax77620-Do-not-allocate-IRQs-upfront.patch | 183 +++ 5 files changed, 2104 insertions(+) create mode 100644 arm64-tegra186-enable-USB-on-Jetson-TX2.patch create mode 100644 drm-nouveau-Enable-GP10B-by-default.patch create mode 100644 gpio-max77620-Use-correct-unit-for-debounce-times.patch create mode 100644 mfd-max77620-Do-not-allocate-IRQs-upfront.patch diff --git a/arm64-tegra186-enable-USB-on-Jetson-TX2.patch b/arm64-tegra186-enable-USB-on-Jetson-TX2.patch new file mode 100644 index 000000000..ea0287c2b --- /dev/null +++ b/arm64-tegra186-enable-USB-on-Jetson-TX2.patch @@ -0,0 +1,51 @@ +From e5ccb943712d261b8ebb3e8ac92a82be4b244ce4 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Sun, 6 Oct 2019 14:44:25 +0100 +Subject: [PATCH] arm64: tegra186: enable USB on Jetson-TX2 + +Based on the following patch series: +https://www.spinics.net/lists/linux-tegra/msg44216.html + +Signed-off-by: Peter Robinson +--- + arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 4 ++-- + arch/arm64/boot/dts/nvidia/tegra186.dtsi | 1 + + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts b/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts +index bdace01561ba..2e6195764268 100644 +--- a/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts ++++ b/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts +@@ -115,7 +115,7 @@ + }; + + padctl@3520000 { +- status = "disabled"; ++ status = "okay"; + + avdd-pll-erefeut-supply = <&vdd_1v8_pll>; + avdd-usb-supply = <&vdd_3v3_sys>; +@@ -193,7 +193,7 @@ + }; + + usb@3530000 { +- status = "disabled"; ++ status = "okay"; + + phys = <&{/padctl@3520000/pads/usb2/lanes/usb2-0}>, + <&{/padctl@3520000/pads/usb2/lanes/usb2-1}>, +diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi +index 47cd831fcf44..abdc81f555b9 100644 +--- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi ++++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi +@@ -525,6 +525,7 @@ + <0x0 0x03538000 0x0 0x1000>; + reg-names = "hcd", "fpci"; + ++ iommus = <&smmu TEGRA186_SID_XUSB_HOST>; + interrupts = , + , + ; +-- +2.21.0 + diff --git a/drm-nouveau-Enable-GP10B-by-default.patch b/drm-nouveau-Enable-GP10B-by-default.patch new file mode 100644 index 000000000..e44a5b339 --- /dev/null +++ b/drm-nouveau-Enable-GP10B-by-default.patch @@ -0,0 +1,1275 @@ +From patchwork Mon Sep 16 15:04:02 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [01/11] drm/nouveau: tegra: Avoid pulsing reset twice +From: Thierry Reding +X-Patchwork-Id: 331044 +Message-Id: <20190916150412.10025-2-thierry.reding@gmail.com> +To: Ben Skeggs , Thierry Reding +Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, + dri-devel@lists.freedesktop.org +Date: Mon, 16 Sep 2019 17:04:02 +0200 + +From: Thierry Reding + +When the GPU powergate is controlled by a generic power domain provider, +the reset will automatically be asserted and deasserted as part of the +power-ungating procedure. + +On some Jetson TX2 boards, doing an additional assert and deassert of +the GPU outside of the power-ungate procedure can cause the GPU to go +into a bad state where the memory interface can no longer access system +memory. + +Signed-off-by: Thierry Reding +--- + drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +index 0e372a190d3f..747a775121cf 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c ++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +@@ -52,18 +52,18 @@ nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev) + clk_set_rate(tdev->clk_pwr, 204000000); + udelay(10); + +- reset_control_assert(tdev->rst); +- udelay(10); +- + if (!tdev->pdev->dev.pm_domain) { ++ reset_control_assert(tdev->rst); ++ udelay(10); ++ + ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D); + if (ret) + goto err_clamp; + udelay(10); +- } + +- reset_control_deassert(tdev->rst); +- udelay(10); ++ reset_control_deassert(tdev->rst); ++ udelay(10); ++ } + + return 0; + + +From patchwork Mon Sep 16 15:04:03 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [02/11] drm/nouveau: tegra: Set clock rate if not set +From: Thierry Reding +X-Patchwork-Id: 331046 +Message-Id: <20190916150412.10025-3-thierry.reding@gmail.com> +To: Ben Skeggs , Thierry Reding +Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, + dri-devel@lists.freedesktop.org +Date: Mon, 16 Sep 2019 17:04:03 +0200 + +From: Thierry Reding + +If the GPU clock has not had a rate set, initialize it to the maximum +clock rate to make sure it does run. + +Signed-off-by: Thierry Reding +--- + drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +index 747a775121cf..d0d52c1d4aee 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c ++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +@@ -279,6 +279,7 @@ nvkm_device_tegra_new(const struct nvkm_device_tegra_func *func, + struct nvkm_device **pdevice) + { + struct nvkm_device_tegra *tdev; ++ unsigned long rate; + int ret; + + if (!(tdev = kzalloc(sizeof(*tdev), GFP_KERNEL))) +@@ -307,6 +308,17 @@ nvkm_device_tegra_new(const struct nvkm_device_tegra_func *func, + goto free; + } + ++ rate = clk_get_rate(tdev->clk); ++ if (rate == 0) { ++ ret = clk_set_rate(tdev->clk, ULONG_MAX); ++ if (ret < 0) ++ goto free; ++ ++ rate = clk_get_rate(tdev->clk); ++ ++ dev_dbg(&pdev->dev, "GPU clock set to %lu\n", rate); ++ } ++ + if (func->require_ref_clk) + tdev->clk_ref = devm_clk_get(&pdev->dev, "ref"); + if (IS_ERR(tdev->clk_ref)) { + +From patchwork Mon Sep 16 15:04:04 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [03/11] drm/nouveau: secboot: Read WPR configuration from GPU + registers +From: Thierry Reding +X-Patchwork-Id: 331048 +Message-Id: <20190916150412.10025-4-thierry.reding@gmail.com> +To: Ben Skeggs , Thierry Reding +Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, + dri-devel@lists.freedesktop.org +Date: Mon, 16 Sep 2019 17:04:04 +0200 + +From: Thierry Reding + +The GPUs found on Tegra SoCs have registers that can be used to read the +WPR configuration. Use these registers instead of reaching into the +memory controller's register space to read the same information. + +Signed-off-by: Thierry Reding +--- + .../drm/nouveau/nvkm/subdev/secboot/gm200.h | 2 +- + .../drm/nouveau/nvkm/subdev/secboot/gm20b.c | 81 ++++++++++++------- + .../drm/nouveau/nvkm/subdev/secboot/gp10b.c | 4 +- + 3 files changed, 53 insertions(+), 34 deletions(-) + +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.h b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.h +index 62c5e162099a..280b1448df88 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.h ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.h +@@ -41,6 +41,6 @@ int gm200_secboot_run_blob(struct nvkm_secboot *, struct nvkm_gpuobj *, + struct nvkm_falcon *); + + /* Tegra-only */ +-int gm20b_secboot_tegra_read_wpr(struct gm200_secboot *, u32); ++int gm20b_secboot_tegra_read_wpr(struct gm200_secboot *); + + #endif +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c +index df8b919dcf09..f8a543122219 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c +@@ -23,39 +23,65 @@ + #include "acr.h" + #include "gm200.h" + +-#define TEGRA210_MC_BASE 0x70019000 +- + #ifdef CONFIG_ARCH_TEGRA +-#define MC_SECURITY_CARVEOUT2_CFG0 0xc58 +-#define MC_SECURITY_CARVEOUT2_BOM_0 0xc5c +-#define MC_SECURITY_CARVEOUT2_BOM_HI_0 0xc60 +-#define MC_SECURITY_CARVEOUT2_SIZE_128K 0xc64 +-#define TEGRA_MC_SECURITY_CARVEOUT_CFG_LOCKED (1 << 1) + /** + * gm20b_secboot_tegra_read_wpr() - read the WPR registers on Tegra + * +- * On dGPU, we can manage the WPR region ourselves, but on Tegra the WPR region +- * is reserved from system memory by the bootloader and irreversibly locked. +- * This function reads the address and size of the pre-configured WPR region. ++ * On dGPU, we can manage the WPR region ourselves, but on Tegra this region ++ * is allocated from system memory by the secure firmware. The region is then ++ * marked as a "secure carveout" and irreversibly locked. Furthermore, the WPR ++ * secure carveout is also configured to be sent to the GPU via a dedicated ++ * serial bus between the memory controller and the GPU. The GPU requests this ++ * information upon leaving reset and exposes it through a FIFO register at ++ * offset 0x100cd4. ++ * ++ * The FIFO register's lower 4 bits can be used to set the read index into the ++ * FIFO. After each read of the FIFO register, the read index is incremented. ++ * ++ * Indices 2 and 3 contain the lower and upper addresses of the WPR. These are ++ * stored in units of 256 B. The WPR is inclusive of both addresses. ++ * ++ * Unfortunately, for some reason the WPR info register doesn't contain the ++ * correct values for the secure carveout. It seems like the upper address is ++ * always too small by 128 KiB - 1. Given that the secure carvout size in the ++ * memory controller configuration is specified in units of 128 KiB, it's ++ * possible that the computation of the upper address of the WPR is wrong and ++ * causes this difference. + */ + int +-gm20b_secboot_tegra_read_wpr(struct gm200_secboot *gsb, u32 mc_base) ++gm20b_secboot_tegra_read_wpr(struct gm200_secboot *gsb) + { ++ struct nvkm_device *device = gsb->base.subdev.device; + struct nvkm_secboot *sb = &gsb->base; +- void __iomem *mc; +- u32 cfg; ++ u64 base, limit; ++ u32 value; + +- mc = ioremap(mc_base, 0xd00); +- if (!mc) { +- nvkm_error(&sb->subdev, "Cannot map Tegra MC registers\n"); +- return -ENOMEM; +- } +- sb->wpr_addr = ioread32_native(mc + MC_SECURITY_CARVEOUT2_BOM_0) | +- ((u64)ioread32_native(mc + MC_SECURITY_CARVEOUT2_BOM_HI_0) << 32); +- sb->wpr_size = ioread32_native(mc + MC_SECURITY_CARVEOUT2_SIZE_128K) +- << 17; +- cfg = ioread32_native(mc + MC_SECURITY_CARVEOUT2_CFG0); +- iounmap(mc); ++ /* set WPR info register to point at WPR base address register */ ++ value = nvkm_rd32(device, 0x100cd4); ++ value &= ~0xf; ++ value |= 0x2; ++ nvkm_wr32(device, 0x100cd4, value); ++ ++ /* read base address */ ++ value = nvkm_rd32(device, 0x100cd4); ++ base = (u64)(value >> 4) << 12; ++ ++ /* read limit */ ++ value = nvkm_rd32(device, 0x100cd4); ++ limit = (u64)(value >> 4) << 12; ++ ++ /* ++ * The upper address of the WPR seems to be computed wrongly and is ++ * actually SZ_128K - 1 bytes lower than it should be. Adjust the ++ * value accordingly. ++ */ ++ limit += SZ_128K - 1; ++ ++ sb->wpr_size = limit - base + 1; ++ sb->wpr_addr = base; ++ ++ nvkm_info(&sb->subdev, "WPR: %016llx-%016llx\n", sb->wpr_addr, ++ sb->wpr_addr + sb->wpr_size - 1); + + /* Check that WPR settings are valid */ + if (sb->wpr_size == 0) { +@@ -63,11 +89,6 @@ gm20b_secboot_tegra_read_wpr(struct gm200_secboot *gsb, u32 mc_base) + return -EINVAL; + } + +- if (!(cfg & TEGRA_MC_SECURITY_CARVEOUT_CFG_LOCKED)) { +- nvkm_error(&sb->subdev, "WPR region not locked\n"); +- return -EINVAL; +- } +- + return 0; + } + #else +@@ -85,7 +106,7 @@ gm20b_secboot_oneinit(struct nvkm_secboot *sb) + struct gm200_secboot *gsb = gm200_secboot(sb); + int ret; + +- ret = gm20b_secboot_tegra_read_wpr(gsb, TEGRA210_MC_BASE); ++ ret = gm20b_secboot_tegra_read_wpr(gsb); + if (ret) + return ret; + +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp10b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp10b.c +index 28ca29d0eeee..d84e85825995 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp10b.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp10b.c +@@ -23,15 +23,13 @@ + #include "acr.h" + #include "gm200.h" + +-#define TEGRA186_MC_BASE 0x02c10000 +- + static int + gp10b_secboot_oneinit(struct nvkm_secboot *sb) + { + struct gm200_secboot *gsb = gm200_secboot(sb); + int ret; + +- ret = gm20b_secboot_tegra_read_wpr(gsb, TEGRA186_MC_BASE); ++ ret = gm20b_secboot_tegra_read_wpr(gsb); + if (ret) + return ret; + + +From patchwork Mon Sep 16 15:04:05 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [04/11] drm/nouveau: gp10b: Add custom L2 cache implementation +From: Thierry Reding +X-Patchwork-Id: 331049 +Message-Id: <20190916150412.10025-5-thierry.reding@gmail.com> +To: Ben Skeggs , Thierry Reding +Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, + dri-devel@lists.freedesktop.org +Date: Mon, 16 Sep 2019 17:04:05 +0200 + +From: Thierry Reding + +There are extra registers that need to be programmed to make the level 2 +cache work on GP10B, such as the stream ID register that is used when an +SMMU is used to translate memory addresses. + +Signed-off-by: Thierry Reding +--- + .../gpu/drm/nouveau/include/nvkm/subdev/ltc.h | 1 + + .../gpu/drm/nouveau/nvkm/engine/device/base.c | 2 +- + .../gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild | 1 + + .../gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c | 69 +++++++++++++++++++ + .../gpu/drm/nouveau/nvkm/subdev/ltc/priv.h | 2 + + 5 files changed, 74 insertions(+), 1 deletion(-) + create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c + +diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h +index 644d527c3b96..d76f60d7d29a 100644 +--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h ++++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h +@@ -40,4 +40,5 @@ int gm107_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **); + int gm200_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **); + int gp100_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **); + int gp102_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **); ++int gp10b_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **); + #endif +diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +index c3c7159f3411..d2d6d5f4028a 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c ++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +@@ -2380,7 +2380,7 @@ nv13b_chipset = { + .fuse = gm107_fuse_new, + .ibus = gp10b_ibus_new, + .imem = gk20a_instmem_new, +- .ltc = gp102_ltc_new, ++ .ltc = gp10b_ltc_new, + .mc = gp10b_mc_new, + .mmu = gp10b_mmu_new, + .secboot = gp10b_secboot_new, +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild +index 2b6d36ea7067..728d75010847 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild +@@ -6,3 +6,4 @@ nvkm-y += nvkm/subdev/ltc/gm107.o + nvkm-y += nvkm/subdev/ltc/gm200.o + nvkm-y += nvkm/subdev/ltc/gp100.o + nvkm-y += nvkm/subdev/ltc/gp102.o ++nvkm-y += nvkm/subdev/ltc/gp10b.o +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c +new file mode 100644 +index 000000000000..4d27c6ea1552 +--- /dev/null ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c +@@ -0,0 +1,69 @@ ++/* ++ * Copyright (c) 2019 NVIDIA Corporation. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ * ++ * Authors: Thierry Reding ++ */ ++ ++#include "priv.h" ++ ++static void ++gp10b_ltc_init(struct nvkm_ltc *ltc) ++{ ++ struct nvkm_device *device = ltc->subdev.device; ++#ifdef CONFIG_IOMMU_API ++ struct iommu_fwspec *spec; ++#endif ++ ++ nvkm_wr32(device, 0x17e27c, ltc->ltc_nr); ++ nvkm_wr32(device, 0x17e000, ltc->ltc_nr); ++ nvkm_wr32(device, 0x100800, ltc->ltc_nr); ++ ++#ifdef CONFIG_IOMMU_API ++ spec = dev_iommu_fwspec_get(device->dev); ++ if (spec) { ++ u32 sid = spec->ids[0] & 0xffff; ++ ++ /* stream ID */ ++ nvkm_wr32(device, 0x160000, sid << 2); ++ } ++#endif ++} ++ ++static const struct nvkm_ltc_func ++gp10b_ltc = { ++ .oneinit = gp100_ltc_oneinit, ++ .init = gp10b_ltc_init, ++ .intr = gp100_ltc_intr, ++ .cbc_clear = gm107_ltc_cbc_clear, ++ .cbc_wait = gm107_ltc_cbc_wait, ++ .zbc = 16, ++ .zbc_clear_color = gm107_ltc_zbc_clear_color, ++ .zbc_clear_depth = gm107_ltc_zbc_clear_depth, ++ .zbc_clear_stencil = gp102_ltc_zbc_clear_stencil, ++ .invalidate = gf100_ltc_invalidate, ++ .flush = gf100_ltc_flush, ++}; ++ ++int ++gp10b_ltc_new(struct nvkm_device *device, int index, struct nvkm_ltc **pltc) ++{ ++ return nvkm_ltc_new_(&gp10b_ltc, device, index, pltc); ++} +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h +index 2fcf18e46ce3..eca5a711b1b8 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h +@@ -46,4 +46,6 @@ void gm107_ltc_zbc_clear_depth(struct nvkm_ltc *, int, const u32); + int gp100_ltc_oneinit(struct nvkm_ltc *); + void gp100_ltc_init(struct nvkm_ltc *); + void gp100_ltc_intr(struct nvkm_ltc *); ++ ++void gp102_ltc_zbc_clear_stencil(struct nvkm_ltc *, int, const u32); + #endif + +From patchwork Mon Sep 16 15:04:06 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [05/11] drm/nouveau: gp10b: Use correct copy engine +From: Thierry Reding +X-Patchwork-Id: 331052 +Message-Id: <20190916150412.10025-6-thierry.reding@gmail.com> +To: Ben Skeggs , Thierry Reding +Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, + dri-devel@lists.freedesktop.org +Date: Mon, 16 Sep 2019 17:04:06 +0200 + +From: Thierry Reding + +gp10b uses the new engine enumeration mechanism introduced in the Pascal +architecture. As a result, the copy engine, which used to be at index 2 +for prior Tegra GPU instantiations, has now moved to index 0. Fix up the +index and also use the gp100 variant of the copy engine class because on +gp10b the PASCAL_DMA_COPY_B class is not supported. + +Signed-off-by: Thierry Reding +--- + drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +index d2d6d5f4028a..99d3fa3fad89 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c ++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +@@ -2387,7 +2387,7 @@ nv13b_chipset = { + .pmu = gm20b_pmu_new, + .timer = gk20a_timer_new, + .top = gk104_top_new, +- .ce[2] = gp102_ce_new, ++ .ce[0] = gp100_ce_new, + .dma = gf119_dma_new, + .fifo = gp10b_fifo_new, + .gr = gp10b_gr_new, + +From patchwork Mon Sep 16 15:04:07 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [06/11] drm/nouveau: gk20a: Set IOMMU bit for DMA API if appropriate +From: Thierry Reding +X-Patchwork-Id: 331053 +Message-Id: <20190916150412.10025-7-thierry.reding@gmail.com> +To: Ben Skeggs , Thierry Reding +Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, + dri-devel@lists.freedesktop.org +Date: Mon, 16 Sep 2019 17:04:07 +0200 + +From: Thierry Reding + +Detect if the DMA API is backed by an IOMMU and set the IOMMU bit if so. +This is needed to make sure IOMMU addresses are properly translated even +the explicit IOMMU API is not used. + +Signed-off-by: Thierry Reding +--- + .../drm/nouveau/nvkm/subdev/instmem/gk20a.c | 35 +++++++++++++------ + 1 file changed, 25 insertions(+), 10 deletions(-) + +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c +index b0493f8df1fe..1120a2a7d5f1 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c +@@ -100,12 +100,14 @@ struct gk20a_instmem { + unsigned int vaddr_max; + struct list_head vaddr_lru; + ++ /* IOMMU mapping */ ++ unsigned int page_shift; ++ u64 iommu_mask; ++ + /* Only used if IOMMU if present */ + struct mutex *mm_mutex; + struct nvkm_mm *mm; + struct iommu_domain *domain; +- unsigned long iommu_pgshift; +- u16 iommu_bit; + + /* Only used by DMA API */ + unsigned long attrs; +@@ -357,12 +359,12 @@ gk20a_instobj_dtor_iommu(struct nvkm_memory *memory) + mutex_unlock(&imem->lock); + + /* clear IOMMU bit to unmap pages */ +- r->offset &= ~BIT(imem->iommu_bit - imem->iommu_pgshift); ++ r->offset &= ~imem->iommu_mask; + + /* Unmap pages from GPU address space and free them */ + for (i = 0; i < node->base.mn->length; i++) { + iommu_unmap(imem->domain, +- (r->offset + i) << imem->iommu_pgshift, PAGE_SIZE); ++ (r->offset + i) << imem->page_shift, PAGE_SIZE); + dma_unmap_page(dev, node->dma_addrs[i], PAGE_SIZE, + DMA_BIDIRECTIONAL); + __free_page(node->pages[i]); +@@ -440,7 +442,7 @@ gk20a_instobj_ctor_dma(struct gk20a_instmem *imem, u32 npages, u32 align, + + /* present memory for being mapped using small pages */ + node->r.type = 12; +- node->r.offset = node->handle >> 12; ++ node->r.offset = imem->iommu_mask | node->handle >> 12; + node->r.length = (npages << PAGE_SHIFT) >> 12; + + node->base.mn = &node->r; +@@ -493,7 +495,7 @@ gk20a_instobj_ctor_iommu(struct gk20a_instmem *imem, u32 npages, u32 align, + mutex_lock(imem->mm_mutex); + /* Reserve area from GPU address space */ + ret = nvkm_mm_head(imem->mm, 0, 1, npages, npages, +- align >> imem->iommu_pgshift, &r); ++ align >> imem->page_shift, &r); + mutex_unlock(imem->mm_mutex); + if (ret) { + nvkm_error(subdev, "IOMMU space is full!\n"); +@@ -502,7 +504,7 @@ gk20a_instobj_ctor_iommu(struct gk20a_instmem *imem, u32 npages, u32 align, + + /* Map into GPU address space */ + for (i = 0; i < npages; i++) { +- u32 offset = (r->offset + i) << imem->iommu_pgshift; ++ u32 offset = (r->offset + i) << imem->page_shift; + + ret = iommu_map(imem->domain, offset, node->dma_addrs[i], + PAGE_SIZE, IOMMU_READ | IOMMU_WRITE); +@@ -518,7 +520,7 @@ gk20a_instobj_ctor_iommu(struct gk20a_instmem *imem, u32 npages, u32 align, + } + + /* IOMMU bit tells that an address is to be resolved through the IOMMU */ +- r->offset |= BIT(imem->iommu_bit - imem->iommu_pgshift); ++ r->offset |= imem->iommu_mask; + + node->base.mn = r; + return 0; +@@ -619,11 +621,12 @@ gk20a_instmem_new(struct nvkm_device *device, int index, + imem->mm_mutex = &tdev->iommu.mutex; + imem->mm = &tdev->iommu.mm; + imem->domain = tdev->iommu.domain; +- imem->iommu_pgshift = tdev->iommu.pgshift; +- imem->iommu_bit = tdev->func->iommu_bit; ++ imem->page_shift = tdev->iommu.pgshift; + + nvkm_info(&imem->base.subdev, "using IOMMU\n"); + } else { ++ imem->page_shift = PAGE_SHIFT; ++ + imem->attrs = DMA_ATTR_NON_CONSISTENT | + DMA_ATTR_WEAK_ORDERING | + DMA_ATTR_WRITE_COMBINE; +@@ -631,5 +634,17 @@ gk20a_instmem_new(struct nvkm_device *device, int index, + nvkm_info(&imem->base.subdev, "using DMA API\n"); + } + ++ /* ++ * The IOMMU mask needs to be set if an IOMMU is used explicitly (via ++ * direct IOMMU API usage) or implicitly (via the DMA API). In both ++ * cases the device will have been attached to an IOMMU domain. ++ */ ++ if (iommu_get_domain_for_dev(device->dev)) { ++ imem->iommu_mask = BIT_ULL(tdev->func->iommu_bit - ++ imem->page_shift); ++ nvkm_debug(&imem->base.subdev, "IOMMU mask: %016llx\n", ++ imem->iommu_mask); ++ } ++ + return 0; + } + +From patchwork Mon Sep 16 15:04:08 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [07/11] drm/nouveau: gk20a: Implement custom MMU class +From: Thierry Reding +X-Patchwork-Id: 331057 +Message-Id: <20190916150412.10025-8-thierry.reding@gmail.com> +To: Ben Skeggs , Thierry Reding +Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, + dri-devel@lists.freedesktop.org +Date: Mon, 16 Sep 2019 17:04:08 +0200 + +From: Thierry Reding + +The GPU integrated in NVIDIA Tegra SoCs is connected to system memory +via two paths: one direct path to the memory controller and another path +that goes through a system MMU first. It's not typically necessary to go +through the system MMU because the GPU's MMU can already map buffers so +that they appear contiguous to the GPU. + +However, in order to support big pages, the system MMU has to be used to +combine multiple small pages into one virtually contiguous chunk so that +the GPU can then treat that as a single big page. + +In order to prepare for big page support, implement a custom MMU class +that takes care of setting the IOMMU bit when writing page tables and +when appropriate. + +This is also necessary to make sure that Nouveau works correctly on +Tegra devices where the GPU is connected to a system MMU and that IOMMU +is used to back the DMA API. Currently Nouveau assumes that the DMA API +is never backed by an IOMMU, so access to DMA-mapped buffers fault when +suddenly this assumption is no longer true. + +One situation where this can happen is on 32-bit Tegra SoCs where the +ARM architecture code automatically attaches the GPU with a DMA/IOMMU +domain. This is currently worked around by detaching the GPU from the +IOMMU domain at probe time. However, with Tegra186 and later this can +now also happen, but unfortunately no mechanism exists to detach from +the domain in the 64-bit ARM architecture code. + +Using this Tegra-specific MMU class ensures that DMA-mapped buffers are +properly mapped (with the IOMMU bit set) if the DMA API is backed by an +IOMMU domain. + +Signed-off-by: Thierry Reding +--- + .../gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.c | 50 ++++++++++++++++++- + .../gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.h | 44 ++++++++++++++++ + .../gpu/drm/nouveau/nvkm/subdev/mmu/gm20b.c | 6 ++- + .../gpu/drm/nouveau/nvkm/subdev/mmu/gp10b.c | 4 +- + drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h | 1 + + .../drm/nouveau/nvkm/subdev/mmu/vmmgk20a.c | 22 +++++++- + .../drm/nouveau/nvkm/subdev/mmu/vmmgm20b.c | 4 +- + .../drm/nouveau/nvkm/subdev/mmu/vmmgp10b.c | 20 +++++++- + 8 files changed, 142 insertions(+), 9 deletions(-) + create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.h + +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.c +index ac74965a60d4..d9a5e05b7dc7 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.c +@@ -19,11 +19,59 @@ + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ ++ ++#include "gk20a.h" + #include "mem.h" + #include "vmm.h" + ++#include + #include + ++static void ++gk20a_mmu_ctor(const struct nvkm_mmu_func *func, struct nvkm_device *device, ++ int index, struct gk20a_mmu *mmu) ++{ ++ struct iommu_domain *domain = iommu_get_domain_for_dev(device->dev); ++ struct nvkm_device_tegra *tegra = device->func->tegra(device); ++ ++ nvkm_mmu_ctor(func, device, index, &mmu->base); ++ ++ /* ++ * If the DMA API is backed by an IOMMU, make sure the IOMMU bit is ++ * set for all buffer accesses. If the IOMMU is explicitly used, it ++ * is only used for instance blocks and the MMU doesn't care, since ++ * buffer objects are only mapped through the MMU, not through the ++ * IOMMU. ++ * ++ * Big page support could be implemented using explicit IOMMU usage, ++ * but the DMA API already provides that for free, so we don't worry ++ * about it for now. ++ */ ++ if (domain && !tegra->iommu.domain) { ++ mmu->iommu_mask = BIT_ULL(tegra->func->iommu_bit); ++ nvkm_debug(&mmu->base.subdev, "IOMMU mask: %llx\n", ++ mmu->iommu_mask); ++ } ++} ++ ++int ++gk20a_mmu_new_(const struct nvkm_mmu_func *func, struct nvkm_device *device, ++ int index, struct nvkm_mmu **pmmu) ++{ ++ struct gk20a_mmu *mmu; ++ ++ mmu = kzalloc(sizeof(*mmu), GFP_KERNEL); ++ if (!mmu) ++ return -ENOMEM; ++ ++ gk20a_mmu_ctor(func, device, index, mmu); ++ ++ if (pmmu) ++ *pmmu = &mmu->base; ++ ++ return 0; ++} ++ + static const struct nvkm_mmu_func + gk20a_mmu = { + .dma_bits = 40, +@@ -37,5 +85,5 @@ gk20a_mmu = { + int + gk20a_mmu_new(struct nvkm_device *device, int index, struct nvkm_mmu **pmmu) + { +- return nvkm_mmu_new_(&gk20a_mmu, device, index, pmmu); ++ return gk20a_mmu_new_(&gk20a_mmu, device, index, pmmu); + } +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.h b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.h +new file mode 100644 +index 000000000000..bb81fc62509c +--- /dev/null ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.h +@@ -0,0 +1,44 @@ ++/* ++ * Copyright (c) 2019 NVIDIA Corporation. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifndef __NVKM_MMU_GK20A_H__ ++#define __NVKM_MMU_GK20A_H__ ++ ++#include "priv.h" ++ ++struct gk20a_mmu { ++ struct nvkm_mmu base; ++ ++ /* ++ * If an IOMMU is used, indicates which address bit will trigger an ++ * IOMMU translation when set (when this bit is not set, the IOMMU is ++ * bypassed). A value of 0 means an IOMMU is never used. ++ */ ++ u64 iommu_mask; ++}; ++ ++#define gk20a_mmu(mmu) container_of(mmu, struct gk20a_mmu, base) ++ ++int gk20a_mmu_new_(const struct nvkm_mmu_func *, struct nvkm_device *, ++ int index, struct nvkm_mmu **); ++ ++#endif +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm20b.c +index 7353a94b4091..7fccd4df52a8 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm20b.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm20b.c +@@ -19,6 +19,8 @@ + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ ++ ++#include "gk20a.h" + #include "mem.h" + #include "vmm.h" + +@@ -50,6 +52,6 @@ int + gm20b_mmu_new(struct nvkm_device *device, int index, struct nvkm_mmu **pmmu) + { + if (device->fb->page) +- return nvkm_mmu_new_(&gm20b_mmu_fixed, device, index, pmmu); +- return nvkm_mmu_new_(&gm20b_mmu, device, index, pmmu); ++ return gk20a_mmu_new_(&gm20b_mmu_fixed, device, index, pmmu); ++ return gk20a_mmu_new_(&gm20b_mmu, device, index, pmmu); + } +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp10b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp10b.c +index 0a50be9a785a..ae3cb47be3d8 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp10b.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp10b.c +@@ -19,6 +19,8 @@ + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ ++ ++#include "gk20a.h" + #include "mem.h" + #include "vmm.h" + +@@ -41,5 +43,5 @@ gp10b_mmu_new(struct nvkm_device *device, int index, struct nvkm_mmu **pmmu) + { + if (!nvkm_boolopt(device->cfgopt, "GP100MmuLayout", true)) + return gm20b_mmu_new(device, index, pmmu); +- return nvkm_mmu_new_(&gp10b_mmu, device, index, pmmu); ++ return gk20a_mmu_new_(&gp10b_mmu, device, index, pmmu); + } +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h +index 5e55ecbd8005..fb3a9e8bb9cd 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h +@@ -213,6 +213,7 @@ void gf100_vmm_invalidate(struct nvkm_vmm *, u32 type); + void gf100_vmm_invalidate_pdb(struct nvkm_vmm *, u64 addr); + + int gk20a_vmm_aper(enum nvkm_memory_target); ++int gk20a_vmm_valid(struct nvkm_vmm *, void *, u32, struct nvkm_vmm_map *); + + int gm200_vmm_new_(const struct nvkm_vmm_func *, const struct nvkm_vmm_func *, + struct nvkm_mmu *, bool, u64, u64, void *, u32, +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgk20a.c +index 5a9582dce970..16d7bf727292 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgk20a.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgk20a.c +@@ -19,6 +19,8 @@ + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ ++ ++#include "gk20a.h" + #include "vmm.h" + + #include +@@ -33,12 +35,28 @@ gk20a_vmm_aper(enum nvkm_memory_target target) + } + } + ++int ++gk20a_vmm_valid(struct nvkm_vmm *vmm, void *argv, u32 argc, ++ struct nvkm_vmm_map *map) ++{ ++ struct gk20a_mmu *mmu = gk20a_mmu(vmm->mmu); ++ int ret; ++ ++ ret = gf100_vmm_valid(vmm, argv, argc, map); ++ if (ret < 0) ++ return ret; ++ ++ map->type |= mmu->iommu_mask >> 8; ++ ++ return 0; ++} ++ + static const struct nvkm_vmm_func + gk20a_vmm_17 = { + .join = gf100_vmm_join, + .part = gf100_vmm_part, + .aper = gf100_vmm_aper, +- .valid = gf100_vmm_valid, ++ .valid = gk20a_vmm_valid, + .flush = gf100_vmm_flush, + .invalidate_pdb = gf100_vmm_invalidate_pdb, + .page = { +@@ -53,7 +71,7 @@ gk20a_vmm_16 = { + .join = gf100_vmm_join, + .part = gf100_vmm_part, + .aper = gf100_vmm_aper, +- .valid = gf100_vmm_valid, ++ .valid = gk20a_vmm_valid, + .flush = gf100_vmm_flush, + .invalidate_pdb = gf100_vmm_invalidate_pdb, + .page = { +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgm20b.c +index 96b759695dd8..7a6066d886cd 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgm20b.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgm20b.c +@@ -26,7 +26,7 @@ gm20b_vmm_17 = { + .join = gm200_vmm_join, + .part = gf100_vmm_part, + .aper = gk20a_vmm_aper, +- .valid = gf100_vmm_valid, ++ .valid = gk20a_vmm_valid, + .flush = gf100_vmm_flush, + .invalidate_pdb = gf100_vmm_invalidate_pdb, + .page = { +@@ -42,7 +42,7 @@ gm20b_vmm_16 = { + .join = gm200_vmm_join, + .part = gf100_vmm_part, + .aper = gk20a_vmm_aper, +- .valid = gf100_vmm_valid, ++ .valid = gk20a_vmm_valid, + .flush = gf100_vmm_flush, + .invalidate_pdb = gf100_vmm_invalidate_pdb, + .page = { +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp10b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp10b.c +index e081239afe58..180c8f006e32 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp10b.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp10b.c +@@ -19,14 +19,32 @@ + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ ++ ++#include "gk20a.h" + #include "vmm.h" + ++static int ++gp10b_vmm_valid(struct nvkm_vmm *vmm, void *argv, u32 argc, ++ struct nvkm_vmm_map *map) ++{ ++ struct gk20a_mmu *mmu = gk20a_mmu(vmm->mmu); ++ int ret; ++ ++ ret = gp100_vmm_valid(vmm, argv, argc, map); ++ if (ret < 0) ++ return ret; ++ ++ map->type |= mmu->iommu_mask >> 4; ++ ++ return 0; ++} ++ + static const struct nvkm_vmm_func + gp10b_vmm = { + .join = gp100_vmm_join, + .part = gf100_vmm_part, + .aper = gk20a_vmm_aper, +- .valid = gp100_vmm_valid, ++ .valid = gp10b_vmm_valid, + .flush = gp100_vmm_flush, + .mthd = gp100_vmm_mthd, + .invalidate_pdb = gp100_vmm_invalidate_pdb, + +From patchwork Mon Sep 16 15:04:09 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [08/11] drm/nouveau: tegra: Skip IOMMU initialization if already + attached +From: Thierry Reding +X-Patchwork-Id: 331060 +Message-Id: <20190916150412.10025-9-thierry.reding@gmail.com> +To: Ben Skeggs , Thierry Reding +Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, + dri-devel@lists.freedesktop.org +Date: Mon, 16 Sep 2019 17:04:09 +0200 + +From: Thierry Reding + +If the GPU is already attached to an IOMMU, don't detach it and setup an +explicit IOMMU domain. Since Nouveau can now properly handle the case of +the DMA API being backed by an IOMMU, just continue using the DMA API. + +Signed-off-by: Thierry Reding +--- + .../drm/nouveau/nvkm/engine/device/tegra.c | 19 +++++++------------ + 1 file changed, 7 insertions(+), 12 deletions(-) + +diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +index d0d52c1d4aee..fc652aaa41c7 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c ++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +@@ -23,10 +23,6 @@ + #ifdef CONFIG_NOUVEAU_PLATFORM_DRIVER + #include "priv.h" + +-#if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU) +-#include +-#endif +- + static int + nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev) + { +@@ -109,14 +105,13 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) + unsigned long pgsize_bitmap; + int ret; + +-#if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU) +- if (dev->archdata.mapping) { +- struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev); +- +- arm_iommu_detach_device(dev); +- arm_iommu_release_mapping(mapping); +- } +-#endif ++ /* ++ * Skip explicit IOMMU initialization if the GPU is already attached ++ * to an IOMMU domain. This can happen if the DMA API is backed by an ++ * IOMMU. ++ */ ++ if (iommu_get_domain_for_dev(dev)) ++ return; + + if (!tdev->func->iommu_bit) + return; + +From patchwork Mon Sep 16 15:04:10 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [09/11] drm/nouveau: tegra: Fall back to 32-bit DMA mask without IOMMU +From: Thierry Reding +X-Patchwork-Id: 331061 +Message-Id: <20190916150412.10025-10-thierry.reding@gmail.com> +To: Ben Skeggs , Thierry Reding +Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, + dri-devel@lists.freedesktop.org +Date: Mon, 16 Sep 2019 17:04:10 +0200 + +From: Thierry Reding + +The GPU can usually address more than 32-bit, even without being +attached to an IOMMU. However, if the GPU is not attached to an IOMMU, +it's likely that there is no IOMMU in the system, in which case any +buffers allocated by Nouveau will likely end up in a region of memory +that cannot be accessed by host1x. + +Signed-off-by: Thierry Reding +--- + .../drm/nouveau/nvkm/engine/device/tegra.c | 111 +++++++++++------- + 1 file changed, 70 insertions(+), 41 deletions(-) + +diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +index fc652aaa41c7..221238a2cf53 100644 +--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c ++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +@@ -97,7 +97,7 @@ nvkm_device_tegra_power_down(struct nvkm_device_tegra *tdev) + return 0; + } + +-static void ++static int + nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) + { + #if IS_ENABLED(CONFIG_IOMMU_API) +@@ -111,47 +111,65 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) + * IOMMU. + */ + if (iommu_get_domain_for_dev(dev)) +- return; ++ return -ENODEV; + + if (!tdev->func->iommu_bit) +- return; ++ return -ENODEV; ++ ++ if (!iommu_present(&platform_bus_type)) ++ return -ENODEV; + + mutex_init(&tdev->iommu.mutex); + +- if (iommu_present(&platform_bus_type)) { +- tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type); +- if (!tdev->iommu.domain) +- goto error; ++ tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type); ++ if (!tdev->iommu.domain) ++ return -ENOMEM; + +- /* +- * A IOMMU is only usable if it supports page sizes smaller +- * or equal to the system's PAGE_SIZE, with a preference if +- * both are equal. +- */ +- pgsize_bitmap = tdev->iommu.domain->ops->pgsize_bitmap; +- if (pgsize_bitmap & PAGE_SIZE) { +- tdev->iommu.pgshift = PAGE_SHIFT; +- } else { +- tdev->iommu.pgshift = fls(pgsize_bitmap & ~PAGE_MASK); +- if (tdev->iommu.pgshift == 0) { +- dev_warn(dev, "unsupported IOMMU page size\n"); +- goto free_domain; +- } +- tdev->iommu.pgshift -= 1; ++ /* ++ * An IOMMU is only usable if it supports page sizes smaller or equal ++ * to the system's PAGE_SIZE, with a preference if both are equal. ++ */ ++ pgsize_bitmap = tdev->iommu.domain->ops->pgsize_bitmap; ++ if (pgsize_bitmap & PAGE_SIZE) { ++ tdev->iommu.pgshift = PAGE_SHIFT; ++ } else { ++ tdev->iommu.pgshift = fls(pgsize_bitmap & ~PAGE_MASK); ++ if (tdev->iommu.pgshift == 0) { ++ dev_warn(dev, "unsupported IOMMU page size\n"); ++ ret = -ENOTSUPP; ++ goto free_domain; + } + +- ret = iommu_attach_device(tdev->iommu.domain, dev); +- if (ret) +- goto free_domain; ++ tdev->iommu.pgshift -= 1; ++ } + +- ret = nvkm_mm_init(&tdev->iommu.mm, 0, 0, +- (1ULL << tdev->func->iommu_bit) >> +- tdev->iommu.pgshift, 1); +- if (ret) +- goto detach_device; ++ ret = iommu_attach_device(tdev->iommu.domain, dev); ++ if (ret) { ++ dev_warn(dev, "failed to attach to IOMMU: %d\n", ret); ++ goto free_domain; ++ } ++ ++ ret = nvkm_mm_init(&tdev->iommu.mm, 0, 0, ++ (1ULL << tdev->func->iommu_bit) >> ++ tdev->iommu.pgshift, 1); ++ if (ret) { ++ dev_warn(dev, "failed to initialize IOVA space: %d\n", ret); ++ goto detach_device; ++ } ++ ++ /* ++ * The IOMMU bit defines the upper limit of the GPU-addressable space. ++ */ ++ ret = dma_set_mask(dev, DMA_BIT_MASK(tdev->func->iommu_bit)); ++ if (ret) { ++ dev_warn(dev, "failed to set DMA mask: %d\n", ret); ++ goto fini_mm; + } + +- return; ++ return 0; ++ ++fini_mm: ++ nvkm_mm_fini(&tdev->iommu.mm); + + detach_device: + iommu_detach_device(tdev->iommu.domain, dev); +@@ -159,10 +177,15 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) + free_domain: + iommu_domain_free(tdev->iommu.domain); + +-error: ++ /* reset these so that the DMA API code paths are executed */ + tdev->iommu.domain = NULL; + tdev->iommu.pgshift = 0; +- dev_err(dev, "cannot initialize IOMMU MM\n"); ++ ++ dev_warn(dev, "cannot initialize IOMMU MM\n"); ++ ++ return ret; ++#else ++ return -ENOTSUPP; + #endif + } + +@@ -327,14 +350,20 @@ nvkm_device_tegra_new(const struct nvkm_device_tegra_func *func, + goto free; + } + +- /** +- * The IOMMU bit defines the upper limit of the GPU-addressable space. +- */ +- ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(tdev->func->iommu_bit)); +- if (ret) +- goto free; +- +- nvkm_device_tegra_probe_iommu(tdev); ++ ret = nvkm_device_tegra_probe_iommu(tdev); ++ if (ret) { ++ /* ++ * If we fail to set up an IOMMU, fall back to a 32-bit DMA ++ * mask. This is not necessary for the GPU to work because it ++ * can usually address all of system memory. However, if the ++ * buffers allocated by Nouveau are meant to be shared with ++ * the display controller, we need to restrict where they can ++ * come from. ++ */ ++ ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); ++ if (ret) ++ goto free; ++ } + + ret = nvkm_device_tegra_power_up(tdev); + if (ret) + +From patchwork Mon Sep 16 15:04:11 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [10/11] arm64: tegra: Enable GPU on Jetson TX2 +From: Thierry Reding +X-Patchwork-Id: 331063 +Message-Id: <20190916150412.10025-11-thierry.reding@gmail.com> +To: Ben Skeggs , Thierry Reding +Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, + dri-devel@lists.freedesktop.org +Date: Mon, 16 Sep 2019 17:04:11 +0200 + +From: Alexandre Courbot + +Enable the GPU node for the Jetson TX2 board. + +Signed-off-by: Alexandre Courbot +Signed-off-by: Thierry Reding +--- + arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts b/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts +index bdace01561ba..6f7c7c4c5c29 100644 +--- a/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts ++++ b/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts +@@ -276,6 +276,10 @@ + }; + }; + ++ gpu@17000000 { ++ status = "okay"; ++ }; ++ + gpio-keys { + compatible = "gpio-keys"; + + +From patchwork Mon Sep 16 15:04:12 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [11/11] arm64: tegra: Enable SMMU for GPU on Tegra186 +From: Thierry Reding +X-Patchwork-Id: 331062 +Message-Id: <20190916150412.10025-12-thierry.reding@gmail.com> +To: Ben Skeggs , Thierry Reding +Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, + dri-devel@lists.freedesktop.org +Date: Mon, 16 Sep 2019 17:04:12 +0200 + +From: Thierry Reding + +The GPU has a connection to the ARM SMMU found on Tegra186, which can be +used to support large pages. Make sure the GPU is attached to the SMMU +to take advantage of its capabilities. + +Signed-off-by: Thierry Reding +--- + arch/arm64/boot/dts/nvidia/tegra186.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi +index 47cd831fcf44..171fd4dfa58d 100644 +--- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi ++++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi +@@ -1172,6 +1172,7 @@ + status = "disabled"; + + power-domains = <&bpmp TEGRA186_POWER_DOMAIN_GPU>; ++ iommus = <&smmu TEGRA186_SID_GPU>; + }; + + sysram@30000000 { diff --git a/gpio-max77620-Use-correct-unit-for-debounce-times.patch b/gpio-max77620-Use-correct-unit-for-debounce-times.patch new file mode 100644 index 000000000..bcf575fb8 --- /dev/null +++ b/gpio-max77620-Use-correct-unit-for-debounce-times.patch @@ -0,0 +1,586 @@ +From patchwork Wed Oct 2 12:28:23 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Thierry Reding +X-Patchwork-Id: 1170631 +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@bilbo.ozlabs.org +Authentication-Results: ozlabs.org; + spf=none (mailfrom) smtp.mailfrom=vger.kernel.org + (client-ip=209.132.180.67; helo=vger.kernel.org; + envelope-from=linux-gpio-owner@vger.kernel.org; + receiver=) +Authentication-Results: ozlabs.org; + dmarc=pass (p=none dis=none) header.from=gmail.com +Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; + unprotected) header.d=gmail.com header.i=@gmail.com + header.b="Xe4ozWCs"; dkim-atps=neutral +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by ozlabs.org (Postfix) with ESMTP id 46jwR31mYjz9sPl + for ; + Wed, 2 Oct 2019 22:28:31 +1000 (AEST) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1725875AbfJBM2a (ORCPT ); + Wed, 2 Oct 2019 08:28:30 -0400 +Received: from mail-wr1-f67.google.com ([209.85.221.67]:42402 "EHLO + mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1725848AbfJBM23 (ORCPT + ); Wed, 2 Oct 2019 08:28:29 -0400 +Received: by mail-wr1-f67.google.com with SMTP id n14so19415351wrw.9; + Wed, 02 Oct 2019 05:28:28 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id:mime-version + :content-transfer-encoding; + bh=qP9mbplmTy0EguziRYmdZKFvmKZpgiY1goXlhQxV0/8=; + b=Xe4ozWCsxpb6DK1agUyM9eUxlP6G03BBFhI5g4JErak3F1hsMTKXmoyANoMKXxS+UF + OWRiAkrVC3cQOJczX/+7HhZQ8bMC3apl96os1jO6/JWJEP2BHZpDAF0bRyJQdbd0lmMA + afH1TDc/aCLYhrc6UF4IMSf4Noe9cSvoyQYpo0qgpxktdn7I/jv5ztIFWEVBOuEfDveP + hKAmMRuOGlokBd9/+TirOM307HbJYDWAZ8Wko3G+bYcw41RSULf9eN0mQPLmeF/+J9tC + XwaypBneeu3VeCmfU/DxP1duZ3pCcnwOu5nrzdHsS6ow28T2CVk8VvAAZGEU1cUIX4Z+ + +hkw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version + :content-transfer-encoding; + bh=qP9mbplmTy0EguziRYmdZKFvmKZpgiY1goXlhQxV0/8=; + b=akVGfKDGN9KlaS7GfDnHx98C2QeedcAeu8RIoCS8uh0twWVOZMZKbUY6M/2HaZKsPI + 38mOkZ2CRPyO1EzbpI9UU6hHXfohMTHuWX0pTdvkFXn+TfZPAxJa1fVRhHgOcknkhb/U + JBzse/qoFFdlsRK3kY6I+0R1YyyAD2SDlzfax4U6ew8DL0icpWegiNEXnIno/7b6sIt2 + 9u9PEHk+1AdQkgS/tVRAFdVg6rrYMbUFkh1JAYsEED71D2IR38JmdUfjsW0Bi1aohXuz + F8LOoB0G33BszHljgknOYlHF4tPGDitMVI+giV3UgwXEWHKFgimUJKOb1nyg+4fcVOLO + 2g1g== +X-Gm-Message-State: APjAAAX5YpK/Xf8BgNQ7EyD7TzARRLtN4fRfLcEXIT3fZkDHf5xGyxPi + jnbTBpi+UDekDgGOQiVnsoo= +X-Google-Smtp-Source: APXvYqw9HA6mSwE4O/MajE0OyTuT/xQaPqMRcrU+p/RXgMiP+Q297cH5ORneUFjHbOQpwrdgestsJw== +X-Received: by 2002:adf:fe05:: with SMTP id n5mr2716992wrr.355.1570019307315; + Wed, 02 Oct 2019 05:28:27 -0700 (PDT) +Received: from localhost (p2E5BE2CE.dip0.t-ipconnect.de. [46.91.226.206]) + by smtp.gmail.com with ESMTPSA id + e17sm5719759wma.15.2019.10.02.05.28.25 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Wed, 02 Oct 2019 05:28:26 -0700 (PDT) +From: Thierry Reding +To: Linus Walleij , + Bartosz Golaszewski +Cc: Timo Alho , linux-gpio@vger.kernel.org, + linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org +Subject: [PATCH 1/3] gpio: max77620: Use correct unit for debounce times +Date: Wed, 2 Oct 2019 14:28:23 +0200 +Message-Id: <20191002122825.3948322-1-thierry.reding@gmail.com> +X-Mailer: git-send-email 2.23.0 +MIME-Version: 1.0 +Sender: linux-gpio-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-gpio@vger.kernel.org + +From: Thierry Reding + +The gpiod_set_debounce() function takes the debounce time in +microseconds. Adjust the switch/case values in the MAX77620 GPIO to use +the correct unit. + +Signed-off-by: Thierry Reding +--- + drivers/gpio/gpio-max77620.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c +index 47d05e357e61..faf86ea9c51a 100644 +--- a/drivers/gpio/gpio-max77620.c ++++ b/drivers/gpio/gpio-max77620.c +@@ -192,13 +192,13 @@ static int max77620_gpio_set_debounce(struct max77620_gpio *mgpio, + case 0: + val = MAX77620_CNFG_GPIO_DBNC_None; + break; +- case 1 ... 8: ++ case 1000 ... 8000: + val = MAX77620_CNFG_GPIO_DBNC_8ms; + break; +- case 9 ... 16: ++ case 9000 ... 16000: + val = MAX77620_CNFG_GPIO_DBNC_16ms; + break; +- case 17 ... 32: ++ case 17000 ... 32000: + val = MAX77620_CNFG_GPIO_DBNC_32ms; + break; + default: + +From patchwork Wed Oct 2 12:28:24 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Thierry Reding +X-Patchwork-Id: 1170635 +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@bilbo.ozlabs.org +Authentication-Results: ozlabs.org; + spf=none (mailfrom) smtp.mailfrom=vger.kernel.org + (client-ip=209.132.180.67; helo=vger.kernel.org; + envelope-from=linux-gpio-owner@vger.kernel.org; + receiver=) +Authentication-Results: ozlabs.org; + dmarc=pass (p=none dis=none) header.from=gmail.com +Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; + unprotected) header.d=gmail.com header.i=@gmail.com + header.b="ZNLKx8UP"; dkim-atps=neutral +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by ozlabs.org (Postfix) with ESMTP id 46jwRG4D1Dz9sPj + for ; + Wed, 2 Oct 2019 22:28:42 +1000 (AEST) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1726684AbfJBM2d (ORCPT ); + Wed, 2 Oct 2019 08:28:33 -0400 +Received: from mail-wr1-f66.google.com ([209.85.221.66]:43919 "EHLO + mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1725848AbfJBM2c (ORCPT + ); Wed, 2 Oct 2019 08:28:32 -0400 +Received: by mail-wr1-f66.google.com with SMTP id q17so19436519wrx.10; + Wed, 02 Oct 2019 05:28:30 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id:in-reply-to:references + :mime-version:content-transfer-encoding; + bh=iB2sFoZ4x2KF5IYNHgeqY98wXl2bB2JULeTFtyoqdVY=; + b=ZNLKx8UP+ukUsboEbPQ9oqLgg5M+37mex1mpr0SgaI7zjToRbmdCJL/chPAEK2r7t8 + C+RcBU7oQnbO3L1hTZQh1VyMX84xXmn0x8g7AskW0bydPo29O2lwBgM9BeNJiMt7gaS7 + LtCbNGe/ttaTfoTsJSOmpLgAJLVJ7mpN5r3h18HtAYcsB5NqjcgFF1yFZ9FvmXOIhxAm + 1MxDJ7tO9pJbc4JQ8iR/yPEsCNibvlX1qtkuBUWdy6aJHG4CkqIbqb+V+84d3R5bsmoe + sDx7f/mMbJ6cF7dCarqOe47Quscz7UkGw/gZywhaYNS/7p6JBvKDCe0bbruzj3MEXMRy + 2tlw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to + :references:mime-version:content-transfer-encoding; + bh=iB2sFoZ4x2KF5IYNHgeqY98wXl2bB2JULeTFtyoqdVY=; + b=E8tcBQ6lyFYE0z3JyOT1cT/Bgc194gfYXxSrFLZnHENJjrNz2Ijr9mgmTvanMcmLgs + qvPIH6L5rKKzPpmhxkGCVNMunQuR3U4+g4lCHaJuDE3QikN/dAMpfidmgej7UBcnxYXq + c8yhdhWsg36bVdUYmTdrPVNYayH3WqNj6h3724+nRQnwGs5Y+emoWuhckIBZQR2fJd3Z + jEEmej1F2QBBv4/Cf7RoOd9BVX1DFI3LgOoGADQcGnuCW/+2clFWp860wnWLGdTGqPKI + KCaPoNOzFDkbQCyhebPt8recsiTexB8AmRdTCOszf/TYQwmlvVUUSVqdwY4/P2N0uAGO + 8kOA== +X-Gm-Message-State: APjAAAVWUbix6mCYosiAjDRWTB69Pz3baQGdU6UKJJJba2d6nCyRFzs3 + w1iyx5KVIbR84BwLezjxgUk= +X-Google-Smtp-Source: APXvYqylRlhdhO5L5gTZTUh+KEGBPZYsf15BqzctBqRpCy2v75DzIQkOOs8h+NZd8ePk6530OH8SlA== +X-Received: by 2002:adf:f112:: with SMTP id r18mr2493221wro.88.1570019309276; + Wed, 02 Oct 2019 05:28:29 -0700 (PDT) +Received: from localhost (p2E5BE2CE.dip0.t-ipconnect.de. [46.91.226.206]) + by smtp.gmail.com with ESMTPSA id + h17sm10777194wme.6.2019.10.02.05.28.28 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Wed, 02 Oct 2019 05:28:28 -0700 (PDT) +From: Thierry Reding +To: Linus Walleij , + Bartosz Golaszewski +Cc: Timo Alho , linux-gpio@vger.kernel.org, + linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org +Subject: [PATCH 2/3] gpio: max77620: Do not allocate IRQs upfront +Date: Wed, 2 Oct 2019 14:28:24 +0200 +Message-Id: <20191002122825.3948322-2-thierry.reding@gmail.com> +X-Mailer: git-send-email 2.23.0 +In-Reply-To: <20191002122825.3948322-1-thierry.reding@gmail.com> +References: <20191002122825.3948322-1-thierry.reding@gmail.com> +MIME-Version: 1.0 +Sender: linux-gpio-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-gpio@vger.kernel.org + +From: Thierry Reding + +regmap_add_irq_chip() will try to allocate all of the IRQ descriptors +upfront if passed a non-zero irq_base parameter. However, the intention +is to allocate IRQ descriptors on an as-needed basis if possible. Pass 0 +instead of -1 to fix that use-case. + +Signed-off-by: Thierry Reding +--- + drivers/gpio/gpio-max77620.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c +index faf86ea9c51a..c58b56e5291e 100644 +--- a/drivers/gpio/gpio-max77620.c ++++ b/drivers/gpio/gpio-max77620.c +@@ -304,7 +304,7 @@ static int max77620_gpio_probe(struct platform_device *pdev) + } + + ret = devm_regmap_add_irq_chip(&pdev->dev, chip->rmap, gpio_irq, +- IRQF_ONESHOT, -1, ++ IRQF_ONESHOT, 0, + &max77620_gpio_irq_chip, + &chip->gpio_irq_data); + if (ret < 0) { + +From patchwork Wed Oct 2 12:28:25 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Thierry Reding +X-Patchwork-Id: 1170633 +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@bilbo.ozlabs.org +Authentication-Results: ozlabs.org; + spf=none (mailfrom) smtp.mailfrom=vger.kernel.org + (client-ip=209.132.180.67; helo=vger.kernel.org; + envelope-from=linux-gpio-owner@vger.kernel.org; + receiver=) +Authentication-Results: ozlabs.org; + dmarc=pass (p=none dis=none) header.from=gmail.com +Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; + unprotected) header.d=gmail.com header.i=@gmail.com + header.b="TsA9TpB7"; dkim-atps=neutral +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by ozlabs.org (Postfix) with ESMTP id 46jwRD5mmDz9sPq + for ; + Wed, 2 Oct 2019 22:28:40 +1000 (AEST) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1727456AbfJBM2f (ORCPT ); + Wed, 2 Oct 2019 08:28:35 -0400 +Received: from mail-wm1-f66.google.com ([209.85.128.66]:34525 "EHLO + mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1726682AbfJBM2e (ORCPT + ); Wed, 2 Oct 2019 08:28:34 -0400 +Received: by mail-wm1-f66.google.com with SMTP id y135so4823030wmc.1; + Wed, 02 Oct 2019 05:28:32 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id:in-reply-to:references + :mime-version:content-transfer-encoding; + bh=CBafHZOcPLRsPg6HMh6RW3fmvKDiW2MODjit57xEepE=; + b=TsA9TpB72Q02EPmaBqcc4zzucsjsdc5mtjgAgTak5YrKh+mRT2HMioWeCxrLu5Cl+6 + 66PhcUzrRtOnct3yEqC1hueFX+K8TsDr1bJq2f3L5LqA9rYz5Hdk93jVmwyEKtrPUOa5 + DNgu/r4ppuWX/d9nuLpVLcFGOzWYjz/GSfyRm/B0MNSsiIFx/VfjsK6OQk48uN2gyMPf + LsirANA0HYZPyXaUFBkchtTE71HqGFSIzJGUSVGm12Z26puMZ9GiUid1l1XJjdDuFfhU + 3k9TQnvLEpZDHArb2G8JrwRI8fRZ/OBDLPyKvH/EEdDYa/FfJOzliZBqMgVFpXpXGTZ6 + 7YAw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to + :references:mime-version:content-transfer-encoding; + bh=CBafHZOcPLRsPg6HMh6RW3fmvKDiW2MODjit57xEepE=; + b=MVU3M5NDj2W8TitA2MM98hE9Vgb07UODtrRolwf9TaeTgf2XRMgYAWr9v5zaHvBU2q + 4q/HPqbn0WAW3OBfSQLW6CFcdiHOkjfR+r8tKHpNMNBbeDrj1DeeKE/A25plLXxg+Ypz + 1bKJe6DPvjIqLvrpVmPADaRtsAkgDFTt/h41ti2uTwS5xq4qEf1mwz6lFyJkGyf+Qjb5 + pnViJ3Lv89RLBvJwWj0j2t/EzzznPZn9xP663YkNrUNRYrAM7ZBauvK7kMyf8LnKo96E + +niJu7OV4PnRspOC8AS3PPM4DHGctXZl6QMcJ1LyPwBkd8EHJioV1iDJKqHQIbxew46f + AzCA== +X-Gm-Message-State: APjAAAWbRYKoHNSgs+vkRdoNeam2jbbuVKAFxN3ysahEdBul5DIjNFsz + JRjkPkilW+LPTwy2EmDLNUE= +X-Google-Smtp-Source: APXvYqyfSTFvcH9+iLVzVGJ5KDEauN0ssdr9eBfIIdRWe8prWnP7KBGuKItc0GAk8lMLMDzdLKlWtw== +X-Received: by 2002:a1c:7306:: with SMTP id d6mr2864027wmb.62.1570019311374; + Wed, 02 Oct 2019 05:28:31 -0700 (PDT) +Received: from localhost (p2E5BE2CE.dip0.t-ipconnect.de. [46.91.226.206]) + by smtp.gmail.com with ESMTPSA id + 90sm3179450wrr.1.2019.10.02.05.28.30 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Wed, 02 Oct 2019 05:28:30 -0700 (PDT) +From: Thierry Reding +To: Linus Walleij , + Bartosz Golaszewski +Cc: Timo Alho , linux-gpio@vger.kernel.org, + linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org +Subject: [PATCH 3/3] gpio: max77620: Fix interrupt handling +Date: Wed, 2 Oct 2019 14:28:25 +0200 +Message-Id: <20191002122825.3948322-3-thierry.reding@gmail.com> +X-Mailer: git-send-email 2.23.0 +In-Reply-To: <20191002122825.3948322-1-thierry.reding@gmail.com> +References: <20191002122825.3948322-1-thierry.reding@gmail.com> +MIME-Version: 1.0 +Sender: linux-gpio-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-gpio@vger.kernel.org + +From: Timo Alho + +The interrupt-related register fields on the MAX77620 GPIO controller +share registers with GPIO related fields. If the IRQ chip is implemented +with regmap-irq, this causes the IRQ controller code to overwrite fields +previously configured by the GPIO controller code. + +Two examples where this causes problems are the NVIDIA Jetson TX1 and +Jetson TX2 boards, where some of the GPIOs are used to enable vital +power regulators. The MAX77620 GPIO controller also provides the USB OTG +ID pin. If configured as an interrupt, this causes some of the +regulators to be powered off. + +Signed-off-by: Timo Alho +Signed-off-by: Thierry Reding +--- + drivers/gpio/gpio-max77620.c | 231 ++++++++++++++++++----------------- + 1 file changed, 117 insertions(+), 114 deletions(-) + +diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c +index c58b56e5291e..c5b64a4ac172 100644 +--- a/drivers/gpio/gpio-max77620.c ++++ b/drivers/gpio/gpio-max77620.c +@@ -18,109 +18,115 @@ struct max77620_gpio { + struct gpio_chip gpio_chip; + struct regmap *rmap; + struct device *dev; ++ struct mutex buslock; /* irq_bus_lock */ ++ unsigned int irq_type[8]; ++ bool irq_enabled[8]; + }; + +-static const struct regmap_irq max77620_gpio_irqs[] = { +- [0] = { +- .reg_offset = 0, +- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE0, +- .type = { +- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, +- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, +- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, +- .type_reg_offset = 0, +- .types_supported = IRQ_TYPE_EDGE_BOTH, +- }, +- }, +- [1] = { +- .reg_offset = 0, +- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE1, +- .type = { +- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, +- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, +- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, +- .type_reg_offset = 1, +- .types_supported = IRQ_TYPE_EDGE_BOTH, +- }, +- }, +- [2] = { +- .reg_offset = 0, +- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE2, +- .type = { +- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, +- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, +- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, +- .type_reg_offset = 2, +- .types_supported = IRQ_TYPE_EDGE_BOTH, +- }, +- }, +- [3] = { +- .reg_offset = 0, +- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE3, +- .type = { +- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, +- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, +- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, +- .type_reg_offset = 3, +- .types_supported = IRQ_TYPE_EDGE_BOTH, +- }, +- }, +- [4] = { +- .reg_offset = 0, +- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE4, +- .type = { +- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, +- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, +- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, +- .type_reg_offset = 4, +- .types_supported = IRQ_TYPE_EDGE_BOTH, +- }, +- }, +- [5] = { +- .reg_offset = 0, +- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE5, +- .type = { +- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, +- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, +- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, +- .type_reg_offset = 5, +- .types_supported = IRQ_TYPE_EDGE_BOTH, +- }, +- }, +- [6] = { +- .reg_offset = 0, +- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE6, +- .type = { +- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, +- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, +- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, +- .type_reg_offset = 6, +- .types_supported = IRQ_TYPE_EDGE_BOTH, +- }, +- }, +- [7] = { +- .reg_offset = 0, +- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE7, +- .type = { +- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, +- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, +- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, +- .type_reg_offset = 7, +- .types_supported = IRQ_TYPE_EDGE_BOTH, +- }, +- }, +-}; ++static irqreturn_t max77620_gpio_irqhandler(int irq, void *data) ++{ ++ struct max77620_gpio *gpio = data; ++ unsigned int value, offset; ++ unsigned long pending; ++ int err; ++ ++ err = regmap_read(gpio->rmap, MAX77620_REG_IRQ_LVL2_GPIO, &value); ++ if (err < 0) { ++ dev_err(gpio->dev, "REG_IRQ_LVL2_GPIO read failed: %d\n", err); ++ return IRQ_NONE; ++ } ++ ++ pending = value; ++ ++ for_each_set_bit(offset, &pending, 8) { ++ unsigned int virq; ++ ++ virq = irq_find_mapping(gpio->gpio_chip.irq.domain, offset); ++ handle_nested_irq(virq); ++ } ++ ++ return IRQ_HANDLED; ++} ++ ++static void max77620_gpio_irq_mask(struct irq_data *data) ++{ ++ struct gpio_chip *chip = irq_data_get_irq_chip_data(data); ++ struct max77620_gpio *gpio = gpiochip_get_data(chip); ++ ++ gpio->irq_enabled[data->hwirq] = false; ++} + +-static const struct regmap_irq_chip max77620_gpio_irq_chip = { +- .name = "max77620-gpio", +- .irqs = max77620_gpio_irqs, +- .num_irqs = ARRAY_SIZE(max77620_gpio_irqs), +- .num_regs = 1, +- .num_type_reg = 8, +- .irq_reg_stride = 1, +- .type_reg_stride = 1, +- .status_base = MAX77620_REG_IRQ_LVL2_GPIO, +- .type_base = MAX77620_REG_GPIO0, ++static void max77620_gpio_irq_unmask(struct irq_data *data) ++{ ++ struct gpio_chip *chip = irq_data_get_irq_chip_data(data); ++ struct max77620_gpio *gpio = gpiochip_get_data(chip); ++ ++ gpio->irq_enabled[data->hwirq] = true; ++} ++ ++static int max77620_gpio_set_irq_type(struct irq_data *data, unsigned int type) ++{ ++ struct gpio_chip *chip = irq_data_get_irq_chip_data(data); ++ struct max77620_gpio *gpio = gpiochip_get_data(chip); ++ unsigned int irq_type; ++ ++ switch (type) { ++ case IRQ_TYPE_EDGE_RISING: ++ irq_type = MAX77620_CNFG_GPIO_INT_RISING; ++ break; ++ ++ case IRQ_TYPE_EDGE_FALLING: ++ irq_type = MAX77620_CNFG_GPIO_INT_FALLING; ++ break; ++ ++ case IRQ_TYPE_EDGE_BOTH: ++ irq_type = MAX77620_CNFG_GPIO_INT_RISING | ++ MAX77620_CNFG_GPIO_INT_FALLING; ++ break; ++ ++ default: ++ return -EINVAL; ++ } ++ ++ gpio->irq_type[data->hwirq] = irq_type; ++ ++ return 0; ++} ++ ++static void max77620_gpio_bus_lock(struct irq_data *data) ++{ ++ struct gpio_chip *chip = irq_data_get_irq_chip_data(data); ++ struct max77620_gpio *gpio = gpiochip_get_data(chip); ++ ++ mutex_lock(&gpio->buslock); ++} ++ ++static void max77620_gpio_bus_sync_unlock(struct irq_data *data) ++{ ++ struct gpio_chip *chip = irq_data_get_irq_chip_data(data); ++ struct max77620_gpio *gpio = gpiochip_get_data(chip); ++ unsigned int value, offset = data->hwirq; ++ int err; ++ ++ value = gpio->irq_enabled[offset] ? gpio->irq_type[offset] : 0; ++ ++ err = regmap_update_bits(gpio->rmap, GPIO_REG_ADDR(offset), ++ MAX77620_CNFG_GPIO_INT_MASK, value); ++ if (err < 0) ++ dev_err(chip->parent, "failed to update interrupt mask: %d\n", ++ err); ++ ++ mutex_unlock(&gpio->buslock); ++} ++ ++static struct irq_chip max77620_gpio_irqchip = { ++ .name = "max77620-gpio", ++ .irq_mask = max77620_gpio_irq_mask, ++ .irq_unmask = max77620_gpio_irq_unmask, ++ .irq_set_type = max77620_gpio_set_irq_type, ++ .irq_bus_lock = max77620_gpio_bus_lock, ++ .irq_bus_sync_unlock = max77620_gpio_bus_sync_unlock, ++ .flags = IRQCHIP_MASK_ON_SUSPEND, + }; + + static int max77620_gpio_dir_input(struct gpio_chip *gc, unsigned int offset) +@@ -254,14 +260,6 @@ static int max77620_gpio_set_config(struct gpio_chip *gc, unsigned int offset, + return -ENOTSUPP; + } + +-static int max77620_gpio_to_irq(struct gpio_chip *gc, unsigned int offset) +-{ +- struct max77620_gpio *mgpio = gpiochip_get_data(gc); +- struct max77620_chip *chip = dev_get_drvdata(mgpio->dev->parent); +- +- return regmap_irq_get_virq(chip->gpio_irq_data, offset); +-} +- + static int max77620_gpio_probe(struct platform_device *pdev) + { + struct max77620_chip *chip = dev_get_drvdata(pdev->dev.parent); +@@ -287,7 +285,6 @@ static int max77620_gpio_probe(struct platform_device *pdev) + mgpio->gpio_chip.direction_output = max77620_gpio_dir_output; + mgpio->gpio_chip.set = max77620_gpio_set; + mgpio->gpio_chip.set_config = max77620_gpio_set_config; +- mgpio->gpio_chip.to_irq = max77620_gpio_to_irq; + mgpio->gpio_chip.ngpio = MAX77620_GPIO_NR; + mgpio->gpio_chip.can_sleep = 1; + mgpio->gpio_chip.base = -1; +@@ -303,15 +300,21 @@ static int max77620_gpio_probe(struct platform_device *pdev) + return ret; + } + +- ret = devm_regmap_add_irq_chip(&pdev->dev, chip->rmap, gpio_irq, +- IRQF_ONESHOT, 0, +- &max77620_gpio_irq_chip, +- &chip->gpio_irq_data); ++ mutex_init(&mgpio->buslock); ++ ++ gpiochip_irqchip_add_nested(&mgpio->gpio_chip, &max77620_gpio_irqchip, ++ 0, handle_edge_irq, IRQ_TYPE_NONE); ++ ++ ret = request_threaded_irq(gpio_irq, NULL, max77620_gpio_irqhandler, ++ IRQF_ONESHOT, "max77620-gpio", mgpio); + if (ret < 0) { +- dev_err(&pdev->dev, "Failed to add gpio irq_chip %d\n", ret); ++ dev_err(&pdev->dev, "failed to request IRQ: %d\n", ret); + return ret; + } + ++ gpiochip_set_nested_irqchip(&mgpio->gpio_chip, &max77620_gpio_irqchip, ++ gpio_irq); ++ + return 0; + } + diff --git a/kernel.spec b/kernel.spec index 0e08534ff..b66e7fb7e 100644 --- a/kernel.spec +++ b/kernel.spec @@ -563,6 +563,14 @@ Patch308: arm64-dts-rockchip-fix-Rockpro64-RK808-interrupt-line.patch Patch320: arm64-tegra-jetson-tx1-fixes.patch # https://www.spinics.net/lists/linux-tegra/msg43110.html Patch321: arm64-tegra-Jetson-TX2-Allow-bootloader-to-configure.patch +# https://patchwork.kernel.org/patch/11171225/ +Patch322: mfd-max77620-Do-not-allocate-IRQs-upfront.patch +# https://patchwork.ozlabs.org/patch/1170631/ +Patch323: gpio-max77620-Use-correct-unit-for-debounce-times.patch +# https://patchwork.freedesktop.org/series/66762/ +Patch324: drm-nouveau-Enable-GP10B-by-default.patch +# https://www.spinics.net/lists/linux-tegra/msg44216.html +Patch325: arm64-tegra186-enable-USB-on-Jetson-TX2.patch # QCom laptop bits # https://patchwork.kernel.org/patch/11133827/ @@ -1803,6 +1811,7 @@ fi %changelog * Sun Oct 6 2019 Peter Robinson - Fixes for RockPro64 +- Fixes for Jetson-TX series devices * Wed Oct 03 2019 Justin M. Forbes - Fix CVE-2019-17052 CVE-2019-17053 CVE-2019-17054 CVE-2019-17055 CVE-2019-17056 diff --git a/mfd-max77620-Do-not-allocate-IRQs-upfront.patch b/mfd-max77620-Do-not-allocate-IRQs-upfront.patch new file mode 100644 index 000000000..0b4820ad7 --- /dev/null +++ b/mfd-max77620-Do-not-allocate-IRQs-upfront.patch @@ -0,0 +1,183 @@ +From patchwork Wed Oct 2 14:43:18 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Thierry Reding +X-Patchwork-Id: 11171225 +Return-Path: + +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C771E1747 + for ; + Wed, 2 Oct 2019 14:45:14 +0000 (UTC) +Received: from bombadil.infradead.org (bombadil.infradead.org + [198.137.202.133]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) + (No client certificate requested) + by mail.kernel.org (Postfix) with ESMTPS id 9703B21D81 + for ; + Wed, 2 Oct 2019 14:45:14 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="LCP5OdWP"; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="ahoJ80fO" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9703B21D81 +Authentication-Results: mail.kernel.org; + dmarc=fail (p=none dis=none) header.from=gmail.com +Authentication-Results: mail.kernel.org; + spf=none + smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=lists.infradead.org; s=bombadil.20170209; h=Sender: + Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: + List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To + :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: + Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: + List-Owner; bh=csIWPoJz7RR9msf1imaCNOLXiDPcaRmxRKjOL8gMaXM=; b=LCP5OdWPpIBxJz + tSNffGBZI2pwLSarAvmqKIowLW5LghNe3CVQh7HM3sIR+IqrUtTSXi/0EEQAQORrYHSnR4zrDlubl + 8IIqIetbgOrEmYRpHQxWZV/Z0p5JTdvNVeOiR63CuFbjz/h9UXPWOiLZijU1eZfSN2UuEJWxzoWMF + CsXxW+3rZ3os8AAa9x0lt6gGLwAPEPrxP44q4AJTVp3q+cD7GTXHu0F2ZT2flxES+cFF2/cPg2GiM + yR5j7GNMDhdxFKjGp8qcDhfCKx/0jF0DofnC4JsVlN0R25HdwYHzdHhysk8ca7JxLIMJlgXsgM5aY + 4XUIEB/0CjoPtdbP+8yw==; +Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) + by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) + id 1iFfsO-0006Nf-SR; Wed, 02 Oct 2019 14:45:12 +0000 +Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) + by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) + id 1iFfqd-0003rK-EL + for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2019 14:43:47 +0000 +Received: by mail-wr1-x443.google.com with SMTP id w12so19991081wro.5 + for ; + Wed, 02 Oct 2019 07:43:21 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id:mime-version + :content-transfer-encoding; + bh=y9l/1MkRoZLCyZNPXaR5fzwvTbuyIzYA20JLtWuhYR4=; + b=ahoJ80fONPxwQPqvbuQRAba40syj0YJFK3SbqTxd0FOzhs1n3WTvNd/gHQ+2WK5WwB + 8joqipXveUGBgePR1RwHR0oQyDAumewRmSMStvhyCHPeo154CNqZfGQNlbNlRng2QJqd + 1/Sq8GNJ1DjcLifpHWbCC9LoK5U3UkvdIWHPFx0cqJ+ENvPHkYPr2FdpaZ8jxuJta3TT + dplkNk0AsL/tc33KBJbKUSlnYppX878WQXUvnhdB+TRmr5R3dtc5Ewc0TH4h7V1SXTly + GiNnbbCc+BKzzqk9PTo/Pqf5dzWcpNDBA1GUkzQZDTXOXXUzBjnlrTaQctjSdE6meWfJ + JbDw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version + :content-transfer-encoding; + bh=y9l/1MkRoZLCyZNPXaR5fzwvTbuyIzYA20JLtWuhYR4=; + b=m4CouDn44ioMScPU+9h/V5vlxCAt0m4CSZKRu3pcsThkHE6u1TeKieaoBr1mh1qnIv + YS+V9Cd7osJa8R8USg+SJkEaSSarOn4kUq2MPTgMMmvKb63SSCCs0QD44nwEBAjIgMd/ + /akFUOMTGQBnN7P8Iq3KWI00bVJLeoVWmqtQPkLFI1cIRrkCKTF4jh6b+i6xsiT8t2rd + l6WPsWnKkqUmPAqzpmLJ9bmSsiGBBFUexUJDcQnskkx6tTBzFhyNtpsbq6VdcY2mS3LR + rgGbisZRFdLvdZfGhmPX1hRgDoiHQLuWNAv49LtJtR7/CjNFmsKr4MBg1ydz0uO01Axr + zoIQ== +X-Gm-Message-State: APjAAAXPZ9a+CEGZKeL6T+FXZoBRFrxryg3xujpPFnNpjznB8ehsaTI0 + P6wL6cWqK9IRnS17Y/YRAb4= +X-Google-Smtp-Source: + APXvYqyETp8FIXhzzDrv+mhfzHhU0D9h3bcpLQ9oRbkEYPG7JvxLk5RVWx/ooYmku2+exI6oXsHTnA== +X-Received: by 2002:a5d:4dd0:: with SMTP id f16mr2905889wru.85.1570027400467; + Wed, 02 Oct 2019 07:43:20 -0700 (PDT) +Received: from localhost (p2E5BE2CE.dip0.t-ipconnect.de. [46.91.226.206]) + by smtp.gmail.com with ESMTPSA id z125sm10251381wme.37.2019.10.02.07.43.19 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Wed, 02 Oct 2019 07:43:19 -0700 (PDT) +From: Thierry Reding +To: Lee Jones +Subject: [PATCH] mfd: max77620: Do not allocate IRQs upfront +Date: Wed, 2 Oct 2019 16:43:18 +0200 +Message-Id: <20191002144318.140365-1-thierry.reding@gmail.com> +X-Mailer: git-send-email 2.23.0 +MIME-Version: 1.0 +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20191002_074330_018855_CC323A91 +X-CRM114-Status: GOOD ( 11.81 ) +X-Spam-Score: -0.2 (/) +X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: + Content analysis details: (-0.2 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, + no trust [2a00:1450:4864:20:0:0:0:443 listed in] + [list.dnswl.org] + -0.0 SPF_PASS SPF: sender matches SPF record + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider (thierry.reding[at]gmail.com) + -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from + envelope-from domain + 0.1 DKIM_SIGNED Message has a DKIM or DK signature, + not necessarily + valid + -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from + author's domain + -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature +X-BeenThere: linux-arm-kernel@lists.infradead.org +X-Mailman-Version: 2.1.29 +Precedence: list +List-Id: +List-Unsubscribe: + , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: + , + +Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org +Content-Type: text/plain; charset="us-ascii" +Sender: "linux-arm-kernel" +Errors-To: + linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org + +From: Thierry Reding + +regmap_add_irq_chip() will try to allocate all of the IRQ descriptors +upfront if passed a non-zero irq_base parameter. However, the intention +is to allocate IRQ descriptors on an as-needed basis if possible. Pass 0 +instead of -1 to fix that use-case. + +Signed-off-by: Thierry Reding +--- + drivers/mfd/max77620.c | 5 ++--- + include/linux/mfd/max77620.h | 1 - + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c +index a851ff473a44..c7ed5c353553 100644 +--- a/drivers/mfd/max77620.c ++++ b/drivers/mfd/max77620.c +@@ -507,7 +507,6 @@ static int max77620_probe(struct i2c_client *client, + + i2c_set_clientdata(client, chip); + chip->dev = &client->dev; +- chip->irq_base = -1; + chip->chip_irq = client->irq; + chip->chip_id = (enum max77620_chip_id)id->driver_data; + +@@ -545,8 +544,8 @@ static int max77620_probe(struct i2c_client *client, + + max77620_top_irq_chip.irq_drv_data = chip; + ret = devm_regmap_add_irq_chip(chip->dev, chip->rmap, client->irq, +- IRQF_ONESHOT | IRQF_SHARED, +- chip->irq_base, &max77620_top_irq_chip, ++ IRQF_ONESHOT | IRQF_SHARED, 0, ++ &max77620_top_irq_chip, + &chip->top_irq_data); + if (ret < 0) { + dev_err(chip->dev, "Failed to add regmap irq: %d\n", ret); +diff --git a/include/linux/mfd/max77620.h b/include/linux/mfd/max77620.h +index 12ba157cb83f..f552ef5b1100 100644 +--- a/include/linux/mfd/max77620.h ++++ b/include/linux/mfd/max77620.h +@@ -329,7 +329,6 @@ struct max77620_chip { + struct regmap *rmap; + + int chip_irq; +- int irq_base; + + /* chip id */ + enum max77620_chip_id chip_id; From 1ab25b7c739834928672ca65f5a4d389ccfcc294 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 6 Oct 2019 14:57:27 +0100 Subject: [PATCH 014/178] fix weekday for Oct 3rd --- kernel.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel.spec b/kernel.spec index b66e7fb7e..d2a52bc6a 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1813,7 +1813,7 @@ fi - Fixes for RockPro64 - Fixes for Jetson-TX series devices -* Wed Oct 03 2019 Justin M. Forbes +* Thu Oct 03 2019 Justin M. Forbes - Fix CVE-2019-17052 CVE-2019-17053 CVE-2019-17054 CVE-2019-17055 CVE-2019-17056 (rhbz 1758239 1758240 1758242 1758243 1758245 1758246 1758248 1758249 1758256 1758257) From 988883b98d6c33bea915f0062f81edec0bc7526a Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Mon, 7 Oct 2019 07:40:43 +0100 Subject: [PATCH 015/178] v5.3.4 --- ...CI-device-IDs-for-family-17h-model-7.patch | 92 ------------------- ...POWER_LIMIT-command-to-FW-version-36.patch | 87 ------------------ kernel.spec | 15 +-- sources | 2 +- 4 files changed, 5 insertions(+), 191 deletions(-) delete mode 100644 0001-x86-amd_nb-Add-PCI-device-IDs-for-family-17h-model-7.patch delete mode 100644 iwlwifi-fw-don-t-send-GEO_TX_POWER_LIMIT-command-to-FW-version-36.patch diff --git a/0001-x86-amd_nb-Add-PCI-device-IDs-for-family-17h-model-7.patch b/0001-x86-amd_nb-Add-PCI-device-IDs-for-family-17h-model-7.patch deleted file mode 100644 index 327789e50..000000000 --- a/0001-x86-amd_nb-Add-PCI-device-IDs-for-family-17h-model-7.patch +++ /dev/null @@ -1,92 +0,0 @@ -From af4e1c5eca95bed1192d8dc45c8ed63aea2209e8 Mon Sep 17 00:00:00 2001 -From: Marcel Bocu -Date: Mon, 22 Jul 2019 20:45:10 +0300 -Subject: [PATCH] x86/amd_nb: Add PCI device IDs for family 17h, model 70h - -The AMD Ryzen gen 3 processors came with a different PCI IDs for the -function 3 & 4 which are used to access the SMN interface. The root -PCI address however remained at the same address as the model 30h. - -Adding the F3/F4 PCI IDs respectively to the misc and link ids appear -to be sufficient for k10temp, so let's add them and follow up on the -patch if other functions need more tweaking. - -Vicki Pfau sent an identical patch after I checked that no-one had -written this patch. I would have been happy about dropping my patch but -unlike for his patch series, I had already Cc:ed the x86 people and -they already reviewed the changes. Since Vicki has not answered to -any email after his initial series, let's assume she is on vacation -and let's avoid duplication of reviews from the maintainers and merge -my series. To acknowledge Vicki's anteriority, I added her S-o-b to -the patch. - -v2, suggested by Guenter Roeck and Brian Woods: - - rename from 71h to 70h - -Signed-off-by: Vicki Pfau -Signed-off-by: Marcel Bocu -Tested-by: Marcel Bocu -Acked-by: Thomas Gleixner -Acked-by: Brian Woods -Acked-by: Bjorn Helgaas # pci_ids.h - -Cc: Thomas Gleixner -Cc: Ingo Molnar -Cc: Borislav Petkov -Cc: "H. Peter Anvin" -Cc: x86@kernel.org -Cc: "Woods, Brian" -Cc: Clemens Ladisch -Cc: Jean Delvare -Cc: Guenter Roeck -Cc: linux-hwmon@vger.kernel.org -Link: https://lore.kernel.org/r/20190722174510.2179-1-marcel.p.bocu@gmail.com -Signed-off-by: Guenter Roeck ---- - arch/x86/kernel/amd_nb.c | 3 +++ - include/linux/pci_ids.h | 1 + - 2 files changed, 4 insertions(+) - -diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c -index d63e63b7d1d9..251c795b4eb3 100644 ---- a/arch/x86/kernel/amd_nb.c -+++ b/arch/x86/kernel/amd_nb.c -@@ -21,6 +21,7 @@ - #define PCI_DEVICE_ID_AMD_17H_DF_F4 0x1464 - #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F4 0x15ec - #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F4 0x1494 -+#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F4 0x1444 - - /* Protect the PCI config register pairs used for SMN and DF indirect access. */ - static DEFINE_MUTEX(smn_mutex); -@@ -50,6 +51,7 @@ const struct pci_device_id amd_nb_misc_ids[] = { - { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F3) }, - { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F3) }, - { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) }, -+ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) }, - {} - }; - EXPORT_SYMBOL_GPL(amd_nb_misc_ids); -@@ -63,6 +65,7 @@ static const struct pci_device_id amd_nb_link_ids[] = { - { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_DF_F4) }, - { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F4) }, - { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F4) }, -+ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F4) }, - { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) }, - {} - }; -diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h -index c842735a4f45..4b97f427cc92 100644 ---- a/include/linux/pci_ids.h -+++ b/include/linux/pci_ids.h -@@ -548,6 +548,7 @@ - #define PCI_DEVICE_ID_AMD_17H_DF_F3 0x1463 - #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F3 0x15eb - #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F3 0x1493 -+#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F3 0x1443 - #define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703 - #define PCI_DEVICE_ID_AMD_LANCE 0x2000 - #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 --- -2.21.0 - diff --git a/iwlwifi-fw-don-t-send-GEO_TX_POWER_LIMIT-command-to-FW-version-36.patch b/iwlwifi-fw-don-t-send-GEO_TX_POWER_LIMIT-command-to-FW-version-36.patch deleted file mode 100644 index f583a5b2d..000000000 --- a/iwlwifi-fw-don-t-send-GEO_TX_POWER_LIMIT-command-to-FW-version-36.patch +++ /dev/null @@ -1,87 +0,0 @@ -From patchwork Tue Sep 24 10:30:57 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Luca Coelho -X-Patchwork-Id: 11158395 -X-Patchwork-Delegate: kvalo@adurom.com -Return-Path: -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62FF3112B - for ; - Tue, 24 Sep 2019 10:31:06 +0000 (UTC) -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by mail.kernel.org (Postfix) with ESMTP id 4AA4E214D9 - for ; - Tue, 24 Sep 2019 10:31:06 +0000 (UTC) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S2409468AbfIXKbF (ORCPT - ); - Tue, 24 Sep 2019 06:31:05 -0400 -Received: from paleale.coelho.fi ([176.9.41.70]:44742 "EHLO - farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org - with ESMTP id S2387644AbfIXKbF (ORCPT - ); - Tue, 24 Sep 2019 06:31:05 -0400 -Received: from [91.156.6.193] (helo=redipa.ger.corp.intel.com) - by farmhouse.coelho.fi with esmtpsa - (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) - (Exim 4.92) - (envelope-from ) - id 1iCi63-0005Je-8E; Tue, 24 Sep 2019 13:31:03 +0300 -From: Luca Coelho -To: kvalo@codeaurora.org -Cc: linux-wireless@vger.kernel.org -Date: Tue, 24 Sep 2019 13:30:57 +0300 -Message-Id: <20190924103057.17147-1-luca@coelho.fi> -X-Mailer: git-send-email 2.23.0 -MIME-Version: 1.0 -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on farmhouse.coelho.fi -X-Spam-Level: -X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, - URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 -Subject: [PATCH v5.4] iwlwifi: fw: don't send GEO_TX_POWER_LIMIT command to FW - version 36 -Sender: linux-wireless-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: linux-wireless@vger.kernel.org - -From: Luca Coelho - -The intention was to have the GEO_TX_POWER_LIMIT command in FW version -36 as well, but not all 8000 family got this feature enabled. The -8000 family is the only one using version 36, so skip this version -entirely. If we try to send this command to the firmwares that do not -support it, we get a BAD_COMMAND response from the firmware. - -This fixes https://bugzilla.kernel.org/show_bug.cgi?id=204151. - -Cc: stable@vger.kernel.org # 4.19+ -Signed-off-by: Luca Coelho ---- - drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c -index 014eca6596e2..32a5e4e5461f 100644 ---- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c -+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c -@@ -889,11 +889,13 @@ static bool iwl_mvm_sar_geo_support(struct iwl_mvm *mvm) - * firmware versions. Unfortunately, we don't have a TLV API - * flag to rely on, so rely on the major version which is in - * the first byte of ucode_ver. This was implemented -- * initially on version 38 and then backported to 36, 29 and -- * 17. -+ * initially on version 38 and then backported to29 and 17. -+ * The intention was to have it in 36 as well, but not all -+ * 8000 family got this feature enabled. The 8000 family is -+ * the only one using version 36, so skip this version -+ * entirely. - */ - return IWL_UCODE_SERIAL(mvm->fw->ucode_ver) >= 38 || -- IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 36 || - IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 29 || - IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 17; - } diff --git a/kernel.spec b/kernel.spec index d2a52bc6a..521bd57d1 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 2 +%define stable_update 4 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -594,20 +594,10 @@ Patch503: KEYS-Make-use-of-platform-keyring-for-module-signature.patch # rhbz 1753099 Patch504: dwc3-fix.patch -# https://patchwork.kernel.org/patch/11158395/ -Patch505: iwlwifi-fw-don-t-send-GEO_TX_POWER_LIMIT-command-to-FW-version-36.patch - -# new ids -Patch506: 0001-x86-amd_nb-Add-PCI-device-IDs-for-family-17h-model-7.patch - # rhbz 1752961 Patch507: v2-1-2-efi-tpm-Don-t-access-event--count-when-it-isn-t-mapped..patch Patch508: v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-parsing.patch -# CVE-2019-17052 CVE-2019-17053 CVE-2019-17054 CVE-2019-17055 CVE-2019-17056 -# rhbz 1758239 1758240 1758242 1758243 1758245 1758246 1758248 1758249 1758256 1758257 -Patch509: enforce-CAP_NET_RAW-for-raw-sockets.patch - # END OF PATCH DEFINITIONS %endif @@ -1809,6 +1799,9 @@ fi # # %changelog +* Mon Oct 7 2019 Peter Robinson 5.3.4-300 +- Linux v5.3.4 + * Sun Oct 6 2019 Peter Robinson - Fixes for RockPro64 - Fixes for Jetson-TX series devices diff --git a/sources b/sources index 6e4650fea..f9f7d3aea 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.2.xz) = 3528b4355ebbf1a1cbc4ac7efd7cdd5b5dddb28c30e182e8c0f3119c61a97d6bc1fb07ec8f2cf0a78067b098c27535bc006485428c76d6c8fb653f215218dff3 +SHA512 (patch-5.3.4.xz) = 63f774e8a4dbc6376cab702e2813c5e7703aaa300d942447f1bb27bb749375179ac969e21a1983314eb33e0109206ad298be503f7fc6f168c85008cf63788002 From 04b2e9ec7b4a72b53e443efa48b4b7eeeb13c01b Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Mon, 7 Oct 2019 08:30:33 +0100 Subject: [PATCH 016/178] arm64: drop tegra nouveau for now, causes issues elsewhere --- drm-nouveau-Enable-GP10B-by-default.patch | 1275 --------------------- kernel.spec | 2 - 2 files changed, 1277 deletions(-) delete mode 100644 drm-nouveau-Enable-GP10B-by-default.patch diff --git a/drm-nouveau-Enable-GP10B-by-default.patch b/drm-nouveau-Enable-GP10B-by-default.patch deleted file mode 100644 index e44a5b339..000000000 --- a/drm-nouveau-Enable-GP10B-by-default.patch +++ /dev/null @@ -1,1275 +0,0 @@ -From patchwork Mon Sep 16 15:04:02 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [01/11] drm/nouveau: tegra: Avoid pulsing reset twice -From: Thierry Reding -X-Patchwork-Id: 331044 -Message-Id: <20190916150412.10025-2-thierry.reding@gmail.com> -To: Ben Skeggs , Thierry Reding -Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, - dri-devel@lists.freedesktop.org -Date: Mon, 16 Sep 2019 17:04:02 +0200 - -From: Thierry Reding - -When the GPU powergate is controlled by a generic power domain provider, -the reset will automatically be asserted and deasserted as part of the -power-ungating procedure. - -On some Jetson TX2 boards, doing an additional assert and deassert of -the GPU outside of the power-ungate procedure can cause the GPU to go -into a bad state where the memory interface can no longer access system -memory. - -Signed-off-by: Thierry Reding ---- - drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c -index 0e372a190d3f..747a775121cf 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c -+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c -@@ -52,18 +52,18 @@ nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev) - clk_set_rate(tdev->clk_pwr, 204000000); - udelay(10); - -- reset_control_assert(tdev->rst); -- udelay(10); -- - if (!tdev->pdev->dev.pm_domain) { -+ reset_control_assert(tdev->rst); -+ udelay(10); -+ - ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D); - if (ret) - goto err_clamp; - udelay(10); -- } - -- reset_control_deassert(tdev->rst); -- udelay(10); -+ reset_control_deassert(tdev->rst); -+ udelay(10); -+ } - - return 0; - - -From patchwork Mon Sep 16 15:04:03 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [02/11] drm/nouveau: tegra: Set clock rate if not set -From: Thierry Reding -X-Patchwork-Id: 331046 -Message-Id: <20190916150412.10025-3-thierry.reding@gmail.com> -To: Ben Skeggs , Thierry Reding -Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, - dri-devel@lists.freedesktop.org -Date: Mon, 16 Sep 2019 17:04:03 +0200 - -From: Thierry Reding - -If the GPU clock has not had a rate set, initialize it to the maximum -clock rate to make sure it does run. - -Signed-off-by: Thierry Reding ---- - drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c -index 747a775121cf..d0d52c1d4aee 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c -+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c -@@ -279,6 +279,7 @@ nvkm_device_tegra_new(const struct nvkm_device_tegra_func *func, - struct nvkm_device **pdevice) - { - struct nvkm_device_tegra *tdev; -+ unsigned long rate; - int ret; - - if (!(tdev = kzalloc(sizeof(*tdev), GFP_KERNEL))) -@@ -307,6 +308,17 @@ nvkm_device_tegra_new(const struct nvkm_device_tegra_func *func, - goto free; - } - -+ rate = clk_get_rate(tdev->clk); -+ if (rate == 0) { -+ ret = clk_set_rate(tdev->clk, ULONG_MAX); -+ if (ret < 0) -+ goto free; -+ -+ rate = clk_get_rate(tdev->clk); -+ -+ dev_dbg(&pdev->dev, "GPU clock set to %lu\n", rate); -+ } -+ - if (func->require_ref_clk) - tdev->clk_ref = devm_clk_get(&pdev->dev, "ref"); - if (IS_ERR(tdev->clk_ref)) { - -From patchwork Mon Sep 16 15:04:04 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [03/11] drm/nouveau: secboot: Read WPR configuration from GPU - registers -From: Thierry Reding -X-Patchwork-Id: 331048 -Message-Id: <20190916150412.10025-4-thierry.reding@gmail.com> -To: Ben Skeggs , Thierry Reding -Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, - dri-devel@lists.freedesktop.org -Date: Mon, 16 Sep 2019 17:04:04 +0200 - -From: Thierry Reding - -The GPUs found on Tegra SoCs have registers that can be used to read the -WPR configuration. Use these registers instead of reaching into the -memory controller's register space to read the same information. - -Signed-off-by: Thierry Reding ---- - .../drm/nouveau/nvkm/subdev/secboot/gm200.h | 2 +- - .../drm/nouveau/nvkm/subdev/secboot/gm20b.c | 81 ++++++++++++------- - .../drm/nouveau/nvkm/subdev/secboot/gp10b.c | 4 +- - 3 files changed, 53 insertions(+), 34 deletions(-) - -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.h b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.h -index 62c5e162099a..280b1448df88 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.h -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.h -@@ -41,6 +41,6 @@ int gm200_secboot_run_blob(struct nvkm_secboot *, struct nvkm_gpuobj *, - struct nvkm_falcon *); - - /* Tegra-only */ --int gm20b_secboot_tegra_read_wpr(struct gm200_secboot *, u32); -+int gm20b_secboot_tegra_read_wpr(struct gm200_secboot *); - - #endif -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c -index df8b919dcf09..f8a543122219 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c -@@ -23,39 +23,65 @@ - #include "acr.h" - #include "gm200.h" - --#define TEGRA210_MC_BASE 0x70019000 -- - #ifdef CONFIG_ARCH_TEGRA --#define MC_SECURITY_CARVEOUT2_CFG0 0xc58 --#define MC_SECURITY_CARVEOUT2_BOM_0 0xc5c --#define MC_SECURITY_CARVEOUT2_BOM_HI_0 0xc60 --#define MC_SECURITY_CARVEOUT2_SIZE_128K 0xc64 --#define TEGRA_MC_SECURITY_CARVEOUT_CFG_LOCKED (1 << 1) - /** - * gm20b_secboot_tegra_read_wpr() - read the WPR registers on Tegra - * -- * On dGPU, we can manage the WPR region ourselves, but on Tegra the WPR region -- * is reserved from system memory by the bootloader and irreversibly locked. -- * This function reads the address and size of the pre-configured WPR region. -+ * On dGPU, we can manage the WPR region ourselves, but on Tegra this region -+ * is allocated from system memory by the secure firmware. The region is then -+ * marked as a "secure carveout" and irreversibly locked. Furthermore, the WPR -+ * secure carveout is also configured to be sent to the GPU via a dedicated -+ * serial bus between the memory controller and the GPU. The GPU requests this -+ * information upon leaving reset and exposes it through a FIFO register at -+ * offset 0x100cd4. -+ * -+ * The FIFO register's lower 4 bits can be used to set the read index into the -+ * FIFO. After each read of the FIFO register, the read index is incremented. -+ * -+ * Indices 2 and 3 contain the lower and upper addresses of the WPR. These are -+ * stored in units of 256 B. The WPR is inclusive of both addresses. -+ * -+ * Unfortunately, for some reason the WPR info register doesn't contain the -+ * correct values for the secure carveout. It seems like the upper address is -+ * always too small by 128 KiB - 1. Given that the secure carvout size in the -+ * memory controller configuration is specified in units of 128 KiB, it's -+ * possible that the computation of the upper address of the WPR is wrong and -+ * causes this difference. - */ - int --gm20b_secboot_tegra_read_wpr(struct gm200_secboot *gsb, u32 mc_base) -+gm20b_secboot_tegra_read_wpr(struct gm200_secboot *gsb) - { -+ struct nvkm_device *device = gsb->base.subdev.device; - struct nvkm_secboot *sb = &gsb->base; -- void __iomem *mc; -- u32 cfg; -+ u64 base, limit; -+ u32 value; - -- mc = ioremap(mc_base, 0xd00); -- if (!mc) { -- nvkm_error(&sb->subdev, "Cannot map Tegra MC registers\n"); -- return -ENOMEM; -- } -- sb->wpr_addr = ioread32_native(mc + MC_SECURITY_CARVEOUT2_BOM_0) | -- ((u64)ioread32_native(mc + MC_SECURITY_CARVEOUT2_BOM_HI_0) << 32); -- sb->wpr_size = ioread32_native(mc + MC_SECURITY_CARVEOUT2_SIZE_128K) -- << 17; -- cfg = ioread32_native(mc + MC_SECURITY_CARVEOUT2_CFG0); -- iounmap(mc); -+ /* set WPR info register to point at WPR base address register */ -+ value = nvkm_rd32(device, 0x100cd4); -+ value &= ~0xf; -+ value |= 0x2; -+ nvkm_wr32(device, 0x100cd4, value); -+ -+ /* read base address */ -+ value = nvkm_rd32(device, 0x100cd4); -+ base = (u64)(value >> 4) << 12; -+ -+ /* read limit */ -+ value = nvkm_rd32(device, 0x100cd4); -+ limit = (u64)(value >> 4) << 12; -+ -+ /* -+ * The upper address of the WPR seems to be computed wrongly and is -+ * actually SZ_128K - 1 bytes lower than it should be. Adjust the -+ * value accordingly. -+ */ -+ limit += SZ_128K - 1; -+ -+ sb->wpr_size = limit - base + 1; -+ sb->wpr_addr = base; -+ -+ nvkm_info(&sb->subdev, "WPR: %016llx-%016llx\n", sb->wpr_addr, -+ sb->wpr_addr + sb->wpr_size - 1); - - /* Check that WPR settings are valid */ - if (sb->wpr_size == 0) { -@@ -63,11 +89,6 @@ gm20b_secboot_tegra_read_wpr(struct gm200_secboot *gsb, u32 mc_base) - return -EINVAL; - } - -- if (!(cfg & TEGRA_MC_SECURITY_CARVEOUT_CFG_LOCKED)) { -- nvkm_error(&sb->subdev, "WPR region not locked\n"); -- return -EINVAL; -- } -- - return 0; - } - #else -@@ -85,7 +106,7 @@ gm20b_secboot_oneinit(struct nvkm_secboot *sb) - struct gm200_secboot *gsb = gm200_secboot(sb); - int ret; - -- ret = gm20b_secboot_tegra_read_wpr(gsb, TEGRA210_MC_BASE); -+ ret = gm20b_secboot_tegra_read_wpr(gsb); - if (ret) - return ret; - -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp10b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp10b.c -index 28ca29d0eeee..d84e85825995 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp10b.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gp10b.c -@@ -23,15 +23,13 @@ - #include "acr.h" - #include "gm200.h" - --#define TEGRA186_MC_BASE 0x02c10000 -- - static int - gp10b_secboot_oneinit(struct nvkm_secboot *sb) - { - struct gm200_secboot *gsb = gm200_secboot(sb); - int ret; - -- ret = gm20b_secboot_tegra_read_wpr(gsb, TEGRA186_MC_BASE); -+ ret = gm20b_secboot_tegra_read_wpr(gsb); - if (ret) - return ret; - - -From patchwork Mon Sep 16 15:04:05 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [04/11] drm/nouveau: gp10b: Add custom L2 cache implementation -From: Thierry Reding -X-Patchwork-Id: 331049 -Message-Id: <20190916150412.10025-5-thierry.reding@gmail.com> -To: Ben Skeggs , Thierry Reding -Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, - dri-devel@lists.freedesktop.org -Date: Mon, 16 Sep 2019 17:04:05 +0200 - -From: Thierry Reding - -There are extra registers that need to be programmed to make the level 2 -cache work on GP10B, such as the stream ID register that is used when an -SMMU is used to translate memory addresses. - -Signed-off-by: Thierry Reding ---- - .../gpu/drm/nouveau/include/nvkm/subdev/ltc.h | 1 + - .../gpu/drm/nouveau/nvkm/engine/device/base.c | 2 +- - .../gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild | 1 + - .../gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c | 69 +++++++++++++++++++ - .../gpu/drm/nouveau/nvkm/subdev/ltc/priv.h | 2 + - 5 files changed, 74 insertions(+), 1 deletion(-) - create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c - -diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h -index 644d527c3b96..d76f60d7d29a 100644 ---- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h -+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h -@@ -40,4 +40,5 @@ int gm107_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **); - int gm200_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **); - int gp100_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **); - int gp102_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **); -+int gp10b_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **); - #endif -diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c -index c3c7159f3411..d2d6d5f4028a 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c -+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c -@@ -2380,7 +2380,7 @@ nv13b_chipset = { - .fuse = gm107_fuse_new, - .ibus = gp10b_ibus_new, - .imem = gk20a_instmem_new, -- .ltc = gp102_ltc_new, -+ .ltc = gp10b_ltc_new, - .mc = gp10b_mc_new, - .mmu = gp10b_mmu_new, - .secboot = gp10b_secboot_new, -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild -index 2b6d36ea7067..728d75010847 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild -@@ -6,3 +6,4 @@ nvkm-y += nvkm/subdev/ltc/gm107.o - nvkm-y += nvkm/subdev/ltc/gm200.o - nvkm-y += nvkm/subdev/ltc/gp100.o - nvkm-y += nvkm/subdev/ltc/gp102.o -+nvkm-y += nvkm/subdev/ltc/gp10b.o -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c -new file mode 100644 -index 000000000000..4d27c6ea1552 ---- /dev/null -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c -@@ -0,0 +1,69 @@ -+/* -+ * Copyright (c) 2019 NVIDIA Corporation. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Thierry Reding -+ */ -+ -+#include "priv.h" -+ -+static void -+gp10b_ltc_init(struct nvkm_ltc *ltc) -+{ -+ struct nvkm_device *device = ltc->subdev.device; -+#ifdef CONFIG_IOMMU_API -+ struct iommu_fwspec *spec; -+#endif -+ -+ nvkm_wr32(device, 0x17e27c, ltc->ltc_nr); -+ nvkm_wr32(device, 0x17e000, ltc->ltc_nr); -+ nvkm_wr32(device, 0x100800, ltc->ltc_nr); -+ -+#ifdef CONFIG_IOMMU_API -+ spec = dev_iommu_fwspec_get(device->dev); -+ if (spec) { -+ u32 sid = spec->ids[0] & 0xffff; -+ -+ /* stream ID */ -+ nvkm_wr32(device, 0x160000, sid << 2); -+ } -+#endif -+} -+ -+static const struct nvkm_ltc_func -+gp10b_ltc = { -+ .oneinit = gp100_ltc_oneinit, -+ .init = gp10b_ltc_init, -+ .intr = gp100_ltc_intr, -+ .cbc_clear = gm107_ltc_cbc_clear, -+ .cbc_wait = gm107_ltc_cbc_wait, -+ .zbc = 16, -+ .zbc_clear_color = gm107_ltc_zbc_clear_color, -+ .zbc_clear_depth = gm107_ltc_zbc_clear_depth, -+ .zbc_clear_stencil = gp102_ltc_zbc_clear_stencil, -+ .invalidate = gf100_ltc_invalidate, -+ .flush = gf100_ltc_flush, -+}; -+ -+int -+gp10b_ltc_new(struct nvkm_device *device, int index, struct nvkm_ltc **pltc) -+{ -+ return nvkm_ltc_new_(&gp10b_ltc, device, index, pltc); -+} -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h -index 2fcf18e46ce3..eca5a711b1b8 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h -@@ -46,4 +46,6 @@ void gm107_ltc_zbc_clear_depth(struct nvkm_ltc *, int, const u32); - int gp100_ltc_oneinit(struct nvkm_ltc *); - void gp100_ltc_init(struct nvkm_ltc *); - void gp100_ltc_intr(struct nvkm_ltc *); -+ -+void gp102_ltc_zbc_clear_stencil(struct nvkm_ltc *, int, const u32); - #endif - -From patchwork Mon Sep 16 15:04:06 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [05/11] drm/nouveau: gp10b: Use correct copy engine -From: Thierry Reding -X-Patchwork-Id: 331052 -Message-Id: <20190916150412.10025-6-thierry.reding@gmail.com> -To: Ben Skeggs , Thierry Reding -Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, - dri-devel@lists.freedesktop.org -Date: Mon, 16 Sep 2019 17:04:06 +0200 - -From: Thierry Reding - -gp10b uses the new engine enumeration mechanism introduced in the Pascal -architecture. As a result, the copy engine, which used to be at index 2 -for prior Tegra GPU instantiations, has now moved to index 0. Fix up the -index and also use the gp100 variant of the copy engine class because on -gp10b the PASCAL_DMA_COPY_B class is not supported. - -Signed-off-by: Thierry Reding ---- - drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c -index d2d6d5f4028a..99d3fa3fad89 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c -+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c -@@ -2387,7 +2387,7 @@ nv13b_chipset = { - .pmu = gm20b_pmu_new, - .timer = gk20a_timer_new, - .top = gk104_top_new, -- .ce[2] = gp102_ce_new, -+ .ce[0] = gp100_ce_new, - .dma = gf119_dma_new, - .fifo = gp10b_fifo_new, - .gr = gp10b_gr_new, - -From patchwork Mon Sep 16 15:04:07 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [06/11] drm/nouveau: gk20a: Set IOMMU bit for DMA API if appropriate -From: Thierry Reding -X-Patchwork-Id: 331053 -Message-Id: <20190916150412.10025-7-thierry.reding@gmail.com> -To: Ben Skeggs , Thierry Reding -Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, - dri-devel@lists.freedesktop.org -Date: Mon, 16 Sep 2019 17:04:07 +0200 - -From: Thierry Reding - -Detect if the DMA API is backed by an IOMMU and set the IOMMU bit if so. -This is needed to make sure IOMMU addresses are properly translated even -the explicit IOMMU API is not used. - -Signed-off-by: Thierry Reding ---- - .../drm/nouveau/nvkm/subdev/instmem/gk20a.c | 35 +++++++++++++------ - 1 file changed, 25 insertions(+), 10 deletions(-) - -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c -index b0493f8df1fe..1120a2a7d5f1 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c -@@ -100,12 +100,14 @@ struct gk20a_instmem { - unsigned int vaddr_max; - struct list_head vaddr_lru; - -+ /* IOMMU mapping */ -+ unsigned int page_shift; -+ u64 iommu_mask; -+ - /* Only used if IOMMU if present */ - struct mutex *mm_mutex; - struct nvkm_mm *mm; - struct iommu_domain *domain; -- unsigned long iommu_pgshift; -- u16 iommu_bit; - - /* Only used by DMA API */ - unsigned long attrs; -@@ -357,12 +359,12 @@ gk20a_instobj_dtor_iommu(struct nvkm_memory *memory) - mutex_unlock(&imem->lock); - - /* clear IOMMU bit to unmap pages */ -- r->offset &= ~BIT(imem->iommu_bit - imem->iommu_pgshift); -+ r->offset &= ~imem->iommu_mask; - - /* Unmap pages from GPU address space and free them */ - for (i = 0; i < node->base.mn->length; i++) { - iommu_unmap(imem->domain, -- (r->offset + i) << imem->iommu_pgshift, PAGE_SIZE); -+ (r->offset + i) << imem->page_shift, PAGE_SIZE); - dma_unmap_page(dev, node->dma_addrs[i], PAGE_SIZE, - DMA_BIDIRECTIONAL); - __free_page(node->pages[i]); -@@ -440,7 +442,7 @@ gk20a_instobj_ctor_dma(struct gk20a_instmem *imem, u32 npages, u32 align, - - /* present memory for being mapped using small pages */ - node->r.type = 12; -- node->r.offset = node->handle >> 12; -+ node->r.offset = imem->iommu_mask | node->handle >> 12; - node->r.length = (npages << PAGE_SHIFT) >> 12; - - node->base.mn = &node->r; -@@ -493,7 +495,7 @@ gk20a_instobj_ctor_iommu(struct gk20a_instmem *imem, u32 npages, u32 align, - mutex_lock(imem->mm_mutex); - /* Reserve area from GPU address space */ - ret = nvkm_mm_head(imem->mm, 0, 1, npages, npages, -- align >> imem->iommu_pgshift, &r); -+ align >> imem->page_shift, &r); - mutex_unlock(imem->mm_mutex); - if (ret) { - nvkm_error(subdev, "IOMMU space is full!\n"); -@@ -502,7 +504,7 @@ gk20a_instobj_ctor_iommu(struct gk20a_instmem *imem, u32 npages, u32 align, - - /* Map into GPU address space */ - for (i = 0; i < npages; i++) { -- u32 offset = (r->offset + i) << imem->iommu_pgshift; -+ u32 offset = (r->offset + i) << imem->page_shift; - - ret = iommu_map(imem->domain, offset, node->dma_addrs[i], - PAGE_SIZE, IOMMU_READ | IOMMU_WRITE); -@@ -518,7 +520,7 @@ gk20a_instobj_ctor_iommu(struct gk20a_instmem *imem, u32 npages, u32 align, - } - - /* IOMMU bit tells that an address is to be resolved through the IOMMU */ -- r->offset |= BIT(imem->iommu_bit - imem->iommu_pgshift); -+ r->offset |= imem->iommu_mask; - - node->base.mn = r; - return 0; -@@ -619,11 +621,12 @@ gk20a_instmem_new(struct nvkm_device *device, int index, - imem->mm_mutex = &tdev->iommu.mutex; - imem->mm = &tdev->iommu.mm; - imem->domain = tdev->iommu.domain; -- imem->iommu_pgshift = tdev->iommu.pgshift; -- imem->iommu_bit = tdev->func->iommu_bit; -+ imem->page_shift = tdev->iommu.pgshift; - - nvkm_info(&imem->base.subdev, "using IOMMU\n"); - } else { -+ imem->page_shift = PAGE_SHIFT; -+ - imem->attrs = DMA_ATTR_NON_CONSISTENT | - DMA_ATTR_WEAK_ORDERING | - DMA_ATTR_WRITE_COMBINE; -@@ -631,5 +634,17 @@ gk20a_instmem_new(struct nvkm_device *device, int index, - nvkm_info(&imem->base.subdev, "using DMA API\n"); - } - -+ /* -+ * The IOMMU mask needs to be set if an IOMMU is used explicitly (via -+ * direct IOMMU API usage) or implicitly (via the DMA API). In both -+ * cases the device will have been attached to an IOMMU domain. -+ */ -+ if (iommu_get_domain_for_dev(device->dev)) { -+ imem->iommu_mask = BIT_ULL(tdev->func->iommu_bit - -+ imem->page_shift); -+ nvkm_debug(&imem->base.subdev, "IOMMU mask: %016llx\n", -+ imem->iommu_mask); -+ } -+ - return 0; - } - -From patchwork Mon Sep 16 15:04:08 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [07/11] drm/nouveau: gk20a: Implement custom MMU class -From: Thierry Reding -X-Patchwork-Id: 331057 -Message-Id: <20190916150412.10025-8-thierry.reding@gmail.com> -To: Ben Skeggs , Thierry Reding -Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, - dri-devel@lists.freedesktop.org -Date: Mon, 16 Sep 2019 17:04:08 +0200 - -From: Thierry Reding - -The GPU integrated in NVIDIA Tegra SoCs is connected to system memory -via two paths: one direct path to the memory controller and another path -that goes through a system MMU first. It's not typically necessary to go -through the system MMU because the GPU's MMU can already map buffers so -that they appear contiguous to the GPU. - -However, in order to support big pages, the system MMU has to be used to -combine multiple small pages into one virtually contiguous chunk so that -the GPU can then treat that as a single big page. - -In order to prepare for big page support, implement a custom MMU class -that takes care of setting the IOMMU bit when writing page tables and -when appropriate. - -This is also necessary to make sure that Nouveau works correctly on -Tegra devices where the GPU is connected to a system MMU and that IOMMU -is used to back the DMA API. Currently Nouveau assumes that the DMA API -is never backed by an IOMMU, so access to DMA-mapped buffers fault when -suddenly this assumption is no longer true. - -One situation where this can happen is on 32-bit Tegra SoCs where the -ARM architecture code automatically attaches the GPU with a DMA/IOMMU -domain. This is currently worked around by detaching the GPU from the -IOMMU domain at probe time. However, with Tegra186 and later this can -now also happen, but unfortunately no mechanism exists to detach from -the domain in the 64-bit ARM architecture code. - -Using this Tegra-specific MMU class ensures that DMA-mapped buffers are -properly mapped (with the IOMMU bit set) if the DMA API is backed by an -IOMMU domain. - -Signed-off-by: Thierry Reding ---- - .../gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.c | 50 ++++++++++++++++++- - .../gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.h | 44 ++++++++++++++++ - .../gpu/drm/nouveau/nvkm/subdev/mmu/gm20b.c | 6 ++- - .../gpu/drm/nouveau/nvkm/subdev/mmu/gp10b.c | 4 +- - drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h | 1 + - .../drm/nouveau/nvkm/subdev/mmu/vmmgk20a.c | 22 +++++++- - .../drm/nouveau/nvkm/subdev/mmu/vmmgm20b.c | 4 +- - .../drm/nouveau/nvkm/subdev/mmu/vmmgp10b.c | 20 +++++++- - 8 files changed, 142 insertions(+), 9 deletions(-) - create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.h - -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.c -index ac74965a60d4..d9a5e05b7dc7 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.c -@@ -19,11 +19,59 @@ - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ -+ -+#include "gk20a.h" - #include "mem.h" - #include "vmm.h" - -+#include - #include - -+static void -+gk20a_mmu_ctor(const struct nvkm_mmu_func *func, struct nvkm_device *device, -+ int index, struct gk20a_mmu *mmu) -+{ -+ struct iommu_domain *domain = iommu_get_domain_for_dev(device->dev); -+ struct nvkm_device_tegra *tegra = device->func->tegra(device); -+ -+ nvkm_mmu_ctor(func, device, index, &mmu->base); -+ -+ /* -+ * If the DMA API is backed by an IOMMU, make sure the IOMMU bit is -+ * set for all buffer accesses. If the IOMMU is explicitly used, it -+ * is only used for instance blocks and the MMU doesn't care, since -+ * buffer objects are only mapped through the MMU, not through the -+ * IOMMU. -+ * -+ * Big page support could be implemented using explicit IOMMU usage, -+ * but the DMA API already provides that for free, so we don't worry -+ * about it for now. -+ */ -+ if (domain && !tegra->iommu.domain) { -+ mmu->iommu_mask = BIT_ULL(tegra->func->iommu_bit); -+ nvkm_debug(&mmu->base.subdev, "IOMMU mask: %llx\n", -+ mmu->iommu_mask); -+ } -+} -+ -+int -+gk20a_mmu_new_(const struct nvkm_mmu_func *func, struct nvkm_device *device, -+ int index, struct nvkm_mmu **pmmu) -+{ -+ struct gk20a_mmu *mmu; -+ -+ mmu = kzalloc(sizeof(*mmu), GFP_KERNEL); -+ if (!mmu) -+ return -ENOMEM; -+ -+ gk20a_mmu_ctor(func, device, index, mmu); -+ -+ if (pmmu) -+ *pmmu = &mmu->base; -+ -+ return 0; -+} -+ - static const struct nvkm_mmu_func - gk20a_mmu = { - .dma_bits = 40, -@@ -37,5 +85,5 @@ gk20a_mmu = { - int - gk20a_mmu_new(struct nvkm_device *device, int index, struct nvkm_mmu **pmmu) - { -- return nvkm_mmu_new_(&gk20a_mmu, device, index, pmmu); -+ return gk20a_mmu_new_(&gk20a_mmu, device, index, pmmu); - } -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.h b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.h -new file mode 100644 -index 000000000000..bb81fc62509c ---- /dev/null -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.h -@@ -0,0 +1,44 @@ -+/* -+ * Copyright (c) 2019 NVIDIA Corporation. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef __NVKM_MMU_GK20A_H__ -+#define __NVKM_MMU_GK20A_H__ -+ -+#include "priv.h" -+ -+struct gk20a_mmu { -+ struct nvkm_mmu base; -+ -+ /* -+ * If an IOMMU is used, indicates which address bit will trigger an -+ * IOMMU translation when set (when this bit is not set, the IOMMU is -+ * bypassed). A value of 0 means an IOMMU is never used. -+ */ -+ u64 iommu_mask; -+}; -+ -+#define gk20a_mmu(mmu) container_of(mmu, struct gk20a_mmu, base) -+ -+int gk20a_mmu_new_(const struct nvkm_mmu_func *, struct nvkm_device *, -+ int index, struct nvkm_mmu **); -+ -+#endif -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm20b.c -index 7353a94b4091..7fccd4df52a8 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm20b.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm20b.c -@@ -19,6 +19,8 @@ - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ -+ -+#include "gk20a.h" - #include "mem.h" - #include "vmm.h" - -@@ -50,6 +52,6 @@ int - gm20b_mmu_new(struct nvkm_device *device, int index, struct nvkm_mmu **pmmu) - { - if (device->fb->page) -- return nvkm_mmu_new_(&gm20b_mmu_fixed, device, index, pmmu); -- return nvkm_mmu_new_(&gm20b_mmu, device, index, pmmu); -+ return gk20a_mmu_new_(&gm20b_mmu_fixed, device, index, pmmu); -+ return gk20a_mmu_new_(&gm20b_mmu, device, index, pmmu); - } -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp10b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp10b.c -index 0a50be9a785a..ae3cb47be3d8 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp10b.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp10b.c -@@ -19,6 +19,8 @@ - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ -+ -+#include "gk20a.h" - #include "mem.h" - #include "vmm.h" - -@@ -41,5 +43,5 @@ gp10b_mmu_new(struct nvkm_device *device, int index, struct nvkm_mmu **pmmu) - { - if (!nvkm_boolopt(device->cfgopt, "GP100MmuLayout", true)) - return gm20b_mmu_new(device, index, pmmu); -- return nvkm_mmu_new_(&gp10b_mmu, device, index, pmmu); -+ return gk20a_mmu_new_(&gp10b_mmu, device, index, pmmu); - } -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h -index 5e55ecbd8005..fb3a9e8bb9cd 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h -@@ -213,6 +213,7 @@ void gf100_vmm_invalidate(struct nvkm_vmm *, u32 type); - void gf100_vmm_invalidate_pdb(struct nvkm_vmm *, u64 addr); - - int gk20a_vmm_aper(enum nvkm_memory_target); -+int gk20a_vmm_valid(struct nvkm_vmm *, void *, u32, struct nvkm_vmm_map *); - - int gm200_vmm_new_(const struct nvkm_vmm_func *, const struct nvkm_vmm_func *, - struct nvkm_mmu *, bool, u64, u64, void *, u32, -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgk20a.c -index 5a9582dce970..16d7bf727292 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgk20a.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgk20a.c -@@ -19,6 +19,8 @@ - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ -+ -+#include "gk20a.h" - #include "vmm.h" - - #include -@@ -33,12 +35,28 @@ gk20a_vmm_aper(enum nvkm_memory_target target) - } - } - -+int -+gk20a_vmm_valid(struct nvkm_vmm *vmm, void *argv, u32 argc, -+ struct nvkm_vmm_map *map) -+{ -+ struct gk20a_mmu *mmu = gk20a_mmu(vmm->mmu); -+ int ret; -+ -+ ret = gf100_vmm_valid(vmm, argv, argc, map); -+ if (ret < 0) -+ return ret; -+ -+ map->type |= mmu->iommu_mask >> 8; -+ -+ return 0; -+} -+ - static const struct nvkm_vmm_func - gk20a_vmm_17 = { - .join = gf100_vmm_join, - .part = gf100_vmm_part, - .aper = gf100_vmm_aper, -- .valid = gf100_vmm_valid, -+ .valid = gk20a_vmm_valid, - .flush = gf100_vmm_flush, - .invalidate_pdb = gf100_vmm_invalidate_pdb, - .page = { -@@ -53,7 +71,7 @@ gk20a_vmm_16 = { - .join = gf100_vmm_join, - .part = gf100_vmm_part, - .aper = gf100_vmm_aper, -- .valid = gf100_vmm_valid, -+ .valid = gk20a_vmm_valid, - .flush = gf100_vmm_flush, - .invalidate_pdb = gf100_vmm_invalidate_pdb, - .page = { -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgm20b.c -index 96b759695dd8..7a6066d886cd 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgm20b.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgm20b.c -@@ -26,7 +26,7 @@ gm20b_vmm_17 = { - .join = gm200_vmm_join, - .part = gf100_vmm_part, - .aper = gk20a_vmm_aper, -- .valid = gf100_vmm_valid, -+ .valid = gk20a_vmm_valid, - .flush = gf100_vmm_flush, - .invalidate_pdb = gf100_vmm_invalidate_pdb, - .page = { -@@ -42,7 +42,7 @@ gm20b_vmm_16 = { - .join = gm200_vmm_join, - .part = gf100_vmm_part, - .aper = gk20a_vmm_aper, -- .valid = gf100_vmm_valid, -+ .valid = gk20a_vmm_valid, - .flush = gf100_vmm_flush, - .invalidate_pdb = gf100_vmm_invalidate_pdb, - .page = { -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp10b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp10b.c -index e081239afe58..180c8f006e32 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp10b.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp10b.c -@@ -19,14 +19,32 @@ - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ -+ -+#include "gk20a.h" - #include "vmm.h" - -+static int -+gp10b_vmm_valid(struct nvkm_vmm *vmm, void *argv, u32 argc, -+ struct nvkm_vmm_map *map) -+{ -+ struct gk20a_mmu *mmu = gk20a_mmu(vmm->mmu); -+ int ret; -+ -+ ret = gp100_vmm_valid(vmm, argv, argc, map); -+ if (ret < 0) -+ return ret; -+ -+ map->type |= mmu->iommu_mask >> 4; -+ -+ return 0; -+} -+ - static const struct nvkm_vmm_func - gp10b_vmm = { - .join = gp100_vmm_join, - .part = gf100_vmm_part, - .aper = gk20a_vmm_aper, -- .valid = gp100_vmm_valid, -+ .valid = gp10b_vmm_valid, - .flush = gp100_vmm_flush, - .mthd = gp100_vmm_mthd, - .invalidate_pdb = gp100_vmm_invalidate_pdb, - -From patchwork Mon Sep 16 15:04:09 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [08/11] drm/nouveau: tegra: Skip IOMMU initialization if already - attached -From: Thierry Reding -X-Patchwork-Id: 331060 -Message-Id: <20190916150412.10025-9-thierry.reding@gmail.com> -To: Ben Skeggs , Thierry Reding -Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, - dri-devel@lists.freedesktop.org -Date: Mon, 16 Sep 2019 17:04:09 +0200 - -From: Thierry Reding - -If the GPU is already attached to an IOMMU, don't detach it and setup an -explicit IOMMU domain. Since Nouveau can now properly handle the case of -the DMA API being backed by an IOMMU, just continue using the DMA API. - -Signed-off-by: Thierry Reding ---- - .../drm/nouveau/nvkm/engine/device/tegra.c | 19 +++++++------------ - 1 file changed, 7 insertions(+), 12 deletions(-) - -diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c -index d0d52c1d4aee..fc652aaa41c7 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c -+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c -@@ -23,10 +23,6 @@ - #ifdef CONFIG_NOUVEAU_PLATFORM_DRIVER - #include "priv.h" - --#if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU) --#include --#endif -- - static int - nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev) - { -@@ -109,14 +105,13 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) - unsigned long pgsize_bitmap; - int ret; - --#if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU) -- if (dev->archdata.mapping) { -- struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev); -- -- arm_iommu_detach_device(dev); -- arm_iommu_release_mapping(mapping); -- } --#endif -+ /* -+ * Skip explicit IOMMU initialization if the GPU is already attached -+ * to an IOMMU domain. This can happen if the DMA API is backed by an -+ * IOMMU. -+ */ -+ if (iommu_get_domain_for_dev(dev)) -+ return; - - if (!tdev->func->iommu_bit) - return; - -From patchwork Mon Sep 16 15:04:10 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [09/11] drm/nouveau: tegra: Fall back to 32-bit DMA mask without IOMMU -From: Thierry Reding -X-Patchwork-Id: 331061 -Message-Id: <20190916150412.10025-10-thierry.reding@gmail.com> -To: Ben Skeggs , Thierry Reding -Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, - dri-devel@lists.freedesktop.org -Date: Mon, 16 Sep 2019 17:04:10 +0200 - -From: Thierry Reding - -The GPU can usually address more than 32-bit, even without being -attached to an IOMMU. However, if the GPU is not attached to an IOMMU, -it's likely that there is no IOMMU in the system, in which case any -buffers allocated by Nouveau will likely end up in a region of memory -that cannot be accessed by host1x. - -Signed-off-by: Thierry Reding ---- - .../drm/nouveau/nvkm/engine/device/tegra.c | 111 +++++++++++------- - 1 file changed, 70 insertions(+), 41 deletions(-) - -diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c -index fc652aaa41c7..221238a2cf53 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c -+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c -@@ -97,7 +97,7 @@ nvkm_device_tegra_power_down(struct nvkm_device_tegra *tdev) - return 0; - } - --static void -+static int - nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) - { - #if IS_ENABLED(CONFIG_IOMMU_API) -@@ -111,47 +111,65 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) - * IOMMU. - */ - if (iommu_get_domain_for_dev(dev)) -- return; -+ return -ENODEV; - - if (!tdev->func->iommu_bit) -- return; -+ return -ENODEV; -+ -+ if (!iommu_present(&platform_bus_type)) -+ return -ENODEV; - - mutex_init(&tdev->iommu.mutex); - -- if (iommu_present(&platform_bus_type)) { -- tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type); -- if (!tdev->iommu.domain) -- goto error; -+ tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type); -+ if (!tdev->iommu.domain) -+ return -ENOMEM; - -- /* -- * A IOMMU is only usable if it supports page sizes smaller -- * or equal to the system's PAGE_SIZE, with a preference if -- * both are equal. -- */ -- pgsize_bitmap = tdev->iommu.domain->ops->pgsize_bitmap; -- if (pgsize_bitmap & PAGE_SIZE) { -- tdev->iommu.pgshift = PAGE_SHIFT; -- } else { -- tdev->iommu.pgshift = fls(pgsize_bitmap & ~PAGE_MASK); -- if (tdev->iommu.pgshift == 0) { -- dev_warn(dev, "unsupported IOMMU page size\n"); -- goto free_domain; -- } -- tdev->iommu.pgshift -= 1; -+ /* -+ * An IOMMU is only usable if it supports page sizes smaller or equal -+ * to the system's PAGE_SIZE, with a preference if both are equal. -+ */ -+ pgsize_bitmap = tdev->iommu.domain->ops->pgsize_bitmap; -+ if (pgsize_bitmap & PAGE_SIZE) { -+ tdev->iommu.pgshift = PAGE_SHIFT; -+ } else { -+ tdev->iommu.pgshift = fls(pgsize_bitmap & ~PAGE_MASK); -+ if (tdev->iommu.pgshift == 0) { -+ dev_warn(dev, "unsupported IOMMU page size\n"); -+ ret = -ENOTSUPP; -+ goto free_domain; - } - -- ret = iommu_attach_device(tdev->iommu.domain, dev); -- if (ret) -- goto free_domain; -+ tdev->iommu.pgshift -= 1; -+ } - -- ret = nvkm_mm_init(&tdev->iommu.mm, 0, 0, -- (1ULL << tdev->func->iommu_bit) >> -- tdev->iommu.pgshift, 1); -- if (ret) -- goto detach_device; -+ ret = iommu_attach_device(tdev->iommu.domain, dev); -+ if (ret) { -+ dev_warn(dev, "failed to attach to IOMMU: %d\n", ret); -+ goto free_domain; -+ } -+ -+ ret = nvkm_mm_init(&tdev->iommu.mm, 0, 0, -+ (1ULL << tdev->func->iommu_bit) >> -+ tdev->iommu.pgshift, 1); -+ if (ret) { -+ dev_warn(dev, "failed to initialize IOVA space: %d\n", ret); -+ goto detach_device; -+ } -+ -+ /* -+ * The IOMMU bit defines the upper limit of the GPU-addressable space. -+ */ -+ ret = dma_set_mask(dev, DMA_BIT_MASK(tdev->func->iommu_bit)); -+ if (ret) { -+ dev_warn(dev, "failed to set DMA mask: %d\n", ret); -+ goto fini_mm; - } - -- return; -+ return 0; -+ -+fini_mm: -+ nvkm_mm_fini(&tdev->iommu.mm); - - detach_device: - iommu_detach_device(tdev->iommu.domain, dev); -@@ -159,10 +177,15 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) - free_domain: - iommu_domain_free(tdev->iommu.domain); - --error: -+ /* reset these so that the DMA API code paths are executed */ - tdev->iommu.domain = NULL; - tdev->iommu.pgshift = 0; -- dev_err(dev, "cannot initialize IOMMU MM\n"); -+ -+ dev_warn(dev, "cannot initialize IOMMU MM\n"); -+ -+ return ret; -+#else -+ return -ENOTSUPP; - #endif - } - -@@ -327,14 +350,20 @@ nvkm_device_tegra_new(const struct nvkm_device_tegra_func *func, - goto free; - } - -- /** -- * The IOMMU bit defines the upper limit of the GPU-addressable space. -- */ -- ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(tdev->func->iommu_bit)); -- if (ret) -- goto free; -- -- nvkm_device_tegra_probe_iommu(tdev); -+ ret = nvkm_device_tegra_probe_iommu(tdev); -+ if (ret) { -+ /* -+ * If we fail to set up an IOMMU, fall back to a 32-bit DMA -+ * mask. This is not necessary for the GPU to work because it -+ * can usually address all of system memory. However, if the -+ * buffers allocated by Nouveau are meant to be shared with -+ * the display controller, we need to restrict where they can -+ * come from. -+ */ -+ ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); -+ if (ret) -+ goto free; -+ } - - ret = nvkm_device_tegra_power_up(tdev); - if (ret) - -From patchwork Mon Sep 16 15:04:11 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [10/11] arm64: tegra: Enable GPU on Jetson TX2 -From: Thierry Reding -X-Patchwork-Id: 331063 -Message-Id: <20190916150412.10025-11-thierry.reding@gmail.com> -To: Ben Skeggs , Thierry Reding -Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, - dri-devel@lists.freedesktop.org -Date: Mon, 16 Sep 2019 17:04:11 +0200 - -From: Alexandre Courbot - -Enable the GPU node for the Jetson TX2 board. - -Signed-off-by: Alexandre Courbot -Signed-off-by: Thierry Reding ---- - arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts b/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts -index bdace01561ba..6f7c7c4c5c29 100644 ---- a/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts -+++ b/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts -@@ -276,6 +276,10 @@ - }; - }; - -+ gpu@17000000 { -+ status = "okay"; -+ }; -+ - gpio-keys { - compatible = "gpio-keys"; - - -From patchwork Mon Sep 16 15:04:12 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [11/11] arm64: tegra: Enable SMMU for GPU on Tegra186 -From: Thierry Reding -X-Patchwork-Id: 331062 -Message-Id: <20190916150412.10025-12-thierry.reding@gmail.com> -To: Ben Skeggs , Thierry Reding -Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, - dri-devel@lists.freedesktop.org -Date: Mon, 16 Sep 2019 17:04:12 +0200 - -From: Thierry Reding - -The GPU has a connection to the ARM SMMU found on Tegra186, which can be -used to support large pages. Make sure the GPU is attached to the SMMU -to take advantage of its capabilities. - -Signed-off-by: Thierry Reding ---- - arch/arm64/boot/dts/nvidia/tegra186.dtsi | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi -index 47cd831fcf44..171fd4dfa58d 100644 ---- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi -+++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi -@@ -1172,6 +1172,7 @@ - status = "disabled"; - - power-domains = <&bpmp TEGRA186_POWER_DOMAIN_GPU>; -+ iommus = <&smmu TEGRA186_SID_GPU>; - }; - - sysram@30000000 { diff --git a/kernel.spec b/kernel.spec index 521bd57d1..53967cc89 100644 --- a/kernel.spec +++ b/kernel.spec @@ -567,8 +567,6 @@ Patch321: arm64-tegra-Jetson-TX2-Allow-bootloader-to-configure.patch Patch322: mfd-max77620-Do-not-allocate-IRQs-upfront.patch # https://patchwork.ozlabs.org/patch/1170631/ Patch323: gpio-max77620-Use-correct-unit-for-debounce-times.patch -# https://patchwork.freedesktop.org/series/66762/ -Patch324: drm-nouveau-Enable-GP10B-by-default.patch # https://www.spinics.net/lists/linux-tegra/msg44216.html Patch325: arm64-tegra186-enable-USB-on-Jetson-TX2.patch From 8bb21014a55f50b1a734322639fffadafcd79672 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Mon, 7 Oct 2019 11:48:17 -0400 Subject: [PATCH 017/178] selinux fix (rhbz 1758597) --- ...low-labeling-before-policy-is-loaded.patch | 153 ++++++++++++++++++ kernel.spec | 5 + 2 files changed, 158 insertions(+) create mode 100644 PATCH-v2-selinux-allow-labeling-before-policy-is-loaded.patch diff --git a/PATCH-v2-selinux-allow-labeling-before-policy-is-loaded.patch b/PATCH-v2-selinux-allow-labeling-before-policy-is-loaded.patch new file mode 100644 index 000000000..001fa32dc --- /dev/null +++ b/PATCH-v2-selinux-allow-labeling-before-policy-is-loaded.patch @@ -0,0 +1,153 @@ +From mboxrd@z Thu Jan 1 00:00:00 1970 +Return-Path: +X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on + aws-us-west-2-korg-lkml-1.web.codeaurora.org +X-Spam-Level: +X-Spam-Status: No, score=-15.0 required=3.0 + tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, + MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT + autolearn=ham autolearn_force=no version=3.4.0 +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) + by smtp.lore.kernel.org (Postfix) with ESMTP id 0CE63C4CEC5 + for ; Thu, 12 Sep 2019 13:30:40 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id DC0B020CC7 + for ; Thu, 12 Sep 2019 13:30:39 +0000 (UTC) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1732192AbfILNaj (ORCPT ); + Thu, 12 Sep 2019 09:30:39 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:52278 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1731687AbfILNaj (ORCPT ); + Thu, 12 Sep 2019 09:30:39 -0400 +Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) + (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) + (No client certificate requested) + by mx1.redhat.com (Postfix) with ESMTPS id 97CC359465 + for ; Thu, 12 Sep 2019 13:30:38 +0000 (UTC) +Received: by mail-qt1-f197.google.com with SMTP id c8so13609684qtd.20 + for ; Thu, 12 Sep 2019 06:30:38 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version + :content-transfer-encoding; + bh=S/MIBrjCy5DTvfqPzJTJqDQQH1pDu780wgGyHs56w4k=; + b=H7fZr4X/c4ge0SXeHHRXrq3U4J60PWfSRqdCphTWxKjyLvBs8nktbJczT562oH7Hxv + hdvVjKgAzNxIXFdQetnmveDXojtHFrE21PNdo5ONQIyh35oZyrJB4ewZdUrNfbrvDc2y + ElMr/HoKEX5pY+GMJE4nzeBotlfCWU9BoAxJPUhzKA9Oib+AqDzQ0hCGH6pQY9RXRXBV + IMH21FE5dxQGtLHNCJXVxE14edDeRo8qQFWQw6ooogK7JvduuJrWBn3BmCbKz1YLTNZE + 9wRXvaHFVGNhr79JrRcItTp6Sx+tZ3XY46CV+Wi6Rq1fu8MePP9zFdIQXw9wqyd+UgLa + AIlw== +X-Gm-Message-State: APjAAAXpWx500L+bZRH8M7OzuSb0aBlsvvjaBYCGvSkzojpa2nRWjtk0 + cjKEj45ivsUgPW2Bbi6CGEtspqM4wmwb72z+ajR4hy5OjMT3KRh6W71HFbVPrlLYQTvse11Ax2d + wGOma7U/qIGDDYkjh/Q== +X-Received: by 2002:ac8:7b2e:: with SMTP id l14mr8094193qtu.11.1568295037636; + Thu, 12 Sep 2019 06:30:37 -0700 (PDT) +X-Google-Smtp-Source: APXvYqzybFpoaFyGZXafGEdtHCL3XllpHltaXggcIZEb7De49V/kJzm1pU6vpg1gN8HtgnB3cilLuA== +X-Received: by 2002:ac8:7b2e:: with SMTP id l14mr8094176qtu.11.1568295037442; + Thu, 12 Sep 2019 06:30:37 -0700 (PDT) +Received: from localhost.localdomain ([12.133.141.2]) + by smtp.gmail.com with ESMTPSA id h68sm11848865qkd.35.2019.09.12.06.30.35 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Thu, 12 Sep 2019 06:30:36 -0700 (PDT) +From: Jonathan Lebon +To: selinux@vger.kernel.org +Cc: Jonathan Lebon , + Victor Kamensky +Subject: [PATCH v2] selinux: allow labeling before policy is loaded +Date: Thu, 12 Sep 2019 09:30:07 -0400 +Message-Id: <20190912133007.27545-1-jlebon@redhat.com> +X-Mailer: git-send-email 2.21.0 +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +Sender: selinux-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: selinux@vger.kernel.org +Archived-At: +List-Archive: +List-Post: + +Currently, the SELinux LSM prevents one from setting the +`security.selinux` xattr on an inode without a policy first being +loaded. However, this restriction is problematic: it makes it impossible +to have newly created files with the correct label before actually +loading the policy. + +This is relevant in distributions like Fedora, where the policy is +loaded by systemd shortly after pivoting out of the initrd. In such +instances, all files created prior to pivoting will be unlabeled. One +then has to relabel them after pivoting, an operation which inherently +races with other processes trying to access those same files. + +Going further, there are use cases for creating the entire root +filesystem on first boot from the initrd (e.g. Container Linux supports +this today[1], and we'd like to support it in Fedora CoreOS as well[2]). +One can imagine doing this in two ways: at the block device level (e.g. +laying down a disk image), or at the filesystem level. In the former, +labeling can simply be part of the image. But even in the latter +scenario, one still really wants to be able to set the right labels when +populating the new filesystem. + +This patch enables this by changing behaviour in the following two ways: +1. allow `setxattr` if we're not initialized +2. don't try to set the in-core inode SID if we're not initialized; + instead leave it as `LABEL_INVALID` so that revalidation may be + attempted at a later time + +Note the first hunk of this patch is mostly the same as a previously +discussed one[3], though it was part of a larger series which wasn't +accepted. + +Co-developed-by: Victor Kamensky +Signed-off-by: Victor Kamensky +Signed-off-by: Jonathan Lebon + +[1] https://coreos.com/os/docs/latest/root-filesystem-placement.html +[2] https://github.com/coreos/fedora-coreos-tracker/issues/94 +[3] https://www.spinics.net/lists/linux-initramfs/msg04593.html + +--- + +v2: + - return early in selinux_inode_setxattr if policy hasn't been loaded + +--- + + security/selinux/hooks.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c +index 94de51628..dbe96c707 100644 +--- a/security/selinux/hooks.c ++++ b/security/selinux/hooks.c +@@ -3142,6 +3142,9 @@ static int selinux_inode_setxattr(struct dentry *dentry, const char *name, + return dentry_has_perm(current_cred(), dentry, FILE__SETATTR); + } + ++ if (!selinux_state.initialized) ++ return (inode_owner_or_capable(inode) ? 0 : -EPERM); ++ + sbsec = inode->i_sb->s_security; + if (!(sbsec->flags & SBLABEL_MNT)) + return -EOPNOTSUPP; +@@ -3225,6 +3228,15 @@ static void selinux_inode_post_setxattr(struct dentry *dentry, const char *name, + return; + } + ++ if (!selinux_state.initialized) { ++ /* If we haven't even been initialized, then we can't validate ++ * against a policy, so leave the label as invalid. It may ++ * resolve to a valid label on the next revalidation try if ++ * we've since initialized. ++ */ ++ return; ++ } ++ + rc = security_context_to_sid_force(&selinux_state, value, size, + &newsid); + if (rc) { +-- +2.21.0 + + diff --git a/kernel.spec b/kernel.spec index 53967cc89..29737a605 100644 --- a/kernel.spec +++ b/kernel.spec @@ -596,6 +596,8 @@ Patch504: dwc3-fix.patch Patch507: v2-1-2-efi-tpm-Don-t-access-event--count-when-it-isn-t-mapped..patch Patch508: v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-parsing.patch +Patch509: PATCH-v2-selinux-allow-labeling-before-policy-is-loaded.patch + # END OF PATCH DEFINITIONS %endif @@ -1797,6 +1799,9 @@ fi # # %changelog +* Mon Oct 7 2019 Laura Abbott +- selinux fix (rhbz 1758597) + * Mon Oct 7 2019 Peter Robinson 5.3.4-300 - Linux v5.3.4 From db060559f7f6a53ffd35d9436d802fb10cbaaa00 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Tue, 8 Oct 2019 08:25:26 -0400 Subject: [PATCH 018/178] Linux v5.3.5 --- kernel.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel.spec b/kernel.spec index 29737a605..f7ee10ce2 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 4 +%define stable_update 5 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -1799,6 +1799,9 @@ fi # # %changelog +* Tue Oct 08 2019 Laura Abbott - 5.3.5-300 +- Linux v5.3.5 + * Mon Oct 7 2019 Laura Abbott - selinux fix (rhbz 1758597) diff --git a/sources b/sources index f9f7d3aea..43a5f5d42 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.4.xz) = 63f774e8a4dbc6376cab702e2813c5e7703aaa300d942447f1bb27bb749375179ac969e21a1983314eb33e0109206ad298be503f7fc6f168c85008cf63788002 +SHA512 (patch-5.3.5.xz) = 70555da6275237bd6fe0514e2e49052f36af87fbae4919a464285dcdc9b84443995264762248496e44291800b2398a45bcf3fa3459a631f162cfdd915b972d9f From 839d783d52c88e8999994d87725351d24a192d9e Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Tue, 8 Oct 2019 14:51:07 +0100 Subject: [PATCH 019/178] arm: disable omap crytpo offload drivers as they currently cause issues on BeagleBone and related HW --- .../fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP | 2 +- .../generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_AES | 2 +- .../generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_DES | 2 +- .../generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_SHAM | 2 +- kernel-armv7hl-debug.config | 8 ++++---- kernel-armv7hl.config | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP index 98ff565f8..df6a929e2 100644 --- a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP +++ b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP @@ -1 +1 @@ -CONFIG_CRYPTO_DEV_OMAP=m +# CONFIG_CRYPTO_DEV_OMAP is not set diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_AES b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_AES index 1b126b18e..eb6803b74 100644 --- a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_AES +++ b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_AES @@ -1 +1 @@ -CONFIG_CRYPTO_DEV_OMAP_AES=m +# CONFIG_CRYPTO_DEV_OMAP_AES is not set diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_DES b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_DES index b359a5c3f..952a6e247 100644 --- a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_DES +++ b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_DES @@ -1 +1 @@ -CONFIG_CRYPTO_DEV_OMAP_DES=m +# CONFIG_CRYPTO_DEV_OMAP_DES is not set diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_SHAM b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_SHAM index 58d162aba..2997e8fc1 100644 --- a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_SHAM +++ b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_SHAM @@ -1 +1 @@ -CONFIG_CRYPTO_DEV_OMAP_SHAM=m +# CONFIG_CRYPTO_DEV_OMAP_SHAM is not set diff --git a/kernel-armv7hl-debug.config b/kernel-armv7hl-debug.config index ea7b2d2b8..4a105466d 100644 --- a/kernel-armv7hl-debug.config +++ b/kernel-armv7hl-debug.config @@ -1142,10 +1142,10 @@ CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y CONFIG_CRYPTO_DEV_MARVELL_CESA=m CONFIG_CRYPTO_DEV_MXS_DCP=m # CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set -CONFIG_CRYPTO_DEV_OMAP_AES=m -CONFIG_CRYPTO_DEV_OMAP_DES=m -CONFIG_CRYPTO_DEV_OMAP=m -CONFIG_CRYPTO_DEV_OMAP_SHAM=m +# CONFIG_CRYPTO_DEV_OMAP_AES is not set +# CONFIG_CRYPTO_DEV_OMAP_DES is not set +# CONFIG_CRYPTO_DEV_OMAP is not set +# CONFIG_CRYPTO_DEV_OMAP_SHAM is not set CONFIG_CRYPTO_DEV_QCE=m CONFIG_CRYPTO_DEV_QCOM_RNG=m CONFIG_CRYPTO_DEV_ROCKCHIP=m diff --git a/kernel-armv7hl.config b/kernel-armv7hl.config index 3f41496ef..614d53a6c 100644 --- a/kernel-armv7hl.config +++ b/kernel-armv7hl.config @@ -1142,10 +1142,10 @@ CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y CONFIG_CRYPTO_DEV_MARVELL_CESA=m CONFIG_CRYPTO_DEV_MXS_DCP=m # CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set -CONFIG_CRYPTO_DEV_OMAP_AES=m -CONFIG_CRYPTO_DEV_OMAP_DES=m -CONFIG_CRYPTO_DEV_OMAP=m -CONFIG_CRYPTO_DEV_OMAP_SHAM=m +# CONFIG_CRYPTO_DEV_OMAP_AES is not set +# CONFIG_CRYPTO_DEV_OMAP_DES is not set +# CONFIG_CRYPTO_DEV_OMAP is not set +# CONFIG_CRYPTO_DEV_OMAP_SHAM is not set CONFIG_CRYPTO_DEV_QCE=m CONFIG_CRYPTO_DEV_QCOM_RNG=m CONFIG_CRYPTO_DEV_ROCKCHIP=m From 30675b84bb5e82190342091a49f81e86df95a2c6 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Fri, 11 Oct 2019 17:19:22 +0100 Subject: [PATCH 020/178] arm64: enable spi flash memory on aarch64 too --- configs/fedora/generic/arm/CONFIG_MTD_M25P80 | 1 + configs/fedora/generic/arm/{armv7 => }/CONFIG_MTD_SPI_NOR | 0 .../arm/{armv7 => }/CONFIG_MTD_SPI_NOR_USE_4K_SECTORS | 0 configs/fedora/generic/arm/CONFIG_SPI_CADENCE_QUADSPI | 1 + kernel-aarch64-debug.config | 6 +++++- kernel-aarch64.config | 6 +++++- 6 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 configs/fedora/generic/arm/CONFIG_MTD_M25P80 rename configs/fedora/generic/arm/{armv7 => }/CONFIG_MTD_SPI_NOR (100%) rename configs/fedora/generic/arm/{armv7 => }/CONFIG_MTD_SPI_NOR_USE_4K_SECTORS (100%) create mode 100644 configs/fedora/generic/arm/CONFIG_SPI_CADENCE_QUADSPI diff --git a/configs/fedora/generic/arm/CONFIG_MTD_M25P80 b/configs/fedora/generic/arm/CONFIG_MTD_M25P80 new file mode 100644 index 000000000..9e4ab3f0b --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_MTD_M25P80 @@ -0,0 +1 @@ +CONFIG_MTD_M25P80=m diff --git a/configs/fedora/generic/arm/armv7/CONFIG_MTD_SPI_NOR b/configs/fedora/generic/arm/CONFIG_MTD_SPI_NOR similarity index 100% rename from configs/fedora/generic/arm/armv7/CONFIG_MTD_SPI_NOR rename to configs/fedora/generic/arm/CONFIG_MTD_SPI_NOR diff --git a/configs/fedora/generic/arm/armv7/CONFIG_MTD_SPI_NOR_USE_4K_SECTORS b/configs/fedora/generic/arm/CONFIG_MTD_SPI_NOR_USE_4K_SECTORS similarity index 100% rename from configs/fedora/generic/arm/armv7/CONFIG_MTD_SPI_NOR_USE_4K_SECTORS rename to configs/fedora/generic/arm/CONFIG_MTD_SPI_NOR_USE_4K_SECTORS diff --git a/configs/fedora/generic/arm/CONFIG_SPI_CADENCE_QUADSPI b/configs/fedora/generic/arm/CONFIG_SPI_CADENCE_QUADSPI new file mode 100644 index 000000000..7c242fd0d --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_SPI_CADENCE_QUADSPI @@ -0,0 +1 @@ +# CONFIG_SPI_CADENCE_QUADSPI is not set diff --git a/kernel-aarch64-debug.config b/kernel-aarch64-debug.config index 708e79178..be66d4230 100644 --- a/kernel-aarch64-debug.config +++ b/kernel-aarch64-debug.config @@ -3577,6 +3577,7 @@ CONFIG_MTD_CFI_STAA=m # CONFIG_MTD_LPDDR2_NVM is not set # CONFIG_MTD_LPDDR is not set CONFIG_MTD=m +CONFIG_MTD_M25P80=m CONFIG_MTD_MAP_BANK_WIDTH_1=y CONFIG_MTD_MAP_BANK_WIDTH_2=y CONFIG_MTD_MAP_BANK_WIDTH_4=y @@ -3620,7 +3621,8 @@ CONFIG_MTD_RAW_NAND=m # CONFIG_MTD_SHARPSL_PARTS is not set # CONFIG_MTD_SLRAM is not set CONFIG_MTD_SPI_NAND=m -# CONFIG_MTD_SPI_NOR is not set +CONFIG_MTD_SPI_NOR=m +# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set # CONFIG_MTD_SST25L is not set # CONFIG_MTD_SWAP is not set # CONFIG_MTD_TESTS is not set @@ -6041,6 +6043,7 @@ CONFIG_SPI_BCM2835=m CONFIG_SPI_BITBANG=m # CONFIG_SPI_BUTTERFLY is not set CONFIG_SPI_CADENCE=m +# CONFIG_SPI_CADENCE_QUADSPI is not set # CONFIG_SPI_DEBUG is not set CONFIG_SPI_DESIGNWARE=m # CONFIG_SPI_DW_MID_DMA is not set @@ -6051,6 +6054,7 @@ CONFIG_SPI_FSL_LPSPI=m CONFIG_SPI_FSL_QUADSPI=m # CONFIG_SPI_FSL_SPI is not set CONFIG_SPI_GPIO=m +CONFIG_SPI_HISI_SFC=m CONFIG_SPI_IMX=m # CONFIG_SPI_LM70_LLP is not set # CONFIG_SPI_LOOPBACK_TEST is not set diff --git a/kernel-aarch64.config b/kernel-aarch64.config index 15cfed8ee..2219b41b1 100644 --- a/kernel-aarch64.config +++ b/kernel-aarch64.config @@ -3557,6 +3557,7 @@ CONFIG_MTD_CFI_STAA=m # CONFIG_MTD_LPDDR2_NVM is not set # CONFIG_MTD_LPDDR is not set CONFIG_MTD=m +CONFIG_MTD_M25P80=m CONFIG_MTD_MAP_BANK_WIDTH_1=y CONFIG_MTD_MAP_BANK_WIDTH_2=y CONFIG_MTD_MAP_BANK_WIDTH_4=y @@ -3600,7 +3601,8 @@ CONFIG_MTD_RAW_NAND=m # CONFIG_MTD_SHARPSL_PARTS is not set # CONFIG_MTD_SLRAM is not set CONFIG_MTD_SPI_NAND=m -# CONFIG_MTD_SPI_NOR is not set +CONFIG_MTD_SPI_NOR=m +# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set # CONFIG_MTD_SST25L is not set # CONFIG_MTD_SWAP is not set # CONFIG_MTD_TESTS is not set @@ -6019,6 +6021,7 @@ CONFIG_SPI_BCM2835=m CONFIG_SPI_BITBANG=m # CONFIG_SPI_BUTTERFLY is not set CONFIG_SPI_CADENCE=m +# CONFIG_SPI_CADENCE_QUADSPI is not set # CONFIG_SPI_DEBUG is not set CONFIG_SPI_DESIGNWARE=m # CONFIG_SPI_DW_MID_DMA is not set @@ -6029,6 +6032,7 @@ CONFIG_SPI_FSL_LPSPI=m CONFIG_SPI_FSL_QUADSPI=m # CONFIG_SPI_FSL_SPI is not set CONFIG_SPI_GPIO=m +CONFIG_SPI_HISI_SFC=m CONFIG_SPI_IMX=m # CONFIG_SPI_LM70_LLP is not set # CONFIG_SPI_LOOPBACK_TEST is not set From 176603ba7ce4ce7d068ac5187b79450907f9ae71 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Fri, 11 Oct 2019 19:22:04 +0100 Subject: [PATCH 021/178] hopefully the final fix for Intel's dodgy iwlwifi firmware 'update' so should finally close out rhbz 1733369 \o/ --- ...ifi-exclude-GEO-SAR-support-for-3168.patch | 47 +++ ...h-jf-devices-to-use-qu-configuration.patch | 325 ++++++++++++++++++ kernel.spec | 6 + 3 files changed, 378 insertions(+) create mode 100644 iwlwifi-exclude-GEO-SAR-support-for-3168.patch create mode 100644 iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch diff --git a/iwlwifi-exclude-GEO-SAR-support-for-3168.patch b/iwlwifi-exclude-GEO-SAR-support-for-3168.patch new file mode 100644 index 000000000..7578695a8 --- /dev/null +++ b/iwlwifi-exclude-GEO-SAR-support-for-3168.patch @@ -0,0 +1,47 @@ +From 12e36d98d3e5acf5fc57774e0a15906d55f30cb9 Mon Sep 17 00:00:00 2001 +From: Luca Coelho +Date: Tue, 8 Oct 2019 13:10:53 +0300 +Subject: iwlwifi: exclude GEO SAR support for 3168 + +We currently support two NICs in FW version 29, namely 7265D and 3168. +Out of these, only 7265D supports GEO SAR, so adjust the function that +checks for it accordingly. + +Signed-off-by: Luca Coelho +Fixes: f5a47fae6aa3 ("iwlwifi: mvm: fix version check for GEO_TX_POWER_LIMIT support") +Signed-off-by: Luca Coelho +--- + drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +index 0d2229319261..d9eb2b286438 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +@@ -899,15 +899,17 @@ static bool iwl_mvm_sar_geo_support(struct iwl_mvm *mvm) + * firmware versions. Unfortunately, we don't have a TLV API + * flag to rely on, so rely on the major version which is in + * the first byte of ucode_ver. This was implemented +- * initially on version 38 and then backported to29 and 17. +- * The intention was to have it in 36 as well, but not all +- * 8000 family got this feature enabled. The 8000 family is +- * the only one using version 36, so skip this version +- * entirely. ++ * initially on version 38 and then backported to 17. It was ++ * also backported to 29, but only for 7265D devices. The ++ * intention was to have it in 36 as well, but not all 8000 ++ * family got this feature enabled. The 8000 family is the ++ * only one using version 36, so skip this version entirely. + */ + return IWL_UCODE_SERIAL(mvm->fw->ucode_ver) >= 38 || +- IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 29 || +- IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 17; ++ IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 17 || ++ (IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 29 && ++ ((mvm->trans->hw_rev & CSR_HW_REV_TYPE_MSK) == ++ CSR_HW_REV_TYPE_7265D)); + } + + int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm) +-- +cgit 1.2-0.3.lf.el7 diff --git a/iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch b/iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch new file mode 100644 index 000000000..e12b50c01 --- /dev/null +++ b/iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch @@ -0,0 +1,325 @@ +From aa0cc7dde17bb6b8cc533bbcfe3f53d70e0dd269 Mon Sep 17 00:00:00 2001 +From: Luca Coelho +Date: Tue, 8 Oct 2019 13:21:02 +0300 +Subject: iwlwifi: pcie: change qu with jf devices to use qu configuration + +There were a bunch of devices with qu and jf that were loading the +configuration with pu and jf, which is wrong. Fix them all +accordingly. Additionally, remove 0x1010 and 0x1210 subsytem IDs from +the list, since they are obviously wrong, and 0x0044 and 0x0244, which +were duplicate. + +Cc: stable@vger.kernel.org # 5.1+ +Signed-off-by: Luca Coelho +--- + drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 274 +++++++++++++------------- + 1 file changed, 137 insertions(+), 137 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +index e29c47744ef5..6f4bb7ce71a5 100644 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +@@ -513,31 +513,33 @@ static const struct pci_device_id iwl_hw_card_ids[] = { + {IWL_PCI_DEVICE(0x24FD, 0x9074, iwl8265_2ac_cfg)}, + + /* 9000 Series */ +- {IWL_PCI_DEVICE(0x02F0, 0x0030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x0034, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x0038, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x003C, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x0060, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x0064, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x00A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x00A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x0230, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x0234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x0238, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x023C, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x0260, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x0264, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x02A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x02A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x1551, iwl9560_killer_s_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x1552, iwl9560_killer_i_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x2030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x2034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x4030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x4034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x40A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x4234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, +- {IWL_PCI_DEVICE(0x02F0, 0x42A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x02F0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ + {IWL_PCI_DEVICE(0x06F0, 0x0030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, + {IWL_PCI_DEVICE(0x06F0, 0x0034, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, + {IWL_PCI_DEVICE(0x06F0, 0x0038, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, +@@ -643,34 +645,34 @@ static const struct pci_device_id iwl_hw_card_ids[] = { + {IWL_PCI_DEVICE(0x2720, 0x40A4, iwl9462_2ac_cfg_soc)}, + {IWL_PCI_DEVICE(0x2720, 0x4234, iwl9560_2ac_cfg_soc)}, + {IWL_PCI_DEVICE(0x2720, 0x42A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x0030, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x0034, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x0038, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x003C, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x0060, iwl9460_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x0064, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x00A0, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x00A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x0230, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x0234, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x0238, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x023C, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x0260, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x0264, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x02A0, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x02A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x1010, iwl9260_2ac_cfg)}, +- {IWL_PCI_DEVICE(0x30DC, 0x1030, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x1210, iwl9260_2ac_cfg)}, +- {IWL_PCI_DEVICE(0x30DC, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x1552, iwl9560_killer_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x2030, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x2034, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x4030, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x4034, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x40A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x4234, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x30DC, 0x42A4, iwl9462_2ac_cfg_soc)}, ++ ++ {IWL_PCI_DEVICE(0x30DC, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x30DC, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ + {IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_160_cfg_shared_clk)}, + {IWL_PCI_DEVICE(0x31DC, 0x0034, iwl9560_2ac_cfg_shared_clk)}, + {IWL_PCI_DEVICE(0x31DC, 0x0038, iwl9560_2ac_160_cfg_shared_clk)}, +@@ -726,62 +728,60 @@ static const struct pci_device_id iwl_hw_card_ids[] = { + {IWL_PCI_DEVICE(0x34F0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x34F0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + +- {IWL_PCI_DEVICE(0x3DF0, 0x0030, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x0034, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x0038, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x003C, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x0060, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x0064, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x00A0, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x00A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x0230, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x0234, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x0238, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x023C, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x0260, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x0264, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x02A0, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x02A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x1010, iwl9260_2ac_cfg)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x1030, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x1210, iwl9260_2ac_cfg)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x2030, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x2034, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x4030, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x4034, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x40A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x4234, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x3DF0, 0x42A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x0030, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x0034, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x0060, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x0064, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x00A0, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x00A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x0230, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x0234, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x0238, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x023C, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x0260, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x0264, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x02A0, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x02A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x1010, iwl9260_2ac_cfg)}, +- {IWL_PCI_DEVICE(0x43F0, 0x1030, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x1210, iwl9260_2ac_cfg)}, +- {IWL_PCI_DEVICE(0x43F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x2030, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x2034, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x4030, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x4034, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x40A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x4234, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0x43F0, 0x42A4, iwl9462_2ac_cfg_soc)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x3DF0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ ++ {IWL_PCI_DEVICE(0x43F0, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0x43F0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ + {IWL_PCI_DEVICE(0x9DF0, 0x0000, iwl9460_2ac_cfg_soc)}, + {IWL_PCI_DEVICE(0x9DF0, 0x0010, iwl9460_2ac_cfg_soc)}, + {IWL_PCI_DEVICE(0x9DF0, 0x0030, iwl9560_2ac_160_cfg_soc)}, +@@ -821,34 +821,34 @@ static const struct pci_device_id iwl_hw_card_ids[] = { + {IWL_PCI_DEVICE(0x9DF0, 0x40A4, iwl9462_2ac_cfg_soc)}, + {IWL_PCI_DEVICE(0x9DF0, 0x4234, iwl9560_2ac_cfg_soc)}, + {IWL_PCI_DEVICE(0x9DF0, 0x42A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x0030, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x0034, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x0060, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x0064, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x00A0, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x00A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x0230, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x0234, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x0238, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x023C, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x0260, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x0264, iwl9461_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x02A0, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x02A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x1010, iwl9260_2ac_cfg)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x1030, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x1210, iwl9260_2ac_cfg)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x2030, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x2034, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x4030, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x4034, iwl9560_2ac_160_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x40A4, iwl9462_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x4234, iwl9560_2ac_cfg_soc)}, +- {IWL_PCI_DEVICE(0xA0F0, 0x42A4, iwl9462_2ac_cfg_soc)}, ++ ++ {IWL_PCI_DEVICE(0xA0F0, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, ++ {IWL_PCI_DEVICE(0xA0F0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ++ + {IWL_PCI_DEVICE(0xA370, 0x0030, iwl9560_2ac_160_cfg_soc)}, + {IWL_PCI_DEVICE(0xA370, 0x0034, iwl9560_2ac_cfg_soc)}, + {IWL_PCI_DEVICE(0xA370, 0x0038, iwl9560_2ac_160_cfg_soc)}, +-- +cgit 1.2-0.3.lf.el7 diff --git a/kernel.spec b/kernel.spec index f7ee10ce2..c902bbca6 100644 --- a/kernel.spec +++ b/kernel.spec @@ -598,6 +598,9 @@ Patch508: v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-pars Patch509: PATCH-v2-selinux-allow-labeling-before-policy-is-loaded.patch +Patch510: iwlwifi-exclude-GEO-SAR-support-for-3168.patch +Patch511: iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch + # END OF PATCH DEFINITIONS %endif @@ -1799,6 +1802,9 @@ fi # # %changelog +* Fri Oct 11 2019 Peter Robinson +- Last iwlwifi fix for the recent firmware issues (rhbz 1733369) + * Tue Oct 08 2019 Laura Abbott - 5.3.5-300 - Linux v5.3.5 From 4bba71a8783e6fe0db4ae90a6cea56230cf53f43 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Fri, 11 Oct 2019 15:52:45 -0400 Subject: [PATCH 022/178] Fix disappearching cursor issue (rhbz 1738614) --- ...k-contents-as-dirty-on-a-write-fault.patch | 54 +++++++++++++++++++ kernel.spec | 6 +++ 2 files changed, 60 insertions(+) create mode 100644 drm-i915-Mark-contents-as-dirty-on-a-write-fault.patch diff --git a/drm-i915-Mark-contents-as-dirty-on-a-write-fault.patch b/drm-i915-Mark-contents-as-dirty-on-a-write-fault.patch new file mode 100644 index 000000000..fd85fd874 --- /dev/null +++ b/drm-i915-Mark-contents-as-dirty-on-a-write-fault.patch @@ -0,0 +1,54 @@ +From 7a78f4f0497f903756183f8b227f6fddaba8cdb0 Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Fri, 20 Sep 2019 13:18:21 +0100 +Subject: [PATCH] drm/i915: Mark contents as dirty on a write fault +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Since dropping the set-to-gtt-domain in commit a679f58d0510 ("drm/i915: +Flush pages on acquisition"), we no longer mark the contents as dirty on +a write fault. This has the issue of us then not marking the pages as +dirty on releasing the buffer, which means the contents are not written +out to the swap device (should we ever pick that buffer as a victim). +Notably, this is visible in the dumb buffer interface used for cursors. +Having updated the cursor contents via mmap, and swapped away, if the +shrinker should evict the old cursor, upon next reuse, the cursor would +be invisible. + +E.g. echo 80 > /proc/sys/kernel/sysrq ; echo f > /proc/sysrq-trigger + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111541 +Fixes: a679f58d0510 ("drm/i915: Flush pages on acquisition") +Signed-off-by: Chris Wilson +Cc: Matthew Auld +Cc: Ville Syrjälä +Cc: # v5.2+ +Reviewed-by: Matthew Auld +Link: https://patchwork.freedesktop.org/patch/msgid/20190920121821.7223-1-chris@chris-wilson.co.uk +(cherry picked from commit 5028851cdfdf78dc22eacbc44a0ab0b3f599ee4a) +Signed-off-by: Rodrigo Vivi +--- + drivers/gpu/drm/i915/gem/i915_gem_mman.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c +index 39a661927d8e..c201289039fe 100644 +--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c ++++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c +@@ -317,7 +317,11 @@ vm_fault_t i915_gem_fault(struct vm_fault *vmf) + msecs_to_jiffies_timeout(CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND)); + GEM_BUG_ON(!obj->userfault_count); + +- i915_vma_set_ggtt_write(vma); ++ if (write) { ++ GEM_BUG_ON(!i915_gem_object_has_pinned_pages(obj)); ++ i915_vma_set_ggtt_write(vma); ++ obj->mm.dirty = true; ++ } + + err_fence: + i915_vma_unpin_fence(vma); +-- +2.21.0 + diff --git a/kernel.spec b/kernel.spec index c902bbca6..2ebebdff4 100644 --- a/kernel.spec +++ b/kernel.spec @@ -601,6 +601,9 @@ Patch509: PATCH-v2-selinux-allow-labeling-before-policy-is-loaded.patch Patch510: iwlwifi-exclude-GEO-SAR-support-for-3168.patch Patch511: iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch +# rhbz 1738614 +Patch512: drm-i915-Mark-contents-as-dirty-on-a-write-fault.patch + # END OF PATCH DEFINITIONS %endif @@ -1802,6 +1805,9 @@ fi # # %changelog +* Fri Oct 11 2019 Laura Abbott +- Fix disappearing cursor issue (rhbz 1738614) + * Fri Oct 11 2019 Peter Robinson - Last iwlwifi fix for the recent firmware issues (rhbz 1733369) From cda78490b383861b0fb5570b5e8c02a53cef1dbd Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sat, 12 Oct 2019 15:06:00 +0100 Subject: [PATCH 023/178] arm: be less harsh on the omap/am33xx disable, it's just CRYPTO_DEV_OMAP_AES that's broken --- .../fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP | 2 +- .../generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_DES | 2 +- .../generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_SHAM | 2 +- kernel-armv7hl-debug.config | 6 +++--- kernel-armv7hl.config | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP index df6a929e2..98ff565f8 100644 --- a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP +++ b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP @@ -1 +1 @@ -# CONFIG_CRYPTO_DEV_OMAP is not set +CONFIG_CRYPTO_DEV_OMAP=m diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_DES b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_DES index 952a6e247..b359a5c3f 100644 --- a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_DES +++ b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_DES @@ -1 +1 @@ -# CONFIG_CRYPTO_DEV_OMAP_DES is not set +CONFIG_CRYPTO_DEV_OMAP_DES=m diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_SHAM b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_SHAM index 2997e8fc1..58d162aba 100644 --- a/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_SHAM +++ b/configs/fedora/generic/arm/armv7/armv7/CONFIG_CRYPTO_DEV_OMAP_SHAM @@ -1 +1 @@ -# CONFIG_CRYPTO_DEV_OMAP_SHAM is not set +CONFIG_CRYPTO_DEV_OMAP_SHAM=m diff --git a/kernel-armv7hl-debug.config b/kernel-armv7hl-debug.config index 4a105466d..2d1deebad 100644 --- a/kernel-armv7hl-debug.config +++ b/kernel-armv7hl-debug.config @@ -1143,9 +1143,9 @@ CONFIG_CRYPTO_DEV_MARVELL_CESA=m CONFIG_CRYPTO_DEV_MXS_DCP=m # CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set # CONFIG_CRYPTO_DEV_OMAP_AES is not set -# CONFIG_CRYPTO_DEV_OMAP_DES is not set -# CONFIG_CRYPTO_DEV_OMAP is not set -# CONFIG_CRYPTO_DEV_OMAP_SHAM is not set +CONFIG_CRYPTO_DEV_OMAP_DES=m +CONFIG_CRYPTO_DEV_OMAP=m +CONFIG_CRYPTO_DEV_OMAP_SHAM=m CONFIG_CRYPTO_DEV_QCE=m CONFIG_CRYPTO_DEV_QCOM_RNG=m CONFIG_CRYPTO_DEV_ROCKCHIP=m diff --git a/kernel-armv7hl.config b/kernel-armv7hl.config index 614d53a6c..c1b3537de 100644 --- a/kernel-armv7hl.config +++ b/kernel-armv7hl.config @@ -1143,9 +1143,9 @@ CONFIG_CRYPTO_DEV_MARVELL_CESA=m CONFIG_CRYPTO_DEV_MXS_DCP=m # CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set # CONFIG_CRYPTO_DEV_OMAP_AES is not set -# CONFIG_CRYPTO_DEV_OMAP_DES is not set -# CONFIG_CRYPTO_DEV_OMAP is not set -# CONFIG_CRYPTO_DEV_OMAP_SHAM is not set +CONFIG_CRYPTO_DEV_OMAP_DES=m +CONFIG_CRYPTO_DEV_OMAP=m +CONFIG_CRYPTO_DEV_OMAP_SHAM=m CONFIG_CRYPTO_DEV_QCE=m CONFIG_CRYPTO_DEV_QCOM_RNG=m CONFIG_CRYPTO_DEV_ROCKCHIP=m From aec7c803933d2a4ece80e2c6c4ffc177e85ea006 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sat, 12 Oct 2019 15:17:53 +0100 Subject: [PATCH 024/178] add forgotten hisi SPI config --- configs/fedora/generic/arm/aarch64/CONFIG_SPI_HISI_SFC | 1 + 1 file changed, 1 insertion(+) create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_SPI_HISI_SFC diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_SPI_HISI_SFC b/configs/fedora/generic/arm/aarch64/CONFIG_SPI_HISI_SFC new file mode 100644 index 000000000..79cccec1d --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_SPI_HISI_SFC @@ -0,0 +1 @@ +CONFIG_SPI_HISI_SFC=m From 6bd74d76febce15a6a6e83f145d5ca8929dfc131 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 13 Oct 2019 10:45:21 +0100 Subject: [PATCH 025/178] bcm2835: hdmi audio regression fix --- ...dio-Fix-draining-behavior-regression.patch | 64 +++++++++++++++++++ kernel.spec | 2 + 2 files changed, 66 insertions(+) create mode 100644 bcm2835-audio-Fix-draining-behavior-regression.patch diff --git a/bcm2835-audio-Fix-draining-behavior-regression.patch b/bcm2835-audio-Fix-draining-behavior-regression.patch new file mode 100644 index 000000000..6d63db3f8 --- /dev/null +++ b/bcm2835-audio-Fix-draining-behavior-regression.patch @@ -0,0 +1,64 @@ +From 2eed19b99c8e95ff87afe6c140ed895c3fac5937 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Sat, 14 Sep 2019 17:24:05 +0200 +Subject: staging: bcm2835-audio: Fix draining behavior regression + +The PCM draining behavior got broken since the recent refactoring, and +this turned out to be the incorrect expectation of the firmware +behavior regarding "draining". While I expected the "drain" flag at +the stop operation would do processing the queued samples, it seems +rather dropping the samples. + +As a quick fix, just drop the SNDRV_PCM_INFO_DRAIN_TRIGGER flag, so +that the driver uses the normal PCM draining procedure. Also, put +some caution comment to the function for future readers not to fall +into the same pitfall. + +Fixes: d7ca3a71545b ("staging: bcm2835-audio: Operate non-atomic PCM ops") +BugLink: https://github.com/raspberrypi/linux/issues/2983 +Cc: stable@vger.kernel.org +Signed-off-by: Takashi Iwai +Acked-by: Stefan Wahren +Link: https://lore.kernel.org/r/20190914152405.7416-1-tiwai@suse.de +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 4 ++-- + drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 1 + + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c +index bc1eaa3a0773..826016c3431a 100644 +--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c ++++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c +@@ -12,7 +12,7 @@ + static const struct snd_pcm_hardware snd_bcm2835_playback_hw = { + .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | + SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | +- SNDRV_PCM_INFO_DRAIN_TRIGGER | SNDRV_PCM_INFO_SYNC_APPLPTR), ++ SNDRV_PCM_INFO_SYNC_APPLPTR), + .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, + .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, + .rate_min = 8000, +@@ -29,7 +29,7 @@ static const struct snd_pcm_hardware snd_bcm2835_playback_hw = { + static const struct snd_pcm_hardware snd_bcm2835_playback_spdif_hw = { + .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | + SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | +- SNDRV_PCM_INFO_DRAIN_TRIGGER | SNDRV_PCM_INFO_SYNC_APPLPTR), ++ SNDRV_PCM_INFO_SYNC_APPLPTR), + .formats = SNDRV_PCM_FMTBIT_S16_LE, + .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_44100 | + SNDRV_PCM_RATE_48000, +diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +index 23fba01107b9..c6f9cf1913d2 100644 +--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c ++++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +@@ -289,6 +289,7 @@ int bcm2835_audio_stop(struct bcm2835_alsa_stream *alsa_stream) + VC_AUDIO_MSG_TYPE_STOP, false); + } + ++/* FIXME: this doesn't seem working as expected for "draining" */ + int bcm2835_audio_drain(struct bcm2835_alsa_stream *alsa_stream) + { + struct vc_audio_msg m = { +-- +cgit 1.2-0.3.lf.el7 diff --git a/kernel.spec b/kernel.spec index 2ebebdff4..f94ed88f0 100644 --- a/kernel.spec +++ b/kernel.spec @@ -559,6 +559,8 @@ Patch307: arm64-dts-rockchip-fix-RockPro64-vdd-log-regulator-settings.patch # https://patchwork.kernel.org/patch/11155461/ Patch308: arm64-dts-rockchip-fix-Rockpro64-RK808-interrupt-line.patch +Patch309: bcm2835-audio-Fix-draining-behavior-regression.patch + # Tegra bits Patch320: arm64-tegra-jetson-tx1-fixes.patch # https://www.spinics.net/lists/linux-tegra/msg43110.html From 7fa6a6fed5a2922b2df19b8424cb5eb6b9d9b22d Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 13 Oct 2019 14:52:53 +0100 Subject: [PATCH 026/178] raspberry pi: fix regression in display output due to new power driver --- ...ng-the-PM-driver-instead-of-firmware.patch | 78 +++++++++++++++++++ kernel.spec | 9 ++- 2 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 Revert-ARM-bcm283x-Switch-V3D-over-to-using-the-PM-driver-instead-of-firmware.patch diff --git a/Revert-ARM-bcm283x-Switch-V3D-over-to-using-the-PM-driver-instead-of-firmware.patch b/Revert-ARM-bcm283x-Switch-V3D-over-to-using-the-PM-driver-instead-of-firmware.patch new file mode 100644 index 000000000..8627b6087 --- /dev/null +++ b/Revert-ARM-bcm283x-Switch-V3D-over-to-using-the-PM-driver-instead-of-firmware.patch @@ -0,0 +1,78 @@ +From 9d1a8ad3c56f4e84a0ec46246b4c08a6d139f638 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Sun, 13 Oct 2019 14:33:23 +0100 +Subject: [PATCH] Revert "ARM: bcm283x: Switch V3D over to using the PM driver + instead of firmware." + +Since release of the new BCM2835 PM driver there has been several reports +of V3D probing issues. This is caused by timeouts during powering-up the +GRAFX PM domain: + + bcm2835-power: Timeout waiting for grafx power OK + +I was able to reproduce this reliable on my Raspberry Pi 3B+ after setting +force_turbo=1 in the firmware configuration. Since there are no issues +using the firmware PM driver with the same setup, there must be an issue +in the BCM2835 PM driver. + +Unfortunately there hasn't been much progress in identifying the root cause +since June (mostly in the lack of documentation), so i decided to switch +back until the issue in the BCM2835 PM driver is fixed. + +Link: https://github.com/raspberrypi/linux/issues/3046 +Fixes: e1dc2b2e1bef (" ARM: bcm283x: Switch V3D over to using the PM driver instead of firmware.") +Cc: stable@vger.kernel.org +Signed-off-by: Stefan Wahren +Acked-by: Eric Anholt +--- + a/arch/arm/boot/dts/bcm2835-rpi.dtsi | 4 ++++ + b/arch/arm/boot/dts/bcm283x.dtsi | 4 +--- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi +index 715d50c64529..d136867c317f 100644 +--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi +@@ -90,6 +90,10 @@ + status = "okay"; + }; + ++&v3d { ++ power-domains = <&power RPI_POWER_DOMAIN_V3D>; ++}; ++ + &vec { + power-domains = <&power RPI_POWER_DOMAIN_VEC>; + status = "okay"; +diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi +index 4b21ddb26aa5..0c6a6611f285 100644 +--- a/arch/arm/boot/dts/bcm283x.dtsi ++++ b/arch/arm/boot/dts/bcm283x.dtsi +@@ -3,7 +3,6 @@ + #include + #include + #include +-#include + + /* firmware-provided startup stubs live here, where the secondary CPUs are + * spinning. +@@ -121,7 +120,7 @@ + #interrupt-cells = <2>; + }; + +- pm: watchdog@7e100000 { ++ watchdog@7e100000 { + compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt"; + #power-domain-cells = <1>; + #reset-cells = <1>; +@@ -641,7 +640,6 @@ + compatible = "brcm,bcm2835-v3d"; + reg = <0x7ec00000 0x1000>; + interrupts = <1 10>; +- power-domains = <&pm BCM2835_POWER_DOMAIN_GRAFX_V3D>; + }; + + vc4: gpu { +-- +2.21.0 + diff --git a/kernel.spec b/kernel.spec index f94ed88f0..9af899b8e 100644 --- a/kernel.spec +++ b/kernel.spec @@ -559,8 +559,6 @@ Patch307: arm64-dts-rockchip-fix-RockPro64-vdd-log-regulator-settings.patch # https://patchwork.kernel.org/patch/11155461/ Patch308: arm64-dts-rockchip-fix-Rockpro64-RK808-interrupt-line.patch -Patch309: bcm2835-audio-Fix-draining-behavior-regression.patch - # Tegra bits Patch320: arm64-tegra-jetson-tx1-fixes.patch # https://www.spinics.net/lists/linux-tegra/msg43110.html @@ -578,6 +576,13 @@ Patch330: arm64-qcom-i2c-geni-Disable-DMA-processing-on-the-Lenovo-Yoga-C630.pat # https://patchwork.kernel.org/patch/11133293/ Patch332: arm64-dts-qcom-Add-Lenovo-Yoga-C630.patch +# Raspberry Pi bits +Patch340: bcm2835-audio-Fix-draining-behavior-regression.patch + +# This is typical rpi, we have a driver but it has problems because ¯\_(ツ)_/¯ but this revert makes pictures work again. +# https://patchwork.kernel.org/patch/11136979/ +Patch341: Revert-ARM-bcm283x-Switch-V3D-over-to-using-the-PM-driver-instead-of-firmware.patch + # 400 - IBM (ppc/s390x) patches # 500 - Temp fixes/CVEs etc From db2600b8ff76954041abf60ff847b413908e5c8c Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Mon, 14 Oct 2019 07:52:10 -0400 Subject: [PATCH 027/178] Linux v5.3.6 --- ...A-processing-on-the-Lenovo-Yoga-C630.patch | 128 ------------------ kernel.spec | 7 +- sources | 2 +- 3 files changed, 5 insertions(+), 132 deletions(-) delete mode 100644 arm64-qcom-i2c-geni-Disable-DMA-processing-on-the-Lenovo-Yoga-C630.patch diff --git a/arm64-qcom-i2c-geni-Disable-DMA-processing-on-the-Lenovo-Yoga-C630.patch b/arm64-qcom-i2c-geni-Disable-DMA-processing-on-the-Lenovo-Yoga-C630.patch deleted file mode 100644 index a7f7c8f20..000000000 --- a/arm64-qcom-i2c-geni-Disable-DMA-processing-on-the-Lenovo-Yoga-C630.patch +++ /dev/null @@ -1,128 +0,0 @@ -From patchwork Thu Sep 5 19:24:12 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Lee Jones -X-Patchwork-Id: 11133827 -Return-Path: -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDFD514ED - for ; - Thu, 5 Sep 2019 19:24:19 +0000 (UTC) -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by mail.kernel.org (Postfix) with ESMTP id D540020870 - for ; - Thu, 5 Sep 2019 19:24:19 +0000 (UTC) -Authentication-Results: mail.kernel.org; - dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org - header.b="j/6kUy9p" -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1727540AbfIETYS (ORCPT - ); - Thu, 5 Sep 2019 15:24:18 -0400 -Received: from mail-wr1-f49.google.com ([209.85.221.49]:36821 "EHLO - mail-wr1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1726008AbfIETYS (ORCPT - ); - Thu, 5 Sep 2019 15:24:18 -0400 -Received: by mail-wr1-f49.google.com with SMTP id y19so4081592wrd.3 - for ; - Thu, 05 Sep 2019 12:24:16 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=linaro.org; s=google; - h=from:to:cc:subject:date:message-id; - bh=19vbMBbLeKgWt8VsEseKuJu+9+rmeS/Lh0ZhXOFWQYc=; - b=j/6kUy9psCaV+YLvz8j0kAZ3/WrmOU3xyh5rDOj0TwK0TnwjLtaLil9Q+C9KpFvvVG - h4R8p4cZFB0U4b/PAfc9Xt4p4xJNkAIpTzL4QRjM+nkXdDcYyiwUGkr9BRJnJmO0lyZB - zmylqwjRd1oOrTQ1tPvwqUV3OUR5u6WA+rDyhn+A516vskkns0bEICMG787HdDEwjigd - +3SR4L9u7swSDpNhqxtfPsn9UFP36sehUfgx32xUcjUhX3ls4RtX+6HCZU+rkeQuILt5 - 0qlmqliIuKXWkQe+ii/gtrK+ulFQ7lEl76YfDJyqXVo4Z357rIhVFAz+mooVn5qpscmU - E+xA== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20161025; - h=x-gm-message-state:from:to:cc:subject:date:message-id; - bh=19vbMBbLeKgWt8VsEseKuJu+9+rmeS/Lh0ZhXOFWQYc=; - b=QjFuCunKeBkoabY9fIsWTo3krapsS69k52eNtOIeLBaCd7M1lvCmItn41DcbJ5ykqT - RQ0rnlNq35x9QvKNumPai3fMZp9AWt3KpJpxbpEokltyLbkGUqRWaeYTrOtuV9P9nRmT - Yj72UBVzYj4d/G+FGq8EBesWjRyEFC51+RekvPlbRZ/h1fVW7/XAy5cO1ywnHrtNe8pQ - 7gYQJ3Xh1Y09qkiO0i8iru5PSMTK3U+vPSLWVdFOeqMh+Beins6I9mbKf+UX+xa8ECK3 - mEFjYxY57YVx+SpaKrmBwEmu9YXLgXqEif1OH1FHFiKZVQ4ABPp19D4+5JOXEV1tCwUS - B6Qw== -X-Gm-Message-State: APjAAAUM7yEkrkGZ+mbleFtCMQGsXfLQSXt2Bd+K6leuP2oAs8Vj1j9k - 4bsoJvF042q/z9+6bnLlGShjoA== -X-Google-Smtp-Source: - APXvYqyThx0kWliMdrjc7dedZ/+AhabFi7TIc04exnxhWAEkAOh7foRP8Cz8ZjjhxGJCvUyUPA4lFg== -X-Received: by 2002:adf:ea0c:: with SMTP id q12mr4172788wrm.172.1567711455933; - Thu, 05 Sep 2019 12:24:15 -0700 (PDT) -Received: from localhost.localdomain ([95.147.198.36]) - by smtp.gmail.com with ESMTPSA id - q24sm7942378wmc.3.2019.09.05.12.24.14 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Thu, 05 Sep 2019 12:24:14 -0700 (PDT) -From: Lee Jones -To: alokc@codeaurora.org, agross@kernel.org, robh+dt@kernel.org, - mark.rutland@arm.com, bjorn.andersson@linaro.org, vkoul@kernel.org, - wsa@the-dreams.de -Cc: linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, - devicetree@vger.kernel.org, Lee Jones -Subject: [RESEND v3 1/1] i2c: qcom-geni: Disable DMA processing on the Lenovo - Yoga C630 -Date: Thu, 5 Sep 2019 20:24:12 +0100 -Message-Id: <20190905192412.23116-1-lee.jones@linaro.org> -X-Mailer: git-send-email 2.17.1 -Sender: linux-arm-msm-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: linux-arm-msm@vger.kernel.org - -We have a production-level laptop (Lenovo Yoga C630) which is exhibiting -a rather horrific bug. When I2C HID devices are being scanned for at -boot-time the QCom Geni based I2C (Serial Engine) attempts to use DMA. -When it does, the laptop reboots and the user never sees the OS. - -Attempts are being made to debug the reason for the spontaneous reboot. -No luck so far, hence the requirement for this hot-fix. This workaround -will be removed once we have a viable fix. - -Signed-off-by: Lee Jones ---- - drivers/i2c/busses/i2c-qcom-geni.c | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c -index a89bfce5388e..17abf60c94ae 100644 ---- a/drivers/i2c/busses/i2c-qcom-geni.c -+++ b/drivers/i2c/busses/i2c-qcom-geni.c -@@ -355,11 +355,13 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, - { - dma_addr_t rx_dma; - unsigned long time_left; -- void *dma_buf; -+ void *dma_buf = NULL; - struct geni_se *se = &gi2c->se; - size_t len = msg->len; - -- dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); -+ if (!of_machine_is_compatible("lenovo,yoga-c630")) -+ dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); -+ - if (dma_buf) - geni_se_select_mode(se, GENI_SE_DMA); - else -@@ -394,11 +396,13 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, - { - dma_addr_t tx_dma; - unsigned long time_left; -- void *dma_buf; -+ void *dma_buf = NULL; - struct geni_se *se = &gi2c->se; - size_t len = msg->len; - -- dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); -+ if (!of_machine_is_compatible("lenovo,yoga-c630")) -+ dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); -+ - if (dma_buf) - geni_se_select_mode(se, GENI_SE_DMA); - else diff --git a/kernel.spec b/kernel.spec index 9af899b8e..b1a828173 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 5 +%define stable_update 6 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -571,8 +571,6 @@ Patch323: gpio-max77620-Use-correct-unit-for-debounce-times.patch Patch325: arm64-tegra186-enable-USB-on-Jetson-TX2.patch # QCom laptop bits -# https://patchwork.kernel.org/patch/11133827/ -Patch330: arm64-qcom-i2c-geni-Disable-DMA-processing-on-the-Lenovo-Yoga-C630.patch # https://patchwork.kernel.org/patch/11133293/ Patch332: arm64-dts-qcom-Add-Lenovo-Yoga-C630.patch @@ -1812,6 +1810,9 @@ fi # # %changelog +* Mon Oct 14 2019 Laura Abbott - 5.3.6-300 +- Linux v5.3.6 + * Fri Oct 11 2019 Laura Abbott - Fix disappearing cursor issue (rhbz 1738614) diff --git a/sources b/sources index 43a5f5d42..409d113b2 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.5.xz) = 70555da6275237bd6fe0514e2e49052f36af87fbae4919a464285dcdc9b84443995264762248496e44291800b2398a45bcf3fa3459a631f162cfdd915b972d9f +SHA512 (patch-5.3.6.xz) = 71ee140d7650189dcc824eb962e78b6f3d790369376b9b32d41babd55f57240ea5620bbeeef62164d0436e857ca772706d6b9202bac94c7ecbce78c3fd9860d2 From 6ee917b9e5941ad3d1eda59e5fccf9875b420a49 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Tue, 15 Oct 2019 08:57:19 +0100 Subject: [PATCH 028/178] fix booting on ARMv7 due to OPTIMIZE_INLINING now being forced, drop old i.MX MMC patch, fix for UFEI on ARMv7 on some devices --- ...-case-uaccess_-calls-are-not-inlined.patch | 143 ++++++++++++ arm-sdhci-esdhc-imx-fixes.patch | 57 ----- ...e-reserved-memory-at-the-base-of-RAM.patch | 216 ++++++++++++++++++ kernel.spec | 11 +- 4 files changed, 367 insertions(+), 60 deletions(-) create mode 100644 ARM-fix-__get_user_check-in-case-uaccess_-calls-are-not-inlined.patch delete mode 100644 arm-sdhci-esdhc-imx-fixes.patch create mode 100644 efi-libstub-arm-account-for-firmware-reserved-memory-at-the-base-of-RAM.patch diff --git a/ARM-fix-__get_user_check-in-case-uaccess_-calls-are-not-inlined.patch b/ARM-fix-__get_user_check-in-case-uaccess_-calls-are-not-inlined.patch new file mode 100644 index 000000000..db893d26e --- /dev/null +++ b/ARM-fix-__get_user_check-in-case-uaccess_-calls-are-not-inlined.patch @@ -0,0 +1,143 @@ +From patchwork Mon Sep 30 05:59:25 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Masahiro Yamada +X-Patchwork-Id: 1132459 +Return-Path: +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) + by smtp.lore.kernel.org (Postfix) with ESMTP id DF215C4360C + for ; Mon, 30 Sep 2019 06:02:56 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id B032A20815 + for ; Mon, 30 Sep 2019 06:02:56 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=nifty.com header.i=@nifty.com + header.b="sVJyT1RO" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1729635AbfI3GCz (ORCPT + ); + Mon, 30 Sep 2019 02:02:55 -0400 +Received: from conuserg-10.nifty.com ([210.131.2.77]:65305 "EHLO + conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1726121AbfI3GCz (ORCPT + ); + Mon, 30 Sep 2019 02:02:55 -0400 +Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp + [153.142.97.92]) (authenticated) + by conuserg-10.nifty.com with ESMTP id x8U60ANM011158; + Mon, 30 Sep 2019 15:00:10 +0900 +DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x8U60ANM011158 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; + s=dec2015msa; t=1569823213; + bh=31RHoPop8t0h2pCPRnwABR+VMelvfuLJ6qwFWQxvRAk=; + h=From:To:Cc:Subject:Date:From; + b=sVJyT1ROU+6mzkZMRTb0M214/0QcKkmxRbNgDwh2q1TPJpEjPLOoE+y1jkVndgyce + qBfr7v3nYiN5WSsx5xTwPYvHohsWcSS3AWwyVRw8Kxjd0CGrX8l5WcF76SmCvJPLCB + wLRZ7C1/Z/zv9v8AVlB2BGhDmSvNQJ9bvuGi42d+JbBXGDfg0HZGGHEj7yDDLBV9nW + EZkTGzP6wtIdqgD6DM5Lj4LA7FnlzH8Ocy6yp5agIZ7tdaiVh4E+Xb97KFsLgRin/o + kTPCap5ub1TziurVW+1pbzwH+G3TNVeY+yJdYcAQRFzXXOrTa7s5zIJUtObrYVGCA2 + ctH5uaN1kjx1g== +X-Nifty-SrcIP: [153.142.97.92] +From: Masahiro Yamada +To: linux-arm-kernel@lists.infradead.org, + Russell King +Cc: Linus Torvalds , + Olof Johansson , Arnd Bergmann , + Nick Desaulniers , + Nicolas Saenz Julienne , + Masahiro Yamada , + Julien Thierry , + Russell King , + Stefan Agner , + Thomas Gleixner , + Vincent Whitchurch , + linux-kernel@vger.kernel.org +Subject: [PATCH] ARM: fix __get_user_check() in case uaccess_* calls are not + inlined +Date: Mon, 30 Sep 2019 14:59:25 +0900 +Message-Id: <20190930055925.25842-1-yamada.masahiro@socionext.com> +X-Mailer: git-send-email 2.17.1 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-kernel@vger.kernel.org + +KernelCI reports that bcm2835_defconfig is no longer booting since +commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING +forcibly"): + + https://lkml.org/lkml/2019/9/26/825 + +I also received a regression report from Nicolas Saenz Julienne: + + https://lkml.org/lkml/2019/9/27/263 + +This problem has cropped up on arch/arm/config/bcm2835_defconfig +because it enables CONFIG_CC_OPTIMIZE_FOR_SIZE. The compiler tends +to prefer not inlining functions with -Os. I was able to reproduce +it with other boards and defconfig files by manually enabling +CONFIG_CC_OPTIMIZE_FOR_SIZE. + +The __get_user_check() specifically uses r0, r1, r2 registers. +So, uaccess_save_and_enable() and uaccess_restore() must be inlined +in order to avoid those registers being overwritten in the callees. + +Prior to commit 9012d011660e ("compiler: allow all arches to enable +CONFIG_OPTIMIZE_INLINING"), the 'inline' marker was always enough for +inlining functions, except on x86. + +Since that commit, all architectures can enable CONFIG_OPTIMIZE_INLINING. +So, __always_inline is now the only guaranteed way of forcible inlining. + +I want to keep as much compiler's freedom as possible about the inlining +decision. So, I changed the function call order instead of adding +__always_inline around. + +Call uaccess_save_and_enable() before assigning the __p ("r0"), and +uaccess_restore() after evacuating the __e ("r0"). + +Fixes: 9012d011660e ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING") +Reported-by: "kernelci.org bot" +Reported-by: Nicolas Saenz Julienne +Signed-off-by: Masahiro Yamada +Acked-by: Arnd Bergmann +Tested-by: Nicolas Saenz Julienne +Tested-by: Fabrizio Castro +Tested-by: Geert Uytterhoeven +--- + + arch/arm/include/asm/uaccess.h | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h +index 303248e5b990..559f252d7e3c 100644 +--- a/arch/arm/include/asm/uaccess.h ++++ b/arch/arm/include/asm/uaccess.h +@@ -191,11 +191,12 @@ extern int __get_user_64t_4(void *); + #define __get_user_check(x, p) \ + ({ \ + unsigned long __limit = current_thread_info()->addr_limit - 1; \ ++ unsigned int __ua_flags = uaccess_save_and_enable(); \ + register typeof(*(p)) __user *__p asm("r0") = (p); \ + register __inttype(x) __r2 asm("r2"); \ + register unsigned long __l asm("r1") = __limit; \ + register int __e asm("r0"); \ +- unsigned int __ua_flags = uaccess_save_and_enable(); \ ++ unsigned int __err; \ + switch (sizeof(*(__p))) { \ + case 1: \ + if (sizeof((x)) >= 8) \ +@@ -223,9 +224,10 @@ extern int __get_user_64t_4(void *); + break; \ + default: __e = __get_user_bad(); break; \ + } \ +- uaccess_restore(__ua_flags); \ ++ __err = __e; \ + x = (typeof(*(p))) __r2; \ +- __e; \ ++ uaccess_restore(__ua_flags); \ ++ __err; \ + }) + + #define get_user(x, p) \ diff --git a/arm-sdhci-esdhc-imx-fixes.patch b/arm-sdhci-esdhc-imx-fixes.patch deleted file mode 100644 index 1b10c3e18..000000000 --- a/arm-sdhci-esdhc-imx-fixes.patch +++ /dev/null @@ -1,57 +0,0 @@ -From patchwork Thu Jun 28 08:13:30 2018 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [2/3] mmc: sdhci: add quirk to prevent higher speed modes -From: Stefan Agner -X-Patchwork-Id: 10493273 -Message-Id: <20180628081331.13051-3-stefan@agner.ch> -To: adrian.hunter@intel.com, ulf.hansson@linaro.org -Cc: fabio.estevam@nxp.com, haibo.chen@nxp.com, aisheng.dong@nxp.com, - michael@amarulasolutions.com, rmk+kernel@armlinux.org.uk, - linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, - Stefan Agner -Date: Thu, 28 Jun 2018 10:13:30 +0200 - -Some hosts are capable of running higher speed modes but do not -have the board support for it. Introduce a quirk which prevents -the stack from using modes running at 100MHz or faster. - -Signed-off-by: Stefan Agner ---- - drivers/mmc/host/sdhci.c | 8 ++++++++ - drivers/mmc/host/sdhci.h | 2 ++ - 2 files changed, 10 insertions(+) - -diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c -index 1c828e0e9905..8ac257dfaab3 100644 ---- a/drivers/mmc/host/sdhci.c -+++ b/drivers/mmc/host/sdhci.c -@@ -3749,6 +3749,14 @@ int sdhci_setup_host(struct sdhci_host *host) - } - } - -+ if (host->quirks2 & SDHCI_QUIRK2_NO_UHS_HS200_HS400) { -+ host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 | -+ SDHCI_SUPPORT_DDR50); -+ -+ mmc->caps2 &= ~(MMC_CAP2_HSX00_1_8V | MMC_CAP2_HSX00_1_2V | -+ MMC_CAP2_HS400_ES); -+ } -+ - if (host->quirks2 & SDHCI_QUIRK2_NO_1_8_V) { - host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 | - SDHCI_SUPPORT_DDR50); -diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h -index 23966f887da6..cb2433d6d61f 100644 ---- a/drivers/mmc/host/sdhci.h -+++ b/drivers/mmc/host/sdhci.h -@@ -450,6 +450,8 @@ struct sdhci_host { - * block count. - */ - #define SDHCI_QUIRK2_USE_32BIT_BLK_CNT (1<<18) -+/* Do not support any higher speeds (>50MHz) */ -+#define SDHCI_QUIRK2_NO_UHS_HS200_HS400 (1<<19) - - int irq; /* Device IRQ */ - void __iomem *ioaddr; /* Mapped address */ diff --git a/efi-libstub-arm-account-for-firmware-reserved-memory-at-the-base-of-RAM.patch b/efi-libstub-arm-account-for-firmware-reserved-memory-at-the-base-of-RAM.patch new file mode 100644 index 000000000..47bccc262 --- /dev/null +++ b/efi-libstub-arm-account-for-firmware-reserved-memory-at-the-base-of-RAM.patch @@ -0,0 +1,216 @@ +From patchwork Mon Oct 14 16:33:09 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Ard Biesheuvel +X-Patchwork-Id: 11189097 +Return-Path: + +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E1AD11390 + for ; + Mon, 14 Oct 2019 16:33:28 +0000 (UTC) +Received: from bombadil.infradead.org (bombadil.infradead.org + [198.137.202.133]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) + (No client certificate requested) + by mail.kernel.org (Postfix) with ESMTPS id BF9BE217D9 + for ; + Mon, 14 Oct 2019 16:33:28 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="AWaZtE0p"; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=linaro.org header.i=@linaro.org header.b="THTDXG/3" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF9BE217D9 +Authentication-Results: mail.kernel.org; + dmarc=fail (p=none dis=none) header.from=linaro.org +Authentication-Results: mail.kernel.org; + spf=none + smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=lists.infradead.org; s=bombadil.20170209; h=Sender: + Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: + List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To + :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: + Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: + List-Owner; bh=bFVBLmSAI67EKVRVJ976rFVJhb17XzlF5Frmxpt4Q24=; b=AWaZtE0prtFAKn + TzXV3jyYung5GM46YpbdIYSXq5utN5mbiOzHoadisQSsfKUn1h5/wpF7esUHXwHaDS5FWUUp5g6F+ + P0rKmQjVgWN+jVD7Kk7RvmJewoFKWvlUzoG5+Lfin8NLSHMwNg+v2Z+sUayE+SylST1LP8jkK8B7e + QiOi647qxPv6IW25Zucu4D+N8DXmh+t6DjJXZ2W1LznbCD0PIPjTpcen0dntkHUYL0FHya3ghdrC3 + ejo+MjvSDlrs4LgP5ER56hiSeucu58WMLefoUS3oSEYirB+9zt3Qk2Ppxv6k2GY/NBkLjw9jT76kg + OIZj83Gck17z+l7+NVmQ==; +Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) + by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) + id 1iK3Hk-0001ZP-CS; Mon, 14 Oct 2019 16:33:28 +0000 +Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) + by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) + id 1iK3Hf-0001Tp-Mo + for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2019 16:33:26 +0000 +Received: by mail-wm1-x341.google.com with SMTP id y135so386665wmc.1 + for ; + Mon, 14 Oct 2019 09:33:23 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; + h=from:to:cc:subject:date:message-id:mime-version + :content-transfer-encoding; + bh=yuEdphuMWOUGDahWSE97oqgmOlObKgpyvQgzFU8TRQU=; + b=THTDXG/3mOeZtb6dOK6qrH1eQvV7z52+jijnE+ULOhMbPReKZiIPTLCR3+W7HnWIkL + RFmtL80kGqOr/FynSqFtzLiwv4TaClqwXnVtULNnpITi/cHhy+AnvWVfQCDZ1THjSHSh + pduFTV40hbsfQR4K3wm6K4LGLOnaAkS193JT28eOdR7oOcCjbZSKoQKTYCquWrAWTeIo + oQAUnFNuy4gdBy+94VmzR0AdgNrDXTc5KPDYLaOTSBxZUJQ8+7pDFhxOxm06B6gNgPEp + fzYcPcRV2R9hc6PtL8jxMKRNQ3PcJnas8KU2DsmaK/FJZxgtzXs97TaHydGKq33TYgst + Mpow== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version + :content-transfer-encoding; + bh=yuEdphuMWOUGDahWSE97oqgmOlObKgpyvQgzFU8TRQU=; + b=PJHaADcio6H7WwVXfMpYGT2fr/FMtU5GUUbNeD+td9rfpid6nfbHrh2TCAQtpxAMaS + B63nd+HNchQoPhWWHWMMx8gbY9KwOKzc5/FO5wqeDo5gbpI/eWidH+ieGLaxozX/Aqku + BLTdsnGMIB+FxmFCmtaY1y9wuqdVmS/4RiobjBycBZmXBYOYxZc3I81zM1u+nBjRKsNZ + h2D/gN8sjkRbT4f5kU/xpHbh+8CbpVp4ze5cpKOf35Iwf+ASNw/l53NHft0Y41ehG2NA + YFsdBpquso+CNhTGqN5VOBlpGdMFRJ4SIseygRQbXVT4KEeZBP60so7Ed8MwxoXmG6sw + gM5w== +X-Gm-Message-State: APjAAAUc9u8vjoe8La6L5Z/DMvnvVKz828SBRtfClkhDufJCaEZaQ1S9 + nO3+g66C+iOliANLi0dTY/L7SkabogZiQQ== +X-Google-Smtp-Source: + APXvYqz0XzN3uY3m31zQi76ZEDZQMtYggJ6COqe0WCePJ5GuE+rYLNtFHVBakYmvlBvQjlPYRU+lrg== +X-Received: by 2002:a1c:a516:: with SMTP id + o22mr16781400wme.116.1571070801893; + Mon, 14 Oct 2019 09:33:21 -0700 (PDT) +Received: from localhost.localdomain + (laubervilliers-657-1-83-120.w92-154.abo.wanadoo.fr. [92.154.90.120]) + by smtp.gmail.com with ESMTPSA id o70sm25785240wme.29.2019.10.14.09.33.20 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Mon, 14 Oct 2019 09:33:21 -0700 (PDT) +From: Ard Biesheuvel +To: linux-arm-kernel@lists.infradead.org +Subject: [PATCH] efi: libstub/arm: account for firmware reserved memory at the + base of RAM +Date: Mon, 14 Oct 2019 18:33:09 +0200 +Message-Id: <20191014163309.2860-1-ard.biesheuvel@linaro.org> +X-Mailer: git-send-email 2.20.1 +MIME-Version: 1.0 +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20191014_093323_781941_B57BEE97 +X-CRM114-Status: GOOD ( 13.99 ) +X-Spam-Score: -0.2 (/) +X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: + Content analysis details: (-0.2 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, + no trust [2a00:1450:4864:20:0:0:0:341 listed in] + [list.dnswl.org] + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + -0.0 SPF_PASS SPF: sender matches SPF record + -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from + author's domain + 0.1 DKIM_SIGNED Message has a DKIM or DK signature, + not necessarily + valid + -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from + envelope-from domain + -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature +X-BeenThere: linux-arm-kernel@lists.infradead.org +X-Mailman-Version: 2.1.29 +Precedence: list +List-Id: +List-Unsubscribe: + , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: + , + +Cc: Chester Lin , Guillaume Gardet , + linux-efi@vger.kernel.org, Ard Biesheuvel +Sender: "linux-arm-kernel" +Errors-To: + linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org + +The EFI stubloader for ARM starts out by allocating a 32 MB window +at the base of RAM, in order to ensure that the decompressor (which +blindly copies the uncompressed kernel into that window) does not +overwrite other allocations that are made while running in the context +of the EFI firmware. + +In some cases, (e.g., U-Boot running on the Raspberry Pi 2), this is +causing boot failures because this initial allocation conflicts with +a page of reserved memory at the base of RAM that contains the SMP spin +tables and other pieces of firmware data and which was put there by +the bootloader under the assumption that the TEXT_OFFSET window right +below the kernel is only used partially during early boot, and will be +left alone once the memory reservations are processed and taken into +account. + +So let's permit reserved memory regions to exist in the region starting +at the base of RAM, and ending at TEXT_OFFSET - 5 * PAGE_SIZE, which is +the window below the kernel that is not touched by the early boot code. + +Cc: Guillaume Gardet +Cc: Chester Lin +Signed-off-by: Ard Biesheuvel +--- + drivers/firmware/efi/libstub/Makefile | 1 + + drivers/firmware/efi/libstub/arm32-stub.c | 16 +++++++++++++--- + 2 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile +index 0460c7581220..ee0661ddb25b 100644 +--- a/drivers/firmware/efi/libstub/Makefile ++++ b/drivers/firmware/efi/libstub/Makefile +@@ -52,6 +52,7 @@ lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o string.o random.o \ + + lib-$(CONFIG_ARM) += arm32-stub.o + lib-$(CONFIG_ARM64) += arm64-stub.o ++CFLAGS_arm32-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET) + CFLAGS_arm64-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET) + + # +diff --git a/drivers/firmware/efi/libstub/arm32-stub.c b/drivers/firmware/efi/libstub/arm32-stub.c +index e8f7aefb6813..47aafeff3e01 100644 +--- a/drivers/firmware/efi/libstub/arm32-stub.c ++++ b/drivers/firmware/efi/libstub/arm32-stub.c +@@ -195,6 +195,7 @@ efi_status_t handle_kernel_image(efi_system_table_t *sys_table, + unsigned long dram_base, + efi_loaded_image_t *image) + { ++ unsigned long kernel_base; + efi_status_t status; + + /* +@@ -204,9 +205,18 @@ efi_status_t handle_kernel_image(efi_system_table_t *sys_table, + * loaded. These assumptions are made by the decompressor, + * before any memory map is available. + */ +- dram_base = round_up(dram_base, SZ_128M); ++ kernel_base = round_up(dram_base, SZ_128M); + +- status = reserve_kernel_base(sys_table, dram_base, reserve_addr, ++ /* ++ * Note that some platforms (notably, the Raspberry Pi 2) put ++ * spin-tables and other pieces of firmware at the base of RAM, ++ * abusing the fact that the window of TEXT_OFFSET bytes at the ++ * base of the kernel image is only partially used at the moment. ++ * (Up to 5 pages are used for the swapper page table) ++ */ ++ kernel_base += TEXT_OFFSET - 5 * PAGE_SIZE; ++ ++ status = reserve_kernel_base(sys_table, kernel_base, reserve_addr, + reserve_size); + if (status != EFI_SUCCESS) { + pr_efi_err(sys_table, "Unable to allocate memory for uncompressed kernel.\n"); +@@ -220,7 +230,7 @@ efi_status_t handle_kernel_image(efi_system_table_t *sys_table, + *image_size = image->image_size; + status = efi_relocate_kernel(sys_table, image_addr, *image_size, + *image_size, +- dram_base + MAX_UNCOMP_KERNEL_SIZE, 0); ++ kernel_base + MAX_UNCOMP_KERNEL_SIZE, 0); + if (status != EFI_SUCCESS) { + pr_efi_err(sys_table, "Failed to relocate kernel.\n"); + efi_free(sys_table, *reserve_size, *reserve_addr); diff --git a/kernel.spec b/kernel.spec index b1a828173..6c928d0bc 100644 --- a/kernel.spec +++ b/kernel.spec @@ -551,9 +551,6 @@ Patch304: usb-phy-tegra-Add-38.4MHz-clock-table-entry.patch # http://patchwork.ozlabs.org/patch/587554/ Patch305: ARM-tegra-usb-no-reset.patch -# https://patchwork.kernel.org/project/linux-mmc/list/?submitter=71861 -Patch306: arm-sdhci-esdhc-imx-fixes.patch - # https://patchwork.kernel.org/patch/11173461/ Patch307: arm64-dts-rockchip-fix-RockPro64-vdd-log-regulator-settings.patch # https://patchwork.kernel.org/patch/11155461/ @@ -581,6 +578,9 @@ Patch340: bcm2835-audio-Fix-draining-behavior-regression.patch # https://patchwork.kernel.org/patch/11136979/ Patch341: Revert-ARM-bcm283x-Switch-V3D-over-to-using-the-PM-driver-instead-of-firmware.patch +# https://www.spinics.net/lists/arm-kernel/msg761152.html +Patch342: efi-libstub-arm-account-for-firmware-reserved-memory-at-the-base-of-RAM.patch + # 400 - IBM (ppc/s390x) patches # 500 - Temp fixes/CVEs etc @@ -609,6 +609,11 @@ Patch511: iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch # rhbz 1738614 Patch512: drm-i915-Mark-contents-as-dirty-on-a-write-fault.patch +# it seems CONFIG_OPTIMIZE_INLINING has been forced now and is causing issues on ARMv7 +# https://lore.kernel.org/patchwork/patch/1132459/ +# https://lkml.org/lkml/2019/8/29/1772 +Patch505: ARM-fix-__get_user_check-in-case-uaccess_-calls-are-not-inlined.patch + # END OF PATCH DEFINITIONS %endif From cd74d7acd33b240b69494f32b72a29c122f94b5a Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Fri, 18 Oct 2019 15:31:23 -0400 Subject: [PATCH 029/178] Linux v5.3.7 --- ...dio-Fix-draining-behavior-regression.patch | 64 ----- ...k-contents-as-dirty-on-a-write-fault.patch | 54 ---- kernel.spec | 15 +- sources | 2 +- ...s-event--count-when-it-isn-t-mapped..patch | 233 ------------------ ...e-after-successful-event-log-parsing.patch | 190 -------------- 6 files changed, 5 insertions(+), 553 deletions(-) delete mode 100644 bcm2835-audio-Fix-draining-behavior-regression.patch delete mode 100644 drm-i915-Mark-contents-as-dirty-on-a-write-fault.patch delete mode 100644 v2-1-2-efi-tpm-Don-t-access-event--count-when-it-isn-t-mapped..patch delete mode 100644 v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-parsing.patch diff --git a/bcm2835-audio-Fix-draining-behavior-regression.patch b/bcm2835-audio-Fix-draining-behavior-regression.patch deleted file mode 100644 index 6d63db3f8..000000000 --- a/bcm2835-audio-Fix-draining-behavior-regression.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 2eed19b99c8e95ff87afe6c140ed895c3fac5937 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Sat, 14 Sep 2019 17:24:05 +0200 -Subject: staging: bcm2835-audio: Fix draining behavior regression - -The PCM draining behavior got broken since the recent refactoring, and -this turned out to be the incorrect expectation of the firmware -behavior regarding "draining". While I expected the "drain" flag at -the stop operation would do processing the queued samples, it seems -rather dropping the samples. - -As a quick fix, just drop the SNDRV_PCM_INFO_DRAIN_TRIGGER flag, so -that the driver uses the normal PCM draining procedure. Also, put -some caution comment to the function for future readers not to fall -into the same pitfall. - -Fixes: d7ca3a71545b ("staging: bcm2835-audio: Operate non-atomic PCM ops") -BugLink: https://github.com/raspberrypi/linux/issues/2983 -Cc: stable@vger.kernel.org -Signed-off-by: Takashi Iwai -Acked-by: Stefan Wahren -Link: https://lore.kernel.org/r/20190914152405.7416-1-tiwai@suse.de -Signed-off-by: Greg Kroah-Hartman ---- - drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 4 ++-- - drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 1 + - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c -index bc1eaa3a0773..826016c3431a 100644 ---- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c -+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c -@@ -12,7 +12,7 @@ - static const struct snd_pcm_hardware snd_bcm2835_playback_hw = { - .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | - SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | -- SNDRV_PCM_INFO_DRAIN_TRIGGER | SNDRV_PCM_INFO_SYNC_APPLPTR), -+ SNDRV_PCM_INFO_SYNC_APPLPTR), - .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, - .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, - .rate_min = 8000, -@@ -29,7 +29,7 @@ static const struct snd_pcm_hardware snd_bcm2835_playback_hw = { - static const struct snd_pcm_hardware snd_bcm2835_playback_spdif_hw = { - .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | - SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | -- SNDRV_PCM_INFO_DRAIN_TRIGGER | SNDRV_PCM_INFO_SYNC_APPLPTR), -+ SNDRV_PCM_INFO_SYNC_APPLPTR), - .formats = SNDRV_PCM_FMTBIT_S16_LE, - .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_44100 | - SNDRV_PCM_RATE_48000, -diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c -index 23fba01107b9..c6f9cf1913d2 100644 ---- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c -+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c -@@ -289,6 +289,7 @@ int bcm2835_audio_stop(struct bcm2835_alsa_stream *alsa_stream) - VC_AUDIO_MSG_TYPE_STOP, false); - } - -+/* FIXME: this doesn't seem working as expected for "draining" */ - int bcm2835_audio_drain(struct bcm2835_alsa_stream *alsa_stream) - { - struct vc_audio_msg m = { --- -cgit 1.2-0.3.lf.el7 diff --git a/drm-i915-Mark-contents-as-dirty-on-a-write-fault.patch b/drm-i915-Mark-contents-as-dirty-on-a-write-fault.patch deleted file mode 100644 index fd85fd874..000000000 --- a/drm-i915-Mark-contents-as-dirty-on-a-write-fault.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 7a78f4f0497f903756183f8b227f6fddaba8cdb0 Mon Sep 17 00:00:00 2001 -From: Chris Wilson -Date: Fri, 20 Sep 2019 13:18:21 +0100 -Subject: [PATCH] drm/i915: Mark contents as dirty on a write fault -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Since dropping the set-to-gtt-domain in commit a679f58d0510 ("drm/i915: -Flush pages on acquisition"), we no longer mark the contents as dirty on -a write fault. This has the issue of us then not marking the pages as -dirty on releasing the buffer, which means the contents are not written -out to the swap device (should we ever pick that buffer as a victim). -Notably, this is visible in the dumb buffer interface used for cursors. -Having updated the cursor contents via mmap, and swapped away, if the -shrinker should evict the old cursor, upon next reuse, the cursor would -be invisible. - -E.g. echo 80 > /proc/sys/kernel/sysrq ; echo f > /proc/sysrq-trigger - -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111541 -Fixes: a679f58d0510 ("drm/i915: Flush pages on acquisition") -Signed-off-by: Chris Wilson -Cc: Matthew Auld -Cc: Ville Syrjälä -Cc: # v5.2+ -Reviewed-by: Matthew Auld -Link: https://patchwork.freedesktop.org/patch/msgid/20190920121821.7223-1-chris@chris-wilson.co.uk -(cherry picked from commit 5028851cdfdf78dc22eacbc44a0ab0b3f599ee4a) -Signed-off-by: Rodrigo Vivi ---- - drivers/gpu/drm/i915/gem/i915_gem_mman.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c -index 39a661927d8e..c201289039fe 100644 ---- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c -+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c -@@ -317,7 +317,11 @@ vm_fault_t i915_gem_fault(struct vm_fault *vmf) - msecs_to_jiffies_timeout(CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND)); - GEM_BUG_ON(!obj->userfault_count); - -- i915_vma_set_ggtt_write(vma); -+ if (write) { -+ GEM_BUG_ON(!i915_gem_object_has_pinned_pages(obj)); -+ i915_vma_set_ggtt_write(vma); -+ obj->mm.dirty = true; -+ } - - err_fence: - i915_vma_unpin_fence(vma); --- -2.21.0 - diff --git a/kernel.spec b/kernel.spec index 6c928d0bc..09c7d18f0 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 6 +%define stable_update 7 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -571,9 +571,6 @@ Patch325: arm64-tegra186-enable-USB-on-Jetson-TX2.patch # https://patchwork.kernel.org/patch/11133293/ Patch332: arm64-dts-qcom-Add-Lenovo-Yoga-C630.patch -# Raspberry Pi bits -Patch340: bcm2835-audio-Fix-draining-behavior-regression.patch - # This is typical rpi, we have a driver but it has problems because ¯\_(ツ)_/¯ but this revert makes pictures work again. # https://patchwork.kernel.org/patch/11136979/ Patch341: Revert-ARM-bcm283x-Switch-V3D-over-to-using-the-PM-driver-instead-of-firmware.patch @@ -597,18 +594,11 @@ Patch503: KEYS-Make-use-of-platform-keyring-for-module-signature.patch # rhbz 1753099 Patch504: dwc3-fix.patch -# rhbz 1752961 -Patch507: v2-1-2-efi-tpm-Don-t-access-event--count-when-it-isn-t-mapped..patch -Patch508: v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-parsing.patch - Patch509: PATCH-v2-selinux-allow-labeling-before-policy-is-loaded.patch Patch510: iwlwifi-exclude-GEO-SAR-support-for-3168.patch Patch511: iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch -# rhbz 1738614 -Patch512: drm-i915-Mark-contents-as-dirty-on-a-write-fault.patch - # it seems CONFIG_OPTIMIZE_INLINING has been forced now and is causing issues on ARMv7 # https://lore.kernel.org/patchwork/patch/1132459/ # https://lkml.org/lkml/2019/8/29/1772 @@ -1815,6 +1805,9 @@ fi # # %changelog +* Fri Oct 18 2019 Laura Abbott - 5.3.7-300 +- Linux v5.3.7 + * Mon Oct 14 2019 Laura Abbott - 5.3.6-300 - Linux v5.3.6 diff --git a/sources b/sources index 409d113b2..52c5ae7f6 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.6.xz) = 71ee140d7650189dcc824eb962e78b6f3d790369376b9b32d41babd55f57240ea5620bbeeef62164d0436e857ca772706d6b9202bac94c7ecbce78c3fd9860d2 +SHA512 (patch-5.3.7.xz) = bf2717b721b3acfd423537a6a520388e6a596ae65605ed8c029a67c117a002e9a21c324de0dd41407bfdc8ef95263687764f4f46aa59cbb50f68ab21b96c29d6 diff --git a/v2-1-2-efi-tpm-Don-t-access-event--count-when-it-isn-t-mapped..patch b/v2-1-2-efi-tpm-Don-t-access-event--count-when-it-isn-t-mapped..patch deleted file mode 100644 index d0ec73a2a..000000000 --- a/v2-1-2-efi-tpm-Don-t-access-event--count-when-it-isn-t-mapped..patch +++ /dev/null @@ -1,233 +0,0 @@ -From patchwork Wed Sep 25 10:16:18 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Jarkko Sakkinen -X-Patchwork-Id: 11160381 -Return-Path: -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43E0E112B - for ; - Wed, 25 Sep 2019 10:16:35 +0000 (UTC) -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by mail.kernel.org (Postfix) with ESMTP id 2BB5521D7A - for ; - Wed, 25 Sep 2019 10:16:35 +0000 (UTC) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S2389040AbfIYKQe (ORCPT - ); - Wed, 25 Sep 2019 06:16:34 -0400 -Received: from mga06.intel.com ([134.134.136.31]:40402 "EHLO mga06.intel.com" - rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP - id S1727141AbfIYKQe (ORCPT ); - Wed, 25 Sep 2019 06:16:34 -0400 -X-Amp-Result: SKIPPED(no attachment in message) -X-Amp-File-Uploaded: False -Received: from orsmga006.jf.intel.com ([10.7.209.51]) - by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; - 25 Sep 2019 03:16:33 -0700 -X-ExtLoop1: 1 -X-IronPort-AV: E=Sophos;i="5.64,547,1559545200"; - d="scan'208";a="193723106" -Received: from dariusvo-mobl.ger.corp.intel.com (HELO localhost) - ([10.249.39.150]) - by orsmga006.jf.intel.com with ESMTP; 25 Sep 2019 03:16:27 -0700 -From: Jarkko Sakkinen -To: linux-integrity@vger.kernel.org -Cc: Peter Jones , linux-efi@vger.kernel.org, - stable@vger.kernel.org, Lyude Paul , - Jarkko Sakkinen , - Matthew Garrett , - Ard Biesheuvel , - Roberto Sassu , - Bartosz Szczepanek , - linux-kernel@vger.kernel.org (open list) -Subject: [PATCH v2 1/2] efi+tpm: Don't access event->count when it isn't - mapped. -Date: Wed, 25 Sep 2019 13:16:18 +0300 -Message-Id: <20190925101622.31457-1-jarkko.sakkinen@linux.intel.com> -X-Mailer: git-send-email 2.20.1 -MIME-Version: 1.0 -Sender: linux-integrity-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: linux-integrity@vger.kernel.org - -From: Peter Jones - -Some machines generate a lot of event log entries. When we're -iterating over them, the code removes the old mapping and adds a -new one, so once we cross the page boundary we're unmapping the page -with the count on it. Hilarity ensues. - -This patch keeps the info from the header in local variables so we don't -need to access that page again or keep track of if it's mapped. - -Fixes: 44038bc514a2 ("tpm: Abstract crypto agile event size calculations") -Cc: linux-efi@vger.kernel.org -Cc: linux-integrity@vger.kernel.org -Cc: stable@vger.kernel.org -Signed-off-by: Peter Jones -Tested-by: Lyude Paul -Reviewed-by: Jarkko Sakkinen -Acked-by: Matthew Garrett -Acked-by: Ard Biesheuvel -Signed-off-by: Jarkko Sakkinen ---- - include/linux/tpm_eventlog.h | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - -diff --git a/include/linux/tpm_eventlog.h b/include/linux/tpm_eventlog.h -index 63238c84dc0b..12584b69a3f3 100644 ---- a/include/linux/tpm_eventlog.h -+++ b/include/linux/tpm_eventlog.h -@@ -170,6 +170,7 @@ static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, - u16 halg; - int i; - int j; -+ u32 count, event_type; - - marker = event; - marker_start = marker; -@@ -190,16 +191,22 @@ static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, - } - - event = (struct tcg_pcr_event2_head *)mapping; -+ /* -+ * the loop below will unmap these fields if the log is larger than -+ * one page, so save them here for reference. -+ */ -+ count = READ_ONCE(event->count); -+ event_type = READ_ONCE(event->event_type); - - efispecid = (struct tcg_efi_specid_event_head *)event_header->event; - - /* Check if event is malformed. */ -- if (event->count > efispecid->num_algs) { -+ if (count > efispecid->num_algs) { - size = 0; - goto out; - } - -- for (i = 0; i < event->count; i++) { -+ for (i = 0; i < count; i++) { - halg_size = sizeof(event->digests[i].alg_id); - - /* Map the digest's algorithm identifier */ -@@ -256,8 +263,9 @@ static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, - + event_field->event_size; - size = marker - marker_start; - -- if ((event->event_type == 0) && (event_field->event_size == 0)) -+ if (event_type == 0 && event_field->event_size == 0) - size = 0; -+ - out: - if (do_mapping) - TPM_MEMUNMAP(mapping, mapping_size); - -From patchwork Wed Sep 25 10:16:19 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Jarkko Sakkinen -X-Patchwork-Id: 11160383 -Return-Path: -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 363B114DB - for ; - Wed, 25 Sep 2019 10:16:40 +0000 (UTC) -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by mail.kernel.org (Postfix) with ESMTP id 1DCE921D7C - for ; - Wed, 25 Sep 2019 10:16:40 +0000 (UTC) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S2389138AbfIYKQj (ORCPT - ); - Wed, 25 Sep 2019 06:16:39 -0400 -Received: from mga18.intel.com ([134.134.136.126]:21948 "EHLO mga18.intel.com" - rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP - id S1727141AbfIYKQj (ORCPT ); - Wed, 25 Sep 2019 06:16:39 -0400 -X-Amp-Result: SKIPPED(no attachment in message) -X-Amp-File-Uploaded: False -Received: from orsmga004.jf.intel.com ([10.7.209.38]) - by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; - 25 Sep 2019 03:16:38 -0700 -X-ExtLoop1: 1 -X-IronPort-AV: E=Sophos;i="5.64,547,1559545200"; - d="scan'208";a="340366339" -Received: from dariusvo-mobl.ger.corp.intel.com (HELO localhost) - ([10.249.39.150]) - by orsmga004.jf.intel.com with ESMTP; 25 Sep 2019 03:16:35 -0700 -From: Jarkko Sakkinen -To: linux-integrity@vger.kernel.org -Cc: Peter Jones , linux-efi@vger.kernel.org, - stable@vger.kernel.org, Lyude Paul , - Jarkko Sakkinen , - Matthew Garrett , - Ard Biesheuvel , - linux-kernel@vger.kernel.org (open list) -Subject: [PATCH v2 2/2] efi+tpm: don't traverse an event log with no events -Date: Wed, 25 Sep 2019 13:16:19 +0300 -Message-Id: <20190925101622.31457-2-jarkko.sakkinen@linux.intel.com> -X-Mailer: git-send-email 2.20.1 -In-Reply-To: <20190925101622.31457-1-jarkko.sakkinen@linux.intel.com> -References: <20190925101622.31457-1-jarkko.sakkinen@linux.intel.com> -MIME-Version: 1.0 -Sender: linux-integrity-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: linux-integrity@vger.kernel.org - -From: Peter Jones - -When there are no entries to put into the final event log, some machines -will return the template they would have populated anyway. In this case -the nr_events field is 0, but the rest of the log is just garbage. - -This patch stops us from trying to iterate the table with -__calc_tpm2_event_size() when the number of events in the table is 0. - -Fixes: c46f3405692d ("tpm: Reserve the TPM final events table") -Cc: linux-efi@vger.kernel.org -Cc: linux-integrity@vger.kernel.org -Cc: stable@vger.kernel.org -Signed-off-by: Peter Jones -Tested-by: Lyude Paul -Reviewed-by: Jarkko Sakkinen -Acked-by: Matthew Garrett -Acked-by: Ard Biesheuvel -Signed-off-by: Jarkko Sakkinen ---- - drivers/firmware/efi/tpm.c | 15 ++++++++++----- - 1 file changed, 10 insertions(+), 5 deletions(-) - -diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c -index 1d3f5ca3eaaf..b9ae5c6f9b9c 100644 ---- a/drivers/firmware/efi/tpm.c -+++ b/drivers/firmware/efi/tpm.c -@@ -75,11 +75,16 @@ int __init efi_tpm_eventlog_init(void) - goto out; - } - -- tbl_size = tpm2_calc_event_log_size((void *)efi.tpm_final_log -- + sizeof(final_tbl->version) -- + sizeof(final_tbl->nr_events), -- final_tbl->nr_events, -- log_tbl->log); -+ tbl_size = 0; -+ if (final_tbl->nr_events != 0) { -+ void *events = (void *)efi.tpm_final_log -+ + sizeof(final_tbl->version) -+ + sizeof(final_tbl->nr_events); -+ -+ tbl_size = tpm2_calc_event_log_size(events, -+ final_tbl->nr_events, -+ log_tbl->log); -+ } - memblock_reserve((unsigned long)final_tbl, - tbl_size + sizeof(*final_tbl)); - early_memunmap(final_tbl, sizeof(*final_tbl)); diff --git a/v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-parsing.patch b/v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-parsing.patch deleted file mode 100644 index a828cb294..000000000 --- a/v3-tpm-only-set-efi_tpm_final_log_size-after-successful-event-log-parsing.patch +++ /dev/null @@ -1,190 +0,0 @@ -From patchwork Wed Sep 25 17:27:05 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Jerry Snitselaar -X-Patchwork-Id: 11161161 -Return-Path: -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88B8A1747 - for ; - Wed, 25 Sep 2019 17:27:13 +0000 (UTC) -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by mail.kernel.org (Postfix) with ESMTP id 66F4F217F4 - for ; - Wed, 25 Sep 2019 17:27:13 +0000 (UTC) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S2505171AbfIYR1J (ORCPT - ); - Wed, 25 Sep 2019 13:27:09 -0400 -Received: from mx1.redhat.com ([209.132.183.28]:41496 "EHLO mx1.redhat.com" - rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP - id S2505170AbfIYR1J (ORCPT ); - Wed, 25 Sep 2019 13:27:09 -0400 -Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com - [10.5.11.22]) - (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) - (No client certificate requested) - by mx1.redhat.com (Postfix) with ESMTPS id 4CE7C1056FB1; - Wed, 25 Sep 2019 17:27:08 +0000 (UTC) -Received: from cantor.redhat.com (ovpn-117-191.phx2.redhat.com [10.3.117.191]) - by smtp.corp.redhat.com (Postfix) with ESMTP id D081B1001B12; - Wed, 25 Sep 2019 17:27:07 +0000 (UTC) -From: Jerry Snitselaar -To: linux-efi@vger.kernel.org -Cc: linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, - stable@vger.kernel.org, Matthew Garrett , - Ard Biesheuvel , - Jarkko Sakkinen -Subject: [PATCH v3] tpm: only set efi_tpm_final_log_size after successful - event log parsing -Date: Wed, 25 Sep 2019 10:27:05 -0700 -Message-Id: <20190925172705.17358-1-jsnitsel@redhat.com> -MIME-Version: 1.0 -X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 -X-Greylist: Sender IP whitelisted, - not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); - Wed, 25 Sep 2019 17:27:08 +0000 (UTC) -Sender: linux-integrity-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: linux-integrity@vger.kernel.org - -If __calc_tpm2_event_size fails to parse an event it will return 0, -resulting tpm2_calc_event_log_size returning -1. Currently there is -no check of this return value, and efi_tpm_final_log_size can end up -being set to this negative value resulting in a panic like the -the one given below. - -Also __calc_tpm2_event_size returns a size of 0 when it fails -to parse an event, so update function documentation to reflect this. - -[ 0.774340] BUG: unable to handle page fault for address: ffffbc8fc00866ad -[ 0.774788] #PF: supervisor read access in kernel mode -[ 0.774788] #PF: error_code(0x0000) - not-present page -[ 0.774788] PGD 107d36067 P4D 107d36067 PUD 107d37067 PMD 107d38067 PTE 0 -[ 0.774788] Oops: 0000 [#1] SMP PTI -[ 0.774788] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.3.0-0.rc2.1.elrdy.x86_64 #1 -[ 0.774788] Hardware name: LENOVO 20HGS22D0W/20HGS22D0W, BIOS N1WET51W (1.30 ) 09/14/2018 -[ 0.774788] RIP: 0010:memcpy_erms+0x6/0x10 -[ 0.774788] Code: 90 90 90 90 eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 a4 c3 0f 1f 80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38 fe -[ 0.774788] RSP: 0000:ffffbc8fc0073b30 EFLAGS: 00010286 -[ 0.774788] RAX: ffff9b1fc7c5b367 RBX: ffff9b1fc8390000 RCX: ffffffffffffe962 -[ 0.774788] RDX: ffffffffffffe962 RSI: ffffbc8fc00866ad RDI: ffff9b1fc7c5b367 -[ 0.774788] RBP: ffff9b1c10ca7018 R08: ffffbc8fc0085fff R09: 8000000000000063 -[ 0.774788] R10: 0000000000001000 R11: 000fffffffe00000 R12: 0000000000003367 -[ 0.774788] R13: ffff9b1fcc47c010 R14: ffffbc8fc0085000 R15: 0000000000000002 -[ 0.774788] FS: 0000000000000000(0000) GS:ffff9b1fce200000(0000) knlGS:0000000000000000 -[ 0.774788] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 -[ 0.774788] CR2: ffffbc8fc00866ad CR3: 000000029f60a001 CR4: 00000000003606f0 -[ 0.774788] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 -[ 0.774788] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 -[ 0.774788] Call Trace: -[ 0.774788] tpm_read_log_efi+0x156/0x1a0 -[ 0.774788] tpm_bios_log_setup+0xc8/0x190 -[ 0.774788] tpm_chip_register+0x50/0x1c0 -[ 0.774788] tpm_tis_core_init.cold.9+0x28c/0x466 -[ 0.774788] tpm_tis_plat_probe+0xcc/0xea -[ 0.774788] platform_drv_probe+0x35/0x80 -[ 0.774788] really_probe+0xef/0x390 -[ 0.774788] driver_probe_device+0xb4/0x100 -[ 0.774788] device_driver_attach+0x4f/0x60 -[ 0.774788] __driver_attach+0x86/0x140 -[ 0.774788] ? device_driver_attach+0x60/0x60 -[ 0.774788] bus_for_each_dev+0x76/0xc0 -[ 0.774788] ? klist_add_tail+0x3b/0x70 -[ 0.774788] bus_add_driver+0x14a/0x1e0 -[ 0.774788] ? tpm_init+0xea/0xea -[ 0.774788] ? do_early_param+0x8e/0x8e -[ 0.774788] driver_register+0x6b/0xb0 -[ 0.774788] ? tpm_init+0xea/0xea -[ 0.774788] init_tis+0x86/0xd8 -[ 0.774788] ? do_early_param+0x8e/0x8e -[ 0.774788] ? driver_register+0x94/0xb0 -[ 0.774788] do_one_initcall+0x46/0x1e4 -[ 0.774788] ? do_early_param+0x8e/0x8e -[ 0.774788] kernel_init_freeable+0x199/0x242 -[ 0.774788] ? rest_init+0xaa/0xaa -[ 0.774788] kernel_init+0xa/0x106 -[ 0.774788] ret_from_fork+0x35/0x40 -[ 0.774788] Modules linked in: -[ 0.774788] CR2: ffffbc8fc00866ad -[ 0.774788] ---[ end trace 42930799f8d6eaea ]--- -[ 0.774788] RIP: 0010:memcpy_erms+0x6/0x10 -[ 0.774788] Code: 90 90 90 90 eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 a4 c3 0f 1f 80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38 fe -[ 0.774788] RSP: 0000:ffffbc8fc0073b30 EFLAGS: 00010286 -[ 0.774788] RAX: ffff9b1fc7c5b367 RBX: ffff9b1fc8390000 RCX: ffffffffffffe962 -[ 0.774788] RDX: ffffffffffffe962 RSI: ffffbc8fc00866ad RDI: ffff9b1fc7c5b367 -[ 0.774788] RBP: ffff9b1c10ca7018 R08: ffffbc8fc0085fff R09: 8000000000000063 -[ 0.774788] R10: 0000000000001000 R11: 000fffffffe00000 R12: 0000000000003367 -[ 0.774788] R13: ffff9b1fcc47c010 R14: ffffbc8fc0085000 R15: 0000000000000002 -[ 0.774788] FS: 0000000000000000(0000) GS:ffff9b1fce200000(0000) knlGS:0000000000000000 -[ 0.774788] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 -[ 0.774788] CR2: ffffbc8fc00866ad CR3: 000000029f60a001 CR4: 00000000003606f0 -[ 0.774788] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 -[ 0.774788] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 -[ 0.774788] Kernel panic - not syncing: Fatal exception -[ 0.774788] Kernel Offset: 0x1d000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) -[ 0.774788] ---[ end Kernel panic - not syncing: Fatal exception ]--- - -The root cause of the issue that caused the failure of event parsing -in this case is resolved by Peter Jone's patchset dealing with large -event logs where crossing over a page boundary causes the page with -the event count to be unmapped. - -Fixes: c46f3405692de ("tpm: Reserve the TPM final events table") -Cc: linux-efi@vger.kernel.org -Cc: linux-integrity@vger.kernel.org -Cc: stable@vger.kernel.org -Cc: Matthew Garrett -Cc: Ard Biesheuvel -Cc: Jarkko Sakkinen -Signed-off-by: Jerry Snitselaar -Reviewed-by: ---- -v3: rebase on top of Peter Jone's patchset -v2: added FW_BUG to pr_err, and renamed label to out_calc. - Updated doc comment for __calc_tpm2_event_size. - - drivers/firmware/efi/tpm.c | 9 ++++++++- - include/linux/tpm_eventlog.h | 2 +- - 2 files changed, 9 insertions(+), 2 deletions(-) - -diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c -index b9ae5c6f9b9c..703469c1ab8e 100644 ---- a/drivers/firmware/efi/tpm.c -+++ b/drivers/firmware/efi/tpm.c -@@ -85,11 +85,18 @@ int __init efi_tpm_eventlog_init(void) - final_tbl->nr_events, - log_tbl->log); - } -+ -+ if (tbl_size < 0) { -+ pr_err(FW_BUG "Failed to parse event in TPM Final Events Log\n"); -+ goto out_calc; -+ } -+ - memblock_reserve((unsigned long)final_tbl, - tbl_size + sizeof(*final_tbl)); -- early_memunmap(final_tbl, sizeof(*final_tbl)); - efi_tpm_final_log_size = tbl_size; - -+out_calc: -+ early_memunmap(final_tbl, sizeof(*final_tbl)); - out: - early_memunmap(log_tbl, sizeof(*log_tbl)); - return ret; -diff --git a/include/linux/tpm_eventlog.h b/include/linux/tpm_eventlog.h -index 12584b69a3f3..2dfdd63ac034 100644 ---- a/include/linux/tpm_eventlog.h -+++ b/include/linux/tpm_eventlog.h -@@ -152,7 +152,7 @@ struct tcg_algorithm_info { - * total. Once we've done this we know the offset of the data length field, - * and can calculate the total size of the event. - * -- * Return: size of the event on success, <0 on failure -+ * Return: size of the event on success, 0 on failure - */ - - static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, From 3ca9f3d998b5bb35bb335152d3fe652af7476c22 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Mon, 21 Oct 2019 14:58:44 -0400 Subject: [PATCH 030/178] Fix CVE-2019-17666 (rhbz 1763692) --- ...i-Fix-potential-overflow-on-P2P-code.patch | 52 +++++++++++++++++++ kernel.spec | 9 +++- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 0001-rtlwifi-Fix-potential-overflow-on-P2P-code.patch diff --git a/0001-rtlwifi-Fix-potential-overflow-on-P2P-code.patch b/0001-rtlwifi-Fix-potential-overflow-on-P2P-code.patch new file mode 100644 index 000000000..f8f40bd82 --- /dev/null +++ b/0001-rtlwifi-Fix-potential-overflow-on-P2P-code.patch @@ -0,0 +1,52 @@ +From 5d6fc173fd2963e39be890667d5bf3b1fde351dd Mon Sep 17 00:00:00 2001 +From: Laura Abbott +Date: Wed, 16 Oct 2019 16:45:48 -0400 +Subject: [PATCH v2] rtlwifi: Fix potential overflow on P2P code +To: Ping-Ke Shih +To: Kalle Valo +Cc: David S. Miller +Cc: linux-wireless@vger.kernel.org +Cc: netdev@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Cc: Nicolas Waisman + +Nicolas Waisman noticed that even though noa_len is checked for +a compatible length it's still possible to overrun the buffers +of p2pinfo since there's no check on the upper bound of noa_num. +Bound noa_num against P2P_MAX_NOA_NUM. + +Reported-by: Nicolas Waisman +Signed-off-by: Laura Abbott +--- +v2: Use P2P_MAX_NOA_NUM instead of erroring out. +--- + drivers/net/wireless/realtek/rtlwifi/ps.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c +index 70f04c2f5b17..fff8dda14023 100644 +--- a/drivers/net/wireless/realtek/rtlwifi/ps.c ++++ b/drivers/net/wireless/realtek/rtlwifi/ps.c +@@ -754,6 +754,9 @@ static void rtl_p2p_noa_ie(struct ieee80211_hw *hw, void *data, + return; + } else { + noa_num = (noa_len - 2) / 13; ++ if (noa_num > P2P_MAX_NOA_NUM) ++ noa_num = P2P_MAX_NOA_NUM; ++ + } + noa_index = ie[3]; + if (rtlpriv->psc.p2p_ps_info.p2p_ps_mode == +@@ -848,6 +851,9 @@ static void rtl_p2p_action_ie(struct ieee80211_hw *hw, void *data, + return; + } else { + noa_num = (noa_len - 2) / 13; ++ if (noa_num > P2P_MAX_NOA_NUM) ++ noa_num = P2P_MAX_NOA_NUM; ++ + } + noa_index = ie[3]; + if (rtlpriv->psc.p2p_ps_info.p2p_ps_mode == +-- +2.21.0 + diff --git a/kernel.spec b/kernel.spec index 09c7d18f0..839bc6aa2 100644 --- a/kernel.spec +++ b/kernel.spec @@ -44,7 +44,7 @@ Summary: The Linux kernel # For non-released -rc kernels, this will be appended after the rcX and # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3" # -%global baserelease 300 +%global baserelease 301 %global fedora_build %{baserelease} # base_sublevel is the kernel version we're starting with and patching @@ -604,6 +604,10 @@ Patch511: iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch # https://lkml.org/lkml/2019/8/29/1772 Patch505: ARM-fix-__get_user_check-in-case-uaccess_-calls-are-not-inlined.patch +# CVE-2019-17666 +# rhbz 176362 +Patch506: 0001-rtlwifi-Fix-potential-overflow-on-P2P-code.patch + # END OF PATCH DEFINITIONS %endif @@ -1805,6 +1809,9 @@ fi # # %changelog +* Mon Oct 21 2019 Laura Abbott - 5.3.7-301 +- Fix CVE-2019-17666 (rhbz 1763692) + * Fri Oct 18 2019 Laura Abbott - 5.3.7-300 - Linux v5.3.7 From f64e21df99d279797d8d19bd9d1c0945c0c26fb8 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Tue, 29 Oct 2019 10:07:27 -0400 Subject: [PATCH 031/178] Linux v5.3.8 --- ...h-jf-devices-to-use-qu-configuration.patch | 325 ------------------ kernel-aarch64-debug.config | 1 + kernel-aarch64.config | 1 + kernel-armv7hl-debug.config | 1 + kernel-armv7hl-lpae-debug.config | 1 + kernel-armv7hl-lpae.config | 1 + kernel-armv7hl.config | 1 + kernel.spec | 8 +- sources | 2 +- 9 files changed, 12 insertions(+), 329 deletions(-) delete mode 100644 iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch diff --git a/iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch b/iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch deleted file mode 100644 index e12b50c01..000000000 --- a/iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch +++ /dev/null @@ -1,325 +0,0 @@ -From aa0cc7dde17bb6b8cc533bbcfe3f53d70e0dd269 Mon Sep 17 00:00:00 2001 -From: Luca Coelho -Date: Tue, 8 Oct 2019 13:21:02 +0300 -Subject: iwlwifi: pcie: change qu with jf devices to use qu configuration - -There were a bunch of devices with qu and jf that were loading the -configuration with pu and jf, which is wrong. Fix them all -accordingly. Additionally, remove 0x1010 and 0x1210 subsytem IDs from -the list, since they are obviously wrong, and 0x0044 and 0x0244, which -were duplicate. - -Cc: stable@vger.kernel.org # 5.1+ -Signed-off-by: Luca Coelho ---- - drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 274 +++++++++++++------------- - 1 file changed, 137 insertions(+), 137 deletions(-) - -diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c -index e29c47744ef5..6f4bb7ce71a5 100644 ---- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c -+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c -@@ -513,31 +513,33 @@ static const struct pci_device_id iwl_hw_card_ids[] = { - {IWL_PCI_DEVICE(0x24FD, 0x9074, iwl8265_2ac_cfg)}, - - /* 9000 Series */ -- {IWL_PCI_DEVICE(0x02F0, 0x0030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x0034, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x0038, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x003C, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x0060, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x0064, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x00A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x00A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x0230, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x0234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x0238, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x023C, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x0260, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x0264, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x02A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x02A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x1551, iwl9560_killer_s_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x1552, iwl9560_killer_i_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x2030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x2034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x4030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x4034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x40A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x4234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, -- {IWL_PCI_DEVICE(0x02F0, 0x42A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x02F0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ - {IWL_PCI_DEVICE(0x06F0, 0x0030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x06F0, 0x0034, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x06F0, 0x0038, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, -@@ -643,34 +645,34 @@ static const struct pci_device_id iwl_hw_card_ids[] = { - {IWL_PCI_DEVICE(0x2720, 0x40A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x2720, 0x4234, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x2720, 0x42A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x0030, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x0034, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x0038, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x003C, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x0060, iwl9460_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x0064, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x00A0, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x00A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x0230, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x0234, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x0238, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x023C, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x0260, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x0264, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x02A0, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x02A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x1010, iwl9260_2ac_cfg)}, -- {IWL_PCI_DEVICE(0x30DC, 0x1030, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x1210, iwl9260_2ac_cfg)}, -- {IWL_PCI_DEVICE(0x30DC, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x1552, iwl9560_killer_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x2030, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x2034, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x4030, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x4034, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x40A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x4234, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x30DC, 0x42A4, iwl9462_2ac_cfg_soc)}, -+ -+ {IWL_PCI_DEVICE(0x30DC, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x30DC, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ - {IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_160_cfg_shared_clk)}, - {IWL_PCI_DEVICE(0x31DC, 0x0034, iwl9560_2ac_cfg_shared_clk)}, - {IWL_PCI_DEVICE(0x31DC, 0x0038, iwl9560_2ac_160_cfg_shared_clk)}, -@@ -726,62 +728,60 @@ static const struct pci_device_id iwl_hw_card_ids[] = { - {IWL_PCI_DEVICE(0x34F0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, - {IWL_PCI_DEVICE(0x34F0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, - -- {IWL_PCI_DEVICE(0x3DF0, 0x0030, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x0034, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x0038, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x003C, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x0060, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x0064, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x00A0, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x00A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x0230, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x0234, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x0238, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x023C, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x0260, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x0264, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x02A0, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x02A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x1010, iwl9260_2ac_cfg)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x1030, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x1210, iwl9260_2ac_cfg)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x2030, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x2034, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x4030, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x4034, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x40A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x4234, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x3DF0, 0x42A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x0030, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x0034, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x0060, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x0064, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x00A0, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x00A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x0230, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x0234, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x0238, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x023C, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x0260, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x0264, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x02A0, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x02A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x1010, iwl9260_2ac_cfg)}, -- {IWL_PCI_DEVICE(0x43F0, 0x1030, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x1210, iwl9260_2ac_cfg)}, -- {IWL_PCI_DEVICE(0x43F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x2030, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x2034, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x4030, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x4034, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x40A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x4234, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0x43F0, 0x42A4, iwl9462_2ac_cfg_soc)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x3DF0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ -+ {IWL_PCI_DEVICE(0x43F0, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0x43F0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ - {IWL_PCI_DEVICE(0x9DF0, 0x0000, iwl9460_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x9DF0, 0x0010, iwl9460_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x9DF0, 0x0030, iwl9560_2ac_160_cfg_soc)}, -@@ -821,34 +821,34 @@ static const struct pci_device_id iwl_hw_card_ids[] = { - {IWL_PCI_DEVICE(0x9DF0, 0x40A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x9DF0, 0x4234, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x9DF0, 0x42A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x0030, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x0034, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x0060, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x0064, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x00A0, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x00A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x0230, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x0234, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x0238, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x023C, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x0260, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x0264, iwl9461_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x02A0, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x02A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x1010, iwl9260_2ac_cfg)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x1030, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x1210, iwl9260_2ac_cfg)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x2030, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x2034, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x4030, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x4034, iwl9560_2ac_160_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x40A4, iwl9462_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x4234, iwl9560_2ac_cfg_soc)}, -- {IWL_PCI_DEVICE(0xA0F0, 0x42A4, iwl9462_2ac_cfg_soc)}, -+ -+ {IWL_PCI_DEVICE(0xA0F0, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, -+ {IWL_PCI_DEVICE(0xA0F0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, -+ - {IWL_PCI_DEVICE(0xA370, 0x0030, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0xA370, 0x0034, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA370, 0x0038, iwl9560_2ac_160_cfg_soc)}, --- -cgit 1.2-0.3.lf.el7 diff --git a/kernel-aarch64-debug.config b/kernel-aarch64-debug.config index be66d4230..c9fb4718e 100644 --- a/kernel-aarch64-debug.config +++ b/kernel-aarch64-debug.config @@ -841,6 +841,7 @@ CONFIG_CAVIUM_ERRATUM_23154=y CONFIG_CAVIUM_ERRATUM_27456=y CONFIG_CAVIUM_ERRATUM_30115=y CONFIG_CAVIUM_PTP=m +CONFIG_CAVIUM_TX2_ERRATUM_219=y CONFIG_CB710_CORE=m # CONFIG_CB710_DEBUG is not set # CONFIG_CC10001_ADC is not set diff --git a/kernel-aarch64.config b/kernel-aarch64.config index 2219b41b1..41dc17336 100644 --- a/kernel-aarch64.config +++ b/kernel-aarch64.config @@ -841,6 +841,7 @@ CONFIG_CAVIUM_ERRATUM_23154=y CONFIG_CAVIUM_ERRATUM_27456=y CONFIG_CAVIUM_ERRATUM_30115=y CONFIG_CAVIUM_PTP=m +CONFIG_CAVIUM_TX2_ERRATUM_219=y CONFIG_CB710_CORE=m # CONFIG_CB710_DEBUG is not set # CONFIG_CC10001_ADC is not set diff --git a/kernel-armv7hl-debug.config b/kernel-armv7hl-debug.config index 2d1deebad..1fe8f68d3 100644 --- a/kernel-armv7hl-debug.config +++ b/kernel-armv7hl-debug.config @@ -845,6 +845,7 @@ CONFIG_CARL9170_DEBUGFS=y CONFIG_CARL9170_LEDS=y CONFIG_CARL9170=m CONFIG_CASSINI=m +CONFIG_CAVIUM_TX2_ERRATUM_219=y CONFIG_CB710_CORE=m # CONFIG_CB710_DEBUG is not set # CONFIG_CC10001_ADC is not set diff --git a/kernel-armv7hl-lpae-debug.config b/kernel-armv7hl-lpae-debug.config index ed5c5b455..4eb2fd845 100644 --- a/kernel-armv7hl-lpae-debug.config +++ b/kernel-armv7hl-lpae-debug.config @@ -821,6 +821,7 @@ CONFIG_CARL9170_DEBUGFS=y CONFIG_CARL9170_LEDS=y CONFIG_CARL9170=m CONFIG_CASSINI=m +CONFIG_CAVIUM_TX2_ERRATUM_219=y CONFIG_CB710_CORE=m # CONFIG_CB710_DEBUG is not set # CONFIG_CC10001_ADC is not set diff --git a/kernel-armv7hl-lpae.config b/kernel-armv7hl-lpae.config index 59b968550..6b7c21499 100644 --- a/kernel-armv7hl-lpae.config +++ b/kernel-armv7hl-lpae.config @@ -821,6 +821,7 @@ CONFIG_CARDMAN_4040=m CONFIG_CARL9170_LEDS=y CONFIG_CARL9170=m CONFIG_CASSINI=m +CONFIG_CAVIUM_TX2_ERRATUM_219=y CONFIG_CB710_CORE=m # CONFIG_CB710_DEBUG is not set # CONFIG_CC10001_ADC is not set diff --git a/kernel-armv7hl.config b/kernel-armv7hl.config index c1b3537de..1424185f4 100644 --- a/kernel-armv7hl.config +++ b/kernel-armv7hl.config @@ -845,6 +845,7 @@ CONFIG_CARDMAN_4040=m CONFIG_CARL9170_LEDS=y CONFIG_CARL9170=m CONFIG_CASSINI=m +CONFIG_CAVIUM_TX2_ERRATUM_219=y CONFIG_CB710_CORE=m # CONFIG_CB710_DEBUG is not set # CONFIG_CC10001_ADC is not set diff --git a/kernel.spec b/kernel.spec index 839bc6aa2..c263a3fe3 100644 --- a/kernel.spec +++ b/kernel.spec @@ -44,7 +44,7 @@ Summary: The Linux kernel # For non-released -rc kernels, this will be appended after the rcX and # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3" # -%global baserelease 301 +%global baserelease 300 %global fedora_build %{baserelease} # base_sublevel is the kernel version we're starting with and patching @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 7 +%define stable_update 8 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -597,7 +597,6 @@ Patch504: dwc3-fix.patch Patch509: PATCH-v2-selinux-allow-labeling-before-policy-is-loaded.patch Patch510: iwlwifi-exclude-GEO-SAR-support-for-3168.patch -Patch511: iwlwifi-pcie-change-qu-with-jf-devices-to-use-qu-configuration.patch # it seems CONFIG_OPTIMIZE_INLINING has been forced now and is causing issues on ARMv7 # https://lore.kernel.org/patchwork/patch/1132459/ @@ -1809,6 +1808,9 @@ fi # # %changelog +* Tue Oct 29 2019 Laura Abbott - 5.3.8-300 +- Linux v5.3.8 + * Mon Oct 21 2019 Laura Abbott - 5.3.7-301 - Fix CVE-2019-17666 (rhbz 1763692) diff --git a/sources b/sources index 52c5ae7f6..947b6dfc3 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.7.xz) = bf2717b721b3acfd423537a6a520388e6a596ae65605ed8c029a67c117a002e9a21c324de0dd41407bfdc8ef95263687764f4f46aa59cbb50f68ab21b96c29d6 +SHA512 (patch-5.3.8.xz) = 870ccc19417fe56517ac13b0e2fc4cc48e21937af0a2291f57a252b60831c1fa41bf4af8c8b1613cde8d6410723dbab763fa58f1dc7ce8ba7a02c90523eba6bf From f60b42ed46ef58380467f69991c9b772b1327c10 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Tue, 29 Oct 2019 10:08:35 -0400 Subject: [PATCH 032/178] forgot this --- configs/fedora/generic/arm/CONFIG_CAVIUM_TX2_ERRATUM_219 | 1 + 1 file changed, 1 insertion(+) create mode 100644 configs/fedora/generic/arm/CONFIG_CAVIUM_TX2_ERRATUM_219 diff --git a/configs/fedora/generic/arm/CONFIG_CAVIUM_TX2_ERRATUM_219 b/configs/fedora/generic/arm/CONFIG_CAVIUM_TX2_ERRATUM_219 new file mode 100644 index 000000000..b7f72514b --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_CAVIUM_TX2_ERRATUM_219 @@ -0,0 +1 @@ +CONFIG_CAVIUM_TX2_ERRATUM_219=y From d8f7b1fa4283ddc7c064996eb722304d89ddb490 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sat, 2 Nov 2019 17:43:30 +0000 Subject: [PATCH 033/178] fix usb on JetsonTX2 --- ...gra-set-MODULE_FIRMWARE-for-tegra186.patch | 36 +++++++++++++++++++ kernel.spec | 4 ++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 arm64-usb-host-xhci-tegra-set-MODULE_FIRMWARE-for-tegra186.patch diff --git a/arm64-usb-host-xhci-tegra-set-MODULE_FIRMWARE-for-tegra186.patch b/arm64-usb-host-xhci-tegra-set-MODULE_FIRMWARE-for-tegra186.patch new file mode 100644 index 000000000..b55daaaeb --- /dev/null +++ b/arm64-usb-host-xhci-tegra-set-MODULE_FIRMWARE-for-tegra186.patch @@ -0,0 +1,36 @@ +From 5a39c1ffc4e18603f2c9af3c0a556e2db6e70705 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Sat, 2 Nov 2019 16:52:15 +0000 +Subject: [PATCH 1/2] usb: host: xhci-tegra: set MODULE_FIRMWARE for tegra186 + +Set the MODULE_FIRMWARE for tegra186, it's registered for 124/210 and +ensures the firmware is available at the appropriate time such as in +the initrd, else if the firmware is unavailable the driver fails with +the following errors: + +tegra-xusb 3530000.usb: Direct firmware load for nvidia/tegra186/xusb.bin failed with error -2 +tegra-xusb 3530000.usb: failed to request firmware: -2 +tegra-xusb 3530000.usb: failed to load firmware: -2 +tegra-xusb: probe of 3530000.usb failed with error -2 + +Fixes: 5f9be5f3f899 ("usb: host: xhci-tegra: Add Tegra186 XUSB support") +Signed-off-by: Peter Robinson +--- + drivers/usb/host/xhci-tegra.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c +index 2ff7c911fbd0..d25aba8fa219 100644 +--- a/drivers/usb/host/xhci-tegra.c ++++ b/drivers/usb/host/xhci-tegra.c +@@ -1433,6 +1433,7 @@ static const struct tegra_xusb_soc tegra186_soc = { + .scale_ss_clock = false, + .has_ipfs = false, + }; ++MODULE_FIRMWARE("nvidia/tegra186/xusb.bin"); + + static const struct of_device_id tegra_xusb_of_match[] = { + { .compatible = "nvidia,tegra124-xusb", .data = &tegra124_soc }, +-- +2.23.0 + diff --git a/kernel.spec b/kernel.spec index c263a3fe3..70748ad88 100644 --- a/kernel.spec +++ b/kernel.spec @@ -565,7 +565,9 @@ Patch322: mfd-max77620-Do-not-allocate-IRQs-upfront.patch # https://patchwork.ozlabs.org/patch/1170631/ Patch323: gpio-max77620-Use-correct-unit-for-debounce-times.patch # https://www.spinics.net/lists/linux-tegra/msg44216.html -Patch325: arm64-tegra186-enable-USB-on-Jetson-TX2.patch +Patch324: arm64-tegra186-enable-USB-on-Jetson-TX2.patch +# https://patchwork.kernel.org/patch/11224177/ +Patch325: arm64-usb-host-xhci-tegra-set-MODULE_FIRMWARE-for-tegra186.patch # QCom laptop bits # https://patchwork.kernel.org/patch/11133293/ From 3181ab1054f063c2ee98b00d863fb18a9b061558 Mon Sep 17 00:00:00 2001 From: David Ward Date: Tue, 29 Oct 2019 17:22:58 -0400 Subject: [PATCH 034/178] Disable Sound Open Firmware support on Intel platforms (rhbz 1750194) --- .../x86/CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH | 1 - .../x86/CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT | 1 - .../x86/CONFIG_SND_SOC_SOF_BAYTRAIL_SUPPORT | 1 - .../x86/CONFIG_SND_SOC_SOF_BROADWELL_SUPPORT | 1 - .../x86/CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT | 1 - .../x86/CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT | 1 - .../x86/CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT | 1 - .../x86/CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT | 1 - .../x86/CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT | 1 - .../x86/CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC | 1 - .../generic/x86/CONFIG_SND_SOC_SOF_HDA_LINK | 1 - .../x86/CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT | 1 - .../generic/x86/CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL | 2 +- .../x86/CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT | 1 - kernel-i686-debug.config | 15 +-------------- kernel-i686.config | 15 +-------------- kernel-x86_64-debug.config | 15 +-------------- kernel-x86_64.config | 15 +-------------- 18 files changed, 5 insertions(+), 70 deletions(-) delete mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH delete mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT delete mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_BAYTRAIL_SUPPORT delete mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_BROADWELL_SUPPORT delete mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT delete mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT delete mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT delete mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT delete mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT delete mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC delete mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_LINK delete mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT delete mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH deleted file mode 100644 index c11d5fcea..000000000 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH=m diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT deleted file mode 100644 index fa0eee213..000000000 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_BAYTRAIL_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_BAYTRAIL_SUPPORT deleted file mode 100644 index 99fe215bd..000000000 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_BAYTRAIL_SUPPORT +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_SOF_BAYTRAIL_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_BROADWELL_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_BROADWELL_SUPPORT deleted file mode 100644 index f3afefecc..000000000 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_BROADWELL_SUPPORT +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_SOF_BROADWELL_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT deleted file mode 100644 index 893908b7d..000000000 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT deleted file mode 100644 index 711e96855..000000000 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT deleted file mode 100644 index f2d98813b..000000000 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT deleted file mode 100644 index eca28b0b2..000000000 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT deleted file mode 100644 index 9b6b0ebe3..000000000 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC deleted file mode 100644 index 32dfcb2bc..000000000 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_LINK b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_LINK deleted file mode 100644 index 3d4aa71ce..000000000 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_LINK +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_SOF_HDA_LINK=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT deleted file mode 100644 index acd67f035..000000000 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL index 93748db03..a8070bb58 100644 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL @@ -1 +1 @@ -CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL=y +# CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL is not set diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT deleted file mode 100644 index aa1c7a699..000000000 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT=y diff --git a/kernel-i686-debug.config b/kernel-i686-debug.config index 56cb3f7c9..eae208300 100644 --- a/kernel-i686-debug.config +++ b/kernel-i686-debug.config @@ -5349,7 +5349,6 @@ CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH=m CONFIG_SND_SOC_INTEL_SKL_RT286_MACH=m CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=y CONFIG_SND_SOC_INTEL_SKYLAKE=m -CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH=m CONFIG_SND_SOC_INTEL_SST_ACPI=m CONFIG_SND_SOC_INTEL_SST=m CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y @@ -5391,20 +5390,8 @@ CONFIG_SND_SOC_RT5660=m CONFIG_SND_SOC_SIMPLE_AMPLIFIER=m # CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set CONFIG_SND_SOC_SOF_ACPI=m -CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_BAYTRAIL_SUPPORT=y -CONFIG_SND_SOC_SOF_BROADWELL_SUPPORT=y -CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT=y -CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT=y # CONFIG_SND_SOC_SOF_DEBUG is not set -CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC=y -CONFIG_SND_SOC_SOF_HDA_LINK=y -CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL=y -CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT=y +# CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL is not set # CONFIG_SND_SOC_SOF_NOCODEC is not set # CONFIG_SND_SOC_SOF_NOCODEC_SUPPORT is not set CONFIG_SND_SOC_SOF_PCI=m diff --git a/kernel-i686.config b/kernel-i686.config index 599d02836..61869e292 100644 --- a/kernel-i686.config +++ b/kernel-i686.config @@ -5328,7 +5328,6 @@ CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH=m CONFIG_SND_SOC_INTEL_SKL_RT286_MACH=m CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=y CONFIG_SND_SOC_INTEL_SKYLAKE=m -CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH=m CONFIG_SND_SOC_INTEL_SST_ACPI=m CONFIG_SND_SOC_INTEL_SST=m CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y @@ -5370,20 +5369,8 @@ CONFIG_SND_SOC_RT5660=m CONFIG_SND_SOC_SIMPLE_AMPLIFIER=m # CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set CONFIG_SND_SOC_SOF_ACPI=m -CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_BAYTRAIL_SUPPORT=y -CONFIG_SND_SOC_SOF_BROADWELL_SUPPORT=y -CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT=y -CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT=y # CONFIG_SND_SOC_SOF_DEBUG is not set -CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC=y -CONFIG_SND_SOC_SOF_HDA_LINK=y -CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL=y -CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT=y +# CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL is not set # CONFIG_SND_SOC_SOF_NOCODEC is not set # CONFIG_SND_SOC_SOF_NOCODEC_SUPPORT is not set CONFIG_SND_SOC_SOF_PCI=m diff --git a/kernel-x86_64-debug.config b/kernel-x86_64-debug.config index 1b57db852..ef6898b86 100644 --- a/kernel-x86_64-debug.config +++ b/kernel-x86_64-debug.config @@ -5404,7 +5404,6 @@ CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH=m CONFIG_SND_SOC_INTEL_SKL_RT286_MACH=m CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=y CONFIG_SND_SOC_INTEL_SKYLAKE=m -CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH=m CONFIG_SND_SOC_INTEL_SST_ACPI=m CONFIG_SND_SOC_INTEL_SST=m CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y @@ -5446,20 +5445,8 @@ CONFIG_SND_SOC_RT5660=m CONFIG_SND_SOC_SIMPLE_AMPLIFIER=m # CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set CONFIG_SND_SOC_SOF_ACPI=m -CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_BAYTRAIL_SUPPORT=y -CONFIG_SND_SOC_SOF_BROADWELL_SUPPORT=y -CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT=y -CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT=y # CONFIG_SND_SOC_SOF_DEBUG is not set -CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC=y -CONFIG_SND_SOC_SOF_HDA_LINK=y -CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL=y -CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT=y +# CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL is not set # CONFIG_SND_SOC_SOF_NOCODEC is not set # CONFIG_SND_SOC_SOF_NOCODEC_SUPPORT is not set CONFIG_SND_SOC_SOF_PCI=m diff --git a/kernel-x86_64.config b/kernel-x86_64.config index 85b9db7ba..e721fb10c 100644 --- a/kernel-x86_64.config +++ b/kernel-x86_64.config @@ -5383,7 +5383,6 @@ CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH=m CONFIG_SND_SOC_INTEL_SKL_RT286_MACH=m CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=y CONFIG_SND_SOC_INTEL_SKYLAKE=m -CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH=m CONFIG_SND_SOC_INTEL_SST_ACPI=m CONFIG_SND_SOC_INTEL_SST=m CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y @@ -5425,20 +5424,8 @@ CONFIG_SND_SOC_RT5660=m CONFIG_SND_SOC_SIMPLE_AMPLIFIER=m # CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set CONFIG_SND_SOC_SOF_ACPI=m -CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_BAYTRAIL_SUPPORT=y -CONFIG_SND_SOC_SOF_BROADWELL_SUPPORT=y -CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT=y -CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT=y # CONFIG_SND_SOC_SOF_DEBUG is not set -CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC=y -CONFIG_SND_SOC_SOF_HDA_LINK=y -CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT=y -CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL=y -CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT=y +# CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL is not set # CONFIG_SND_SOC_SOF_NOCODEC is not set # CONFIG_SND_SOC_SOF_NOCODEC_SUPPORT is not set CONFIG_SND_SOC_SOF_PCI=m From 3180dfe4466211f811ef458a87fbb285c4b9b7ab Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Wed, 6 Nov 2019 10:47:03 -0500 Subject: [PATCH 035/178] Linux v5.3.9 --- ...i-Fix-potential-overflow-on-P2P-code.patch | 52 -- ...-Use-correct-unit-for-debounce-times.patch | 586 ------------------ ...ifi-exclude-GEO-SAR-support-for-3168.patch | 47 -- kernel.spec | 13 +- sources | 2 +- 5 files changed, 5 insertions(+), 695 deletions(-) delete mode 100644 0001-rtlwifi-Fix-potential-overflow-on-P2P-code.patch delete mode 100644 gpio-max77620-Use-correct-unit-for-debounce-times.patch delete mode 100644 iwlwifi-exclude-GEO-SAR-support-for-3168.patch diff --git a/0001-rtlwifi-Fix-potential-overflow-on-P2P-code.patch b/0001-rtlwifi-Fix-potential-overflow-on-P2P-code.patch deleted file mode 100644 index f8f40bd82..000000000 --- a/0001-rtlwifi-Fix-potential-overflow-on-P2P-code.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 5d6fc173fd2963e39be890667d5bf3b1fde351dd Mon Sep 17 00:00:00 2001 -From: Laura Abbott -Date: Wed, 16 Oct 2019 16:45:48 -0400 -Subject: [PATCH v2] rtlwifi: Fix potential overflow on P2P code -To: Ping-Ke Shih -To: Kalle Valo -Cc: David S. Miller -Cc: linux-wireless@vger.kernel.org -Cc: netdev@vger.kernel.org -Cc: linux-kernel@vger.kernel.org -Cc: Nicolas Waisman - -Nicolas Waisman noticed that even though noa_len is checked for -a compatible length it's still possible to overrun the buffers -of p2pinfo since there's no check on the upper bound of noa_num. -Bound noa_num against P2P_MAX_NOA_NUM. - -Reported-by: Nicolas Waisman -Signed-off-by: Laura Abbott ---- -v2: Use P2P_MAX_NOA_NUM instead of erroring out. ---- - drivers/net/wireless/realtek/rtlwifi/ps.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c -index 70f04c2f5b17..fff8dda14023 100644 ---- a/drivers/net/wireless/realtek/rtlwifi/ps.c -+++ b/drivers/net/wireless/realtek/rtlwifi/ps.c -@@ -754,6 +754,9 @@ static void rtl_p2p_noa_ie(struct ieee80211_hw *hw, void *data, - return; - } else { - noa_num = (noa_len - 2) / 13; -+ if (noa_num > P2P_MAX_NOA_NUM) -+ noa_num = P2P_MAX_NOA_NUM; -+ - } - noa_index = ie[3]; - if (rtlpriv->psc.p2p_ps_info.p2p_ps_mode == -@@ -848,6 +851,9 @@ static void rtl_p2p_action_ie(struct ieee80211_hw *hw, void *data, - return; - } else { - noa_num = (noa_len - 2) / 13; -+ if (noa_num > P2P_MAX_NOA_NUM) -+ noa_num = P2P_MAX_NOA_NUM; -+ - } - noa_index = ie[3]; - if (rtlpriv->psc.p2p_ps_info.p2p_ps_mode == --- -2.21.0 - diff --git a/gpio-max77620-Use-correct-unit-for-debounce-times.patch b/gpio-max77620-Use-correct-unit-for-debounce-times.patch deleted file mode 100644 index bcf575fb8..000000000 --- a/gpio-max77620-Use-correct-unit-for-debounce-times.patch +++ /dev/null @@ -1,586 +0,0 @@ -From patchwork Wed Oct 2 12:28:23 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Thierry Reding -X-Patchwork-Id: 1170631 -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@bilbo.ozlabs.org -Authentication-Results: ozlabs.org; - spf=none (mailfrom) smtp.mailfrom=vger.kernel.org - (client-ip=209.132.180.67; helo=vger.kernel.org; - envelope-from=linux-gpio-owner@vger.kernel.org; - receiver=) -Authentication-Results: ozlabs.org; - dmarc=pass (p=none dis=none) header.from=gmail.com -Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; - unprotected) header.d=gmail.com header.i=@gmail.com - header.b="Xe4ozWCs"; dkim-atps=neutral -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by ozlabs.org (Postfix) with ESMTP id 46jwR31mYjz9sPl - for ; - Wed, 2 Oct 2019 22:28:31 +1000 (AEST) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1725875AbfJBM2a (ORCPT ); - Wed, 2 Oct 2019 08:28:30 -0400 -Received: from mail-wr1-f67.google.com ([209.85.221.67]:42402 "EHLO - mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1725848AbfJBM23 (ORCPT - ); Wed, 2 Oct 2019 08:28:29 -0400 -Received: by mail-wr1-f67.google.com with SMTP id n14so19415351wrw.9; - Wed, 02 Oct 2019 05:28:28 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; - h=from:to:cc:subject:date:message-id:mime-version - :content-transfer-encoding; - bh=qP9mbplmTy0EguziRYmdZKFvmKZpgiY1goXlhQxV0/8=; - b=Xe4ozWCsxpb6DK1agUyM9eUxlP6G03BBFhI5g4JErak3F1hsMTKXmoyANoMKXxS+UF - OWRiAkrVC3cQOJczX/+7HhZQ8bMC3apl96os1jO6/JWJEP2BHZpDAF0bRyJQdbd0lmMA - afH1TDc/aCLYhrc6UF4IMSf4Noe9cSvoyQYpo0qgpxktdn7I/jv5ztIFWEVBOuEfDveP - hKAmMRuOGlokBd9/+TirOM307HbJYDWAZ8Wko3G+bYcw41RSULf9eN0mQPLmeF/+J9tC - XwaypBneeu3VeCmfU/DxP1duZ3pCcnwOu5nrzdHsS6ow28T2CVk8VvAAZGEU1cUIX4Z+ - +hkw== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20161025; - h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version - :content-transfer-encoding; - bh=qP9mbplmTy0EguziRYmdZKFvmKZpgiY1goXlhQxV0/8=; - b=akVGfKDGN9KlaS7GfDnHx98C2QeedcAeu8RIoCS8uh0twWVOZMZKbUY6M/2HaZKsPI - 38mOkZ2CRPyO1EzbpI9UU6hHXfohMTHuWX0pTdvkFXn+TfZPAxJa1fVRhHgOcknkhb/U - JBzse/qoFFdlsRK3kY6I+0R1YyyAD2SDlzfax4U6ew8DL0icpWegiNEXnIno/7b6sIt2 - 9u9PEHk+1AdQkgS/tVRAFdVg6rrYMbUFkh1JAYsEED71D2IR38JmdUfjsW0Bi1aohXuz - F8LOoB0G33BszHljgknOYlHF4tPGDitMVI+giV3UgwXEWHKFgimUJKOb1nyg+4fcVOLO - 2g1g== -X-Gm-Message-State: APjAAAX5YpK/Xf8BgNQ7EyD7TzARRLtN4fRfLcEXIT3fZkDHf5xGyxPi - jnbTBpi+UDekDgGOQiVnsoo= -X-Google-Smtp-Source: APXvYqw9HA6mSwE4O/MajE0OyTuT/xQaPqMRcrU+p/RXgMiP+Q297cH5ORneUFjHbOQpwrdgestsJw== -X-Received: by 2002:adf:fe05:: with SMTP id n5mr2716992wrr.355.1570019307315; - Wed, 02 Oct 2019 05:28:27 -0700 (PDT) -Received: from localhost (p2E5BE2CE.dip0.t-ipconnect.de. [46.91.226.206]) - by smtp.gmail.com with ESMTPSA id - e17sm5719759wma.15.2019.10.02.05.28.25 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Wed, 02 Oct 2019 05:28:26 -0700 (PDT) -From: Thierry Reding -To: Linus Walleij , - Bartosz Golaszewski -Cc: Timo Alho , linux-gpio@vger.kernel.org, - linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org -Subject: [PATCH 1/3] gpio: max77620: Use correct unit for debounce times -Date: Wed, 2 Oct 2019 14:28:23 +0200 -Message-Id: <20191002122825.3948322-1-thierry.reding@gmail.com> -X-Mailer: git-send-email 2.23.0 -MIME-Version: 1.0 -Sender: linux-gpio-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: linux-gpio@vger.kernel.org - -From: Thierry Reding - -The gpiod_set_debounce() function takes the debounce time in -microseconds. Adjust the switch/case values in the MAX77620 GPIO to use -the correct unit. - -Signed-off-by: Thierry Reding ---- - drivers/gpio/gpio-max77620.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c -index 47d05e357e61..faf86ea9c51a 100644 ---- a/drivers/gpio/gpio-max77620.c -+++ b/drivers/gpio/gpio-max77620.c -@@ -192,13 +192,13 @@ static int max77620_gpio_set_debounce(struct max77620_gpio *mgpio, - case 0: - val = MAX77620_CNFG_GPIO_DBNC_None; - break; -- case 1 ... 8: -+ case 1000 ... 8000: - val = MAX77620_CNFG_GPIO_DBNC_8ms; - break; -- case 9 ... 16: -+ case 9000 ... 16000: - val = MAX77620_CNFG_GPIO_DBNC_16ms; - break; -- case 17 ... 32: -+ case 17000 ... 32000: - val = MAX77620_CNFG_GPIO_DBNC_32ms; - break; - default: - -From patchwork Wed Oct 2 12:28:24 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Thierry Reding -X-Patchwork-Id: 1170635 -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@bilbo.ozlabs.org -Authentication-Results: ozlabs.org; - spf=none (mailfrom) smtp.mailfrom=vger.kernel.org - (client-ip=209.132.180.67; helo=vger.kernel.org; - envelope-from=linux-gpio-owner@vger.kernel.org; - receiver=) -Authentication-Results: ozlabs.org; - dmarc=pass (p=none dis=none) header.from=gmail.com -Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; - unprotected) header.d=gmail.com header.i=@gmail.com - header.b="ZNLKx8UP"; dkim-atps=neutral -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by ozlabs.org (Postfix) with ESMTP id 46jwRG4D1Dz9sPj - for ; - Wed, 2 Oct 2019 22:28:42 +1000 (AEST) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1726684AbfJBM2d (ORCPT ); - Wed, 2 Oct 2019 08:28:33 -0400 -Received: from mail-wr1-f66.google.com ([209.85.221.66]:43919 "EHLO - mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1725848AbfJBM2c (ORCPT - ); Wed, 2 Oct 2019 08:28:32 -0400 -Received: by mail-wr1-f66.google.com with SMTP id q17so19436519wrx.10; - Wed, 02 Oct 2019 05:28:30 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; - h=from:to:cc:subject:date:message-id:in-reply-to:references - :mime-version:content-transfer-encoding; - bh=iB2sFoZ4x2KF5IYNHgeqY98wXl2bB2JULeTFtyoqdVY=; - b=ZNLKx8UP+ukUsboEbPQ9oqLgg5M+37mex1mpr0SgaI7zjToRbmdCJL/chPAEK2r7t8 - C+RcBU7oQnbO3L1hTZQh1VyMX84xXmn0x8g7AskW0bydPo29O2lwBgM9BeNJiMt7gaS7 - LtCbNGe/ttaTfoTsJSOmpLgAJLVJ7mpN5r3h18HtAYcsB5NqjcgFF1yFZ9FvmXOIhxAm - 1MxDJ7tO9pJbc4JQ8iR/yPEsCNibvlX1qtkuBUWdy6aJHG4CkqIbqb+V+84d3R5bsmoe - sDx7f/mMbJ6cF7dCarqOe47Quscz7UkGw/gZywhaYNS/7p6JBvKDCe0bbruzj3MEXMRy - 2tlw== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20161025; - h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to - :references:mime-version:content-transfer-encoding; - bh=iB2sFoZ4x2KF5IYNHgeqY98wXl2bB2JULeTFtyoqdVY=; - b=E8tcBQ6lyFYE0z3JyOT1cT/Bgc194gfYXxSrFLZnHENJjrNz2Ijr9mgmTvanMcmLgs - qvPIH6L5rKKzPpmhxkGCVNMunQuR3U4+g4lCHaJuDE3QikN/dAMpfidmgej7UBcnxYXq - c8yhdhWsg36bVdUYmTdrPVNYayH3WqNj6h3724+nRQnwGs5Y+emoWuhckIBZQR2fJd3Z - jEEmej1F2QBBv4/Cf7RoOd9BVX1DFI3LgOoGADQcGnuCW/+2clFWp860wnWLGdTGqPKI - KCaPoNOzFDkbQCyhebPt8recsiTexB8AmRdTCOszf/TYQwmlvVUUSVqdwY4/P2N0uAGO - 8kOA== -X-Gm-Message-State: APjAAAVWUbix6mCYosiAjDRWTB69Pz3baQGdU6UKJJJba2d6nCyRFzs3 - w1iyx5KVIbR84BwLezjxgUk= -X-Google-Smtp-Source: APXvYqylRlhdhO5L5gTZTUh+KEGBPZYsf15BqzctBqRpCy2v75DzIQkOOs8h+NZd8ePk6530OH8SlA== -X-Received: by 2002:adf:f112:: with SMTP id r18mr2493221wro.88.1570019309276; - Wed, 02 Oct 2019 05:28:29 -0700 (PDT) -Received: from localhost (p2E5BE2CE.dip0.t-ipconnect.de. [46.91.226.206]) - by smtp.gmail.com with ESMTPSA id - h17sm10777194wme.6.2019.10.02.05.28.28 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Wed, 02 Oct 2019 05:28:28 -0700 (PDT) -From: Thierry Reding -To: Linus Walleij , - Bartosz Golaszewski -Cc: Timo Alho , linux-gpio@vger.kernel.org, - linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org -Subject: [PATCH 2/3] gpio: max77620: Do not allocate IRQs upfront -Date: Wed, 2 Oct 2019 14:28:24 +0200 -Message-Id: <20191002122825.3948322-2-thierry.reding@gmail.com> -X-Mailer: git-send-email 2.23.0 -In-Reply-To: <20191002122825.3948322-1-thierry.reding@gmail.com> -References: <20191002122825.3948322-1-thierry.reding@gmail.com> -MIME-Version: 1.0 -Sender: linux-gpio-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: linux-gpio@vger.kernel.org - -From: Thierry Reding - -regmap_add_irq_chip() will try to allocate all of the IRQ descriptors -upfront if passed a non-zero irq_base parameter. However, the intention -is to allocate IRQ descriptors on an as-needed basis if possible. Pass 0 -instead of -1 to fix that use-case. - -Signed-off-by: Thierry Reding ---- - drivers/gpio/gpio-max77620.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c -index faf86ea9c51a..c58b56e5291e 100644 ---- a/drivers/gpio/gpio-max77620.c -+++ b/drivers/gpio/gpio-max77620.c -@@ -304,7 +304,7 @@ static int max77620_gpio_probe(struct platform_device *pdev) - } - - ret = devm_regmap_add_irq_chip(&pdev->dev, chip->rmap, gpio_irq, -- IRQF_ONESHOT, -1, -+ IRQF_ONESHOT, 0, - &max77620_gpio_irq_chip, - &chip->gpio_irq_data); - if (ret < 0) { - -From patchwork Wed Oct 2 12:28:25 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Thierry Reding -X-Patchwork-Id: 1170633 -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@bilbo.ozlabs.org -Authentication-Results: ozlabs.org; - spf=none (mailfrom) smtp.mailfrom=vger.kernel.org - (client-ip=209.132.180.67; helo=vger.kernel.org; - envelope-from=linux-gpio-owner@vger.kernel.org; - receiver=) -Authentication-Results: ozlabs.org; - dmarc=pass (p=none dis=none) header.from=gmail.com -Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; - unprotected) header.d=gmail.com header.i=@gmail.com - header.b="TsA9TpB7"; dkim-atps=neutral -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by ozlabs.org (Postfix) with ESMTP id 46jwRD5mmDz9sPq - for ; - Wed, 2 Oct 2019 22:28:40 +1000 (AEST) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1727456AbfJBM2f (ORCPT ); - Wed, 2 Oct 2019 08:28:35 -0400 -Received: from mail-wm1-f66.google.com ([209.85.128.66]:34525 "EHLO - mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1726682AbfJBM2e (ORCPT - ); Wed, 2 Oct 2019 08:28:34 -0400 -Received: by mail-wm1-f66.google.com with SMTP id y135so4823030wmc.1; - Wed, 02 Oct 2019 05:28:32 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; - h=from:to:cc:subject:date:message-id:in-reply-to:references - :mime-version:content-transfer-encoding; - bh=CBafHZOcPLRsPg6HMh6RW3fmvKDiW2MODjit57xEepE=; - b=TsA9TpB72Q02EPmaBqcc4zzucsjsdc5mtjgAgTak5YrKh+mRT2HMioWeCxrLu5Cl+6 - 66PhcUzrRtOnct3yEqC1hueFX+K8TsDr1bJq2f3L5LqA9rYz5Hdk93jVmwyEKtrPUOa5 - DNgu/r4ppuWX/d9nuLpVLcFGOzWYjz/GSfyRm/B0MNSsiIFx/VfjsK6OQk48uN2gyMPf - LsirANA0HYZPyXaUFBkchtTE71HqGFSIzJGUSVGm12Z26puMZ9GiUid1l1XJjdDuFfhU - 3k9TQnvLEpZDHArb2G8JrwRI8fRZ/OBDLPyKvH/EEdDYa/FfJOzliZBqMgVFpXpXGTZ6 - 7YAw== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20161025; - h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to - :references:mime-version:content-transfer-encoding; - bh=CBafHZOcPLRsPg6HMh6RW3fmvKDiW2MODjit57xEepE=; - b=MVU3M5NDj2W8TitA2MM98hE9Vgb07UODtrRolwf9TaeTgf2XRMgYAWr9v5zaHvBU2q - 4q/HPqbn0WAW3OBfSQLW6CFcdiHOkjfR+r8tKHpNMNBbeDrj1DeeKE/A25plLXxg+Ypz - 1bKJe6DPvjIqLvrpVmPADaRtsAkgDFTt/h41ti2uTwS5xq4qEf1mwz6lFyJkGyf+Qjb5 - pnViJ3Lv89RLBvJwWj0j2t/EzzznPZn9xP663YkNrUNRYrAM7ZBauvK7kMyf8LnKo96E - +niJu7OV4PnRspOC8AS3PPM4DHGctXZl6QMcJ1LyPwBkd8EHJioV1iDJKqHQIbxew46f - AzCA== -X-Gm-Message-State: APjAAAWbRYKoHNSgs+vkRdoNeam2jbbuVKAFxN3ysahEdBul5DIjNFsz - JRjkPkilW+LPTwy2EmDLNUE= -X-Google-Smtp-Source: APXvYqyfSTFvcH9+iLVzVGJ5KDEauN0ssdr9eBfIIdRWe8prWnP7KBGuKItc0GAk8lMLMDzdLKlWtw== -X-Received: by 2002:a1c:7306:: with SMTP id d6mr2864027wmb.62.1570019311374; - Wed, 02 Oct 2019 05:28:31 -0700 (PDT) -Received: from localhost (p2E5BE2CE.dip0.t-ipconnect.de. [46.91.226.206]) - by smtp.gmail.com with ESMTPSA id - 90sm3179450wrr.1.2019.10.02.05.28.30 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Wed, 02 Oct 2019 05:28:30 -0700 (PDT) -From: Thierry Reding -To: Linus Walleij , - Bartosz Golaszewski -Cc: Timo Alho , linux-gpio@vger.kernel.org, - linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org -Subject: [PATCH 3/3] gpio: max77620: Fix interrupt handling -Date: Wed, 2 Oct 2019 14:28:25 +0200 -Message-Id: <20191002122825.3948322-3-thierry.reding@gmail.com> -X-Mailer: git-send-email 2.23.0 -In-Reply-To: <20191002122825.3948322-1-thierry.reding@gmail.com> -References: <20191002122825.3948322-1-thierry.reding@gmail.com> -MIME-Version: 1.0 -Sender: linux-gpio-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: linux-gpio@vger.kernel.org - -From: Timo Alho - -The interrupt-related register fields on the MAX77620 GPIO controller -share registers with GPIO related fields. If the IRQ chip is implemented -with regmap-irq, this causes the IRQ controller code to overwrite fields -previously configured by the GPIO controller code. - -Two examples where this causes problems are the NVIDIA Jetson TX1 and -Jetson TX2 boards, where some of the GPIOs are used to enable vital -power regulators. The MAX77620 GPIO controller also provides the USB OTG -ID pin. If configured as an interrupt, this causes some of the -regulators to be powered off. - -Signed-off-by: Timo Alho -Signed-off-by: Thierry Reding ---- - drivers/gpio/gpio-max77620.c | 231 ++++++++++++++++++----------------- - 1 file changed, 117 insertions(+), 114 deletions(-) - -diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c -index c58b56e5291e..c5b64a4ac172 100644 ---- a/drivers/gpio/gpio-max77620.c -+++ b/drivers/gpio/gpio-max77620.c -@@ -18,109 +18,115 @@ struct max77620_gpio { - struct gpio_chip gpio_chip; - struct regmap *rmap; - struct device *dev; -+ struct mutex buslock; /* irq_bus_lock */ -+ unsigned int irq_type[8]; -+ bool irq_enabled[8]; - }; - --static const struct regmap_irq max77620_gpio_irqs[] = { -- [0] = { -- .reg_offset = 0, -- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE0, -- .type = { -- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, -- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, -- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, -- .type_reg_offset = 0, -- .types_supported = IRQ_TYPE_EDGE_BOTH, -- }, -- }, -- [1] = { -- .reg_offset = 0, -- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE1, -- .type = { -- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, -- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, -- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, -- .type_reg_offset = 1, -- .types_supported = IRQ_TYPE_EDGE_BOTH, -- }, -- }, -- [2] = { -- .reg_offset = 0, -- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE2, -- .type = { -- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, -- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, -- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, -- .type_reg_offset = 2, -- .types_supported = IRQ_TYPE_EDGE_BOTH, -- }, -- }, -- [3] = { -- .reg_offset = 0, -- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE3, -- .type = { -- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, -- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, -- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, -- .type_reg_offset = 3, -- .types_supported = IRQ_TYPE_EDGE_BOTH, -- }, -- }, -- [4] = { -- .reg_offset = 0, -- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE4, -- .type = { -- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, -- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, -- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, -- .type_reg_offset = 4, -- .types_supported = IRQ_TYPE_EDGE_BOTH, -- }, -- }, -- [5] = { -- .reg_offset = 0, -- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE5, -- .type = { -- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, -- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, -- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, -- .type_reg_offset = 5, -- .types_supported = IRQ_TYPE_EDGE_BOTH, -- }, -- }, -- [6] = { -- .reg_offset = 0, -- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE6, -- .type = { -- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, -- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, -- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, -- .type_reg_offset = 6, -- .types_supported = IRQ_TYPE_EDGE_BOTH, -- }, -- }, -- [7] = { -- .reg_offset = 0, -- .mask = MAX77620_IRQ_LVL2_GPIO_EDGE7, -- .type = { -- .type_rising_val = MAX77620_CNFG_GPIO_INT_RISING, -- .type_falling_val = MAX77620_CNFG_GPIO_INT_FALLING, -- .type_reg_mask = MAX77620_CNFG_GPIO_INT_MASK, -- .type_reg_offset = 7, -- .types_supported = IRQ_TYPE_EDGE_BOTH, -- }, -- }, --}; -+static irqreturn_t max77620_gpio_irqhandler(int irq, void *data) -+{ -+ struct max77620_gpio *gpio = data; -+ unsigned int value, offset; -+ unsigned long pending; -+ int err; -+ -+ err = regmap_read(gpio->rmap, MAX77620_REG_IRQ_LVL2_GPIO, &value); -+ if (err < 0) { -+ dev_err(gpio->dev, "REG_IRQ_LVL2_GPIO read failed: %d\n", err); -+ return IRQ_NONE; -+ } -+ -+ pending = value; -+ -+ for_each_set_bit(offset, &pending, 8) { -+ unsigned int virq; -+ -+ virq = irq_find_mapping(gpio->gpio_chip.irq.domain, offset); -+ handle_nested_irq(virq); -+ } -+ -+ return IRQ_HANDLED; -+} -+ -+static void max77620_gpio_irq_mask(struct irq_data *data) -+{ -+ struct gpio_chip *chip = irq_data_get_irq_chip_data(data); -+ struct max77620_gpio *gpio = gpiochip_get_data(chip); -+ -+ gpio->irq_enabled[data->hwirq] = false; -+} - --static const struct regmap_irq_chip max77620_gpio_irq_chip = { -- .name = "max77620-gpio", -- .irqs = max77620_gpio_irqs, -- .num_irqs = ARRAY_SIZE(max77620_gpio_irqs), -- .num_regs = 1, -- .num_type_reg = 8, -- .irq_reg_stride = 1, -- .type_reg_stride = 1, -- .status_base = MAX77620_REG_IRQ_LVL2_GPIO, -- .type_base = MAX77620_REG_GPIO0, -+static void max77620_gpio_irq_unmask(struct irq_data *data) -+{ -+ struct gpio_chip *chip = irq_data_get_irq_chip_data(data); -+ struct max77620_gpio *gpio = gpiochip_get_data(chip); -+ -+ gpio->irq_enabled[data->hwirq] = true; -+} -+ -+static int max77620_gpio_set_irq_type(struct irq_data *data, unsigned int type) -+{ -+ struct gpio_chip *chip = irq_data_get_irq_chip_data(data); -+ struct max77620_gpio *gpio = gpiochip_get_data(chip); -+ unsigned int irq_type; -+ -+ switch (type) { -+ case IRQ_TYPE_EDGE_RISING: -+ irq_type = MAX77620_CNFG_GPIO_INT_RISING; -+ break; -+ -+ case IRQ_TYPE_EDGE_FALLING: -+ irq_type = MAX77620_CNFG_GPIO_INT_FALLING; -+ break; -+ -+ case IRQ_TYPE_EDGE_BOTH: -+ irq_type = MAX77620_CNFG_GPIO_INT_RISING | -+ MAX77620_CNFG_GPIO_INT_FALLING; -+ break; -+ -+ default: -+ return -EINVAL; -+ } -+ -+ gpio->irq_type[data->hwirq] = irq_type; -+ -+ return 0; -+} -+ -+static void max77620_gpio_bus_lock(struct irq_data *data) -+{ -+ struct gpio_chip *chip = irq_data_get_irq_chip_data(data); -+ struct max77620_gpio *gpio = gpiochip_get_data(chip); -+ -+ mutex_lock(&gpio->buslock); -+} -+ -+static void max77620_gpio_bus_sync_unlock(struct irq_data *data) -+{ -+ struct gpio_chip *chip = irq_data_get_irq_chip_data(data); -+ struct max77620_gpio *gpio = gpiochip_get_data(chip); -+ unsigned int value, offset = data->hwirq; -+ int err; -+ -+ value = gpio->irq_enabled[offset] ? gpio->irq_type[offset] : 0; -+ -+ err = regmap_update_bits(gpio->rmap, GPIO_REG_ADDR(offset), -+ MAX77620_CNFG_GPIO_INT_MASK, value); -+ if (err < 0) -+ dev_err(chip->parent, "failed to update interrupt mask: %d\n", -+ err); -+ -+ mutex_unlock(&gpio->buslock); -+} -+ -+static struct irq_chip max77620_gpio_irqchip = { -+ .name = "max77620-gpio", -+ .irq_mask = max77620_gpio_irq_mask, -+ .irq_unmask = max77620_gpio_irq_unmask, -+ .irq_set_type = max77620_gpio_set_irq_type, -+ .irq_bus_lock = max77620_gpio_bus_lock, -+ .irq_bus_sync_unlock = max77620_gpio_bus_sync_unlock, -+ .flags = IRQCHIP_MASK_ON_SUSPEND, - }; - - static int max77620_gpio_dir_input(struct gpio_chip *gc, unsigned int offset) -@@ -254,14 +260,6 @@ static int max77620_gpio_set_config(struct gpio_chip *gc, unsigned int offset, - return -ENOTSUPP; - } - --static int max77620_gpio_to_irq(struct gpio_chip *gc, unsigned int offset) --{ -- struct max77620_gpio *mgpio = gpiochip_get_data(gc); -- struct max77620_chip *chip = dev_get_drvdata(mgpio->dev->parent); -- -- return regmap_irq_get_virq(chip->gpio_irq_data, offset); --} -- - static int max77620_gpio_probe(struct platform_device *pdev) - { - struct max77620_chip *chip = dev_get_drvdata(pdev->dev.parent); -@@ -287,7 +285,6 @@ static int max77620_gpio_probe(struct platform_device *pdev) - mgpio->gpio_chip.direction_output = max77620_gpio_dir_output; - mgpio->gpio_chip.set = max77620_gpio_set; - mgpio->gpio_chip.set_config = max77620_gpio_set_config; -- mgpio->gpio_chip.to_irq = max77620_gpio_to_irq; - mgpio->gpio_chip.ngpio = MAX77620_GPIO_NR; - mgpio->gpio_chip.can_sleep = 1; - mgpio->gpio_chip.base = -1; -@@ -303,15 +300,21 @@ static int max77620_gpio_probe(struct platform_device *pdev) - return ret; - } - -- ret = devm_regmap_add_irq_chip(&pdev->dev, chip->rmap, gpio_irq, -- IRQF_ONESHOT, 0, -- &max77620_gpio_irq_chip, -- &chip->gpio_irq_data); -+ mutex_init(&mgpio->buslock); -+ -+ gpiochip_irqchip_add_nested(&mgpio->gpio_chip, &max77620_gpio_irqchip, -+ 0, handle_edge_irq, IRQ_TYPE_NONE); -+ -+ ret = request_threaded_irq(gpio_irq, NULL, max77620_gpio_irqhandler, -+ IRQF_ONESHOT, "max77620-gpio", mgpio); - if (ret < 0) { -- dev_err(&pdev->dev, "Failed to add gpio irq_chip %d\n", ret); -+ dev_err(&pdev->dev, "failed to request IRQ: %d\n", ret); - return ret; - } - -+ gpiochip_set_nested_irqchip(&mgpio->gpio_chip, &max77620_gpio_irqchip, -+ gpio_irq); -+ - return 0; - } - diff --git a/iwlwifi-exclude-GEO-SAR-support-for-3168.patch b/iwlwifi-exclude-GEO-SAR-support-for-3168.patch deleted file mode 100644 index 7578695a8..000000000 --- a/iwlwifi-exclude-GEO-SAR-support-for-3168.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 12e36d98d3e5acf5fc57774e0a15906d55f30cb9 Mon Sep 17 00:00:00 2001 -From: Luca Coelho -Date: Tue, 8 Oct 2019 13:10:53 +0300 -Subject: iwlwifi: exclude GEO SAR support for 3168 - -We currently support two NICs in FW version 29, namely 7265D and 3168. -Out of these, only 7265D supports GEO SAR, so adjust the function that -checks for it accordingly. - -Signed-off-by: Luca Coelho -Fixes: f5a47fae6aa3 ("iwlwifi: mvm: fix version check for GEO_TX_POWER_LIMIT support") -Signed-off-by: Luca Coelho ---- - drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 16 +++++++++------- - 1 file changed, 9 insertions(+), 7 deletions(-) - -diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c -index 0d2229319261..d9eb2b286438 100644 ---- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c -+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c -@@ -899,15 +899,17 @@ static bool iwl_mvm_sar_geo_support(struct iwl_mvm *mvm) - * firmware versions. Unfortunately, we don't have a TLV API - * flag to rely on, so rely on the major version which is in - * the first byte of ucode_ver. This was implemented -- * initially on version 38 and then backported to29 and 17. -- * The intention was to have it in 36 as well, but not all -- * 8000 family got this feature enabled. The 8000 family is -- * the only one using version 36, so skip this version -- * entirely. -+ * initially on version 38 and then backported to 17. It was -+ * also backported to 29, but only for 7265D devices. The -+ * intention was to have it in 36 as well, but not all 8000 -+ * family got this feature enabled. The 8000 family is the -+ * only one using version 36, so skip this version entirely. - */ - return IWL_UCODE_SERIAL(mvm->fw->ucode_ver) >= 38 || -- IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 29 || -- IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 17; -+ IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 17 || -+ (IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 29 && -+ ((mvm->trans->hw_rev & CSR_HW_REV_TYPE_MSK) == -+ CSR_HW_REV_TYPE_7265D)); - } - - int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm) --- -cgit 1.2-0.3.lf.el7 diff --git a/kernel.spec b/kernel.spec index 70748ad88..4d41afa7d 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 8 +%define stable_update 9 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -562,8 +562,6 @@ Patch320: arm64-tegra-jetson-tx1-fixes.patch Patch321: arm64-tegra-Jetson-TX2-Allow-bootloader-to-configure.patch # https://patchwork.kernel.org/patch/11171225/ Patch322: mfd-max77620-Do-not-allocate-IRQs-upfront.patch -# https://patchwork.ozlabs.org/patch/1170631/ -Patch323: gpio-max77620-Use-correct-unit-for-debounce-times.patch # https://www.spinics.net/lists/linux-tegra/msg44216.html Patch324: arm64-tegra186-enable-USB-on-Jetson-TX2.patch # https://patchwork.kernel.org/patch/11224177/ @@ -598,17 +596,11 @@ Patch504: dwc3-fix.patch Patch509: PATCH-v2-selinux-allow-labeling-before-policy-is-loaded.patch -Patch510: iwlwifi-exclude-GEO-SAR-support-for-3168.patch - # it seems CONFIG_OPTIMIZE_INLINING has been forced now and is causing issues on ARMv7 # https://lore.kernel.org/patchwork/patch/1132459/ # https://lkml.org/lkml/2019/8/29/1772 Patch505: ARM-fix-__get_user_check-in-case-uaccess_-calls-are-not-inlined.patch -# CVE-2019-17666 -# rhbz 176362 -Patch506: 0001-rtlwifi-Fix-potential-overflow-on-P2P-code.patch - # END OF PATCH DEFINITIONS %endif @@ -1810,6 +1802,9 @@ fi # # %changelog +* Wed Nov 06 2019 Laura Abbott - 5.3.9-300 +- Linux v5.3.9 + * Tue Oct 29 2019 Laura Abbott - 5.3.8-300 - Linux v5.3.8 diff --git a/sources b/sources index 947b6dfc3..ec1c9d2d8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.8.xz) = 870ccc19417fe56517ac13b0e2fc4cc48e21937af0a2291f57a252b60831c1fa41bf4af8c8b1613cde8d6410723dbab763fa58f1dc7ce8ba7a02c90523eba6bf +SHA512 (patch-5.3.9.xz) = b2bb836ad47e23b475bebeea06cce4ceb6feec0e5d2cf5e1d13fd788d2a9efddc22694806dd59413956f2c2baac9b01071f8fe5115cfe75d8750fe020825ee24 From 9db1e5ec277a56e2a39d11e9c73c12e93ab4f0ee Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Thu, 7 Nov 2019 11:19:36 -0500 Subject: [PATCH 036/178] Enable the Apple SPI driver for keyboard/touchpad (rhbz 1769465) This enables support for Macbook8,1 and later, along with the MacbookPro13,* and MacbookPro14,*. --- configs/fedora/generic/x86/x86_64/CONFIG_KEYBOARD_APPLESPI | 1 + kernel-x86_64-debug.config | 2 +- kernel-x86_64.config | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 configs/fedora/generic/x86/x86_64/CONFIG_KEYBOARD_APPLESPI diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_KEYBOARD_APPLESPI b/configs/fedora/generic/x86/x86_64/CONFIG_KEYBOARD_APPLESPI new file mode 100644 index 000000000..b13ce3c0b --- /dev/null +++ b/configs/fedora/generic/x86/x86_64/CONFIG_KEYBOARD_APPLESPI @@ -0,0 +1 @@ +CONFIG_KEYBOARD_APPLESPI=m diff --git a/kernel-x86_64-debug.config b/kernel-x86_64-debug.config index ef6898b86..1e7e74847 100644 --- a/kernel-x86_64-debug.config +++ b/kernel-x86_64-debug.config @@ -2704,7 +2704,7 @@ CONFIG_KEXEC=y # CONFIG_KEYBOARD_ADC is not set # CONFIG_KEYBOARD_ADP5588 is not set # CONFIG_KEYBOARD_ADP5589 is not set -# CONFIG_KEYBOARD_APPLESPI is not set +CONFIG_KEYBOARD_APPLESPI=m CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_CAP11XX is not set CONFIG_KEYBOARD_CROS_EC=m diff --git a/kernel-x86_64.config b/kernel-x86_64.config index e721fb10c..bc866f8ad 100644 --- a/kernel-x86_64.config +++ b/kernel-x86_64.config @@ -2685,7 +2685,7 @@ CONFIG_KEXEC=y # CONFIG_KEYBOARD_ADC is not set # CONFIG_KEYBOARD_ADP5588 is not set # CONFIG_KEYBOARD_ADP5589 is not set -# CONFIG_KEYBOARD_APPLESPI is not set +CONFIG_KEYBOARD_APPLESPI=m CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_CAP11XX is not set CONFIG_KEYBOARD_CROS_EC=m From b5a4168451b643b67c1566f203d148f1292a7988 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Thu, 7 Nov 2019 11:38:35 -0500 Subject: [PATCH 037/178] Add a changelog note for the Macbook SPI driver --- kernel.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel.spec b/kernel.spec index 4d41afa7d..a02b140ad 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1802,6 +1802,9 @@ fi # # %changelog +* Thu Nov 07 2019 Jeremy Cline +- Add support for a number of Macbook keyboards and touchpads (rhbz 1769465) + * Wed Nov 06 2019 Laura Abbott - 5.3.9-300 - Linux v5.3.9 From 396ad4eaca713d88aab992c84d7786ec57ebcb82 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Mon, 11 Nov 2019 11:55:50 -0500 Subject: [PATCH 038/178] Linux v5.3.10 --- ...RockPro64-vdd-log-regulator-settings.patch | 516 ------------------ ...p-fix-Rockpro64-RK808-interrupt-line.patch | 176 ------ kernel.spec | 10 +- sources | 2 +- 4 files changed, 5 insertions(+), 699 deletions(-) delete mode 100644 arm64-dts-rockchip-fix-RockPro64-vdd-log-regulator-settings.patch delete mode 100644 arm64-dts-rockchip-fix-Rockpro64-RK808-interrupt-line.patch diff --git a/arm64-dts-rockchip-fix-RockPro64-vdd-log-regulator-settings.patch b/arm64-dts-rockchip-fix-RockPro64-vdd-log-regulator-settings.patch deleted file mode 100644 index 73be35378..000000000 --- a/arm64-dts-rockchip-fix-RockPro64-vdd-log-regulator-settings.patch +++ /dev/null @@ -1,516 +0,0 @@ -From patchwork Thu Oct 3 21:50:34 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: =?utf-8?q?S=C3=B6ren_Moch?= -X-Patchwork-Id: 11173461 -Return-Path: - -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FDE613B1 - for ; - Thu, 3 Oct 2019 21:51:01 +0000 (UTC) -Received: from bombadil.infradead.org (bombadil.infradead.org - [198.137.202.133]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) - (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id 7B69C2086A - for ; - Thu, 3 Oct 2019 21:51:01 +0000 (UTC) -Authentication-Results: mail.kernel.org; - dkim=pass (2048-bit key) header.d=lists.infradead.org - header.i=@lists.infradead.org header.b="urDY/XN+"; - dkim=fail reason="signature verification failed" (1024-bit key) - header.d=web.de header.i=@web.de header.b="mtJWe9Bf" -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B69C2086A -Authentication-Results: mail.kernel.org; - dmarc=none (p=none dis=none) header.from=web.de -Authentication-Results: mail.kernel.org; - spf=none - smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=lists.infradead.org; s=bombadil.20170209; h=Sender: - Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: - List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: - Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: - Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: - References:List-Owner; bh=lFYiMYcBMxmyphhrNw72C/NN1znHxWUoCJiED50SPC4=; b=urD - Y/XN+2WA8vvyESWBs6m/bzLBWZSG2TrdRGIEtY0TIXn9YXWd7vRkAWVm8GrT8FCC0eFXXfrnpBljO - x9URr69wRs5c3rgbhPO2Ayx1T0WcHFNAzIW6SffEJKnrsbUPYUE1wQ5BrAaUEVHCv0XWcTeKzg26J - mnIJaqoHpew22YkkB/8M4LGCJVaZxeX/gAd7I2FeB6tBzmBgKvKvb3P1010X4zK2POVVxtd8dAlLb - lRKl+Vj0dcjGL/WOqrDIy3vABg5Av25akdGM3SrWI0y/YOVGtSi/glUyQ7gI8pDR3uR/456zEGRjy - cVc9Y8QganXtR/CoNbBCIpll/ZAGZng==; -Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) - by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) - id 1iG8zx-0004iz-UO; Thu, 03 Oct 2019 21:50:57 +0000 -Received: from mout.web.de ([217.72.192.78]) - by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) - id 1iG8zt-0004gY-Sh; Thu, 03 Oct 2019 21:50:55 +0000 -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; - s=dbaedf251592; t=1570139445; - bh=+slu9oigrifofLBmSnoGBXNUCdUs8UMw+gAQMYZR/OU=; - h=X-UI-Sender-Class:From:To:Cc:Subject:Date; - b=mtJWe9BfGLpk166deIOWv6NwNSVtqNu4zEFmltWTZO+Quufhq50MugB4t3PI53Dij - P75Ixq7hozzbk0+FHdq9w1smAfhLlT6WCPVlEGLVmzgVIbWf+qdMbLNHxgkPW11OH5 - mvpxatuhvRgzbIbSTYrf6MF+3Mcs9GpROLzrOyrI= -X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 -Received: from platinum.fritz.box ([89.14.73.200]) by smtp.web.de (mrweb103 - [213.165.67.124]) with ESMTPSA (Nemesis) id 0LdVza-1hpIko3M5i-00ikbu; Thu, 03 - Oct 2019 23:50:44 +0200 -From: Soeren Moch -To: Heiko Stuebner -Subject: [PATCH 1/3] arm64: dts: rockchip: fix RockPro64 vdd-log regulator - settings -Date: Thu, 3 Oct 2019 23:50:34 +0200 -Message-Id: <20191003215036.15023-1-smoch@web.de> -X-Mailer: git-send-email 2.17.1 -X-Provags-ID: V03:K1:sVWSznPIdgTeGmxS0/KuK5sR3zlLN0yEjQwtifgjotr6sUlPGeX - SCaKNvjkY2xrsa2JwfaH4KWsSiYOkozaZoxo4JmqSc/EwguMpI45EebjNI3cQkwrCfPim6b - 02b5Xj+b3kuMwjLS4tqXGFCniDNAIH3qhHOEWovdeCy4yOGDuzQye7qcb011wpp5K3Y+zv3 - u+KYJmttKbwcJdT8JijcQ== -X-Spam-Flag: NO -X-UI-Out-Filterresults: notjunk:1;V03:K0:vCe5hpyJPR8=:disR8f0omoqst11p1fIKAh - iBAK1nFXc7AmOcAiFW44MeJNXdocthJHRd3VEcy9/B9yqK/hTjhNCgBGLXvhk3UzVzVTDK802 - kBf9cEBdt34sF6mLB40sUD5CXT7PaMoPa78w45lA9C3+dF/9UxU09+6fr6SVTgU3mu6Hn2JqJ - nvfqFZiqINBWoePt9nqRkkTUrqgEyMT6qHHfJUTadp6PJeCXCeirRPUqFqdJ8vx+tsSMrD+G5 - fmZlzpPnl8Ky3j1gtFkLLcEAOMtAgzPfeEONvZiwK5J6n5MxwprBNRT7E07hW+xDfcQbQE0rD - 8RGbx1mkzr2V92lpYcIRTNqde+Oh+/V4C4s6rQGxN+x/xws7iNpUeU9Rpv65WHyiheHZUcHs6 - 4n7JmhPiZXUCFzWUrmM6oJB7O70rL8WobnNCWQmNtYRuiqGautEew+TItXYvKBCtvFrALXdM+ - vb1+FrU03VriEuoHeRWwPEsO45SGVwhYIsolu6CRDFU9G4a0WdORqWZVYVP+0JvpMOe/lA2zY - 2rl2QFH53x1+BtBVK20hHOh7W3xtLH+WzZFsAzmnNe3+61mRhxIzHfDY3otUHd7hUG+pyyhXw - 6RI9YNTvxF2AQ1rzSvvCNNtPkovfmdPvPTfO2Sqig4TRyAE9/Un4zf1wnoho8+Hqw2w2gvh2g - lFdajNupo7PiibkssZMeWpi2Yyw+Ql484vPZldLOBFiuDXWRwYHJA7n3CWPRqu4FkvqZI0woF - iWwuOPIyYV09g8L2UPq4YiXXvNXKdJWpQh/x59dBhs26HHmbaZxBvFHrUY7FWo9HRjA0t8hvE - oDTTozWqTW6xzbFzIwp0E29Vp6mciCpjiqoLv7MMTbg0U9pPnAQecIk11U33l0ZqVQyKSxq8G - Fdwl4gLqiQcP6Y/Zm2wBLvnsSffYrkTmqpiQ6RjPOPPy9GxZHTglNZP6Cr4a5N3lHKv4+rvUV - pKvy7jWH6ub53Ne6v/8q//sL+wQIbqfuTNNpvc+MI28YX7YthEldq1GRyRKJ5k4z6o2nrqUik - oRx5AuvdO3oPcAIsUwKaeuXqRrTtC9M6kdubTFXOZ8EZzZtj1unz7h3zRztMQu37AvKSyHhxt - k56zCWlbMOjoKO97tb/lVKVF80M81PnaiIOXQ9I9E3UIF2s95Wg/VbtVzkWi4oF6WwrqqO44y - sthchBfNPGC/jUAm3c9UeqBDY4lM5Ilus4dUpjvn4gcHDKMGS6iu/KEEMEuL56mRaMcwg/xXM - L5sIsGmzM7HYTjE4fJFm35NicLPlNwOqZLoaMsg== -X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20191003_145054_230248_23AC2987 -X-CRM114-Status: UNSURE ( 9.25 ) -X-CRM114-Notice: Please train this message. -X-Spam-Score: -0.9 (/) -X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: - Content analysis details: (-0.9 points) - pts rule name description - ---- ---------------------- - -------------------------------------------------- - 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail - provider (smoch[at]web.de) - -0.0 SPF_PASS SPF: sender matches SPF record - 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record - -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature - -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from - author's domain - -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from - envelope-from domain - 0.1 DKIM_SIGNED Message has a DKIM or DK signature, - not necessarily - valid - -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, - low trust [217.72.192.78 listed in list.dnswl.org] -X-BeenThere: linux-arm-kernel@lists.infradead.org -X-Mailman-Version: 2.1.29 -Precedence: list -List-Id: -List-Unsubscribe: - , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: - , - -Cc: linux-rockchip@lists.infradead.org, Soeren Moch , - linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org -MIME-Version: 1.0 -Content-Type: text/plain; charset="us-ascii" -Sender: "linux-arm-kernel" -Errors-To: - linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org - -The RockPro64 schematic [1] page 18 states a min voltage of 0.8V and a -max voltage of 1.4V for the VDD_LOG pwm regulator. However, there is an -additional note that the pwm parameter needs to be modified. -From the schematics a voltage range of 0.8V to 1.7V can be calculated. -Additional voltage measurements on the board show that this fix indeed -leads to the correct voltage, while without this fix the voltage was set -too high. - -[1] http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf - -Fixes: e4f3fb490967 ("arm64: dts: rockchip: add initial dts support for Rockpro64") -Signed-off-by: Soeren Moch ---- -Cc: Heiko Stuebner -Cc: linux-rockchip@lists.infradead.org -Cc: linux-arm-kernel@lists.infradead.org -Cc: linux-kernel@vger.kernel.org ---- - arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - --- -2.17.1 - -diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts -index 0401d4ec1f45..845eb070b5b0 100644 ---- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts -@@ -173,7 +173,7 @@ - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <800000>; -- regulator-max-microvolt = <1400000>; -+ regulator-max-microvolt = <1700000>; - vin-supply = <&vcc5v0_sys>; - }; - }; - -From patchwork Thu Oct 3 21:50:35 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: =?utf-8?q?S=C3=B6ren_Moch?= -X-Patchwork-Id: 11173469 -Return-Path: - -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5975A76 - for ; - Thu, 3 Oct 2019 21:51:41 +0000 (UTC) -Received: from bombadil.infradead.org (bombadil.infradead.org - [198.137.202.133]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) - (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id E5CD92133F - for ; - Thu, 3 Oct 2019 21:51:40 +0000 (UTC) -Authentication-Results: mail.kernel.org; - dkim=pass (2048-bit key) header.d=lists.infradead.org - header.i=@lists.infradead.org header.b="aIzQ/7Xd"; - dkim=fail reason="signature verification failed" (1024-bit key) - header.d=web.de header.i=@web.de header.b="cmtE0euk" -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E5CD92133F -Authentication-Results: mail.kernel.org; - dmarc=none (p=none dis=none) header.from=web.de -Authentication-Results: mail.kernel.org; - spf=none - smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=lists.infradead.org; s=bombadil.20170209; h=Sender: - Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: - List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: - In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: - Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc - :Resent-Message-ID:List-Owner; - bh=1Ja1XJBYc2rMTJo1j3aWlo4ggxMpTccXfhnANJoFXgY=; b=aIzQ/7XdT4Dm/qBnxRPzUbll2w - +n6AExDbccfUt23EF39R3wxjN3Y1Apw4+gGY7pruuVEJUqZtMi/llXHhDQ8hfCughA/ul1Tw1OOuw - MdhrxvxV35qrfTIRGY5ZWD1bXE2jh5w65I6NUHqvoXdC8pXxgd55P2RS4TCGPlqt9mo+0i+/E/wmN - 11Za83+GgoXTvJdukL/nDZOY19RYk1SmkjyvMwU3JHraN2osMq9ct+NQMZWalPOMgC6SrU7+eEvMC - Gxip1cUJ1f6bIUhuIikgD83hJeX+xmzblFy8fdqxostMpqcn+bhQfyeIAzwRGCFIWjQyNtmnlC5n+ - UXRYljnQ==; -Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) - by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) - id 1iG90Y-0005J7-RT; Thu, 03 Oct 2019 21:51:34 +0000 -Received: from mout.web.de ([212.227.17.11]) - by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) - id 1iG8zv-0004gv-AV; Thu, 03 Oct 2019 21:50:57 +0000 -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; - s=dbaedf251592; t=1570139445; - bh=Kn0TuCilrYfaGPMHgSwOwV8cx+fxujsxvbyRlPzXJ8o=; - h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; - b=cmtE0euk/irI14sTr6wSajU7DkGxBMrgNowkeu6VcNZvW3f0N4hhG8ItwhpI0YpTh - 8lzeG8VnZoKFq/TjpSg5uwCrqPWpS10ZdCAyg2gD2AFDHFNrJYOXdAz36LgORPmGbW - V5MeWcSytSaC+XTNGoV1tvq3jSY9Mv9Bl83T95nw= -X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 -Received: from platinum.fritz.box ([89.14.73.200]) by smtp.web.de (mrweb103 - [213.165.67.124]) with ESMTPSA (Nemesis) id 0MfYj1-1iVD2M15x5-00P6D9; Thu, 03 - Oct 2019 23:50:45 +0200 -From: Soeren Moch -To: Heiko Stuebner -Subject: [PATCH 2/3] arm64: dts: rockchip: fix RockPro64 sdhci settings -Date: Thu, 3 Oct 2019 23:50:35 +0200 -Message-Id: <20191003215036.15023-2-smoch@web.de> -X-Mailer: git-send-email 2.17.1 -In-Reply-To: <20191003215036.15023-1-smoch@web.de> -References: <20191003215036.15023-1-smoch@web.de> -X-Provags-ID: V03:K1:B7ZztmDbKfGYru8Phbjqw2pez33XX2FSpU8BwevUN/gNPgO8fUz - Mai6ERMM+Am8U/N9uGjHbwMNeghFPQW7/5jXUjBypLLZwSwWLX/bmfozsCdhRyF473wRV6y - spAcVmzJIceDsbk8eJUfuek7itb3S1FXU0GIz+J8Kq+NUgmS2uain/rtAWa5uIY4abpsNPZ - xoT1S8+2Brauk0we7S4Yw== -X-Spam-Flag: NO -X-UI-Out-Filterresults: notjunk:1;V03:K0:Fx3wTDvJkB4=:V0/tzMx03qqKbK8T7SQOWI - 9oNjxL17k927PeGDNqyW09+kBTsivpZYFEY55iOLZQv/pcGoOi5Xb6AcCBYKMiTRyhraVXwye - XKQOQIxWQimyx0etxkPkyvp/uyl2YBSavT6nSF+kTgN7t+SgVJNTyrLv+eMPwmzkEkIJQdCU5 - V1mtMudj13veu2CM7XQHE0kPcRVBw26Tay25FSXUsMl40Ha8HuKe+8mnjZQsVgdcSVG8xSVQ3 - jZmjAH1ehBHemYGNbgyMUp4e1f4HcPWsLUuWF7UKPu9TbSACPtxiuV32C66ptioz4kPPQ5siy - ectJM+L471sJFLXv55j5x/Nkgj3PfaxjEVTdSm+P4K/6H5hfWWRp82n3BenrB1d+6VFEhsO+u - JnBewMKGVVfdh5O5JtioJ0k+pSM0S42OwzaNZd/cNJ9dAIKjhMH2vyEvbZezZocTcofxDukVp - gjfr4Mm1dVwDaazXLJEkMEToo5SOcAmmV6FsW/ivupt+fLuexl4Oo6lD4BIV1OKMoVIpr1dBn - kMgHVJneAh+yrmtQvAzjUwD5AC8O9qu5jZf+j/jmDX+rL6TANZS3ia8aI9JMpxtGKjzii+6iD - U3WMamIS9EBYCuXWR0fUXwzkylZVpKJj8OLQyl4z4hBJ1mYflKFVTDvqir/+XPgIgMB0W62oA - jjHIRSmMdnYgJBjR2DmfERbvRA+CoadWdHgQCy9O7RysmAZL++rd9wX+HfiOgKhPho8G66nvR - mz3xPqQHcPpbLXgz2xr3tF3itCBwtwuC1YVf1AN0cg7UdiskrXLDx2UesrDqApECFUNx3vPYD - Fknt9SE0EqaerIgseAeXAAJcmIn4pvUio9sTKyC1oKt0ojx0CpOhF2/alKQx9sLCfNJpqSSLx - Nn0sPBZCgbq0fI3Y+qGctkGUZCbS/yode78mXh4C/fHyf0VA1gJLGVo8R18or9Zpk5asg1hBp - gLIG+YYUC0a1HSlF0zIeTiYeXkOeLiEBn65QzM0DJSLVcPG5G5HR8/s0AbXXpAsX62BRHA4jk - yWxcY7I9ZJ8iKPjZgyr1+Q5dqidladBAq1qWsHy7X0xQTJn+CC4y2jrpjxYOsym5sLnj76U90 - CHjUybKWdmPaaENk6I/jdwCrzqRU3MJERrz9IdsxepZZYpwXIWpH6KBrNOX4zm1FINpUtxgdx - 9VajcWzh3pSIG5rAfJiTartXpAvyOMcZeG6dJkNoUWslE74gCsm4LFbqAGrsdx7oExx57Guae - 1ASgkma3Lp4s45yCKgQP7X/0hLVXqE1uQeloYqg== -X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20191003_145055_661636_5577849E -X-CRM114-Status: UNSURE ( 9.52 ) -X-CRM114-Notice: Please train this message. -X-Spam-Score: -0.9 (/) -X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: - Content analysis details: (-0.9 points) - pts rule name description - ---- ---------------------- - -------------------------------------------------- - -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, - low trust [212.227.17.11 listed in list.dnswl.org] - 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail - provider (smoch[at]web.de) - -0.0 SPF_PASS SPF: sender matches SPF record - 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record - -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature - -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from - author's domain - -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from - envelope-from domain - 0.1 DKIM_SIGNED Message has a DKIM or DK signature, - not necessarily - valid -X-BeenThere: linux-arm-kernel@lists.infradead.org -X-Mailman-Version: 2.1.29 -Precedence: list -List-Id: -List-Unsubscribe: - , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: - , - -Cc: linux-rockchip@lists.infradead.org, Soeren Moch , - linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org -MIME-Version: 1.0 -Content-Type: text/plain; charset="us-ascii" -Sender: "linux-arm-kernel" -Errors-To: - linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org - -The RockPro64 schematics [1], [2] show that the rk3399 EMMC_STRB pin is -connected to the RESET pin instead of the DATA_STROBE pin of the eMMC module. -So the data strobe cannot be used for its intended purpose on this board, -and so the HS400 eMMC mode is not functional. Limit the controller to HS200. - -[1] http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf -[2] http://files.pine64.org/doc/rock64/PINE64_eMMC_Module_20170719.pdf - -Fixes: e4f3fb490967 ("arm64: dts: rockchip: add initial dts support for Rockpro64") -Signed-off-by: Soeren Moch ---- -Cc: Heiko Stuebner -Cc: linux-rockchip@lists.infradead.org -Cc: linux-arm-kernel@lists.infradead.org -Cc: linux-kernel@vger.kernel.org ---- - arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - --- -2.17.1 - -diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts -index 845eb070b5b0..2e44dae4865a 100644 ---- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts -@@ -636,8 +636,7 @@ - - &sdhci { - bus-width = <8>; -- mmc-hs400-1_8v; -- mmc-hs400-enhanced-strobe; -+ mmc-hs200-1_8v; - non-removable; - status = "okay"; - }; - -From patchwork Fri Oct 4 20:32:13 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: =?utf-8?q?S=C3=B6ren_Moch?= -X-Patchwork-Id: 11175275 -Return-Path: - -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB53776 - for ; - Fri, 4 Oct 2019 20:32:36 +0000 (UTC) -Received: from bombadil.infradead.org (bombadil.infradead.org - [198.137.202.133]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) - (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id B885821D81 - for ; - Fri, 4 Oct 2019 20:32:36 +0000 (UTC) -Authentication-Results: mail.kernel.org; - dkim=pass (2048-bit key) header.d=lists.infradead.org - header.i=@lists.infradead.org header.b="Kyzudsgx"; - dkim=fail reason="signature verification failed" (1024-bit key) - header.d=web.de header.i=@web.de header.b="LF1if5y/" -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B885821D81 -Authentication-Results: mail.kernel.org; - dmarc=none (p=none dis=none) header.from=web.de -Authentication-Results: mail.kernel.org; - spf=none - smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=lists.infradead.org; s=bombadil.20170209; h=Sender: - Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: - List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: - Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: - Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: - References:List-Owner; bh=dHmD7+pyTraHtU6tNX3vZnXR737wGLCZLdWRfkYFpi0=; b=Kyz - udsgxHfoJqpjf89AdGuslY1w4pUpYO7aJ6+VJuDnsGLufBp9F4+yxX7UHhyIbWqlaegelJ+Z3a0CN - vdb7065nXi+ggnq64pCIXY8ZyS13Nc+lpmpFoEMEyvxgrNdu38SJaLj5s8LUMJdZENP1j8kLESEa4 - 8VbV9r7X+GwBf2aBERsF9+vxV3D+49ULxCaDv5mLVRX+5nM8d/AEPJqyBnLYh/i7j/31rk6aH26dY - 4TdVsdvTnm2Ck6zIcHEDX22Eq2vlcw1U8WdctFzzfHSDsWFGAvVvWPwnSe0h7niizqbqLO3cC2WOT - 2ttragRnBvdMCd1TD/sRdBnoOj946RQ==; -Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) - by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) - id 1iGUFf-0002b8-O6; Fri, 04 Oct 2019 20:32:35 +0000 -Received: from mout.web.de ([217.72.192.78]) - by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) - id 1iGUFc-0002ac-RO; Fri, 04 Oct 2019 20:32:34 +0000 -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; - s=dbaedf251592; t=1570221145; - bh=x/DBaa+r9mxjwAjUssLHup4baAiO0UG/yVrLOutxWsg=; - h=X-UI-Sender-Class:From:To:Cc:Subject:Date; - b=LF1if5y/7T4QYPyiawCf94aYJcnXUc1aL405rucwF10cabjCghlaJXN/uO8vszdOl - pJS9oYcF8l9BmR4yT8PVrUWeMZYyAGpt9jc7syVqksEP91IhyUph/X/QnrJzecxDXx - 1vehZNdcbWFN/q59sUmwmzsDfjka3LhL7znEDfv0= -X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 -Received: from platinum.fritz.box ([77.191.3.29]) by smtp.web.de (mrweb103 - [213.165.67.124]) with ESMTPSA (Nemesis) id 0LetQh-1hlnfS19m3-00qhBK; Fri, 04 - Oct 2019 22:32:25 +0200 -From: Soeren Moch -To: Heiko Stuebner -Subject: [PATCH v2] arm64: dts: rockchip: fix RockPro64 sdmmc settings -Date: Fri, 4 Oct 2019 22:32:13 +0200 -Message-Id: <20191004203213.4995-1-smoch@web.de> -X-Mailer: git-send-email 2.17.1 -X-Provags-ID: V03:K1:1I5fDQkIZVn2LdNRnwDfp8md+rO+2Vp/TSL6bgE19S+U7e8RlmF - EhFJGxdLBOeBh6Du3qsKPexxIxstJER4ErQMtp1m6HJoiQsEne8w+BrsSwO0Wh30laTuPec - sK6/onl3zLo9YFphxcEW9zEFFPKS60lWUADP6OIr07s0FyO6OanEsEx+RHULWedKrDDKbbW - 4W1V/uNb/1JyOY4IW4Qow== -X-Spam-Flag: NO -X-UI-Out-Filterresults: notjunk:1;V03:K0:ICsnY7aMJQ4=:5/WFKM85bWZHZp/krlqXXa - JGKxGv3pOO7ubUb+8TvRSP6RJu3y4QxXOJWL/6bmP5fpRZvWD3UZl7gdjPlA+nLBC8i2W/+dO - zdVsBndquXxgZt1sQulCc5ZMhkMIh6ThPnQnHBB+oy1YPivo6dPcxncbjvbgb0+O0i7ydHoXj - 9ZiON6aJCfh7U6zRf7GSQSUu25BEz2Oyo8z8ITYVI+YANji74gj8tiobps8fVES9iDrL6irbj - dhL1JHZOJxr/fK6Z51SzaBX3usndL2ldDDzJI/TWTeKygsqRVom91DOy93TS2/y3+qdVSvYHG - Ohp2hB9xJxVXu2IJoD0BlEEMMMLGLXsi9R8z0GYiCaG43z0zSRDzc0SdumQ7fznh8D2k2mmMR - FPMSML/uY/JqWBSj1nTV4nmpdVeLGEuANsCwJoXq+NOlXAaU2K5vXwSSoNPY9+ned+268R90G - 28MCRcCSpFU0YrPun9sMM9fy/3pD3PKjGmTMDoOQHOlF7mYi796LT/8J7kAw2TK7XILqRP0/V - 2RJz031b8L1r3Hptl0OD20z+eYtpFmPPsa7q2+CmsKLprUxrdBx+xgC4poof91mOYwsQAqLBc - X6ljlMxZ+BwxkNf4QTipd4dhMcUuTrIO5BxXx02nG9XMwrHIx5zHBaMz9KAnyxHt7Q1BVocqi - Wv4JyFhARvR526ogFn1aXu7KJxyBeM87BW5J2a4fsaeGrQlrMViuc6VzaSV/jHDJ8Hu1i+i6O - Mfgqc4+EEuoFxKT4vfCmaYNX+2Jn2t1jXf1Km1+AE05VCFEkhmo4ogflTJ1fsf5NrX4fyoZcU - vFlEQyR6Msy3TXJGZfVmHSdTV1BnTSIMMDUfgJHO+Gwuw3t0J0xITHeF/6VebU/APujrOpRqS - bvEoHl729Odz0/0o7HK+5fctl7UktilntlJkCQnUzVl12NrTOrdFeZNU8jvm/PyK7U6UlWVva - iIjHQxfZqOOCb7no9+gZ0+OXFguVTBdHUsDbdI8rMTY3l1xXsLKc0wZoBvGtJkydtkZxQ7K8r - yvGgesqk8DaEJSzOL1rSStkQBqE7gHuApTovSRLe9nn2uA0UNabEYbwP3mmZ2A8X02EZ3m7Yu - SjpYxwom+3lHLwSTaYCSoGEe/zKKwZBQ/I3sRnuKEGJwMT2Ph7UWe/OohBaLf5VDopnWXL3iP - D5waU3h0q0iVYGMjc75FAtIpG/uPJAVIAouxPQa4k0aoqU7IzGd2dCky/LxxSob/H7k4Bu4Vq - sjEKSF7D5Grbp7B0vKAQvqgdUg6ohIjG5LGVLRQ== -X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20191004_133233_182966_B73EA9A6 -X-CRM114-Status: UNSURE ( 6.77 ) -X-CRM114-Notice: Please train this message. -X-Spam-Score: -0.9 (/) -X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: - Content analysis details: (-0.9 points) - pts rule name description - ---- ---------------------- - -------------------------------------------------- - 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail - provider (smoch[at]web.de) - -0.0 SPF_PASS SPF: sender matches SPF record - 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record - -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature - -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from - author's domain - -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from - envelope-from domain - 0.1 DKIM_SIGNED Message has a DKIM or DK signature, - not necessarily - valid - -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, - low trust [217.72.192.78 listed in list.dnswl.org] -X-BeenThere: linux-arm-kernel@lists.infradead.org -X-Mailman-Version: 2.1.29 -Precedence: list -List-Id: -List-Unsubscribe: - , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: - , - -Cc: linux-rockchip@lists.infradead.org, Soeren Moch , - linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org -MIME-Version: 1.0 -Content-Type: text/plain; charset="us-ascii" -Sender: "linux-arm-kernel" -Errors-To: - linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org - -According to the RockPro64 schematic [1] the rk3399 sdmmc controller is -connected to a microSD (TF card) slot. Remove the cap-mmc-highspeed -property of the sdmmc controller, since no mmc card can be connected here. - -[1] http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf - -Fixes: e4f3fb490967 ("arm64: dts: rockchip: add initial dts support for Rockpro64") -Signed-off-by: Soeren Moch ---- -Cc: Heiko Stuebner -Cc: linux-rockchip@lists.infradead.org -Cc: linux-arm-kernel@lists.infradead.org -Cc: linux-kernel@vger.kernel.org ---- - arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 1 - - 1 file changed, 1 deletion(-) - --- -2.17.1 - -diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts -index 2e44dae4865a..6ec4d273a39b 100644 ---- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts -@@ -624,7 +624,6 @@ - - &sdmmc { - bus-width = <4>; -- cap-mmc-highspeed; - cap-sd-highspeed; - cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; - disable-wp; diff --git a/arm64-dts-rockchip-fix-Rockpro64-RK808-interrupt-line.patch b/arm64-dts-rockchip-fix-Rockpro64-RK808-interrupt-line.patch deleted file mode 100644 index 439a46cef..000000000 --- a/arm64-dts-rockchip-fix-Rockpro64-RK808-interrupt-line.patch +++ /dev/null @@ -1,176 +0,0 @@ -From patchwork Sat Sep 21 13:14:57 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Hugh Cole-Baker -X-Patchwork-Id: 11155461 -Return-Path: - -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E1D6015E6 - for ; - Sat, 21 Sep 2019 13:15:24 +0000 (UTC) -Received: from bombadil.infradead.org (bombadil.infradead.org - [198.137.202.133]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) - (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id B3213208C0 - for ; - Sat, 21 Sep 2019 13:15:24 +0000 (UTC) -Authentication-Results: mail.kernel.org; - dkim=pass (2048-bit key) header.d=lists.infradead.org - header.i=@lists.infradead.org header.b="W5WNb2TT"; - dkim=fail reason="signature verification failed" (2048-bit key) - header.d=gmail.com header.i=@gmail.com header.b="aEQ/uRYv" -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3213208C0 -Authentication-Results: mail.kernel.org; - dmarc=fail (p=none dis=none) header.from=gmail.com -Authentication-Results: mail.kernel.org; - spf=none - smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=lists.infradead.org; s=bombadil.20170209; h=Sender: - Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: - List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: - Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: - Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: - References:List-Owner; bh=QLfO79ztbvlytyrABYnU/Ie8WNhDlpOUcFlxv1bWAE0=; b=W5W - Nb2TTjjSFXpARxovU0gOdO72UtLrMdXbc9I5OSMOqQEbYRXyDnfj5yxtTPyEDEdPNIP0C+CINfgqP - i7tvTWHEJ+WLQl6W5x9rWLoj02r3L2huGNpc5wjq+YZe20bFzs9eRe1leAnmghM8UAnvP496rcA18 - haBwaAQzZoECuKW3x+uDJ5eehlnL9OhnPUXpYYaOLBBiBg0jOPFlA/FIMUzY7IXRQrlzgSVcAN6pR - Ls+x5RBZZyQQqm9RfmChVRfa2NKhWD/TjnjLEfCYB0IovxrY3ar4mLmYeGm9ladShqqfLX8zhY0+8 - OaTRBY64J4Yfk8owMuN7Rr+D4O12ndQ==; -Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) - by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) - id 1iBfEN-0002Op-RP; Sat, 21 Sep 2019 13:15:19 +0000 -Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) - by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) - id 1iBfEL-0002O9-AK; Sat, 21 Sep 2019 13:15:18 +0000 -Received: by mail-wm1-x341.google.com with SMTP id p7so5200464wmp.4; - Sat, 21 Sep 2019 06:15:14 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; - h=from:to:cc:subject:date:message-id; - bh=CUIiObmZUoLOjlcmGuE4Z8qsrk1peXb9nnaXkFScf1o=; - b=aEQ/uRYvCsbX944pwrZC5Zi5+pI6s/P143IvpXdlQXMblp/gr0TEwvb4/jIY8KcTPb - h+OCadPSshMmMPvaxG+aDklS4bI+8UV1JUuif5+/cH6ND7u1pCPlRypNjKUUSwZlcfVY - fmOmGc8jEjdrmt2rxdLStr2mvlAdNsGDr/SrNSboflvindXVGUKuxoMwkhXbfAgD7kXD - ds2xaFd7dONWCaZm0mLYpGcfY18vZi6cbUNr7JCDZAZ7y8bfR+bZaJZLCL3MaN0W9/8b - tqoH4C7+jAVoy4HWXeff+DTBMlGe4VHPROBfJn0KzOOWdKjEpBrMct/Vjc06IqQSo+hy - Tt8g== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20161025; - h=x-gm-message-state:from:to:cc:subject:date:message-id; - bh=CUIiObmZUoLOjlcmGuE4Z8qsrk1peXb9nnaXkFScf1o=; - b=h+cy8eJs/UTeiJzt803DJY4bgVbfMVP/Z49o/wr03kqhpNI9ydIH+ar2zzI2iWexpM - ZzgUMv/1GPmqL5YPESh7p9gigoIQ5a7lDX7pO7mqxC0PNyeyZKSsrNhMZLKEZkErPY1f - 8IhO3DYPn2TROfHNhrKazqoojHc845188c8sTkxVvAf6AmfwYAMl9ca12NZBmVQR36NN - XhN4VYehR2XAzE9AcGOTZvyBa9ebhSMG7u5Q/OiSAckDPmZ6B26Px96jwwRvRW/PBfPB - yiXMvWNnRqBaIx9cdHDFXEMccoB/3RNR//uNJmlHwCy6Kn0F7toMgVi8AauCtbUQsgwQ - cIpg== -X-Gm-Message-State: APjAAAVE1l4BxwL8Z1YLGXAhzhm5VGSZTLQmSXQg6+3ibumsSm+bxwaN - BBaU69sXBc8Y2h20jUfrC6I= -X-Google-Smtp-Source: - APXvYqwjrERzxUIeZTPWyTYAXdg1ZTPDKGaLOeQoXI2vdua+67gV4Ml3mGFKjPE7ijQS8GUVUSa4Hw== -X-Received: by 2002:a05:600c:295d:: with SMTP id - n29mr6713359wmd.36.1569071712994; - Sat, 21 Sep 2019 06:15:12 -0700 (PDT) -Received: from apple.sigmaris.info ([84.93.172.212]) - by smtp.gmail.com with ESMTPSA id g11sm5676349wmh.45.2019.09.21.06.15.11 - (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); - Sat, 21 Sep 2019 06:15:12 -0700 (PDT) -From: Hugh Cole-Baker -To: devicetree@vger.kernel.org -Subject: [PATCH] arm64: dts: rockchip: fix Rockpro64 RK808 interrupt line -Date: Sat, 21 Sep 2019 14:14:57 +0100 -Message-Id: <20190921131457.36258-1-sigmaris@gmail.com> -X-Mailer: git-send-email 2.17.2 (Apple Git-113) -X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20190921_061517_383773_FFE10321 -X-CRM114-Status: GOOD ( 13.01 ) -X-Spam-Score: -0.2 (/) -X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: - Content analysis details: (-0.2 points) - pts rule name description - ---- ---------------------- - -------------------------------------------------- - -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, - no trust [2a00:1450:4864:20:0:0:0:341 listed in] - [list.dnswl.org] - 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record - 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail - provider (sigmaris[at]gmail.com) - -0.0 SPF_PASS SPF: sender matches SPF record - -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from - author's domain - 0.1 DKIM_SIGNED Message has a DKIM or DK signature, - not necessarily - valid - -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature - -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from - envelope-from domain -X-BeenThere: linux-arm-kernel@lists.infradead.org -X-Mailman-Version: 2.1.29 -Precedence: list -List-Id: -List-Unsubscribe: - , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: - , - -Cc: Mark Rutland , Heiko Stuebner , - Akash Gajjar , linux-kernel@vger.kernel.org, - linux-rockchip@lists.infradead.org, Rob Herring , - Hugh Cole-Baker , linux-arm-kernel@lists.infradead.org -MIME-Version: 1.0 -Content-Type: text/plain; charset="us-ascii" -Sender: "linux-arm-kernel" -Errors-To: - linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org - -Fix the pinctrl and interrupt specifier for RK808 to use GPIO3_B2. On the -Rockpro64 schematic [1] page 16, it shows GPIO3_B2 used for the interrupt -line PMIC_INT_L from the RK808, and there's a note which translates as: -"PMU termination GPIO1_C5 changed to this". - -Tested by setting an RTC wakealarm and checking /proc/interrupts counters. -Without this patch, neither the rockchip_gpio_irq counter for the RK808, -nor the RTC alarm counter increment when the alarm time is reached. -With this patch, both interrupt counters increment by 1 as expected. - -[1] http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf - -Fixes: e4f3fb4 ("arm64: dts: rockchip: add initial dts support for Rockpro64") -Signed-off-by: Hugh Cole-Baker ---- - arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts -index 0401d4ec1f45..c27d8a6ae1c5 100644 ---- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts -@@ -247,8 +247,8 @@ - rk808: pmic@1b { - compatible = "rockchip,rk808"; - reg = <0x1b>; -- interrupt-parent = <&gpio1>; -- interrupts = <21 IRQ_TYPE_LEVEL_LOW>; -+ interrupt-parent = <&gpio3>; -+ interrupts = <10 IRQ_TYPE_LEVEL_LOW>; - #clock-cells = <1>; - clock-output-names = "xin32k", "rk808-clkout2"; - pinctrl-names = "default"; -@@ -574,7 +574,7 @@ - - pmic { - pmic_int_l: pmic-int-l { -- rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; -+ rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>; - }; - - vsel1_gpio: vsel1-gpio { diff --git a/kernel.spec b/kernel.spec index a02b140ad..54d7f9673 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 9 +%define stable_update 10 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -551,11 +551,6 @@ Patch304: usb-phy-tegra-Add-38.4MHz-clock-table-entry.patch # http://patchwork.ozlabs.org/patch/587554/ Patch305: ARM-tegra-usb-no-reset.patch -# https://patchwork.kernel.org/patch/11173461/ -Patch307: arm64-dts-rockchip-fix-RockPro64-vdd-log-regulator-settings.patch -# https://patchwork.kernel.org/patch/11155461/ -Patch308: arm64-dts-rockchip-fix-Rockpro64-RK808-interrupt-line.patch - # Tegra bits Patch320: arm64-tegra-jetson-tx1-fixes.patch # https://www.spinics.net/lists/linux-tegra/msg43110.html @@ -1802,6 +1797,9 @@ fi # # %changelog +* Mon Nov 11 2019 Laura Abbott - 5.3.10-300 +- Linux v5.3.10 + * Thu Nov 07 2019 Jeremy Cline - Add support for a number of Macbook keyboards and touchpads (rhbz 1769465) diff --git a/sources b/sources index ec1c9d2d8..3d7c84282 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.9.xz) = b2bb836ad47e23b475bebeea06cce4ceb6feec0e5d2cf5e1d13fd788d2a9efddc22694806dd59413956f2c2baac9b01071f8fe5115cfe75d8750fe020825ee24 +SHA512 (patch-5.3.10.xz) = cc086c1c2aa68fa751dbcabd0a762d18d7de10e763aaa12b6f88d02585451e6ab2fea9f3bf841f14e8f9ae2dc2cb0ec6a9fdf65309318df8c6c43ada3f70c718 From 6dfe5c1ffbd3d03349b35a4d5f6536aa4a253bbb Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Tue, 12 Nov 2019 12:46:57 -0600 Subject: [PATCH 039/178] Linux v5.3.11 --- .../x86/CONFIG_X86_INTEL_TSX_MODE_AUTO | 1 + .../generic/x86/CONFIG_X86_INTEL_TSX_MODE_OFF | 1 + .../generic/x86/CONFIG_X86_INTEL_TSX_MODE_ON | 1 + ...e-reserved-memory-at-the-base-of-RAM.patch | 216 ------------------ kernel-i686-debug.config | 3 + kernel-i686.config | 3 + kernel-x86_64-debug.config | 3 + kernel-x86_64.config | 3 + kernel.spec | 12 +- sources | 2 +- 10 files changed, 24 insertions(+), 221 deletions(-) create mode 100644 configs/fedora/generic/x86/CONFIG_X86_INTEL_TSX_MODE_AUTO create mode 100644 configs/fedora/generic/x86/CONFIG_X86_INTEL_TSX_MODE_OFF create mode 100644 configs/fedora/generic/x86/CONFIG_X86_INTEL_TSX_MODE_ON delete mode 100644 efi-libstub-arm-account-for-firmware-reserved-memory-at-the-base-of-RAM.patch diff --git a/configs/fedora/generic/x86/CONFIG_X86_INTEL_TSX_MODE_AUTO b/configs/fedora/generic/x86/CONFIG_X86_INTEL_TSX_MODE_AUTO new file mode 100644 index 000000000..788136fc5 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_X86_INTEL_TSX_MODE_AUTO @@ -0,0 +1 @@ +# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set diff --git a/configs/fedora/generic/x86/CONFIG_X86_INTEL_TSX_MODE_OFF b/configs/fedora/generic/x86/CONFIG_X86_INTEL_TSX_MODE_OFF new file mode 100644 index 000000000..d22a12f0d --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_X86_INTEL_TSX_MODE_OFF @@ -0,0 +1 @@ +CONFIG_X86_INTEL_TSX_MODE_OFF=y diff --git a/configs/fedora/generic/x86/CONFIG_X86_INTEL_TSX_MODE_ON b/configs/fedora/generic/x86/CONFIG_X86_INTEL_TSX_MODE_ON new file mode 100644 index 000000000..b6471915c --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_X86_INTEL_TSX_MODE_ON @@ -0,0 +1 @@ +# CONFIG_X86_INTEL_TSX_MODE_ON is not set diff --git a/efi-libstub-arm-account-for-firmware-reserved-memory-at-the-base-of-RAM.patch b/efi-libstub-arm-account-for-firmware-reserved-memory-at-the-base-of-RAM.patch deleted file mode 100644 index 47bccc262..000000000 --- a/efi-libstub-arm-account-for-firmware-reserved-memory-at-the-base-of-RAM.patch +++ /dev/null @@ -1,216 +0,0 @@ -From patchwork Mon Oct 14 16:33:09 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Ard Biesheuvel -X-Patchwork-Id: 11189097 -Return-Path: - -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E1AD11390 - for ; - Mon, 14 Oct 2019 16:33:28 +0000 (UTC) -Received: from bombadil.infradead.org (bombadil.infradead.org - [198.137.202.133]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) - (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id BF9BE217D9 - for ; - Mon, 14 Oct 2019 16:33:28 +0000 (UTC) -Authentication-Results: mail.kernel.org; - dkim=pass (2048-bit key) header.d=lists.infradead.org - header.i=@lists.infradead.org header.b="AWaZtE0p"; - dkim=fail reason="signature verification failed" (2048-bit key) - header.d=linaro.org header.i=@linaro.org header.b="THTDXG/3" -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF9BE217D9 -Authentication-Results: mail.kernel.org; - dmarc=fail (p=none dis=none) header.from=linaro.org -Authentication-Results: mail.kernel.org; - spf=none - smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=lists.infradead.org; s=bombadil.20170209; h=Sender: - Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: - List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To - :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: - Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: - List-Owner; bh=bFVBLmSAI67EKVRVJ976rFVJhb17XzlF5Frmxpt4Q24=; b=AWaZtE0prtFAKn - TzXV3jyYung5GM46YpbdIYSXq5utN5mbiOzHoadisQSsfKUn1h5/wpF7esUHXwHaDS5FWUUp5g6F+ - P0rKmQjVgWN+jVD7Kk7RvmJewoFKWvlUzoG5+Lfin8NLSHMwNg+v2Z+sUayE+SylST1LP8jkK8B7e - QiOi647qxPv6IW25Zucu4D+N8DXmh+t6DjJXZ2W1LznbCD0PIPjTpcen0dntkHUYL0FHya3ghdrC3 - ejo+MjvSDlrs4LgP5ER56hiSeucu58WMLefoUS3oSEYirB+9zt3Qk2Ppxv6k2GY/NBkLjw9jT76kg - OIZj83Gck17z+l7+NVmQ==; -Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) - by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) - id 1iK3Hk-0001ZP-CS; Mon, 14 Oct 2019 16:33:28 +0000 -Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) - by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) - id 1iK3Hf-0001Tp-Mo - for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2019 16:33:26 +0000 -Received: by mail-wm1-x341.google.com with SMTP id y135so386665wmc.1 - for ; - Mon, 14 Oct 2019 09:33:23 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; - h=from:to:cc:subject:date:message-id:mime-version - :content-transfer-encoding; - bh=yuEdphuMWOUGDahWSE97oqgmOlObKgpyvQgzFU8TRQU=; - b=THTDXG/3mOeZtb6dOK6qrH1eQvV7z52+jijnE+ULOhMbPReKZiIPTLCR3+W7HnWIkL - RFmtL80kGqOr/FynSqFtzLiwv4TaClqwXnVtULNnpITi/cHhy+AnvWVfQCDZ1THjSHSh - pduFTV40hbsfQR4K3wm6K4LGLOnaAkS193JT28eOdR7oOcCjbZSKoQKTYCquWrAWTeIo - oQAUnFNuy4gdBy+94VmzR0AdgNrDXTc5KPDYLaOTSBxZUJQ8+7pDFhxOxm06B6gNgPEp - fzYcPcRV2R9hc6PtL8jxMKRNQ3PcJnas8KU2DsmaK/FJZxgtzXs97TaHydGKq33TYgst - Mpow== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20161025; - h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version - :content-transfer-encoding; - bh=yuEdphuMWOUGDahWSE97oqgmOlObKgpyvQgzFU8TRQU=; - b=PJHaADcio6H7WwVXfMpYGT2fr/FMtU5GUUbNeD+td9rfpid6nfbHrh2TCAQtpxAMaS - B63nd+HNchQoPhWWHWMMx8gbY9KwOKzc5/FO5wqeDo5gbpI/eWidH+ieGLaxozX/Aqku - BLTdsnGMIB+FxmFCmtaY1y9wuqdVmS/4RiobjBycBZmXBYOYxZc3I81zM1u+nBjRKsNZ - h2D/gN8sjkRbT4f5kU/xpHbh+8CbpVp4ze5cpKOf35Iwf+ASNw/l53NHft0Y41ehG2NA - YFsdBpquso+CNhTGqN5VOBlpGdMFRJ4SIseygRQbXVT4KEeZBP60so7Ed8MwxoXmG6sw - gM5w== -X-Gm-Message-State: APjAAAUc9u8vjoe8La6L5Z/DMvnvVKz828SBRtfClkhDufJCaEZaQ1S9 - nO3+g66C+iOliANLi0dTY/L7SkabogZiQQ== -X-Google-Smtp-Source: - APXvYqz0XzN3uY3m31zQi76ZEDZQMtYggJ6COqe0WCePJ5GuE+rYLNtFHVBakYmvlBvQjlPYRU+lrg== -X-Received: by 2002:a1c:a516:: with SMTP id - o22mr16781400wme.116.1571070801893; - Mon, 14 Oct 2019 09:33:21 -0700 (PDT) -Received: from localhost.localdomain - (laubervilliers-657-1-83-120.w92-154.abo.wanadoo.fr. [92.154.90.120]) - by smtp.gmail.com with ESMTPSA id o70sm25785240wme.29.2019.10.14.09.33.20 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Mon, 14 Oct 2019 09:33:21 -0700 (PDT) -From: Ard Biesheuvel -To: linux-arm-kernel@lists.infradead.org -Subject: [PATCH] efi: libstub/arm: account for firmware reserved memory at the - base of RAM -Date: Mon, 14 Oct 2019 18:33:09 +0200 -Message-Id: <20191014163309.2860-1-ard.biesheuvel@linaro.org> -X-Mailer: git-send-email 2.20.1 -MIME-Version: 1.0 -X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20191014_093323_781941_B57BEE97 -X-CRM114-Status: GOOD ( 13.99 ) -X-Spam-Score: -0.2 (/) -X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: - Content analysis details: (-0.2 points) - pts rule name description - ---- ---------------------- - -------------------------------------------------- - -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, - no trust [2a00:1450:4864:20:0:0:0:341 listed in] - [list.dnswl.org] - 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record - -0.0 SPF_PASS SPF: sender matches SPF record - -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from - author's domain - 0.1 DKIM_SIGNED Message has a DKIM or DK signature, - not necessarily - valid - -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from - envelope-from domain - -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -X-BeenThere: linux-arm-kernel@lists.infradead.org -X-Mailman-Version: 2.1.29 -Precedence: list -List-Id: -List-Unsubscribe: - , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: - , - -Cc: Chester Lin , Guillaume Gardet , - linux-efi@vger.kernel.org, Ard Biesheuvel -Sender: "linux-arm-kernel" -Errors-To: - linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org - -The EFI stubloader for ARM starts out by allocating a 32 MB window -at the base of RAM, in order to ensure that the decompressor (which -blindly copies the uncompressed kernel into that window) does not -overwrite other allocations that are made while running in the context -of the EFI firmware. - -In some cases, (e.g., U-Boot running on the Raspberry Pi 2), this is -causing boot failures because this initial allocation conflicts with -a page of reserved memory at the base of RAM that contains the SMP spin -tables and other pieces of firmware data and which was put there by -the bootloader under the assumption that the TEXT_OFFSET window right -below the kernel is only used partially during early boot, and will be -left alone once the memory reservations are processed and taken into -account. - -So let's permit reserved memory regions to exist in the region starting -at the base of RAM, and ending at TEXT_OFFSET - 5 * PAGE_SIZE, which is -the window below the kernel that is not touched by the early boot code. - -Cc: Guillaume Gardet -Cc: Chester Lin -Signed-off-by: Ard Biesheuvel ---- - drivers/firmware/efi/libstub/Makefile | 1 + - drivers/firmware/efi/libstub/arm32-stub.c | 16 +++++++++++++--- - 2 files changed, 14 insertions(+), 3 deletions(-) - -diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile -index 0460c7581220..ee0661ddb25b 100644 ---- a/drivers/firmware/efi/libstub/Makefile -+++ b/drivers/firmware/efi/libstub/Makefile -@@ -52,6 +52,7 @@ lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o string.o random.o \ - - lib-$(CONFIG_ARM) += arm32-stub.o - lib-$(CONFIG_ARM64) += arm64-stub.o -+CFLAGS_arm32-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET) - CFLAGS_arm64-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET) - - # -diff --git a/drivers/firmware/efi/libstub/arm32-stub.c b/drivers/firmware/efi/libstub/arm32-stub.c -index e8f7aefb6813..47aafeff3e01 100644 ---- a/drivers/firmware/efi/libstub/arm32-stub.c -+++ b/drivers/firmware/efi/libstub/arm32-stub.c -@@ -195,6 +195,7 @@ efi_status_t handle_kernel_image(efi_system_table_t *sys_table, - unsigned long dram_base, - efi_loaded_image_t *image) - { -+ unsigned long kernel_base; - efi_status_t status; - - /* -@@ -204,9 +205,18 @@ efi_status_t handle_kernel_image(efi_system_table_t *sys_table, - * loaded. These assumptions are made by the decompressor, - * before any memory map is available. - */ -- dram_base = round_up(dram_base, SZ_128M); -+ kernel_base = round_up(dram_base, SZ_128M); - -- status = reserve_kernel_base(sys_table, dram_base, reserve_addr, -+ /* -+ * Note that some platforms (notably, the Raspberry Pi 2) put -+ * spin-tables and other pieces of firmware at the base of RAM, -+ * abusing the fact that the window of TEXT_OFFSET bytes at the -+ * base of the kernel image is only partially used at the moment. -+ * (Up to 5 pages are used for the swapper page table) -+ */ -+ kernel_base += TEXT_OFFSET - 5 * PAGE_SIZE; -+ -+ status = reserve_kernel_base(sys_table, kernel_base, reserve_addr, - reserve_size); - if (status != EFI_SUCCESS) { - pr_efi_err(sys_table, "Unable to allocate memory for uncompressed kernel.\n"); -@@ -220,7 +230,7 @@ efi_status_t handle_kernel_image(efi_system_table_t *sys_table, - *image_size = image->image_size; - status = efi_relocate_kernel(sys_table, image_addr, *image_size, - *image_size, -- dram_base + MAX_UNCOMP_KERNEL_SIZE, 0); -+ kernel_base + MAX_UNCOMP_KERNEL_SIZE, 0); - if (status != EFI_SUCCESS) { - pr_efi_err(sys_table, "Failed to relocate kernel.\n"); - efi_free(sys_table, *reserve_size, *reserve_addr); diff --git a/kernel-i686-debug.config b/kernel-i686-debug.config index eae208300..95884ea08 100644 --- a/kernel-i686-debug.config +++ b/kernel-i686-debug.config @@ -6561,6 +6561,9 @@ CONFIG_X86_INTEL_LPSS=y CONFIG_X86_INTEL_MPX=y CONFIG_X86_INTEL_PSTATE=y # CONFIG_X86_INTEL_QUARK is not set +# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set +CONFIG_X86_INTEL_TSX_MODE_OFF=y +# CONFIG_X86_INTEL_TSX_MODE_ON is not set # CONFIG_X86_LEGACY_VM86 is not set # CONFIG_X86_LONGHAUL is not set CONFIG_X86_LONGRUN=y diff --git a/kernel-i686.config b/kernel-i686.config index 61869e292..a89417761 100644 --- a/kernel-i686.config +++ b/kernel-i686.config @@ -6540,6 +6540,9 @@ CONFIG_X86_INTEL_LPSS=y CONFIG_X86_INTEL_MPX=y CONFIG_X86_INTEL_PSTATE=y # CONFIG_X86_INTEL_QUARK is not set +# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set +CONFIG_X86_INTEL_TSX_MODE_OFF=y +# CONFIG_X86_INTEL_TSX_MODE_ON is not set # CONFIG_X86_LEGACY_VM86 is not set # CONFIG_X86_LONGHAUL is not set CONFIG_X86_LONGRUN=y diff --git a/kernel-x86_64-debug.config b/kernel-x86_64-debug.config index 1e7e74847..132d17a99 100644 --- a/kernel-x86_64-debug.config +++ b/kernel-x86_64-debug.config @@ -6618,6 +6618,9 @@ CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y # CONFIG_X86_INTEL_MID is not set CONFIG_X86_INTEL_MPX=y CONFIG_X86_INTEL_PSTATE=y +# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set +CONFIG_X86_INTEL_TSX_MODE_OFF=y +# CONFIG_X86_INTEL_TSX_MODE_ON is not set # CONFIG_X86_LEGACY_VM86 is not set CONFIG_X86_MCE_AMD=y CONFIG_X86_MCE_INJECT=m diff --git a/kernel-x86_64.config b/kernel-x86_64.config index bc866f8ad..115df0c07 100644 --- a/kernel-x86_64.config +++ b/kernel-x86_64.config @@ -6597,6 +6597,9 @@ CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y # CONFIG_X86_INTEL_MID is not set CONFIG_X86_INTEL_MPX=y CONFIG_X86_INTEL_PSTATE=y +# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set +CONFIG_X86_INTEL_TSX_MODE_OFF=y +# CONFIG_X86_INTEL_TSX_MODE_ON is not set # CONFIG_X86_LEGACY_VM86 is not set CONFIG_X86_MCE_AMD=y CONFIG_X86_MCE_INJECT=m diff --git a/kernel.spec b/kernel.spec index 54d7f9673..e746d6e07 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 10 +%define stable_update 11 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -570,9 +570,6 @@ Patch332: arm64-dts-qcom-Add-Lenovo-Yoga-C630.patch # https://patchwork.kernel.org/patch/11136979/ Patch341: Revert-ARM-bcm283x-Switch-V3D-over-to-using-the-PM-driver-instead-of-firmware.patch -# https://www.spinics.net/lists/arm-kernel/msg761152.html -Patch342: efi-libstub-arm-account-for-firmware-reserved-memory-at-the-base-of-RAM.patch - # 400 - IBM (ppc/s390x) patches # 500 - Temp fixes/CVEs etc @@ -1797,6 +1794,13 @@ fi # # %changelog +* Tue Nov 12 2019 Justin M. Forbes - 5.3.11-300 +- Linux v5.3.11 +- Fixes CVE-2019-11135 (rhbz 1753062 1771649) +- Fixes CVE-2018-12207 (rhbz 1646768 1771645) +- Fixes CVE-2019-0154 (rhbz 1724393 1771642) +- Fixes CVE-2019-0155 (rhbz 1724398 1771644) + * Mon Nov 11 2019 Laura Abbott - 5.3.10-300 - Linux v5.3.10 diff --git a/sources b/sources index 3d7c84282..5e1166799 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.10.xz) = cc086c1c2aa68fa751dbcabd0a762d18d7de10e763aaa12b6f88d02585451e6ab2fea9f3bf841f14e8f9ae2dc2cb0ec6a9fdf65309318df8c6c43ada3f70c718 +SHA512 (patch-5.3.11.xz) = 27f6974d008c874bba700cb6f4b70838fdd5bc6cd85340f596663752a7046e3e844e7c50516d3ed7f736e258007e6091c387a989a22eed8170bfd99710f59f52 From a4828aea55cf33e5cacf60ec2482496cf309aa18 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sat, 16 Nov 2019 01:37:42 +0000 Subject: [PATCH 040/178] enable the STMPE touchscreen stack to a wider audience --- .../generic/arm/{armv7/armv7 => }/CONFIG_GPIO_STMPE | 0 .../generic/arm/{armv7/armv7 => }/CONFIG_KEYBOARD_STMPE | 0 .../generic/arm/{armv7/armv7 => }/CONFIG_MFD_STMPE | 0 .../generic/arm/{armv7/armv7 => }/CONFIG_PWM_STMPE | 0 configs/fedora/generic/arm/{armv7 => }/CONFIG_STMPE_ADC | 0 .../generic/arm/{armv7/armv7 => }/CONFIG_STMPE_I2C | 0 .../generic/arm/{armv7/armv7 => }/CONFIG_STMPE_SPI | 0 .../arm/{armv7/armv7 => }/CONFIG_TOUCHSCREEN_STMPE | 0 kernel-aarch64-debug.config | 9 ++++++++- kernel-aarch64.config | 9 ++++++++- kernel-armv7hl-lpae-debug.config | 8 +++++++- kernel-armv7hl-lpae.config | 8 +++++++- 12 files changed, 30 insertions(+), 4 deletions(-) rename configs/fedora/generic/arm/{armv7/armv7 => }/CONFIG_GPIO_STMPE (100%) rename configs/fedora/generic/arm/{armv7/armv7 => }/CONFIG_KEYBOARD_STMPE (100%) rename configs/fedora/generic/arm/{armv7/armv7 => }/CONFIG_MFD_STMPE (100%) rename configs/fedora/generic/arm/{armv7/armv7 => }/CONFIG_PWM_STMPE (100%) rename configs/fedora/generic/arm/{armv7 => }/CONFIG_STMPE_ADC (100%) rename configs/fedora/generic/arm/{armv7/armv7 => }/CONFIG_STMPE_I2C (100%) rename configs/fedora/generic/arm/{armv7/armv7 => }/CONFIG_STMPE_SPI (100%) rename configs/fedora/generic/arm/{armv7/armv7 => }/CONFIG_TOUCHSCREEN_STMPE (100%) diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_GPIO_STMPE b/configs/fedora/generic/arm/CONFIG_GPIO_STMPE similarity index 100% rename from configs/fedora/generic/arm/armv7/armv7/CONFIG_GPIO_STMPE rename to configs/fedora/generic/arm/CONFIG_GPIO_STMPE diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_KEYBOARD_STMPE b/configs/fedora/generic/arm/CONFIG_KEYBOARD_STMPE similarity index 100% rename from configs/fedora/generic/arm/armv7/armv7/CONFIG_KEYBOARD_STMPE rename to configs/fedora/generic/arm/CONFIG_KEYBOARD_STMPE diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_MFD_STMPE b/configs/fedora/generic/arm/CONFIG_MFD_STMPE similarity index 100% rename from configs/fedora/generic/arm/armv7/armv7/CONFIG_MFD_STMPE rename to configs/fedora/generic/arm/CONFIG_MFD_STMPE diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_PWM_STMPE b/configs/fedora/generic/arm/CONFIG_PWM_STMPE similarity index 100% rename from configs/fedora/generic/arm/armv7/armv7/CONFIG_PWM_STMPE rename to configs/fedora/generic/arm/CONFIG_PWM_STMPE diff --git a/configs/fedora/generic/arm/armv7/CONFIG_STMPE_ADC b/configs/fedora/generic/arm/CONFIG_STMPE_ADC similarity index 100% rename from configs/fedora/generic/arm/armv7/CONFIG_STMPE_ADC rename to configs/fedora/generic/arm/CONFIG_STMPE_ADC diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_STMPE_I2C b/configs/fedora/generic/arm/CONFIG_STMPE_I2C similarity index 100% rename from configs/fedora/generic/arm/armv7/armv7/CONFIG_STMPE_I2C rename to configs/fedora/generic/arm/CONFIG_STMPE_I2C diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_STMPE_SPI b/configs/fedora/generic/arm/CONFIG_STMPE_SPI similarity index 100% rename from configs/fedora/generic/arm/armv7/armv7/CONFIG_STMPE_SPI rename to configs/fedora/generic/arm/CONFIG_STMPE_SPI diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_TOUCHSCREEN_STMPE b/configs/fedora/generic/arm/CONFIG_TOUCHSCREEN_STMPE similarity index 100% rename from configs/fedora/generic/arm/armv7/armv7/CONFIG_TOUCHSCREEN_STMPE rename to configs/fedora/generic/arm/CONFIG_TOUCHSCREEN_STMPE diff --git a/kernel-aarch64-debug.config b/kernel-aarch64-debug.config index c9fb4718e..1c6629b3c 100644 --- a/kernel-aarch64-debug.config +++ b/kernel-aarch64-debug.config @@ -2025,6 +2025,7 @@ CONFIG_GPIO_RASPBERRYPI_EXP=m # CONFIG_GPIO_RDC321X is not set # CONFIG_GPIO_SAMA5D2_PIOBU is not set # CONFIG_GPIO_SCH311X is not set +CONFIG_GPIO_STMPE=y CONFIG_GPIO_SYSCON=m # CONFIG_GPIO_SYSFS is not set CONFIG_GPIO_TEGRA186=y @@ -2911,6 +2912,7 @@ CONFIG_KEYBOARD_QT1070=m # CONFIG_KEYBOARD_QT2160 is not set # CONFIG_KEYBOARD_SAMSUNG is not set CONFIG_KEYBOARD_SNVS_PWRKEY=m +CONFIG_KEYBOARD_STMPE=m # CONFIG_KEYBOARD_STOWAWAY is not set # CONFIG_KEYBOARD_SUN4I_LRADC is not set # CONFIG_KEYBOARD_SUNKBD is not set @@ -3341,7 +3343,7 @@ CONFIG_MFD_SM501=m # CONFIG_MFD_SMSC is not set CONFIG_MFD_SPMI_PMIC=m # CONFIG_MFD_STMFX is not set -# CONFIG_MFD_STMPE is not set +CONFIG_MFD_STMPE=y # CONFIG_MFD_STPMIC1 is not set # CONFIG_MFD_SUN4I_GPADC is not set # CONFIG_MFD_SUN6I_PRCM is not set @@ -4679,6 +4681,7 @@ CONFIG_PWM_IMX_TPM=m CONFIG_PWM_MESON=m # CONFIG_PWM_PCA9685 is not set CONFIG_PWM_ROCKCHIP=m +# CONFIG_PWM_STMPE is not set CONFIG_PWM_SUN4I=m CONFIG_PWM_SYSFS=y CONFIG_PWM_TEGRA=y @@ -6144,6 +6147,9 @@ CONFIG_STMMAC_ETH=m # CONFIG_STMMAC_PCI is not set CONFIG_STMMAC_PLATFORM=m # CONFIG_STMMAC_SELFTESTS is not set +# CONFIG_STMPE_ADC is not set +CONFIG_STMPE_I2C=y +CONFIG_STMPE_SPI=y CONFIG_STRICT_DEVMEM=y # CONFIG_STRING_SELFTEST is not set CONFIG_STRIP_ASM_SYMS=y @@ -6430,6 +6436,7 @@ CONFIG_TOUCHSCREEN_SILEAD=m CONFIG_TOUCHSCREEN_SIS_I2C=m CONFIG_TOUCHSCREEN_ST1232=m # CONFIG_TOUCHSCREEN_STMFTS is not set +CONFIG_TOUCHSCREEN_STMPE=m # CONFIG_TOUCHSCREEN_SUN4I is not set # CONFIG_TOUCHSCREEN_SUR40 is not set # CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set diff --git a/kernel-aarch64.config b/kernel-aarch64.config index 41dc17336..90487f75c 100644 --- a/kernel-aarch64.config +++ b/kernel-aarch64.config @@ -2009,6 +2009,7 @@ CONFIG_GPIO_RASPBERRYPI_EXP=m # CONFIG_GPIO_RDC321X is not set # CONFIG_GPIO_SAMA5D2_PIOBU is not set # CONFIG_GPIO_SCH311X is not set +CONFIG_GPIO_STMPE=y CONFIG_GPIO_SYSCON=m # CONFIG_GPIO_SYSFS is not set CONFIG_GPIO_TEGRA186=y @@ -2893,6 +2894,7 @@ CONFIG_KEYBOARD_QT1070=m # CONFIG_KEYBOARD_QT2160 is not set # CONFIG_KEYBOARD_SAMSUNG is not set CONFIG_KEYBOARD_SNVS_PWRKEY=m +CONFIG_KEYBOARD_STMPE=m # CONFIG_KEYBOARD_STOWAWAY is not set # CONFIG_KEYBOARD_SUN4I_LRADC is not set # CONFIG_KEYBOARD_SUNKBD is not set @@ -3322,7 +3324,7 @@ CONFIG_MFD_SM501=m # CONFIG_MFD_SMSC is not set CONFIG_MFD_SPMI_PMIC=m # CONFIG_MFD_STMFX is not set -# CONFIG_MFD_STMPE is not set +CONFIG_MFD_STMPE=y # CONFIG_MFD_STPMIC1 is not set # CONFIG_MFD_SUN4I_GPADC is not set # CONFIG_MFD_SUN6I_PRCM is not set @@ -4658,6 +4660,7 @@ CONFIG_PWM_IMX_TPM=m CONFIG_PWM_MESON=m # CONFIG_PWM_PCA9685 is not set CONFIG_PWM_ROCKCHIP=m +# CONFIG_PWM_STMPE is not set CONFIG_PWM_SUN4I=m CONFIG_PWM_SYSFS=y CONFIG_PWM_TEGRA=y @@ -6122,6 +6125,9 @@ CONFIG_STMMAC_ETH=m # CONFIG_STMMAC_PCI is not set CONFIG_STMMAC_PLATFORM=m # CONFIG_STMMAC_SELFTESTS is not set +# CONFIG_STMPE_ADC is not set +CONFIG_STMPE_I2C=y +CONFIG_STMPE_SPI=y CONFIG_STRICT_DEVMEM=y # CONFIG_STRING_SELFTEST is not set CONFIG_STRIP_ASM_SYMS=y @@ -6408,6 +6414,7 @@ CONFIG_TOUCHSCREEN_SILEAD=m CONFIG_TOUCHSCREEN_SIS_I2C=m CONFIG_TOUCHSCREEN_ST1232=m # CONFIG_TOUCHSCREEN_STMFTS is not set +CONFIG_TOUCHSCREEN_STMPE=m # CONFIG_TOUCHSCREEN_SUN4I is not set # CONFIG_TOUCHSCREEN_SUR40 is not set # CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set diff --git a/kernel-armv7hl-lpae-debug.config b/kernel-armv7hl-lpae-debug.config index 4eb2fd845..f2b26d448 100644 --- a/kernel-armv7hl-lpae-debug.config +++ b/kernel-armv7hl-lpae-debug.config @@ -1980,6 +1980,7 @@ CONFIG_GPIO_RASPBERRYPI_EXP=m # CONFIG_GPIO_RDC321X is not set # CONFIG_GPIO_SAMA5D2_PIOBU is not set # CONFIG_GPIO_SCH311X is not set +CONFIG_GPIO_STMPE=y CONFIG_GPIO_SYSCON=m # CONFIG_GPIO_SYSFS is not set CONFIG_GPIO_TEGRA=y @@ -2849,6 +2850,7 @@ CONFIG_KEYBOARD_QT1050=m CONFIG_KEYBOARD_QT1070=m # CONFIG_KEYBOARD_QT2160 is not set # CONFIG_KEYBOARD_SAMSUNG is not set +CONFIG_KEYBOARD_STMPE=m # CONFIG_KEYBOARD_STOWAWAY is not set CONFIG_KEYBOARD_SUN4I_LRADC=m # CONFIG_KEYBOARD_SUNKBD is not set @@ -3294,7 +3296,7 @@ CONFIG_MFD_SM501=m CONFIG_MFD_STM32_LPTIMER=m CONFIG_MFD_STM32_TIMERS=m # CONFIG_MFD_STMFX is not set -# CONFIG_MFD_STMPE is not set +CONFIG_MFD_STMPE=y CONFIG_MFD_STPMIC1=m CONFIG_MFD_SUN4I_GPADC=m CONFIG_MFD_SUN6I_PRCM=y @@ -4605,6 +4607,7 @@ CONFIG_PWM_ROCKCHIP=m CONFIG_PWM_SAMSUNG=m # CONFIG_PWM_STM32 is not set # CONFIG_PWM_STM32_LP is not set +# CONFIG_PWM_STMPE is not set CONFIG_PWM_SUN4I=m CONFIG_PWM_SYSFS=y CONFIG_PWM_TEGRA=y @@ -6061,6 +6064,8 @@ CONFIG_STMMAC_ETH=m CONFIG_STMMAC_PLATFORM=m # CONFIG_STMMAC_SELFTESTS is not set # CONFIG_STMPE_ADC is not set +CONFIG_STMPE_I2C=y +CONFIG_STMPE_SPI=y CONFIG_STPMIC1_WATCHDOG=m CONFIG_STRICT_DEVMEM=y CONFIG_STRICT_KERNEL_RWX=y @@ -6356,6 +6361,7 @@ CONFIG_TOUCHSCREEN_SILEAD=m CONFIG_TOUCHSCREEN_SIS_I2C=m CONFIG_TOUCHSCREEN_ST1232=m # CONFIG_TOUCHSCREEN_STMFTS is not set +CONFIG_TOUCHSCREEN_STMPE=m CONFIG_TOUCHSCREEN_SUN4I=m # CONFIG_TOUCHSCREEN_SUR40 is not set # CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set diff --git a/kernel-armv7hl-lpae.config b/kernel-armv7hl-lpae.config index 6b7c21499..ec85503ad 100644 --- a/kernel-armv7hl-lpae.config +++ b/kernel-armv7hl-lpae.config @@ -1965,6 +1965,7 @@ CONFIG_GPIO_RASPBERRYPI_EXP=m # CONFIG_GPIO_RDC321X is not set # CONFIG_GPIO_SAMA5D2_PIOBU is not set # CONFIG_GPIO_SCH311X is not set +CONFIG_GPIO_STMPE=y CONFIG_GPIO_SYSCON=m # CONFIG_GPIO_SYSFS is not set CONFIG_GPIO_TEGRA=y @@ -2832,6 +2833,7 @@ CONFIG_KEYBOARD_QT1050=m CONFIG_KEYBOARD_QT1070=m # CONFIG_KEYBOARD_QT2160 is not set # CONFIG_KEYBOARD_SAMSUNG is not set +CONFIG_KEYBOARD_STMPE=m # CONFIG_KEYBOARD_STOWAWAY is not set CONFIG_KEYBOARD_SUN4I_LRADC=m # CONFIG_KEYBOARD_SUNKBD is not set @@ -3276,7 +3278,7 @@ CONFIG_MFD_SM501=m CONFIG_MFD_STM32_LPTIMER=m CONFIG_MFD_STM32_TIMERS=m # CONFIG_MFD_STMFX is not set -# CONFIG_MFD_STMPE is not set +CONFIG_MFD_STMPE=y CONFIG_MFD_STPMIC1=m CONFIG_MFD_SUN4I_GPADC=m CONFIG_MFD_SUN6I_PRCM=y @@ -4585,6 +4587,7 @@ CONFIG_PWM_ROCKCHIP=m CONFIG_PWM_SAMSUNG=m # CONFIG_PWM_STM32 is not set # CONFIG_PWM_STM32_LP is not set +# CONFIG_PWM_STMPE is not set CONFIG_PWM_SUN4I=m CONFIG_PWM_SYSFS=y CONFIG_PWM_TEGRA=y @@ -6040,6 +6043,8 @@ CONFIG_STMMAC_ETH=m CONFIG_STMMAC_PLATFORM=m # CONFIG_STMMAC_SELFTESTS is not set # CONFIG_STMPE_ADC is not set +CONFIG_STMPE_I2C=y +CONFIG_STMPE_SPI=y CONFIG_STPMIC1_WATCHDOG=m CONFIG_STRICT_DEVMEM=y CONFIG_STRICT_KERNEL_RWX=y @@ -6335,6 +6340,7 @@ CONFIG_TOUCHSCREEN_SILEAD=m CONFIG_TOUCHSCREEN_SIS_I2C=m CONFIG_TOUCHSCREEN_ST1232=m # CONFIG_TOUCHSCREEN_STMFTS is not set +CONFIG_TOUCHSCREEN_STMPE=m CONFIG_TOUCHSCREEN_SUN4I=m # CONFIG_TOUCHSCREEN_SUR40 is not set # CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set From e15ee2111479955c9ad79127341d013c1719332b Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Thu, 21 Nov 2019 09:26:33 -0500 Subject: [PATCH 041/178] Linux v5.3.12 --- kernel.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel.spec b/kernel.spec index e746d6e07..21e0fb490 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 11 +%define stable_update 12 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -1794,6 +1794,9 @@ fi # # %changelog +* Thu Nov 21 2019 Laura Abbott - 5.3.12-300 +- Linux v5.3.12 + * Tue Nov 12 2019 Justin M. Forbes - 5.3.11-300 - Linux v5.3.11 - Fixes CVE-2019-11135 (rhbz 1753062 1771649) diff --git a/sources b/sources index 5e1166799..376f03ab7 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.11.xz) = 27f6974d008c874bba700cb6f4b70838fdd5bc6cd85340f596663752a7046e3e844e7c50516d3ed7f736e258007e6091c387a989a22eed8170bfd99710f59f52 +SHA512 (patch-5.3.12.xz) = 3294d938800b6a2608d64ff25d4e43a0c4b4e90dfb531370eb646a0a5ed449440d9399f8442c0f8078eee78d2ae696a53ee82a9f209c840a6d5538b72ec92dc8 From 45948240a7a67c34bb3227f458dc8ee14d7c37dd Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Thu, 21 Nov 2019 14:14:58 -0600 Subject: [PATCH 042/178] Fix a bunch of CVEs --- ...elease-allocated-buffer-if-timed-out.patch | 29 +++++ ...elease-allocated-buffer-if-timed-out.patch | 46 ++++++++ ...ini-fix-memory-leak-in-alloc_sgtable.patch | 29 +++++ ...-memory-leaks-in-iwl_pcie_ctxt_info_.patch | 99 ++++++++++++++++ ...ry-leak-in-nl80211_get_ftm_responder.patch | 33 ++++++ ...or-path-in-predicate_parse-free-its-.patch | 37 ++++++ ...fix-memory-leak-in-crypto_reportstat.patch | 107 +++++++++++++++++ ...x-memory-leak-in-__ipmi_bmc_register.patch | 102 ++++++++++++++++ kernel.spec | 84 ++++++++++++- ...vent-memory-leak-in-cx23888_ir_probe.patch | 103 ++++++++++++++++ ...y-leak-in-mwifiex_pcie_init_evt_ring.patch | 111 ++++++++++++++++++ ...eak-in-mwifiex_pcie_alloc_cmdrsp_buf.patch | 109 +++++++++++++++++ ...t-memory-leak-in-i40e_setup_macvlans.patch | 80 +++++++++++++ rpmsg-char-release-allocated-memory.patch | 103 ++++++++++++++++ ...ease-skb-if-rsi_prepare_beacon-fails.patch | 101 ++++++++++++++++ rtl8xxxu-prevent-leaking-urb.patch | 101 ++++++++++++++++ ...prevent-memory-leak-in-rtl_usb_probe.patch | 110 +++++++++++++++++ ...se-allocated-memory-in-case-of-error.patch | 105 +++++++++++++++++ ...revent-memory-leak-in-spi_gpio_probe.patch | 39 ++++++ ...i-fix-memory-leak-in-fsl_lpspi_probe.patch | 105 +++++++++++++++++ 20 files changed, 1631 insertions(+), 2 deletions(-) create mode 100644 0001-ath9k-release-allocated-buffer-if-timed-out.patch create mode 100644 0001-ath9k_htc-release-allocated-buffer-if-timed-out.patch create mode 100644 0001-iwlwifi-dbg_ini-fix-memory-leak-in-alloc_sgtable.patch create mode 100644 0001-iwlwifi-pcie-fix-memory-leaks-in-iwl_pcie_ctxt_info_.patch create mode 100644 0001-nl80211-fix-memory-leak-in-nl80211_get_ftm_responder.patch create mode 100644 0001-tracing-Have-error-path-in-predicate_parse-free-its-.patch create mode 100644 crypto-user-fix-memory-leak-in-crypto_reportstat.patch create mode 100644 ipmi-Fix-memory-leak-in-__ipmi_bmc_register.patch create mode 100644 media-rc-prevent-memory-leak-in-cx23888_ir_probe.patch create mode 100644 mwifiex-pcie-Fix-memory-leak-in-mwifiex_pcie_init_evt_ring.patch create mode 100644 mwifiex-pcie-fix-memory-leak-in-mwifiex_pcie_alloc_cmdrsp_buf.patch create mode 100644 net-next-v2-9-9-i40e-prevent-memory-leak-in-i40e_setup_macvlans.patch create mode 100644 rpmsg-char-release-allocated-memory.patch create mode 100644 rsi-release-skb-if-rsi_prepare_beacon-fails.patch create mode 100644 rtl8xxxu-prevent-leaking-urb.patch create mode 100644 rtlwifi-prevent-memory-leak-in-rtl_usb_probe.patch create mode 100644 scsi-bfa-release-allocated-memory-in-case-of-error.patch create mode 100644 spi-gpio-prevent-memory-leak-in-spi_gpio_probe.patch create mode 100644 spi-lpspi-fix-memory-leak-in-fsl_lpspi_probe.patch diff --git a/0001-ath9k-release-allocated-buffer-if-timed-out.patch b/0001-ath9k-release-allocated-buffer-if-timed-out.patch new file mode 100644 index 000000000..db71192a3 --- /dev/null +++ b/0001-ath9k-release-allocated-buffer-if-timed-out.patch @@ -0,0 +1,29 @@ +From 728c1e2a05e4b5fc52fab3421dce772a806612a2 Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Fri, 6 Sep 2019 13:59:30 -0500 +Subject: [PATCH] ath9k: release allocated buffer if timed out + +In ath9k_wmi_cmd, the allocated network buffer needs to be released +if timeout happens. Otherwise memory will be leaked. + +Signed-off-by: Navid Emamdoost +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/ath/ath9k/wmi.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c +index d1f6710ca63b..cdc146091194 100644 +--- a/drivers/net/wireless/ath/ath9k/wmi.c ++++ b/drivers/net/wireless/ath/ath9k/wmi.c +@@ -336,6 +336,7 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id, + ath_dbg(common, WMI, "Timeout waiting for WMI command: %s\n", + wmi_cmd_to_name(cmd_id)); + mutex_unlock(&wmi->op_mutex); ++ kfree_skb(skb); + return -ETIMEDOUT; + } + +-- +2.23.0 + diff --git a/0001-ath9k_htc-release-allocated-buffer-if-timed-out.patch b/0001-ath9k_htc-release-allocated-buffer-if-timed-out.patch new file mode 100644 index 000000000..0d21d61c7 --- /dev/null +++ b/0001-ath9k_htc-release-allocated-buffer-if-timed-out.patch @@ -0,0 +1,46 @@ +From 853acf7caf10b828102d92d05b5c101666a6142b Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Fri, 6 Sep 2019 13:26:03 -0500 +Subject: [PATCH] ath9k_htc: release allocated buffer if timed out + +In htc_config_pipe_credits, htc_setup_complete, and htc_connect_service +if time out happens, the allocated buffer needs to be released. +Otherwise there will be memory leak. + +Signed-off-by: Navid Emamdoost +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/ath/ath9k/htc_hst.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c +index 1bf63a4efb4c..d091c8ebdcf0 100644 +--- a/drivers/net/wireless/ath/ath9k/htc_hst.c ++++ b/drivers/net/wireless/ath/ath9k/htc_hst.c +@@ -170,6 +170,7 @@ static int htc_config_pipe_credits(struct htc_target *target) + time_left = wait_for_completion_timeout(&target->cmd_wait, HZ); + if (!time_left) { + dev_err(target->dev, "HTC credit config timeout\n"); ++ kfree_skb(skb); + return -ETIMEDOUT; + } + +@@ -205,6 +206,7 @@ static int htc_setup_complete(struct htc_target *target) + time_left = wait_for_completion_timeout(&target->cmd_wait, HZ); + if (!time_left) { + dev_err(target->dev, "HTC start timeout\n"); ++ kfree_skb(skb); + return -ETIMEDOUT; + } + +@@ -277,6 +279,7 @@ int htc_connect_service(struct htc_target *target, + if (!time_left) { + dev_err(target->dev, "Service connection timeout for: %d\n", + service_connreq->service_id); ++ kfree_skb(skb); + return -ETIMEDOUT; + } + +-- +2.23.0 + diff --git a/0001-iwlwifi-dbg_ini-fix-memory-leak-in-alloc_sgtable.patch b/0001-iwlwifi-dbg_ini-fix-memory-leak-in-alloc_sgtable.patch new file mode 100644 index 000000000..d82c3f254 --- /dev/null +++ b/0001-iwlwifi-dbg_ini-fix-memory-leak-in-alloc_sgtable.patch @@ -0,0 +1,29 @@ +From b4b814fec1a5a849383f7b3886b654a13abbda7d Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Thu, 12 Sep 2019 23:23:27 -0500 +Subject: [PATCH] iwlwifi: dbg_ini: fix memory leak in alloc_sgtable + +In alloc_sgtable if alloc_page fails, the alocated table should be +released. + +Signed-off-by: Navid Emamdoost +Signed-off-by: Luca Coelho +--- + drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +index 5c8602de9168..87421807e040 100644 +--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c ++++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +@@ -646,6 +646,7 @@ static struct scatterlist *alloc_sgtable(int size) + if (new_page) + __free_page(new_page); + } ++ kfree(table); + return NULL; + } + alloc_size = min_t(int, size, PAGE_SIZE); +-- +2.23.0 + diff --git a/0001-iwlwifi-pcie-fix-memory-leaks-in-iwl_pcie_ctxt_info_.patch b/0001-iwlwifi-pcie-fix-memory-leaks-in-iwl_pcie_ctxt_info_.patch new file mode 100644 index 000000000..a72e920bd --- /dev/null +++ b/0001-iwlwifi-pcie-fix-memory-leaks-in-iwl_pcie_ctxt_info_.patch @@ -0,0 +1,99 @@ +From 0f4f199443faca715523b0659aa536251d8b978f Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Fri, 27 Sep 2019 15:56:04 -0500 +Subject: [PATCH] iwlwifi: pcie: fix memory leaks in + iwl_pcie_ctxt_info_gen3_init + +In iwl_pcie_ctxt_info_gen3_init there are cases that the allocated dma +memory is leaked in case of error. + +DMA memories prph_scratch, prph_info, and ctxt_info_gen3 are allocated +and initialized to be later assigned to trans_pcie. But in any error case +before such assignment the allocated memories should be released. + +First of such error cases happens when iwl_pcie_init_fw_sec fails. +Current implementation correctly releases prph_scratch. But in two +sunsequent error cases where dma_alloc_coherent may fail, such +releases are missing. + +This commit adds release for prph_scratch when allocation for +prph_info fails, and adds releases for prph_scratch and prph_info when +allocation for ctxt_info_gen3 fails. + +Fixes: 2ee824026288 ("iwlwifi: pcie: support context information for 22560 devices") +Signed-off-by: Navid Emamdoost +Signed-off-by: Luca Coelho +--- + .../intel/iwlwifi/pcie/ctxt-info-gen3.c | 36 +++++++++++++------ + 1 file changed, 25 insertions(+), 11 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +index 75fa8a6aafee..74980382e64c 100644 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +@@ -107,13 +107,9 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, + + /* allocate ucode sections in dram and set addresses */ + ret = iwl_pcie_init_fw_sec(trans, fw, &prph_scratch->dram); +- if (ret) { +- dma_free_coherent(trans->dev, +- sizeof(*prph_scratch), +- prph_scratch, +- trans_pcie->prph_scratch_dma_addr); +- return ret; +- } ++ if (ret) ++ goto err_free_prph_scratch; ++ + + /* Allocate prph information + * currently we don't assign to the prph info anything, but it would get +@@ -121,16 +117,20 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, + prph_info = dma_alloc_coherent(trans->dev, sizeof(*prph_info), + &trans_pcie->prph_info_dma_addr, + GFP_KERNEL); +- if (!prph_info) +- return -ENOMEM; ++ if (!prph_info) { ++ ret = -ENOMEM; ++ goto err_free_prph_scratch; ++ } + + /* Allocate context info */ + ctxt_info_gen3 = dma_alloc_coherent(trans->dev, + sizeof(*ctxt_info_gen3), + &trans_pcie->ctxt_info_dma_addr, + GFP_KERNEL); +- if (!ctxt_info_gen3) +- return -ENOMEM; ++ if (!ctxt_info_gen3) { ++ ret = -ENOMEM; ++ goto err_free_prph_info; ++ } + + ctxt_info_gen3->prph_info_base_addr = + cpu_to_le64(trans_pcie->prph_info_dma_addr); +@@ -186,6 +186,20 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, + iwl_set_bit(trans, CSR_GP_CNTRL, CSR_AUTO_FUNC_INIT); + + return 0; ++ ++err_free_prph_info: ++ dma_free_coherent(trans->dev, ++ sizeof(*prph_info), ++ prph_info, ++ trans_pcie->prph_info_dma_addr); ++ ++err_free_prph_scratch: ++ dma_free_coherent(trans->dev, ++ sizeof(*prph_scratch), ++ prph_scratch, ++ trans_pcie->prph_scratch_dma_addr); ++ return ret; ++ + } + + void iwl_pcie_ctxt_info_gen3_free(struct iwl_trans *trans) +-- +2.23.0 + diff --git a/0001-nl80211-fix-memory-leak-in-nl80211_get_ftm_responder.patch b/0001-nl80211-fix-memory-leak-in-nl80211_get_ftm_responder.patch new file mode 100644 index 000000000..e72e53ebd --- /dev/null +++ b/0001-nl80211-fix-memory-leak-in-nl80211_get_ftm_responder.patch @@ -0,0 +1,33 @@ +From 1399c59fa92984836db90538cf92397fe7caaa57 Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Fri, 4 Oct 2019 14:42:19 -0500 +Subject: [PATCH] nl80211: fix memory leak in nl80211_get_ftm_responder_stats + +In nl80211_get_ftm_responder_stats, a new skb is created via nlmsg_new +named msg. If nl80211hdr_put() fails, then msg should be released. The +return statement should be replace by goto to error handling code. + +Fixes: 81e54d08d9d8 ("cfg80211: support FTM responder configuration/statistics") +Signed-off-by: Navid Emamdoost +Link: https://lore.kernel.org/r/20191004194220.19412-1-navid.emamdoost@gmail.com +Signed-off-by: Johannes Berg +--- + net/wireless/nl80211.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c +index 141cdb171665..4453dd375de9 100644 +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -13682,7 +13682,7 @@ static int nl80211_get_ftm_responder_stats(struct sk_buff *skb, + hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, + NL80211_CMD_GET_FTM_RESPONDER_STATS); + if (!hdr) +- return -ENOBUFS; ++ goto nla_put_failure; + + if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) + goto nla_put_failure; +-- +2.23.0 + diff --git a/0001-tracing-Have-error-path-in-predicate_parse-free-its-.patch b/0001-tracing-Have-error-path-in-predicate_parse-free-its-.patch new file mode 100644 index 000000000..42d4e176a --- /dev/null +++ b/0001-tracing-Have-error-path-in-predicate_parse-free-its-.patch @@ -0,0 +1,37 @@ +From 96c5c6e6a5b6db592acae039fed54b5c8844cd35 Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Fri, 20 Sep 2019 17:57:59 -0500 +Subject: [PATCH] tracing: Have error path in predicate_parse() free its + allocated memory + +In predicate_parse, there is an error path that is not going to +out_free instead it returns directly which leads to a memory leak. + +Link: http://lkml.kernel.org/r/20190920225800.3870-1-navid.emamdoost@gmail.com + +Signed-off-by: Navid Emamdoost +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/trace/trace_events_filter.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c +index c773b8fb270c..c9a74f82b14a 100644 +--- a/kernel/trace/trace_events_filter.c ++++ b/kernel/trace/trace_events_filter.c +@@ -452,8 +452,10 @@ predicate_parse(const char *str, int nr_parens, int nr_preds, + + switch (*next) { + case '(': /* #2 */ +- if (top - op_stack > nr_parens) +- return ERR_PTR(-EINVAL); ++ if (top - op_stack > nr_parens) { ++ ret = -EINVAL; ++ goto out_free; ++ } + *(++top) = invert; + continue; + case '!': /* #3 */ +-- +2.23.0 + diff --git a/crypto-user-fix-memory-leak-in-crypto_reportstat.patch b/crypto-user-fix-memory-leak-in-crypto_reportstat.patch new file mode 100644 index 000000000..2f7cc0205 --- /dev/null +++ b/crypto-user-fix-memory-leak-in-crypto_reportstat.patch @@ -0,0 +1,107 @@ +From mboxrd@z Thu Jan 1 00:00:00 1970 +Return-Path: +X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on + aws-us-west-2-korg-lkml-1.web.codeaurora.org +X-Spam-Level: +X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, + DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, + HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, + SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable + autolearn_force=no version=3.4.0 +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) + by smtp.lore.kernel.org (Postfix) with ESMTP id 8D752C4CED1 + for ; Fri, 4 Oct 2019 19:35:05 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 696E721D81 + for ; Fri, 4 Oct 2019 19:35:05 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KfPgoQZi" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1730579AbfJDTfE (ORCPT + ); + Fri, 4 Oct 2019 15:35:04 -0400 +Received: from mail-io1-f66.google.com ([209.85.166.66]:36406 "EHLO + mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1725932AbfJDTfE (ORCPT + ); + Fri, 4 Oct 2019 15:35:04 -0400 +Received: by mail-io1-f66.google.com with SMTP id b136so16026274iof.3; + Fri, 04 Oct 2019 12:35:03 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=YUxdWoMjBc3fq7ZEjHVbfnvWMNYpsAW2uL8SUTPJJOk=; + b=KfPgoQZiuCc2H7qvFQGzN/Y3EGPnFsu/TLq9CSR8tecMTpa9YL5eWsqgES34oDbm/Z + tBCmz9oK9X/m4/+VrPKpX573tizGffhrsfpuA+Fq69Y2qLjGgld9HOjAHd01oZ83u+Oe + IfpTdiUjqLS2q1WMSLKP4SYO6lGOL2hAK3fuICIkeFaCYYGEBCZ2DyuGyNv2KTqUkk7I + KQb1aZ8FaukkgvjqFvRKzmxBX1EAfsP/eODyKd0CEqnIZdQbkd0Y6geyteNUOKSTNqcn + /XpZgD+IsGXz2qWx9KTOw6csMacDX9jweaZEo3BHAZO4XGnVw+LP8rKJvYE92arFNI4q + +LLA== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=YUxdWoMjBc3fq7ZEjHVbfnvWMNYpsAW2uL8SUTPJJOk=; + b=MZTiefsa/zD0rlKyJnXaNkjhKxyXM1RPbiOfRsBzjAXppzdpVXEsMuoNuMbb7UL0XD + StXE1INBYwfkI73zbAuORpk1uc3QBCg0KUc6/FT8QWdwM6pVw3g0pWbwPcnA3YhdqbTk + 0XWZReG3dHpnGJ+HjFibx9C5K2a5pTK2zAXRfXgJvSLWuhLdI26dNRjOdqmwW02tAThC + Z86x/deIZhaQiRbpDadvJVNEx7tRQ0TT1d27Rf93LQStQ5vJW01jA5g//b8D5aB1Q4md + mqI61eE+ughOjC7Ef3gIldPML4dtt/zOjR45rFV078yk8vaefDXDqdVnXIL309NOfiRj + iGPg== +X-Gm-Message-State: APjAAAWuXZ3QkwcdijV+oJ20x5WQPqQsko2OjLI/I2ZE5tL5mXtDiZ9P + Kn6oGyHFRVspaJiNUH3WmBs= +X-Google-Smtp-Source: APXvYqxdxqTqNQ2D2g2hs/N3xw+sie1sFybvZM7Bv8s50eW0Wl4EA5uLHeMeKaifDlU11aRt9jEhKg== +X-Received: by 2002:a5d:88d1:: with SMTP id i17mr14654011iol.235.1570217702565; + Fri, 04 Oct 2019 12:35:02 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id t8sm3372621ild.7.2019.10.04.12.35.01 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Fri, 04 Oct 2019 12:35:01 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu, + Navid Emamdoost , + Herbert Xu , + "David S. Miller" , + linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org +Subject: [PATCH] crypto: user - fix memory leak in crypto_reportstat +Date: Fri, 4 Oct 2019 14:34:54 -0500 +Message-Id: <20191004193455.18348-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: +List-Archive: +List-Post: + +In crypto_reportstat, a new skb is created by nlmsg_new(). This skb is +leaked if crypto_reportstat_alg() fails. Required release for skb is +added. + +Fixes: cac5818c25d0 ("crypto: user - Implement a generic crypto statistics") +Signed-off-by: Navid Emamdoost +--- + crypto/crypto_user_stat.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/crypto/crypto_user_stat.c b/crypto/crypto_user_stat.c +index 8bad88413de1..1be95432fa23 100644 +--- a/crypto/crypto_user_stat.c ++++ b/crypto/crypto_user_stat.c +@@ -328,8 +328,10 @@ int crypto_reportstat(struct sk_buff *in_skb, struct nlmsghdr *in_nlh, + drop_alg: + crypto_mod_put(alg); + +- if (err) ++ if (err) { ++ kfree_skb(skb); + return err; ++ } + + return nlmsg_unicast(crypto_nlsk, skb, NETLINK_CB(in_skb).portid); + } +-- +2.17.1 + + diff --git a/ipmi-Fix-memory-leak-in-__ipmi_bmc_register.patch b/ipmi-Fix-memory-leak-in-__ipmi_bmc_register.patch new file mode 100644 index 000000000..779810f98 --- /dev/null +++ b/ipmi-Fix-memory-leak-in-__ipmi_bmc_register.patch @@ -0,0 +1,102 @@ +From patchwork Mon Oct 21 20:06:48 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 1142634 +Return-Path: +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) + by smtp.lore.kernel.org (Postfix) with ESMTP id EA234CA9EAF + for ; Mon, 21 Oct 2019 20:06:59 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id BED092084C + for ; Mon, 21 Oct 2019 20:06:59 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="X0MaxGN8" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1730272AbfJUUG6 (ORCPT + ); + Mon, 21 Oct 2019 16:06:58 -0400 +Received: from mail-io1-f68.google.com ([209.85.166.68]:34607 "EHLO + mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1729406AbfJUUG6 (ORCPT + ); + Mon, 21 Oct 2019 16:06:58 -0400 +Received: by mail-io1-f68.google.com with SMTP id q1so17550475ion.1 + for ; + Mon, 21 Oct 2019 13:06:57 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=DIJwALRySeQ5zjngsNl1Oe1bgDriLGNlywHknPtGNKc=; + b=X0MaxGN8uxeLjYheUzuflEGcTyAqv8YypCRnHwa4mTnDTdSFogTx9CmYGVwjKjmBXc + ImeJqPHySwSBK5FlsHysS8KWszaYtbNOrRgojf/0F+/RfarheahIQiunZyUotRZ9TAof + xIVIJOh6WGISCOs5n1WzwQq1osMxUM9HEh3Szg6lGyhQQ7k6jd7Jemg1+TpOtd8USEPH + r3a/x+xk11Q/5Opu+1zLFcPL9hujVi3s+U9By+5oBW5H6sgEMiQdgX9KSjIN0fWYy6p2 + vxxpECwHW/25y9nXwmH/GJvl9MgOHRHPBm4IGzRvu6ppe9DHbvB6CFaDWsXRNxK+lzJf + Idjw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=DIJwALRySeQ5zjngsNl1Oe1bgDriLGNlywHknPtGNKc=; + b=j2RCkPeTaplVf86HaOq2gLcWX/ri2fSs8uSZL59RuMcUohLJhfdxMZ5PCO5yGpm3vz + 9U3Eo7NyCGuTCv+xLJvanDw5YSe+QadEz92hTBZbP5vdhYcWlT1byLjRnLXr1n3O7fvG + irPww56P/AyO4hZBMwQpJLvAcwgKYLYbUVdL2QQVAIk+RAnIfYxFEMG56H6NPDhOyDer + rmEyr3Z1yQZHEmrqPSvaYyQ5rWLgfHl9GVACAz/nNoF2+j5H7NFRWyfPFAD4qBtnaimm + GVINQdfuXGU18S4Qlt26cvs4G3kx05gVVDtEn1LYJ/Wrim1vPPalKKJ3CJtvUd6NH5pC + /jxQ== +X-Gm-Message-State: APjAAAXVQAU+1Bai+XjnGC0zCaCEr0QIS571QaPV5KbcsMXjGxIQjnYr + zFmkQrr1KoRu2rZPwhOr/yU= +X-Google-Smtp-Source: + APXvYqwEYhuc38vwAbFtVAVtw8KV1JZMFhL3O31vXn9gEH9A2rMxW/fJ2esBpTWkjZy7Hbvve2Y6Tg== +X-Received: by 2002:a02:3208:: with SMTP id j8mr93347jaa.86.1571688417041; + Mon, 21 Oct 2019 13:06:57 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + d21sm4743611iom.29.2019.10.21.13.06.56 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Mon, 21 Oct 2019 13:06:56 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu, + Navid Emamdoost , + Corey Minyard , Arnd Bergmann , + Greg Kroah-Hartman , + openipmi-developer@lists.sourceforge.net, + linux-kernel@vger.kernel.org +Subject: [PATCH] ipmi: Fix memory leak in __ipmi_bmc_register +Date: Mon, 21 Oct 2019 15:06:48 -0500 +Message-Id: <20191021200649.1511-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-kernel@vger.kernel.org + +In the impelementation of __ipmi_bmc_register() the allocated memory for +bmc should be released in case ida_simple_get() fails. + +Fixes: 68e7e50f195f ("ipmi: Don't use BMC product/dev ids in the BMC name") +Signed-off-by: Navid Emamdoost +--- + drivers/char/ipmi/ipmi_msghandler.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c +index 2aab80e19ae0..e4928ed46396 100644 +--- a/drivers/char/ipmi/ipmi_msghandler.c ++++ b/drivers/char/ipmi/ipmi_msghandler.c +@@ -3031,8 +3031,11 @@ static int __ipmi_bmc_register(struct ipmi_smi *intf, + bmc->pdev.name = "ipmi_bmc"; + + rv = ida_simple_get(&ipmi_bmc_ida, 0, 0, GFP_KERNEL); +- if (rv < 0) ++ if (rv < 0) { ++ kfree(bmc); + goto out; ++ } ++ + bmc->pdev.dev.driver = &ipmidriver.driver; + bmc->pdev.id = rv; + bmc->pdev.dev.release = release_bmc_device; diff --git a/kernel.spec b/kernel.spec index 21e0fb490..a740c5d9f 100644 --- a/kernel.spec +++ b/kernel.spec @@ -586,13 +586,71 @@ Patch503: KEYS-Make-use-of-platform-keyring-for-module-signature.patch # rhbz 1753099 Patch504: dwc3-fix.patch -Patch509: PATCH-v2-selinux-allow-labeling-before-policy-is-loaded.patch +Patch500: PATCH-v2-selinux-allow-labeling-before-policy-is-loaded.patch # it seems CONFIG_OPTIMIZE_INLINING has been forced now and is causing issues on ARMv7 # https://lore.kernel.org/patchwork/patch/1132459/ # https://lkml.org/lkml/2019/8/29/1772 Patch505: ARM-fix-__get_user_check-in-case-uaccess_-calls-are-not-inlined.patch +# CVE-2019-19074 rhbz 1774933 1774934 +Patch506: 0001-ath9k-release-allocated-buffer-if-timed-out.patch + +# CVE-2019-19073 rhbz 1774937 1774939 +Patch507: 0001-ath9k_htc-release-allocated-buffer-if-timed-out.patch + +# CVE-2019-19072 rhbz 1774946 1774947 +Patch508: 0001-tracing-Have-error-path-in-predicate_parse-free-its-.patch + +# CVE-2019-19071 rhbz 1774949 1774950 +Patch509: rsi-release-skb-if-rsi_prepare_beacon-fails.patch + +# CVE-2019-19070 rhbz 1774957 1774958 +Patch510: spi-gpio-prevent-memory-leak-in-spi_gpio_probe.patch + +# CVE-2019-19068 rhbz 1774963 1774965 +Patch511: rtl8xxxu-prevent-leaking-urb.patch + +# CVE-2019-19043 rhbz 1774972 1774973 +Patch512: net-next-v2-9-9-i40e-prevent-memory-leak-in-i40e_setup_macvlans.patch + +# CVE-2019-19066 rhbz 1774976 1774978 +Patch513: scsi-bfa-release-allocated-memory-in-case-of-error.patch + +# CVE-2019-19046 rhbz 1774988 1774989 +Patch514: ipmi-Fix-memory-leak-in-__ipmi_bmc_register.patch + +# CVE-2019-19050 rhbz 1774998 1775002 +# CVE-2019-19062 rhbz 1775021 1775023 +Patch515: crypto-user-fix-memory-leak-in-crypto_reportstat.patch + +# CVE-2019-19064 rhbz 1775010 1775011 +Patch516: spi-lpspi-fix-memory-leak-in-fsl_lpspi_probe.patch + +# CVE-2019-19063 rhbz 1775015 1775016 +Patch517: rtlwifi-prevent-memory-leak-in-rtl_usb_probe.patch + +# CVE-2019-19059 rhbz 1775042 1775043 +Patch518: 0001-iwlwifi-pcie-fix-memory-leaks-in-iwl_pcie_ctxt_info_.patch + +# CVE-2019-19058 rhbz 1775047 1775048 +Patch519: 0001-iwlwifi-dbg_ini-fix-memory-leak-in-alloc_sgtable.patch + +# CVE-2019-19057 rhbz 1775050 1775051 +Patch520: mwifiex-pcie-Fix-memory-leak-in-mwifiex_pcie_init_evt_ring.patch + +# CVE-2019-19053 rhbz 1775956 1775110 +Patch521: rpmsg-char-release-allocated-memory.patch + +# CVE-2019-19056 rhbz 1775097 1775115 +Patch522: mwifiex-pcie-fix-memory-leak-in-mwifiex_pcie_alloc_cmdrsp_buf.patch + +# CVE-2019-19055 rhbz 1775074 1775116 +Patch523: 0001-nl80211-fix-memory-leak-in-nl80211_get_ftm_responder.patch + +# CVE-2019-19054 rhbz 1775063 1775117 +Patch524: media-rc-prevent-memory-leak-in-cx23888_ir_probe.patch + # END OF PATCH DEFINITIONS %endif @@ -1794,7 +1852,29 @@ fi # # %changelog -* Thu Nov 21 2019 Laura Abbott - 5.3.12-300 +* Thu Nov 21 2019 Justin M. Forbes - 5.3.12-300 +- Fix CVE-2019-19074 (rhbz 1774933 1774934) +- Fix CVE-2019-19073 (rhbz 1774937 1774939) +- Fix CVE-2019-19072 (rhbz 1774946 1774947) +- Fix CVE-2019-19071 (rhbz 1774949 1774950) +- Fix CVE-2019-19070 (rhbz 1774957 1774958) +- Fix CVE-2019-19068 (rhbz 1774963 1774965) +- Fix CVE-2019-19043 (rhbz 1774972 1774973) +- Fix CVE-2019-19066 (rhbz 1774976 1774978) +- Fix CVE-2019-19046 (rhbz 1774988 1774989) +- Fix CVE-2019-19050 (rhbz 1774998 1775002) +- Fix CVE-2019-19062 (rhbz 1775021 1775023) +- Fix CVE-2019-19064 (rhbz 1775010 1775011) +- Fix CVE-2019-19063 (rhbz 1775015 1775016) +- Fix CVE-2019-19059 (rhbz 1775042 1775043) +- Fix CVE-2019-19058 (rhbz 1775047 1775048) +- Fix CVE-2019-19057 (rhbz 1775050 1775051) +- Fix CVE-2019-19053 (rhbz 1775956 1775110) +- Fix CVE-2019-19056 (rhbz 1775097 1775115) +- Fix CVE-2019-19055 (rhbz 1775074 1775116) +- Fix CVE-2019-19054 (rhbz 1775063 1775117) + +* Thu Nov 21 2019 Laura Abbott - Linux v5.3.12 * Tue Nov 12 2019 Justin M. Forbes - 5.3.11-300 diff --git a/media-rc-prevent-memory-leak-in-cx23888_ir_probe.patch b/media-rc-prevent-memory-leak-in-cx23888_ir_probe.patch new file mode 100644 index 000000000..10ec07f22 --- /dev/null +++ b/media-rc-prevent-memory-leak-in-cx23888_ir_probe.patch @@ -0,0 +1,103 @@ +From patchwork Wed Sep 25 15:02:41 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 1131334 +Return-Path: +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) + by smtp.lore.kernel.org (Postfix) with ESMTP id D12E6C432C2 + for ; Wed, 25 Sep 2019 15:02:56 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id A3ACD21D7B + for ; Wed, 25 Sep 2019 15:02:56 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="arASj5Yv" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2438783AbfIYPC4 (ORCPT + ); + Wed, 25 Sep 2019 11:02:56 -0400 +Received: from mail-io1-f66.google.com ([209.85.166.66]:44698 "EHLO + mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1731142AbfIYPCz (ORCPT + ); + Wed, 25 Sep 2019 11:02:55 -0400 +Received: by mail-io1-f66.google.com with SMTP id j4so14606376iog.11; + Wed, 25 Sep 2019 08:02:53 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=MWyh3PNmOklfeVqzYOrNwzDcAH8lax2jMCGmRDG4urM=; + b=arASj5Yv5bqz17U8QZVYbble7TDB5sj0TMbNk56fxz5ejOoHyT3kYbYJ/QtfbbLSs6 + iEjbcUYxhDqPRDkxpycr9uysp4vVx+usX4dONocnmhwJEwUZNwBO9gxatNe8zkYv3cBV + 6/zgf3/mu1ElXkjkjabewFHnWgFLNY2bEKtd9Wx3P6FGJyuwNg5dgB8SDQb/2DSr4X9q + aUgMqjBas1yw+cOjn/+KzpYS5k6gjQTDGNc4k+SZec43+S+O208YvxdUJ1ivWceNMa90 + RFPA3kk2XYQIgbJVbmqVTOzfX1l/qDVCb/GHdWaEq3GUolGoF7RGnD3ntqNF7uyElR4g + 1cfA== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=MWyh3PNmOklfeVqzYOrNwzDcAH8lax2jMCGmRDG4urM=; + b=a11vAjMQ8OwRtbrsNLlkXz9P6ewInEp9Y3Yp+tDjNcUdkcFEfckW79Eoc5EIFPd58E + KdJncVKoKTHG4PNxbHcjBXFY82d8wYP+gzkfv4Fx5zKfi9ZRj03gupr1tq8kAizI6+QM + fQUaDU5Z+kETTNPQx4V9W9WsMituZTsmC3yIjhtyaY9qnvDFpjeIcFi8ityCJ59nqaBs + xDkYx9NCUK/ZkRujeIznZ3kaCDvgTxG/PM02POWE8/CEnkaS4oVwMqIJ1WJqRO4cW5Rd + ak9LLUKankinb6T5dd1BPeVmOq4MJJnB8OrnMrENhtYgLgCDELF9090hqfpBkv4FW4zN + vGOQ== +X-Gm-Message-State: APjAAAULnVDgP2mQfcWBZXj8JYWYlmhlw/fk0WqZRMbvjRR4s+BO+yLW + YtHDvZSJqP12YLMYI6zTrm0= +X-Google-Smtp-Source: + APXvYqwPBH16FuEXUH7rOy3JWTXRjXFzwF9Spfa1QHh9p2MfWd+kBFJthLybBlVk8lVb6Ym4UWB2NA== +X-Received: by 2002:a5d:8ad4:: with SMTP id e20mr2109019iot.203.1569423773435; + Wed, 25 Sep 2019 08:02:53 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + 2sm206447ilw.50.2019.09.25.08.02.52 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Wed, 25 Sep 2019 08:02:52 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, + Navid Emamdoost , + Mauro Carvalho Chehab , + Kate Stewart , + Thomas Gleixner , + Allison Randal , + Greg Kroah-Hartman , + Sean Young , linux-media@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] media: rc: prevent memory leak in cx23888_ir_probe +Date: Wed, 25 Sep 2019 10:02:41 -0500 +Message-Id: <20190925150244.13644-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-kernel@vger.kernel.org + +In cx23888_ir_probe if kfifo_alloc fails the allocated memory for state +should be released. + +Signed-off-by: Navid Emamdoost +--- + drivers/media/pci/cx23885/cx23888-ir.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c +index e880afe37f15..90e7c32c54bb 100644 +--- a/drivers/media/pci/cx23885/cx23888-ir.c ++++ b/drivers/media/pci/cx23885/cx23888-ir.c +@@ -1167,8 +1167,11 @@ int cx23888_ir_probe(struct cx23885_dev *dev) + return -ENOMEM; + + spin_lock_init(&state->rx_kfifo_lock); +- if (kfifo_alloc(&state->rx_kfifo, CX23888_IR_RX_KFIFO_SIZE, GFP_KERNEL)) ++ if (kfifo_alloc(&state->rx_kfifo, CX23888_IR_RX_KFIFO_SIZE, ++ GFP_KERNEL)) { ++ kfree(state); + return -ENOMEM; ++ } + + state->dev = dev; + sd = &state->sd; diff --git a/mwifiex-pcie-Fix-memory-leak-in-mwifiex_pcie_init_evt_ring.patch b/mwifiex-pcie-Fix-memory-leak-in-mwifiex_pcie_init_evt_ring.patch new file mode 100644 index 000000000..b606e1c82 --- /dev/null +++ b/mwifiex-pcie-Fix-memory-leak-in-mwifiex_pcie_init_evt_ring.patch @@ -0,0 +1,111 @@ +From patchwork Fri Oct 4 20:16:48 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 11175265 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B95B16B1 + for ; + Fri, 4 Oct 2019 20:17:03 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 695CE222BE + for ; + Fri, 4 Oct 2019 20:17:03 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="eKzyOkdw" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1731313AbfJDUQ7 (ORCPT + ); + Fri, 4 Oct 2019 16:16:59 -0400 +Received: from mail-io1-f66.google.com ([209.85.166.66]:38177 "EHLO + mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1727978AbfJDUQ7 (ORCPT + ); + Fri, 4 Oct 2019 16:16:59 -0400 +Received: by mail-io1-f66.google.com with SMTP id u8so16270784iom.5; + Fri, 04 Oct 2019 13:16:59 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=hT/oExY7ats1AqepuNnxgrg+W5xUde0ZFah/AwhjxeA=; + b=eKzyOkdwTVgDQ2K7yVdvbQpQ2Y5o9gQHjf1ZLs/0TtknuoSEf88gRE3B/VgSXRe2nM + MaPWiP+DFmtmMOa4V+/fIXuzmU7h0LfbH92QwqYCh6xpzlPF6Y4etarqtYGFwcN8YIFh + KTbhy9t0/3m87L4UKRDIPV+aiyoEDLA1YrY+pxytqsh/8wTp82JG4WTVt4pgwk2YsDFT + TYQK7y3xY2D8O2nwUROYE+zlwF6oua9EA/ixXRVx4CRlh/lRFc124Qw5TlMD2GZdMIPJ + 3GHq32K5Z1F8XMQnUSU6+WxybmUN18B736DtQMDHjjnt70M8oCb/qgoMbH3Bx6xDBx4t + mwIQ== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=hT/oExY7ats1AqepuNnxgrg+W5xUde0ZFah/AwhjxeA=; + b=OCKRhcqw7kz4tZ/5U2VB84zj0RK/HtQHQ0/BUR0GLJMYOM7HJ1WBdSXnPtJs7UfIX1 + +C4Eq7PaUUpYg+OTWL+BOB7HpPh2AWvmoN/pElS49IYwKCcF9gUb/yfz1ZPSZBZrILg5 + pLgkiiBqoKOaUgVMzBGUs53mAhE7h0RuUDK3i3lptARoQDhVnRCk3HW6uz9G1pjCG6+m + nOC9rnGsphMQZ30AbdG6u8z1oVH+F63nWumldsiz4sNMs++qwDXS5a9ho2EjS9cZwCnL + c3V0vn5HgDqWWVwakE75xEnYAmApdEOC+BtAw6/zMFPMGWoDI98gN1u2ej7Ig6VZ3sDY + GmXA== +X-Gm-Message-State: APjAAAUvXc/AEaa09LdQbBGOHXwA82YLzxvRaRqZB1BY9YQoSNU4yJRa + 7zybbZ/DYfKfmszLK0NP4Vs= +X-Google-Smtp-Source: + APXvYqzNrXPxTps0mq67LtrgFhdE+kz3sXZyk7jqXZoSLFBjfwzONVFvHnNSmdK/pmDZR02HMuSgCw== +X-Received: by 2002:a6b:6e02:: with SMTP id d2mr5637516ioh.8.1570220218662; + Fri, 04 Oct 2019 13:16:58 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + o5sm2830180ilc.68.2019.10.04.13.16.57 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Fri, 04 Oct 2019 13:16:58 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu, + Navid Emamdoost , + Amitkumar Karwar , + Nishant Sarmukadam , + Ganapathi Bhat , + Xinming Hu , + Kalle Valo , + "David S. Miller" , + linux-wireless@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_init_evt_ring +Date: Fri, 4 Oct 2019 15:16:48 -0500 +Message-Id: <20191004201649.25087-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +In mwifiex_pcie_init_evt_ring, a new skb is allocated which should be +released if mwifiex_map_pci_memory() fails. The release for skb and +card->evtbd_ring_vbase is added. + +Fixes: 0732484b47b5 ("mwifiex: separate ring initialization and ring creation routines") +Signed-off-by: Navid Emamdoost +Acked-by: Ganapathi Bhat +--- + drivers/net/wireless/marvell/mwifiex/pcie.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c +index eff06d59e9df..096334e941a1 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie.c ++++ b/drivers/net/wireless/marvell/mwifiex/pcie.c +@@ -687,8 +687,11 @@ static int mwifiex_pcie_init_evt_ring(struct mwifiex_adapter *adapter) + skb_put(skb, MAX_EVENT_SIZE); + + if (mwifiex_map_pci_memory(adapter, skb, MAX_EVENT_SIZE, +- PCI_DMA_FROMDEVICE)) ++ PCI_DMA_FROMDEVICE)) { ++ kfree_skb(skb); ++ kfree(card->evtbd_ring_vbase); + return -1; ++ } + + buf_pa = MWIFIEX_SKB_DMA_ADDR(skb); + diff --git a/mwifiex-pcie-fix-memory-leak-in-mwifiex_pcie_alloc_cmdrsp_buf.patch b/mwifiex-pcie-fix-memory-leak-in-mwifiex_pcie_alloc_cmdrsp_buf.patch new file mode 100644 index 000000000..5c12cb493 --- /dev/null +++ b/mwifiex-pcie-fix-memory-leak-in-mwifiex_pcie_alloc_cmdrsp_buf.patch @@ -0,0 +1,109 @@ +From mboxrd@z Thu Jan 1 00:00:00 1970 +Return-Path: +X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on + aws-us-west-2-korg-lkml-1.web.codeaurora.org +X-Spam-Level: +X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, + DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, + HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, + SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable + autolearn_force=no version=3.4.0 +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) + by smtp.lore.kernel.org (Postfix) with ESMTP id 973EDC47404 + for ; Fri, 4 Oct 2019 20:09:06 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 700B62133F + for ; Fri, 4 Oct 2019 20:09:06 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kWRjsMO7" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1731310AbfJDUJE (ORCPT ); + Fri, 4 Oct 2019 16:09:04 -0400 +Received: from mail-io1-f68.google.com ([209.85.166.68]:42107 "EHLO + mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1729079AbfJDUJD (ORCPT + ); Fri, 4 Oct 2019 16:09:03 -0400 +Received: by mail-io1-f68.google.com with SMTP id n197so16151518iod.9; + Fri, 04 Oct 2019 13:09:03 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=TzGHd63YhhSYgCiRZ9tl0C+QqBhc3B9t1YurdXMHHEk=; + b=kWRjsMO7kWGMm/IT1zcaML7wX7Qq9Yq8WRm+RABc1yvFRuSkg1MJFKvuhIADpR86Sk + vk1W0Z5v0fSKpGUd8/OWzfGGYUmUKyVV0GCdL13GMMOSK9DpPSyvyt77eG5WmY3ZmctQ + TGC8Cmmzyp9qWwicYV847MUo/KmeyE8yz2h7Smb7WOcrkh2TV9S23hinrXd+nv5M0ZyF + ASEYU02I8rRxFXPCLp8D/KgP4shuTzi8Fg2/Hk1WrnV7b+j7LB2iDWk/cyp1qilFIKMU + ZBR7mheI1uaHirJEtlL1lGs5B+v25rI82daNM0pAfgJ1uilLnWPeFNCSgjxJjo/1l4rp + Y9qg== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=TzGHd63YhhSYgCiRZ9tl0C+QqBhc3B9t1YurdXMHHEk=; + b=i14dfaCVcowVdtunic+1Wp2wGV+1ZNLuoXJwp7E15v+1eEJZwFN3kPpygTaLhCxUcK + GwKISgBQGzHrbHDnyg1HwrLXM02Ldx63K+ocW92bWoiabvGepNaNkKLLjh1Cc9Z5Udr5 + FaRfo4jqaLUlKwSETn1kU+GSCbHc7OjVJMEAosWc4bRRpy2Z+vcoUwHuCG5OaNg6EQsh + rYclOJRJfMAu448q1becWoBHIpImXDm50NiWfQtEoUOj5o22/QPRUwaUeIC5LrB/sOiI + ZDVFoRHgEjTok93ZXTlcDfOXok4PcETTA6aDez2v7cwSd2y9Z9PI3Ng1mnPK/vmvqmXW + iQZw== +X-Gm-Message-State: APjAAAXV8P3/lHsEKg8iHeiLr3dvIg5sDmZQ5/1qeeMO2VMTctGtUgtN + UfU23ad10Ce+u/Moful94ba6TP6V/uo= +X-Google-Smtp-Source: APXvYqzID3S043QvcjXSlnz2Lfed2XSsv1r0x047tSPe8/gvBVD1NyJxtMQ/ZV89X4qzhOAjTbC2WA== +X-Received: by 2002:a92:603:: with SMTP id x3mr17481056ilg.295.1570219742776; + Fri, 04 Oct 2019 13:09:02 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id i67sm4267112ilf.84.2019.10.04.13.09.02 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Fri, 04 Oct 2019 13:09:02 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu, + Navid Emamdoost , + Amitkumar Karwar , + Nishant Sarmukadam , + Ganapathi Bhat , + Xinming Hu , + Kalle Valo , + "David S. Miller" , + linux-wireless@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf +Date: Fri, 4 Oct 2019 15:08:52 -0500 +Message-Id: <20191004200853.23353-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: netdev-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: netdev@vger.kernel.org +Archived-At: +List-Archive: +List-Post: + +In mwifiex_pcie_alloc_cmdrsp_buf, a new skb is allocated which should be +released if mwifiex_map_pci_memory() fails. The release is added. + +Fixes: fc3314609047 ("mwifiex: use pci_alloc/free_consistent APIs for PCIe") +Signed-off-by: Navid Emamdoost +--- + drivers/net/wireless/marvell/mwifiex/pcie.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c +index eff06d59e9df..1578eaa071bd 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie.c ++++ b/drivers/net/wireless/marvell/mwifiex/pcie.c +@@ -1029,8 +1029,10 @@ static int mwifiex_pcie_alloc_cmdrsp_buf(struct mwifiex_adapter *adapter) + } + skb_put(skb, MWIFIEX_UPLD_SIZE); + if (mwifiex_map_pci_memory(adapter, skb, MWIFIEX_UPLD_SIZE, +- PCI_DMA_FROMDEVICE)) ++ PCI_DMA_FROMDEVICE)) { ++ kfree_skb(skb); + return -1; ++ } + + card->cmdrsp_buf = skb; + +-- +2.17.1 + + diff --git a/net-next-v2-9-9-i40e-prevent-memory-leak-in-i40e_setup_macvlans.patch b/net-next-v2-9-9-i40e-prevent-memory-leak-in-i40e_setup_macvlans.patch new file mode 100644 index 000000000..e58103c7a --- /dev/null +++ b/net-next-v2-9-9-i40e-prevent-memory-leak-in-i40e_setup_macvlans.patch @@ -0,0 +1,80 @@ +From patchwork Fri Oct 25 20:42:42 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Jeff Kirsher +X-Patchwork-Id: 1184451 +X-Patchwork-Delegate: davem@davemloft.net +Return-Path: +X-Original-To: patchwork-incoming-netdev@ozlabs.org +Delivered-To: patchwork-incoming-netdev@ozlabs.org +Authentication-Results: ozlabs.org; spf=none (no SPF record) + smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; + helo=vger.kernel.org; + envelope-from=netdev-owner@vger.kernel.org; + receiver=) +Authentication-Results: ozlabs.org; + dmarc=fail (p=none dis=none) header.from=intel.com +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by ozlabs.org (Postfix) with ESMTP id 470GJz096Tz9sPf + for ; + Sat, 26 Oct 2019 07:42:59 +1100 (AEDT) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1728655AbfJYUmz (ORCPT + ); + Fri, 25 Oct 2019 16:42:55 -0400 +Received: from mga11.intel.com ([192.55.52.93]:22523 "EHLO mga11.intel.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1728604AbfJYUmq (ORCPT ); + Fri, 25 Oct 2019 16:42:46 -0400 +X-Amp-Result: SKIPPED(no attachment in message) +X-Amp-File-Uploaded: False +Received: from orsmga006.jf.intel.com ([10.7.209.51]) + by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; + 25 Oct 2019 13:42:46 -0700 +X-ExtLoop1: 1 +X-IronPort-AV: E=Sophos;i="5.68,229,1569308400"; d="scan'208";a="202713981" +Received: from jtkirshe-desk1.jf.intel.com ([134.134.177.96]) + by orsmga006.jf.intel.com with ESMTP; 25 Oct 2019 13:42:44 -0700 +From: Jeff Kirsher +To: davem@davemloft.net +Cc: Navid Emamdoost , + netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com, + Andrew Bowers , + Jeff Kirsher +Subject: [net-next v2 9/9] i40e: prevent memory leak in i40e_setup_macvlans +Date: Fri, 25 Oct 2019 13:42:42 -0700 +Message-Id: <20191025204242.10535-10-jeffrey.t.kirsher@intel.com> +X-Mailer: git-send-email 2.21.0 +In-Reply-To: <20191025204242.10535-1-jeffrey.t.kirsher@intel.com> +References: <20191025204242.10535-1-jeffrey.t.kirsher@intel.com> +MIME-Version: 1.0 +Sender: netdev-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: netdev@vger.kernel.org + +From: Navid Emamdoost + +In i40e_setup_macvlans if i40e_setup_channel fails the allocated memory +for ch should be released. + +Signed-off-by: Navid Emamdoost +Tested-by: Andrew Bowers +Signed-off-by: Jeff Kirsher +--- + drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c +index 2e4df0bd8d37..141575ada588 100644 +--- a/drivers/net/ethernet/intel/i40e/i40e_main.c ++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c +@@ -7187,6 +7187,7 @@ static int i40e_setup_macvlans(struct i40e_vsi *vsi, u16 macvlan_cnt, u16 qcnt, + ch->num_queue_pairs = qcnt; + if (!i40e_setup_channel(pf, vsi, ch)) { + ret = -EINVAL; ++ kfree(ch); + goto err_free; + } + ch->parent_vsi = vsi; diff --git a/rpmsg-char-release-allocated-memory.patch b/rpmsg-char-release-allocated-memory.patch new file mode 100644 index 000000000..fa44f8468 --- /dev/null +++ b/rpmsg-char-release-allocated-memory.patch @@ -0,0 +1,103 @@ +From patchwork Tue Sep 17 03:31:23 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 11148039 +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AADA514E5 + for ; + Tue, 17 Sep 2019 03:31:44 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 8922720650 + for ; + Tue, 17 Sep 2019 03:31:44 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="rGHRRJc6" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2392211AbfIQDbo (ORCPT + ); + Mon, 16 Sep 2019 23:31:44 -0400 +Received: from mail-io1-f65.google.com ([209.85.166.65]:43574 "EHLO + mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1730000AbfIQDbo (ORCPT + ); + Mon, 16 Sep 2019 23:31:44 -0400 +Received: by mail-io1-f65.google.com with SMTP id v2so4080968iob.10; + Mon, 16 Sep 2019 20:31:43 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=AZbBTIbQbqXwZoo2mD7WVQh8P9va3DGLxdwCMpbqykM=; + b=rGHRRJc6cmlQU6fzDipZt7KO5qJAWDWcnNDKSmndXpk0ewSLW23M8z7MSAS//IRj1l + tALlRIDw+7SUzX5oZBm7estXiqj5CDURnMfZuF79BxBQ+zBn15C215GlFtTeHRuG5oJR + v35CbGdsHyQUlJbZwndh7jhpbviDigFIUwvtN87/RcR1LLkquGA24oKzOknAIZzGKLxO + 7oJx7GgYMDJcZTaQBiy1SXTwC0dRQjDNmtdSjt40yzfROfi7nvGYsEyGo683REJTh3cr + Csz+zl2qSybIJaFl1b9JqdfU0fZdWLhwBvZAW6VFTo1GDKCalj3bu56OLWpXe5/2EyHe + k8+Q== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=AZbBTIbQbqXwZoo2mD7WVQh8P9va3DGLxdwCMpbqykM=; + b=H0T7GzjEzd76Q4M+fZ0zeWuyI2xvoQ6DwrCEEZr3Gb78xewtcJrJ2Uoy02HqXTY7Wh + wPXhKdlNpvGEAr5jCqHSqAO97xEf0q8Uo+5PTpbIePdn6AUBy+oZq95pT7ugT55Lw+X4 + 0q/Ef6854dvkM3Z9cjers0ia9MTaDYv1Ipn5SZ0gb87EvuZ9iQxfcNxpiqrAR3DfEGIH + LTwDRowj4YD0b9QqzpEyDlqbsMWY2241Yfj+awLnJ0gOSCTnAhE/BlgB2BrraWvCYfFH + t7thN0U6VI7faKxaP/Q1pUMeJ3tIcq+5lXfEzZecdIBxHFvS5W4u4eULnDUKhaa/jk4u + SLbQ== +X-Gm-Message-State: APjAAAVgR6KWN4oOwYJYA/Y6CJAcZxUfM16AUVfuG/Yx618weACP4BC4 + YV7/xT1rb1pLuAt/gojQxXgdV4jgRos= +X-Google-Smtp-Source: + APXvYqx4BGYBTXWug5NY3wJbo99uGA8r8HQaH6QnaLuCl7KSJytf2lAhCbNRWnl2/4bx5Sw7OH9Ksg== +X-Received: by 2002:a6b:c7c2:: with SMTP id + x185mr1469065iof.224.1568691103125; + Mon, 16 Sep 2019 20:31:43 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + i26sm1134258ion.40.2019.09.16.20.31.42 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Mon, 16 Sep 2019 20:31:42 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, + Navid Emamdoost , + Ohad Ben-Cohen , + Bjorn Andersson , + linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org +Subject: [PATCH] rpmsg: char: release allocated memory +Date: Mon, 16 Sep 2019 22:31:23 -0500 +Message-Id: <20190917033124.1077-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-remoteproc-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-remoteproc@vger.kernel.org + +In rpmsg_eptdev_write_iter, if copy_from_iter_full fails the allocated +buffer needs to be released. + +Signed-off-by: Navid Emamdoost +--- + drivers/rpmsg/rpmsg_char.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c +index eea5ebbb5119..c655074c07c2 100644 +--- a/drivers/rpmsg/rpmsg_char.c ++++ b/drivers/rpmsg/rpmsg_char.c +@@ -227,8 +227,10 @@ static ssize_t rpmsg_eptdev_write_iter(struct kiocb *iocb, + if (!kbuf) + return -ENOMEM; + +- if (!copy_from_iter_full(kbuf, len, from)) +- return -EFAULT; ++ if (!copy_from_iter_full(kbuf, len, from)) { ++ ret = -EFAULT; ++ goto free_kbuf; ++ } + + if (mutex_lock_interruptible(&eptdev->ept_lock)) { + ret = -ERESTARTSYS; diff --git a/rsi-release-skb-if-rsi_prepare_beacon-fails.patch b/rsi-release-skb-if-rsi_prepare_beacon-fails.patch new file mode 100644 index 000000000..64c40f408 --- /dev/null +++ b/rsi-release-skb-if-rsi_prepare_beacon-fails.patch @@ -0,0 +1,101 @@ +From patchwork Sat Sep 14 00:08:11 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 11145515 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BDCB14DB + for ; + Sat, 14 Sep 2019 00:08:28 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 1C8DC20692 + for ; + Sat, 14 Sep 2019 00:08:28 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="H4ki8bM3" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2390814AbfINAIX (ORCPT + ); + Fri, 13 Sep 2019 20:08:23 -0400 +Received: from mail-io1-f67.google.com ([209.85.166.67]:38748 "EHLO + mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S2390793AbfINAIX (ORCPT + ); + Fri, 13 Sep 2019 20:08:23 -0400 +Received: by mail-io1-f67.google.com with SMTP id k5so41134655iol.5; + Fri, 13 Sep 2019 17:08:22 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=jwG/Aiknb+UcZynbTQk90VqogFgsnd/QMY7azs6Zupc=; + b=H4ki8bM3b9Bmty2ruf5ZSCj1ONr4jsOiep+vLMdBWcjq1+6e8umPfwLlGHYesuoz/Q + VF5OFoRIgllqVfRh1O0ob/rthiQm73toq+PTtrX9iKlZ8u3smXrOHJ2yH7252RrvcFpT + O3TQVuU3UKw0Am3Efn13+5jVOA3Oh/oH5UC9uNsla1kvJ3F/R6nBoiOSwOMnclPvgRSn + vay6xtYVjr5LkBAO60l/e/agltxV8p/eNiUH2xLAV7FcQ7951+WbMmnXr40trn8HDEj4 + 6yl80zQa8B2dbLThm6nFvE462hhCUY3BrldbuGcsFiHG7iW0/cIshuHIso8SieQZdhM+ + gIzw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=jwG/Aiknb+UcZynbTQk90VqogFgsnd/QMY7azs6Zupc=; + b=sTBiyouiK4UyXL4mE50HQlhIkI9Ns2+bLnk+9IC/vhspdjwj+xTPQI2DtQxLD94ruR + EUXt194VEVxAqhmZQJy2MmYkPLsTxt31pXvm59EGf0bFyboMEVIx/BOWcqjS1+pOKH4I + PisI3obo+CTL2hsat1wiEc2pMg+ZsZKzwlboyXVB0sL/FjH0xkEqAF1YC39sbegiiU6P + PX/iDiNXMRckuIc/hvl5JA+8DFBj6onQYoXyPjRG7Ry122UQPLyu9SCSc2nGtgiv/EqM + 0YAhTTXDm0FyknKt7MoTbOuMcDqzz/io6uTl6/oMPotLSrKVAe+8u0V/hl9WS8VvitOm + U3xw== +X-Gm-Message-State: APjAAAUnAd+MBw2rCpslu6F+1lT07zH7ui3l7LUI6IDQAbTwKXToMRDT + yPjM/YAgsdE/f2RMGo4WmJhx7rwf6+4= +X-Google-Smtp-Source: + APXvYqw7AMJKs0y62zgNzfsmBOSndsvr5y6XtYV+6wx/T/jGH6LPa1JJmCjPhOygc0/qx3csQoLVXA== +X-Received: by 2002:a6b:5b07:: with SMTP id v7mr3108833ioh.76.1568419702221; + Fri, 13 Sep 2019 17:08:22 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + t9sm3973230iop.86.2019.09.13.17.08.21 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Fri, 13 Sep 2019 17:08:21 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, + Navid Emamdoost , + Amitkumar Karwar , + Siva Rebbagondla , + Kalle Valo , + "David S. Miller" , + linux-wireless@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] rsi: release skb if rsi_prepare_beacon fails +Date: Fri, 13 Sep 2019 19:08:11 -0500 +Message-Id: <20190914000812.10188-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +In rsi_send_beacon, if rsi_prepare_beacon fails the allocated skb should +be released. + +Signed-off-by: Navid Emamdoost +--- + drivers/net/wireless/rsi/rsi_91x_mgmt.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c +index 6c7f26ef6476..9cc8a335d519 100644 +--- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c ++++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c +@@ -1756,6 +1756,7 @@ static int rsi_send_beacon(struct rsi_common *common) + skb_pull(skb, (64 - dword_align_bytes)); + if (rsi_prepare_beacon(common, skb)) { + rsi_dbg(ERR_ZONE, "Failed to prepare beacon\n"); ++ dev_kfree_skb(skb); + return -EINVAL; + } + skb_queue_tail(&common->tx_queue[MGMT_BEACON_Q], skb); diff --git a/rtl8xxxu-prevent-leaking-urb.patch b/rtl8xxxu-prevent-leaking-urb.patch new file mode 100644 index 000000000..ff088dea0 --- /dev/null +++ b/rtl8xxxu-prevent-leaking-urb.patch @@ -0,0 +1,101 @@ +From patchwork Fri Sep 20 03:00:41 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 11153733 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7607B76 + for ; + Fri, 20 Sep 2019 03:00:56 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 48CF521929 + for ; + Fri, 20 Sep 2019 03:00:56 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="fzAGUdQV" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2405830AbfITDAw (ORCPT + ); + Thu, 19 Sep 2019 23:00:52 -0400 +Received: from mail-io1-f66.google.com ([209.85.166.66]:44050 "EHLO + mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S2389956AbfITDAv (ORCPT + ); + Thu, 19 Sep 2019 23:00:51 -0400 +Received: by mail-io1-f66.google.com with SMTP id j4so12740088iog.11; + Thu, 19 Sep 2019 20:00:51 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=wR9pye3sH3f9c/Ue486PD/cpETKoqUyEfHnMaMiRPdY=; + b=fzAGUdQVIXP8BO6Um0bEY7aXmxWrofp3WYusEuhMgPmQ27A5ZhIq51xSMAN9gohJey + xdsD6nXME5ZveH9/lQ1MvNo7e8lxKB+VJiF53+KRWHjYY3yo3CO+r/lMh38wUGe5T120 + NI5FyQ8YmYV/aaqGUTa6/SbDVBDZBSb3F3uOkXNjWxRyI80HGsx60/fhQaY8HNtHHcDb + 511aV1DthYS9mGIh4z56qpebAKs9Q6CMcrqtYaemGR01y1sZsyooYZweWPqYYQ28lZUi + oVHgUKZHp3jvfYhzZnVc8ousIPPiZiLXszN06Siqs6CGkR6p4m+lf80we8Xi6J0bEISz + hFBw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=wR9pye3sH3f9c/Ue486PD/cpETKoqUyEfHnMaMiRPdY=; + b=mUe4i46sJphvT9eHFwqTegYlyqNnE95+R/GbAr/Is0OJfzCFXHu/cUrw5ElaQR4ATd + ShSEU7xpcL4ISPtNRc3kSBvt3ROv3RHbxdgCw3UYVG+DJLMet3AvPnJT0bwN5UWcCodd + z7bw4VprjwTZj8WPj+itlX2LdPws17O4C/ROM8RuRJ7MFQLwCg0qLscbxBXwKUsnyoTp + KIi52u4X85ABBEBFgGrx6ZS/sllG/u+spcSMjf/TVV0UglkLy7sRgZ4gyMBHgbMrzUDO + tGJQMGon7uU9OTA6a73s3ap8eeQ/c8KZUftJBh6c7xJL7qrH5lfZJSQBjePgKF+RF/rt + 40wQ== +X-Gm-Message-State: APjAAAWUFzu7MpjxWJtu4hgZuo8rk1uE8i27EiFcdjhNEG5ZaOg9jkNB + zqGym44mT1nF7nFS4RHjg/Y= +X-Google-Smtp-Source: + APXvYqwI+IXRu7Lhr0HmMj08qfXGIRkcCHYMdmSMkCW5GIIz+Ml1cQ5Uy6GCUGV2WrCpixMQAv4aog== +X-Received: by 2002:a02:ac82:: with SMTP id x2mr13978167jan.34.1568948450810; + Thu, 19 Sep 2019 20:00:50 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + t9sm380269iop.86.2019.09.19.20.00.50 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Thu, 19 Sep 2019 20:00:50 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, + Navid Emamdoost , + Jes Sorensen , + Kalle Valo , + "David S. Miller" , + linux-wireless@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] rtl8xxxu: prevent leaking urb +Date: Thu, 19 Sep 2019 22:00:41 -0500 +Message-Id: <20190920030043.30137-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +In rtl8xxxu_submit_int_urb if usb_submit_urb fails the allocated urb +should be released. + +Signed-off-by: Navid Emamdoost +Reviewed-by: Chris Chiu +--- + drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +index 8136e268b4e6..4a559c37e208 100644 +--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c ++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +@@ -5443,6 +5443,7 @@ static int rtl8xxxu_submit_int_urb(struct ieee80211_hw *hw) + ret = usb_submit_urb(urb, GFP_KERNEL); + if (ret) { + usb_unanchor_urb(urb); ++ usb_free_urb(urb); + goto error; + } + diff --git a/rtlwifi-prevent-memory-leak-in-rtl_usb_probe.patch b/rtlwifi-prevent-memory-leak-in-rtl_usb_probe.patch new file mode 100644 index 000000000..69d1c0f46 --- /dev/null +++ b/rtlwifi-prevent-memory-leak-in-rtl_usb_probe.patch @@ -0,0 +1,110 @@ +From patchwork Wed Sep 25 01:20:21 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 1131161 +Return-Path: +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) + by smtp.lore.kernel.org (Postfix) with ESMTP id BC591C432C1 + for ; Wed, 25 Sep 2019 01:20:44 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 8BCDC2146E + for ; Wed, 25 Sep 2019 01:20:44 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="SWiOz5xt" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2411353AbfIYBUn (ORCPT + ); + Tue, 24 Sep 2019 21:20:43 -0400 +Received: from mail-io1-f68.google.com ([209.85.166.68]:33885 "EHLO + mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S2392379AbfIYBUn (ORCPT + ); + Tue, 24 Sep 2019 21:20:43 -0400 +Received: by mail-io1-f68.google.com with SMTP id q1so9351551ion.1; + Tue, 24 Sep 2019 18:20:42 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=mQUUiLblrejWrKd0KlOdzOcENXF40rH5GYEM9TuaSS4=; + b=SWiOz5xtaFHfAe7qhrZOfB3XaTTABaRoUA2WkntQTu6mZLAPtLqltcn1HSz4FOVdmc + C4hiQS6HxKitVmGPHJR6BnOiAdmb8p/ke41JsAiVtxDyJj/EtgPgcn000LqwSw2XXpRs + aJsehFF9sM31eMjJ3jPJMVhf1moysCBTI8rG+6ARu4tg//7sLz/cZpWsKuTFtLA41S2X + Moj049CPHidyuiCC+TLFAA4dTAVT1wk5YorB1e+xMSVKHkW4g3k4FuVp38c12CmbT13R + wsO2tqJ0iRFy2a/3SfO203+i0XYenfEQ/WWVu5ywTPrwX422oKO4PeywgDE5pL7ILA7N + 5lXA== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=mQUUiLblrejWrKd0KlOdzOcENXF40rH5GYEM9TuaSS4=; + b=PVpA/fyBIdoLH3ctyZntsZiwJLKRkFCP/mefxIVWehzdNs+J01dhg9UvthHik8uSD0 + WAfXOKljH2T6Dz6LC8B/araiwV5iwm9zy3h1VlfLlervg6lYtMtGN8XfNFJccvIcoFIf + 0rOQal8NWpkvib3lEqdVdolhDogapBQWxjPQApj9tuYkO3JWOpr994A5Legt0Ha/Mdpg + iLum0KUzciv2wLRhPIGTis08rgOJQbuV/lWNmEkCqbS6tSlvN/HH7apJEJU+Xm1vfhqB + SB2zOsviArNFeNhb/VpZyY329Au5/aGwh06J3nI6xfxyUSWEDCs24g1LN/PL7ESZvquK + +kzg== +X-Gm-Message-State: APjAAAWn+51fVnTld2M5xyo/OXfdxePecAEGRlXft7qNHI0Gnp9EyVgR + otCkul6uMkwDI6M6UjbBXIo20ZwJqcc= +X-Google-Smtp-Source: + APXvYqwYH0op/7MmCPiM8xAfMsxn7k8FX5LrV/HLNynk01ydo/cjks9o5mJOS8EhqcleAu7Y+qfNeQ== +X-Received: by 2002:a02:5ec4:: with SMTP id + h187mr2345350jab.101.1569374442036; + Tue, 24 Sep 2019 18:20:42 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + r12sm28225ilq.70.2019.09.24.18.20.41 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Tue, 24 Sep 2019 18:20:41 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, + Navid Emamdoost , + Ping-Ke Shih , + Kalle Valo , + "David S. Miller" , + linux-wireless@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] rtlwifi: prevent memory leak in rtl_usb_probe +Date: Tue, 24 Sep 2019 20:20:21 -0500 +Message-Id: <20190925012022.13727-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-kernel@vger.kernel.org + +In rtl_usb_probe if allocation for usb_data fails the allocated hw +should be released. In addition the allocated rtlpriv->usb_data should +be released on error handling path. + +Signed-off-by: Navid Emamdoost +--- + drivers/net/wireless/realtek/rtlwifi/usb.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c +index 4b59f3b46b28..348b0072cdd6 100644 +--- a/drivers/net/wireless/realtek/rtlwifi/usb.c ++++ b/drivers/net/wireless/realtek/rtlwifi/usb.c +@@ -1021,8 +1021,10 @@ int rtl_usb_probe(struct usb_interface *intf, + rtlpriv->hw = hw; + rtlpriv->usb_data = kcalloc(RTL_USB_MAX_RX_COUNT, sizeof(u32), + GFP_KERNEL); +- if (!rtlpriv->usb_data) ++ if (!rtlpriv->usb_data) { ++ ieee80211_free_hw(hw); + return -ENOMEM; ++ } + + /* this spin lock must be initialized early */ + spin_lock_init(&rtlpriv->locks.usb_lock); +@@ -1083,6 +1085,7 @@ int rtl_usb_probe(struct usb_interface *intf, + _rtl_usb_io_handler_release(hw); + usb_put_dev(udev); + complete(&rtlpriv->firmware_loading_complete); ++ kfree(rtlpriv->usb_data); + return -ENODEV; + } + EXPORT_SYMBOL(rtl_usb_probe); diff --git a/scsi-bfa-release-allocated-memory-in-case-of-error.patch b/scsi-bfa-release-allocated-memory-in-case-of-error.patch new file mode 100644 index 000000000..6bbf61364 --- /dev/null +++ b/scsi-bfa-release-allocated-memory-in-case-of-error.patch @@ -0,0 +1,105 @@ +From mboxrd@z Thu Jan 1 00:00:00 1970 +Return-Path: +X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on + aws-us-west-2-korg-lkml-1.web.codeaurora.org +X-Spam-Level: +X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, + DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, + HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, + SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable + autolearn_force=no version=3.4.0 +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) + by smtp.lore.kernel.org (Postfix) with ESMTP id 91A3BC49ED7 + for ; Tue, 10 Sep 2019 23:44:32 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 695AB216F4 + for ; Tue, 10 Sep 2019 23:44:32 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="agIEQzR/" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1726192AbfIJXo2 (ORCPT ); + Tue, 10 Sep 2019 19:44:28 -0400 +Received: from mail-io1-f68.google.com ([209.85.166.68]:47033 "EHLO + mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1725876AbfIJXo2 (ORCPT + ); Tue, 10 Sep 2019 19:44:28 -0400 +Received: by mail-io1-f68.google.com with SMTP id d17so19749943ios.13; + Tue, 10 Sep 2019 16:44:28 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=ZGP+PYUf116KpmFZWCQJ/+W1BpD8OneYbmbPw8KI1DY=; + b=agIEQzR/UIcZsX92ydKv9iYSTD0wKkF0DCdfCvbuRl+mJRlsmk4xv6oXdAgiahYN66 + Y4Q1c3uqGfdg1IWTY8T5VS2bzEO4YTifAiDII2S1ZWE4qCq8jQdhAiMYFsy8Ny7SDa1i + RXfYurzoCzrqs+1B+eQquaIosJ9qTs67bacbWDhEbp+bhuDtAJoSJ2fs0ADFREjunWBy + UiNXq4j/j6LSfUZc7/Al3xGpHnxht5yshuaAEMNrtlbZPVklWY2XcluBTm1eBpVv4pNu + 6n0+q3EwwYu6YMWPprH1JbHi2Uu9ZaR2Jluku1++jFb128U92+e23LofkhY5gkwB7hwY + Liug== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=ZGP+PYUf116KpmFZWCQJ/+W1BpD8OneYbmbPw8KI1DY=; + b=Vn2eF6QjqBqKG9rCWyHMzAcWxAyjzqoNnmTtmP1drV/AtPZojXG21vO6Yrnrd0w3PE + D6Ej3hyD9banePwuxeoxD9PJaOZhH6vDSisM4T6cdycmHACIq7Q4y0wNLMJHmBpfx92C + WnE4PkQBXz9XrBkbHT0/qI0csFhmBgKD4B+pbnRSAiIqSIt4WSSTwSpLo/TOL7Ub4fTj + pzgVYex3XzJEdoPo2wADo0RBjCbf+JqPDME58Yub8LpfLVerY/I/+jo838cdS9dbfHcN + cD1eu4BYssjD887++aPPqQnIKLOMNl4pra1065KqKPtIfrEB1T9nwAqxbcC8/weZWeAn + MbFA== +X-Gm-Message-State: APjAAAVbAnon8+4rQ6lpU3M2lHtSY87bZtAXd06oMDim1otUrO2FXd8d + LBElDhZf0bU+XXNO4CU1XdQ= +X-Google-Smtp-Source: APXvYqzpHFPcs8wqSh6UDjLhtAgV9r92A+H6PKQaASa8MTnRPf9hCZWEZ/wN9o/vH1jWAEJYkcaPtA== +X-Received: by 2002:a6b:b714:: with SMTP id h20mr37211941iof.302.1568159067609; + Tue, 10 Sep 2019 16:44:27 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id z20sm19383990iof.38.2019.09.10.16.44.26 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Tue, 10 Sep 2019 16:44:27 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, + Navid Emamdoost , + Anil Gurumurthy , + Sudarsana Kalluru , + "James E.J. Bottomley" , + "Martin K. Petersen" , + linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org +Subject: [PATCH] scsi: bfa: release allocated memory in case of error +Date: Tue, 10 Sep 2019 18:44:15 -0500 +Message-Id: <20190910234417.22151-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-scsi-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-scsi@vger.kernel.org +Archived-At: +List-Archive: +List-Post: + +In bfad_im_get_stats if bfa_port_get_stats fails, allocated memory +needs to be released. + +Signed-off-by: Navid Emamdoost +--- + drivers/scsi/bfa/bfad_attr.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c +index 29ab81df75c0..fbfce02e5b93 100644 +--- a/drivers/scsi/bfa/bfad_attr.c ++++ b/drivers/scsi/bfa/bfad_attr.c +@@ -275,8 +275,10 @@ bfad_im_get_stats(struct Scsi_Host *shost) + rc = bfa_port_get_stats(BFA_FCPORT(&bfad->bfa), + fcstats, bfad_hcb_comp, &fcomp); + spin_unlock_irqrestore(&bfad->bfad_lock, flags); +- if (rc != BFA_STATUS_OK) ++ if (rc != BFA_STATUS_OK) { ++ kfree(fcstats); + return NULL; ++ } + + wait_for_completion(&fcomp.comp); + +-- +2.17.1 + + diff --git a/spi-gpio-prevent-memory-leak-in-spi_gpio_probe.patch b/spi-gpio-prevent-memory-leak-in-spi_gpio_probe.patch new file mode 100644 index 000000000..e0a79cfe2 --- /dev/null +++ b/spi-gpio-prevent-memory-leak-in-spi_gpio_probe.patch @@ -0,0 +1,39 @@ +From d3b0ffa1d75d5305ebe34735598993afbb8a869d Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Mon, 30 Sep 2019 15:52:40 -0500 +Subject: spi: gpio: prevent memory leak in spi_gpio_probe + +In spi_gpio_probe an SPI master is allocated via spi_alloc_master, but +this controller should be released if devm_add_action_or_reset fails, +otherwise memory leaks. In order to avoid leak spi_contriller_put must +be called in case of failure for devm_add_action_or_reset. + +Fixes: 8b797490b4db ("spi: gpio: Make sure spi_master_put() is called in every error path") +Signed-off-by: Navid Emamdoost +Link: https://lore.kernel.org/r/20190930205241.5483-1-navid.emamdoost@gmail.com +Signed-off-by: Mark Brown +--- + drivers/spi/spi-gpio.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +(limited to 'drivers/spi/spi-gpio.c') + +diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c +index 1d3e23ec20a6..f9c5bbb74714 100644 +--- a/drivers/spi/spi-gpio.c ++++ b/drivers/spi/spi-gpio.c +@@ -371,8 +371,10 @@ static int spi_gpio_probe(struct platform_device *pdev) + return -ENOMEM; + + status = devm_add_action_or_reset(&pdev->dev, spi_gpio_put, master); +- if (status) ++ if (status) { ++ spi_master_put(master); + return status; ++ } + + if (of_id) + status = spi_gpio_probe_dt(pdev, master); +-- +cgit 1.2-0.3.lf.el7 + diff --git a/spi-lpspi-fix-memory-leak-in-fsl_lpspi_probe.patch b/spi-lpspi-fix-memory-leak-in-fsl_lpspi_probe.patch new file mode 100644 index 000000000..918877f5e --- /dev/null +++ b/spi-lpspi-fix-memory-leak-in-fsl_lpspi_probe.patch @@ -0,0 +1,105 @@ +From mboxrd@z Thu Jan 1 00:00:00 1970 +Return-Path: +X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on + aws-us-west-2-korg-lkml-1.web.codeaurora.org +X-Spam-Level: +X-Spam-Status: No, score=-9.4 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, + DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, + HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, + SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no + version=3.4.0 +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) + by smtp.lore.kernel.org (Postfix) with ESMTP id C92DFC4360C + for ; Mon, 30 Sep 2019 03:46:18 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 9B3EE20863 + for ; Mon, 30 Sep 2019 03:46:18 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MxIuKg6c" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1729507AbfI3DqO (ORCPT + ); + Sun, 29 Sep 2019 23:46:14 -0400 +Received: from mail-io1-f66.google.com ([209.85.166.66]:35210 "EHLO + mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1726360AbfI3DqO (ORCPT + ); + Sun, 29 Sep 2019 23:46:14 -0400 +Received: by mail-io1-f66.google.com with SMTP id q10so34551005iop.2; + Sun, 29 Sep 2019 20:46:13 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=CSb8gKQFW+56QuRhWd4MVB/962Fvkd5QK+eXub6cDmE=; + b=MxIuKg6cc7vmVBU35srXcQltSjWfzAQElpoZgAlV4IAegsPDx906fw8dUzLriT4baK + fBI64z8uZ5KseshsQzqi5BVxbpb6LulT2mykTJq/pUGdaGaks60BJexhUMeSfNyaRrSw + jfZjzE0QCgGBSOYA5ovK/1GcPySgrArlnITUbkIzeObOLmetAQSgfIuEmD3QDkMSGBgo + vEJ/PmjTcPWD8rCJc/XKg+rTU7wVeK/VTlmL6KxFvwOwenU6A7VjSjSUIUuRLyY4DrMN + cYq+KCSyF9sfI4q5YOSUdQ0T1s5RpFvx8+sTAS78lMKQQqGwvVqM05jR/nbSHSEltzPy + JHUg== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=CSb8gKQFW+56QuRhWd4MVB/962Fvkd5QK+eXub6cDmE=; + b=bNFNL53TYUcz8nZsGgBlk1ntXRHaszBkoC9NrxFaR2ySpC2T71F+IlYFFeTyhVcLUW + F9WAID6IG3m1OQEoyR0Hdnz5xkY22u1wVHTx4QWpil9NKsfyBmzVhoAlGmKRvgt1nso3 + 2XJXPzoemp9nWy/y8GTqhFO+OofhRcwJdijhsRitU6J8z5xb0wHCwplFwRGZjRZI9uP7 + /+81BUj3Dhsz4jPbMTT9LrFVvqszsTkzTReqyp6sKnxMKhpfhUQwSX9fRF++E5EBEc3C + X8uCSxmhI2UraYuwaASHqGk+nvpVTkUaNNaaz9J8HNMi0dq7N1xua7AT65rICXDfBvkO + Sdnw== +X-Gm-Message-State: APjAAAWroOwvHW6SHGBmhWef7X7KS1ypb0sPG9ZHVxp4GIygokLX/WFb + 1azxubBLqnwY/4ic3z+D784= +X-Google-Smtp-Source: APXvYqzx55nalXFB8YovlLh9qfXLKQ5njGsXu/sw9z0VR74i+3mZlYSj//BvPzrbGIA2nI5KDHHqbw== +X-Received: by 2002:a92:844b:: with SMTP id l72mr17962867ild.275.1569815173041; + Sun, 29 Sep 2019 20:46:13 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id w16sm5283677ilc.62.2019.09.29.20.46.12 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Sun, 29 Sep 2019 20:46:12 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu, + Navid Emamdoost , + Mark Brown , linux-spi@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] spi: lpspi: fix memory leak in fsl_lpspi_probe +Date: Sun, 29 Sep 2019 22:46:01 -0500 +Message-Id: <20190930034602.1467-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: +List-Archive: +List-Post: + +In fsl_lpspi_probe an SPI controller is allocated either via +spi_alloc_slave or spi_alloc_master. In all but one error cases this +controller is put by going to error handling code. This commit fixes the +case when pm_runtime_get_sync fails and it should go to the error +handling path. + +Fixes: 944c01a889d9 ("spi: lpspi: enable runtime pm for lpspi") +Signed-off-by: Navid Emamdoost +--- + drivers/spi/spi-fsl-lpspi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c +index d08e9324140e..3528ed5eea9b 100644 +--- a/drivers/spi/spi-fsl-lpspi.c ++++ b/drivers/spi/spi-fsl-lpspi.c +@@ -938,7 +938,7 @@ static int fsl_lpspi_probe(struct platform_device *pdev) + ret = pm_runtime_get_sync(fsl_lpspi->dev); + if (ret < 0) { + dev_err(fsl_lpspi->dev, "failed to enable clock\n"); +- return ret; ++ goto out_controller_put; + } + + temp = readl(fsl_lpspi->base + IMX7ULP_PARAM); +-- +2.17.1 + + From 94fd6d88caba2ff24654a4f0bd2569b76d893544 Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Fri, 22 Nov 2019 12:59:39 -0600 Subject: [PATCH 043/178] Fix CVE-2019-19077 rhbz 1775724 1775725 --- ...rget-to-release-the-allocated-memory.patch | 33 +++++++++++++++++++ kernel.spec | 6 ++++ 2 files changed, 39 insertions(+) create mode 100644 0001-RDMA-Fix-goto-target-to-release-the-allocated-memory.patch diff --git a/0001-RDMA-Fix-goto-target-to-release-the-allocated-memory.patch b/0001-RDMA-Fix-goto-target-to-release-the-allocated-memory.patch new file mode 100644 index 000000000..87f4b4db7 --- /dev/null +++ b/0001-RDMA-Fix-goto-target-to-release-the-allocated-memory.patch @@ -0,0 +1,33 @@ +From 4a9d46a9fe14401f21df69cea97c62396d5fb053 Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Tue, 10 Sep 2019 17:21:19 -0500 +Subject: [PATCH] RDMA: Fix goto target to release the allocated memory + +In bnxt_re_create_srq(), when ib_copy_to_udata() fails allocated memory +should be released by goto fail. + +Fixes: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters") +Link: https://lore.kernel.org/r/20190910222120.16517-1-navid.emamdoost@gmail.com +Signed-off-by: Navid Emamdoost +Reviewed-by: Jason Gunthorpe +Signed-off-by: Jason Gunthorpe +--- + drivers/infiniband/hw/bnxt_re/ib_verbs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c +index f9e97d0cc459..b4149dc9e824 100644 +--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c ++++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c +@@ -1398,7 +1398,7 @@ int bnxt_re_create_srq(struct ib_srq *ib_srq, + dev_err(rdev_to_dev(rdev), "SRQ copy to udata failed!"); + bnxt_qplib_destroy_srq(&rdev->qplib_res, + &srq->qplib_srq); +- goto exit; ++ goto fail; + } + } + if (nq) +-- +2.23.0 + diff --git a/kernel.spec b/kernel.spec index a740c5d9f..f5351c904 100644 --- a/kernel.spec +++ b/kernel.spec @@ -651,6 +651,9 @@ Patch523: 0001-nl80211-fix-memory-leak-in-nl80211_get_ftm_responder.patch # CVE-2019-19054 rhbz 1775063 1775117 Patch524: media-rc-prevent-memory-leak-in-cx23888_ir_probe.patch +# CVE-2019-19077 rhbz 1775724 1775725 +Patch525: 0001-RDMA-Fix-goto-target-to-release-the-allocated-memory.patch + # END OF PATCH DEFINITIONS %endif @@ -1852,6 +1855,9 @@ fi # # %changelog +* Fri Nov 22 2019 Justin M. Forbes +- Fix CVE-2019-19077 rhbz 1775724 1775725 + * Thu Nov 21 2019 Justin M. Forbes - 5.3.12-300 - Fix CVE-2019-19074 (rhbz 1774933 1774934) - Fix CVE-2019-19073 (rhbz 1774937 1774939) From 137fde170dffa75be93c4bca126ed2c119c20f75 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Mon, 25 Nov 2019 09:01:51 -0500 Subject: [PATCH 044/178] Linux v5.3.13 --- kernel.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel.spec b/kernel.spec index f5351c904..39d98bd63 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 12 +%define stable_update 13 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -1855,6 +1855,9 @@ fi # # %changelog +* Mon Nov 25 2019 Laura Abbott - 5.3.13-300 +- Linux v5.3.13 + * Fri Nov 22 2019 Justin M. Forbes - Fix CVE-2019-19077 rhbz 1775724 1775725 diff --git a/sources b/sources index 376f03ab7..b89afbfd2 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.12.xz) = 3294d938800b6a2608d64ff25d4e43a0c4b4e90dfb531370eb646a0a5ed449440d9399f8442c0f8078eee78d2ae696a53ee82a9f209c840a6d5538b72ec92dc8 +SHA512 (patch-5.3.13.xz) = 3df94df06bc296d2edbeb5a409702da3a9d3d8394df9ffa3f01ab745726505b84078cefe352d38955d62d6bbede975450646093858e786eaf7416c46eec33972 From 82d983221ca70c2813b39de565b7968c3a955cf6 Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Mon, 25 Nov 2019 10:12:59 -0600 Subject: [PATCH 045/178] Fix a number of CVEs --- ath10k-fix-memory-leak.patch | 154 ++++++++++++ kernel.spec | 22 +- ...-overflows-at-parsing-bss-descriptor.patch | 120 ++++++++++ ...n-mmwifiex_process_tdls_action_frame.patch | 226 ++++++++++++++++++ ...erflow-in-mwifiex_process_country_ie.patch | 129 ++++++++++ 5 files changed, 650 insertions(+), 1 deletion(-) create mode 100644 ath10k-fix-memory-leak.patch create mode 100644 libertas-Fix-two-buffer-overflows-at-parsing-bss-descriptor.patch create mode 100644 mwifiex-Fix-heap-overflow-in-mmwifiex_process_tdls_action_frame.patch create mode 100644 mwifiex-fix-possible-heap-overflow-in-mwifiex_process_country_ie.patch diff --git a/ath10k-fix-memory-leak.patch b/ath10k-fix-memory-leak.patch new file mode 100644 index 000000000..f7120b81f --- /dev/null +++ b/ath10k-fix-memory-leak.patch @@ -0,0 +1,154 @@ +From patchwork Fri Sep 20 01:36:26 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 11153701 +Return-Path: + +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D3F0714DB + for ; + Fri, 20 Sep 2019 01:36:54 +0000 (UTC) +Received: from bombadil.infradead.org (bombadil.infradead.org + [198.137.202.133]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) + (No client certificate requested) + by mail.kernel.org (Postfix) with ESMTPS id B1A2E206C2 + for ; + Fri, 20 Sep 2019 01:36:54 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="bhsKgarK"; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="nljLTTHa" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1A2E206C2 +Authentication-Results: mail.kernel.org; + dmarc=fail (p=none dis=none) header.from=gmail.com +Authentication-Results: mail.kernel.org; + spf=none + smtp.mailfrom=ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=lists.infradead.org; s=bombadil.20170209; h=Sender: + Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: + List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: + Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: + Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: + References:List-Owner; bh=TgqIPzTUSDBMffxK6MmqtQ+I81SfWmrbmWLuWLbhwV8=; b=bhs + KgarKUaVoFaf/6TPo+T+LIemPUgT0DioZ9Aa4cXD7m02vV5SrBodW911B9amgDGQ4ipx7UyAgOokS + QqumgU8MLbC9VEmDHseDYkrMDJvPAVL/+Ou5bAAoDDa4G14hJi1RWh5lsdIJBMKmjMI9KcW7qFdEj + eQ6JBoJXliaYp31BoAPEbyBnG4b8RQxO6wT9wA+/Bs8gR8bBQN9Wjo7zsIKHobQbKfAXTTRwn46dt + J7kt19264hkIv2Dr3UQc7W8kYL09TmllYFjEGYTOuGFEOoHlejt6CpbUnh0mdPtDggPPxsQ+e/f/h + 0dGNUqgR/L7R5/70DbHnF24DnXzwfQw==; +Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) + by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) + id 1iB7qu-0006An-U6; Fri, 20 Sep 2019 01:36:52 +0000 +Received: from mail-io1-xd43.google.com ([2607:f8b0:4864:20::d43]) + by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) + id 1iB7qr-0006A2-PC + for ath10k@lists.infradead.org; Fri, 20 Sep 2019 01:36:51 +0000 +Received: by mail-io1-xd43.google.com with SMTP id q10so12531160iop.2 + for ; Thu, 19 Sep 2019 18:36:47 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=2vkYM2Vw9GpvccAiSSIMhifEzfuK8Ld4R3bwXVgh1ps=; + b=nljLTTHaQr3RenMHyxOGrtAwE/I0ES0GK9UJLdYkS7iEalzRrwu+/ygif0A/YnEFuE + fMLFG5zBRN2I7SpqvTBqaxAYJbA+a5Nnb5ymeV3s6Ef+CcGHE165IRfi+4dxEt/RvV3k + 4CjBDTDWGnnBO1wfDcS0WW9TqjJEoxFKWNCL+8oAzUyMten4zs8XPRUPlZVc5dHnkqC9 + LmLWnaSBjm2g5JG0GJKSrT8KrYP2mv4yGUR0HaWruQWwfQQ8NJc2RyXm1Ml99KZkoU73 + TG98jQSy2dcHrVqaNRfpAtyj0WEwXdLqMfT1ggk69p1ZfC7ol/7QEQxzgDIU0EFn2r59 + owvA== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=2vkYM2Vw9GpvccAiSSIMhifEzfuK8Ld4R3bwXVgh1ps=; + b=h6uidvjJA/lvtevOi6n+lWV9vjtx5XM1d7kRlAFgObUBjJMIap329Jxa7uA0de8dx/ + 4ANBCQj9/8psgTYwWqBv0bJH+7IC+ewxZb2m3z1dMYwsFp8coTyMryaBVWb4trh0My3B + XT2OseKTL0iAiy35/SDbWV/5FljTuVmto5Jgglq6lB3uPpQVIGu46UY8kNKwuIdNseow + y4r+4w82KCHMoANJmlEPlFYb7xnmENPIdx0ZITs6ISjjvTICaf8nyA3OgqPCI5l3/DCb + 3plewsEuTwGiFXPqJx2ldY3gIwfH8D7w1MLxadUUL6o2fDRt0ZjFbJuUk/tiX/EM5MOL + W3dQ== +X-Gm-Message-State: APjAAAWIX+IMQ2tM7gV9yX2n6iqisUO1ysXCEYfl/P1BcWwlYgTk8xNq + /djn9P594uwGss08Ku8JA9E= +X-Google-Smtp-Source: + APXvYqzLPqJkNUviwDSfcaSYJH+eUFOLc0fBeZpgji797e/U5UAY6XAi9Cq7iKldElsnElvAmFWNCw== +X-Received: by 2002:a6b:8f15:: with SMTP id r21mr3490587iod.259.1568943406715; + Thu, 19 Sep 2019 18:36:46 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id x12sm335602ioh.76.2019.09.19.18.36.45 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Thu, 19 Sep 2019 18:36:45 -0700 (PDT) +From: Navid Emamdoost +To: +Subject: [PATCH] ath10k: fix memory leak +Date: Thu, 19 Sep 2019 20:36:26 -0500 +Message-Id: <20190920013632.30796-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20190919_183649_845813_A1A80F7F +X-CRM114-Status: UNSURE ( 7.25 ) +X-CRM114-Notice: Please train this message. +X-Spam-Score: -0.2 (/) +X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: + Content analysis details: (-0.2 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, + no trust [2607:f8b0:4864:20:0:0:0:d43 listed in] + [list.dnswl.org] + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + -0.0 SPF_PASS SPF: sender matches SPF record + 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider (navid.emamdoost[at]gmail.com) + -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature + -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from + author's domain + -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from + envelope-from domain + 0.1 DKIM_SIGNED Message has a DKIM or DK signature, + not necessarily + valid +X-BeenThere: ath10k@lists.infradead.org +X-Mailman-Version: 2.1.29 +Precedence: list +List-Id: +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Cc: linux-wireless@vger.kernel.org, kjlu@umn.edu, + linux-kernel@vger.kernel.org, + ath10k@lists.infradead.org, emamd001@umn.edu, smccaman@umn.edu, + netdev@vger.kernel.org, "David S. Miller" , + Kalle Valo , + Navid Emamdoost +MIME-Version: 1.0 +Sender: "ath10k" +Errors-To: + ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org + +In ath10k_usb_hif_tx_sg the allocated urb should be released if +usb_submit_urb fails. + +Signed-off-by: Navid Emamdoost +--- + drivers/net/wireless/ath/ath10k/usb.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/wireless/ath/ath10k/usb.c b/drivers/net/wireless/ath/ath10k/usb.c +index e1420f67f776..730ed22e08a0 100644 +--- a/drivers/net/wireless/ath/ath10k/usb.c ++++ b/drivers/net/wireless/ath/ath10k/usb.c +@@ -435,6 +435,7 @@ static int ath10k_usb_hif_tx_sg(struct ath10k *ar, u8 pipe_id, + ath10k_dbg(ar, ATH10K_DBG_USB_BULK, + "usb bulk transmit failed: %d\n", ret); + usb_unanchor_urb(urb); ++ usb_free_urb(urb); + ret = -EINVAL; + goto err_free_urb_to_pipe; + } diff --git a/kernel.spec b/kernel.spec index 39d98bd63..5c137697e 100644 --- a/kernel.spec +++ b/kernel.spec @@ -654,6 +654,19 @@ Patch524: media-rc-prevent-memory-leak-in-cx23888_ir_probe.patch # CVE-2019-19077 rhbz 1775724 1775725 Patch525: 0001-RDMA-Fix-goto-target-to-release-the-allocated-memory.patch +# CVE-2019-14895 rhbz 1774870 1776139 +Patch526: mwifiex-fix-possible-heap-overflow-in-mwifiex_process_country_ie.patch + +# CVE-2019-14896 rhbz 1774875 1776143 +# CVE-2019-14897 rhbz 1774879 1776146 +Patch527: libertas-Fix-two-buffer-overflows-at-parsing-bss-descriptor.patch + +# CVE-2019-14901 rhbz 1773519 1776184 +Patch528: mwifiex-Fix-heap-overflow-in-mmwifiex_process_tdls_action_frame.patch + +# CVE-2019-19078 rhbz 1776354 1776353 +Patch529: ath10k-fix-memory-leak.patch + # END OF PATCH DEFINITIONS %endif @@ -1855,7 +1868,14 @@ fi # # %changelog -* Mon Nov 25 2019 Laura Abbott - 5.3.13-300 +* Mon Nov 25 2019 Justin M. Forbes - 5.3.13-300 +- Fix CVE-2019-14895 (rhbz 1774870 1776139) +- Fix CVE-2019-14896 (rhbz 1774875 1776143) +- Fix CVE-2019-14897 (rhbz 1774879 1776146) +- Fix CVE-2019-14901 (rhbz 1773519 1776184) +- Fix CVE-2019-19078 (rhbz 1776354 1776353) + +* Mon Nov 25 2019 Laura Abbott - Linux v5.3.13 * Fri Nov 22 2019 Justin M. Forbes diff --git a/libertas-Fix-two-buffer-overflows-at-parsing-bss-descriptor.patch b/libertas-Fix-two-buffer-overflows-at-parsing-bss-descriptor.patch new file mode 100644 index 000000000..e8c4c4b64 --- /dev/null +++ b/libertas-Fix-two-buffer-overflows-at-parsing-bss-descriptor.patch @@ -0,0 +1,120 @@ +From patchwork Fri Nov 22 05:29:17 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: huangwenabc@gmail.com +X-Patchwork-Id: 11257187 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 032DA112B + for ; + Fri, 22 Nov 2019 05:29:36 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id D68A920707 + for ; + Fri, 22 Nov 2019 05:29:35 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com + header.b="WaDUta6X" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1726719AbfKVF3f (ORCPT + ); + Fri, 22 Nov 2019 00:29:35 -0500 +Received: from mail-pf1-f194.google.com ([209.85.210.194]:43041 "EHLO + mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1726529AbfKVF3e (ORCPT + ); + Fri, 22 Nov 2019 00:29:34 -0500 +Received: by mail-pf1-f194.google.com with SMTP id 3so2912048pfb.10 + for ; + Thu, 21 Nov 2019 21:29:34 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id; + bh=9G4UM2vhuEG4TSdFZTVuZ71GTOHLABBI6xxxI/2Oncw=; + b=WaDUta6XODn4hzzqR0np+iPcfBChaSE05EpSM8UrALWvgf7x/9f0e8SMvgXTGXaN74 + Irmx+lKSr5piR/mhpfRO+HVN7bu7ukOSsxCxlNav6kvJn3SG/q0TV9VGoWEKM+8yISrK + Bc5MtndhyGLDrWQFgc5fSdMf+/79HC0AWnnavMoEKxnAti/HKBQnIPreGoLnrWIpbhXZ + EdU3ei0kxlwAUbNl8/FywUG2qzQeoeh5RranVfooFhbBQ0QfNtx3k3ARWrVdT9uV7QtX + pcpYtJsjn94TXL0llHTzpE182eTvmUrzxf89ubigJh+EYnryHC+HUHZoVtjYtbjidWoV + I0FQ== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=9G4UM2vhuEG4TSdFZTVuZ71GTOHLABBI6xxxI/2Oncw=; + b=gNC3IOfmB1H65frnsn63mdzaxphxG6xvR0SHEIOJSaWI/Jx9VK+CfnGr+7pOQZ/Pyw + wORhpVi6EbFsE7mVKbjlJ7O96hk14FnUKSPVOhl9NH4xXBktd7sJc5Z36N3J6RRv9Cfc + gQWPy1otHKeNz1riMgHcbkaiKj3CANpJ6gaAE/R8EjWLXjS7Bw/vBgQSr5WnAVV27Ppw + Flrks3Qv8BGkRUCymKArD05r646Fx1ew/FI7oGyKQhxxWJPuv5RoVTGPbAC1unU+zjfN + 2XNdr1yKKfY4R5S8q49FeHsN5Mb+lmriUPdLPL062UzQ7x/pTzfh3rI9Lf92jMJiJ9/n + 9zPw== +X-Gm-Message-State: APjAAAVgSeSrlZfb2Ch2KXDFaNq6RLCJCvq40zW4toublIDi1zh7feyc + srNh0xN+iNrBCzEMbsxDKJS2IOoUYXc= +X-Google-Smtp-Source: + APXvYqwPwHZStvNKOZtUBWgPYiEFiNFqEQLMngqNoFN6jFqDKFjISduUPDUYh2y907mFwD+Qn6zs9w== +X-Received: by 2002:a63:7456:: with SMTP id + e22mr14245471pgn.314.1574400573682; + Thu, 21 Nov 2019 21:29:33 -0800 (PST) +Received: from localhost ([38.121.20.202]) + by smtp.gmail.com with ESMTPSA id + x192sm5658165pfd.96.2019.11.21.21.29.32 + (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); + Thu, 21 Nov 2019 21:29:32 -0800 (PST) +From: huangwenabc@gmail.com +To: linux-wireless@vger.kernel.org +Cc: linux-distros@vs.openwall.org, security@kernel.org, + libertas-dev@lists.infradead.org +Subject: [PATCH] libertas: Fix two buffer overflows at parsing bss descriptor +Date: Fri, 22 Nov 2019 13:29:17 +0800 +Message-Id: <20191122052917.11309-1-huangwenabc@gmail.com> +X-Mailer: git-send-email 2.17.1 +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +From: Wen Huang + +add_ie_rates() copys rates without checking the length +in bss descriptor from remote AP.when victim connects to +remote attacker, this may trigger buffer overflow. +lbs_ibss_join_existing() copys rates without checking the length +in bss descriptor from remote IBSS node.when victim connects to +remote attacker, this may trigger buffer overflow. +Fix them by putting the length check before performing copy. + +This fix addresses CVE-2019-14896 and CVE-2019-14897. + +Signed-off-by: Wen Huang +--- + drivers/net/wireless/marvell/libertas/cfg.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/net/wireless/marvell/libertas/cfg.c b/drivers/net/wireless/marvell/libertas/cfg.c +index 57edfada0..290280764 100644 +--- a/drivers/net/wireless/marvell/libertas/cfg.c ++++ b/drivers/net/wireless/marvell/libertas/cfg.c +@@ -273,6 +273,10 @@ add_ie_rates(u8 *tlv, const u8 *ie, int *nrates) + int hw, ap, ap_max = ie[1]; + u8 hw_rate; + ++ if (ap_max > MAX_RATES) { ++ lbs_deb_assoc("invalid rates\n"); ++ return tlv; ++ } + /* Advance past IE header */ + ie += 2; + +@@ -1777,6 +1781,10 @@ static int lbs_ibss_join_existing(struct lbs_private *priv, + } else { + int hw, i; + u8 rates_max = rates_eid[1]; ++ if (rates_max > MAX_RATES) { ++ lbs_deb_join("invalid rates"); ++ goto out; ++ } + u8 *rates = cmd.bss.rates; + for (hw = 0; hw < ARRAY_SIZE(lbs_rates); hw++) { + u8 hw_rate = lbs_rates[hw].bitrate / 5; diff --git a/mwifiex-Fix-heap-overflow-in-mmwifiex_process_tdls_action_frame.patch b/mwifiex-Fix-heap-overflow-in-mmwifiex_process_tdls_action_frame.patch new file mode 100644 index 000000000..bfd39e5a9 --- /dev/null +++ b/mwifiex-Fix-heap-overflow-in-mmwifiex_process_tdls_action_frame.patch @@ -0,0 +1,226 @@ +From patchwork Fri Nov 22 09:43:49 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: qize wang +X-Patchwork-Id: 11257535 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 311581390 + for ; + Fri, 22 Nov 2019 09:44:01 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 09A6920708 + for ; + Fri, 22 Nov 2019 09:44:01 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com + header.b="gFC1GPvm" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1726802AbfKVJoA (ORCPT + ); + Fri, 22 Nov 2019 04:44:00 -0500 +Received: from mail-pj1-f65.google.com ([209.85.216.65]:35154 "EHLO + mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1726500AbfKVJoA (ORCPT + ); + Fri, 22 Nov 2019 04:44:00 -0500 +Received: by mail-pj1-f65.google.com with SMTP id s8so2836990pji.2 + for ; + Fri, 22 Nov 2019 01:43:57 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=from:content-transfer-encoding:mime-version:subject:message-id:date + :cc:to; + bh=1kENrBK+Si8GTG/z7vluv90p0vaDDTLdLP0ZTBYtdys=; + b=gFC1GPvmciglvQH3QRWVdrtGLMliah1xCIA8nZta7Mis7sATxTwTG/XMZ/G4Zb8efA + bvc58q+E3uHBiZOOCVFqZrDhJzM1SJVkOtFKPIquJLhmKms1Rd7FLwLFKwbq9DKE28C4 + crZUPOja7RMESC2jajleQdZ9YO/o/LEA+6QmEKIQFZ11R7j/qT/bNTdf08hDTINa7VVq + r20OL/q5iTBYBqodQaQVOPHH7f8iRs46gS/23GSX8E8Lo920r4wtTUPXXBidt0bay7ID + L2CF8vLLDGRe4Dohd71wCJgl54yVxF1Fi9qAvQluyVTulAtDVNw8Ol9hFdLa9R7j2M2z + 9wWw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:from:content-transfer-encoding:mime-version + :subject:message-id:date:cc:to; + bh=1kENrBK+Si8GTG/z7vluv90p0vaDDTLdLP0ZTBYtdys=; + b=lGAdjvr9L1WcGIvtpY5RO07jVV2t+CQ7rGsSqHcqyoDarWzcfl+FowtU0U+OV0Uf0k + Dxs4mJ+rml43X7SrPljpiHzQB1mRWWnTcIKwO9YFH1DbuMxYpTV/AdDtkyLGwQEPCTu2 + U/RIv2CvLNWTGQYXAqUH4wZJ0MAo0w2fWX8QeMCWarAPRgOsyeT9LEZQT6ypWzy9bAKs + ri4P+HqxmhlvDFb3ij0pl0x7hhOOhDCSdzZEfy8MGL/wmxdbOLM5AV8DevGNLEZHZrJ9 + AHHgRlkUPn5esIeIhTiYu3hox+z4GLrcRZccqcL3O9QM9rKX6SyNF9MjoEIgD5WK7ycl + Tlvg== +X-Gm-Message-State: APjAAAVLU8HZian8Pqy8r1Iwnjga8cqc70tKNQWQHXIQ/WEWDgKWDzip + dkM+yuOUv3M4BD3u8wHsttGE4Sk9BqOSqA== +X-Google-Smtp-Source: + APXvYqxWR1wx4sFD+yyfHofiemrR7B+b6xLDxQu9tS4dKDTYtMBUggkRWVG0Y4CUsP1DbHGVYW2rGg== +X-Received: by 2002:a17:90a:c004:: with SMTP id + p4mr17937350pjt.104.1574415837353; + Fri, 22 Nov 2019 01:43:57 -0800 (PST) +Received: from [127.0.0.1] (187.220.92.34.bc.googleusercontent.com. + [34.92.220.187]) + by smtp.gmail.com with ESMTPSA id + 71sm6800121pfx.107.2019.11.22.01.43.52 + (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Fri, 22 Nov 2019 01:43:56 -0800 (PST) +From: qize wang +Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) +Subject: [PATCH] mwifiex: Fix heap overflow in + mmwifiex_process_tdls_action_frame() +Message-Id: +Date: Fri, 22 Nov 2019 17:43:49 +0800 +Cc: amitkarwar , nishants , + gbhat , huxinming820 , + kvalo , Greg KH , + security , + linux-distros , + "dan.carpenter" , + Solar Designer +To: linux-wireless@vger.kernel.org +X-Mailer: Apple Mail (2.3445.6.18) +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +mwifiex_process_tdls_action_frame() without checking +the incoming tdls infomation element's vality before use it, +this may cause multi heap buffer overflows. + +Fix them by putting vality check before use it. + +Signed-off-by: qize wang +--- +drivers/net/wireless/marvell/mwifiex/tdls.c | 70 ++++++++++++++++++++++++++--- +1 file changed, 64 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/wireless/marvell/mwifiex/tdls.c b/drivers/net/wireless/marvell/mwifiex/tdls.c +index 18e654d..7f60214 100644 +--- a/drivers/net/wireless/marvell/mwifiex/tdls.c ++++ b/drivers/net/wireless/marvell/mwifiex/tdls.c +@@ -954,59 +954,117 @@ void mwifiex_process_tdls_action_frame(struct mwifiex_private *priv, + + switch (*pos) { + case WLAN_EID_SUPP_RATES: ++ if (pos[1] > 32) ++ return; + sta_ptr->tdls_cap.rates_len = pos[1]; + for (i = 0; i < pos[1]; i++) + sta_ptr->tdls_cap.rates[i] = pos[i + 2]; + break; + + case WLAN_EID_EXT_SUPP_RATES: ++ if (pos[1] > 32) ++ return; + basic = sta_ptr->tdls_cap.rates_len; ++ if (pos[1] > 32 - basic) ++ return; + for (i = 0; i < pos[1]; i++) + sta_ptr->tdls_cap.rates[basic + i] = pos[i + 2]; + sta_ptr->tdls_cap.rates_len += pos[1]; + break; + case WLAN_EID_HT_CAPABILITY: +- memcpy((u8 *)&sta_ptr->tdls_cap.ht_capb, pos, ++ if (pos > end - sizeof(struct ieee80211_ht_cap) - 2) ++ return; ++ if (pos[1] != sizeof(struct ieee80211_ht_cap)) ++ return; ++ /* copy the ie's value into ht_capb*/ ++ memcpy((u8 *)&sta_ptr->tdls_cap.ht_capb, pos + 2, + sizeof(struct ieee80211_ht_cap)); + sta_ptr->is_11n_enabled = 1; + break; + case WLAN_EID_HT_OPERATION: +- memcpy(&sta_ptr->tdls_cap.ht_oper, pos, ++ if (pos > end - ++ sizeof(struct ieee80211_ht_operation) - 2) ++ return; ++ if (pos[1] != sizeof(struct ieee80211_ht_operation)) ++ return; ++ /* copy the ie's value into ht_oper*/ ++ memcpy(&sta_ptr->tdls_cap.ht_oper, pos + 2, + sizeof(struct ieee80211_ht_operation)); + break; + case WLAN_EID_BSS_COEX_2040: ++ if (pos > end - 3) ++ return; ++ if (pos[1] != 1) ++ return; + sta_ptr->tdls_cap.coex_2040 = pos[2]; + break; + case WLAN_EID_EXT_CAPABILITY: ++ if (pos > end - sizeof(struct ieee_types_header)) ++ return; ++ if (pos[1] < sizeof(struct ieee_types_header)) ++ return; ++ if (pos[1] > 8) ++ return; + memcpy((u8 *)&sta_ptr->tdls_cap.extcap, pos, + sizeof(struct ieee_types_header) + + min_t(u8, pos[1], 8)); + break; + case WLAN_EID_RSN: ++ if (pos > end - sizeof(struct ieee_types_header)) ++ return; ++ if (pos[1] < sizeof(struct ieee_types_header)) ++ return; ++ if (pos[1] > IEEE_MAX_IE_SIZE - ++ sizeof(struct ieee_types_header)) ++ return; + memcpy((u8 *)&sta_ptr->tdls_cap.rsn_ie, pos, + sizeof(struct ieee_types_header) + + min_t(u8, pos[1], IEEE_MAX_IE_SIZE - + sizeof(struct ieee_types_header))); + break; + case WLAN_EID_QOS_CAPA: ++ if (pos > end - 3) ++ return; ++ if (pos[1] != 1) ++ return; + sta_ptr->tdls_cap.qos_info = pos[2]; + break; + case WLAN_EID_VHT_OPERATION: +- if (priv->adapter->is_hw_11ac_capable) +- memcpy(&sta_ptr->tdls_cap.vhtoper, pos, ++ if (priv->adapter->is_hw_11ac_capable) { ++ if (pos > end - ++ sizeof(struct ieee80211_vht_operation) - 2) ++ return; ++ if (pos[1] != ++ sizeof(struct ieee80211_vht_operation)) ++ return; ++ /* copy the ie's value into vhtoper*/ ++ memcpy(&sta_ptr->tdls_cap.vhtoper, pos + 2, + sizeof(struct ieee80211_vht_operation)); ++ } + break; + case WLAN_EID_VHT_CAPABILITY: + if (priv->adapter->is_hw_11ac_capable) { +- memcpy((u8 *)&sta_ptr->tdls_cap.vhtcap, pos, ++ if (pos > end - ++ sizeof(struct ieee80211_vht_cap) - 2) ++ return; ++ if (pos[1] != sizeof(struct ieee80211_vht_cap)) ++ return; ++ /* copy the ie's value into vhtcap*/ ++ memcpy((u8 *)&sta_ptr->tdls_cap.vhtcap, pos + 2, + sizeof(struct ieee80211_vht_cap)); + sta_ptr->is_11ac_enabled = 1; + } + break; + case WLAN_EID_AID: +- if (priv->adapter->is_hw_11ac_capable) ++ if (priv->adapter->is_hw_11ac_capable) { ++ if (pos > end - 4) ++ return; ++ if (pos[1] != 2) ++ return; + sta_ptr->tdls_cap.aid = + get_unaligned_le16((pos + 2)); ++ } ++ break; + default: + break; + } diff --git a/mwifiex-fix-possible-heap-overflow-in-mwifiex_process_country_ie.patch b/mwifiex-fix-possible-heap-overflow-in-mwifiex_process_country_ie.patch new file mode 100644 index 000000000..c006a9b2c --- /dev/null +++ b/mwifiex-fix-possible-heap-overflow-in-mwifiex_process_country_ie.patch @@ -0,0 +1,129 @@ +From patchwork Thu Nov 21 16:04:38 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Ganapathi Bhat +X-Patchwork-Id: 11256477 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AAABF138C + for ; + Thu, 21 Nov 2019 16:04:48 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 8950220637 + for ; + Thu, 21 Nov 2019 16:04:48 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com + header.b="nkGygBtm" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1727141AbfKUQEs (ORCPT + ); + Thu, 21 Nov 2019 11:04:48 -0500 +Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:6582 "EHLO + mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) + by vger.kernel.org with ESMTP id S1726980AbfKUQEr (ORCPT + ); + Thu, 21 Nov 2019 11:04:47 -0500 +Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) + by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id + xALFu718003199; + Thu, 21 Nov 2019 08:04:44 -0800 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; + h=from : to : cc : + subject : date : message-id : mime-version : content-type; s=pfpt0818; + bh=o/oIGGHPmwt5MFTKPl2GcISKabBWhPBOdPXPhlV+8H8=; + b=nkGygBtmdc1LxIp0VzpsKssm8mQFI+syng1Rek/N5Fx3Vz4o2KAlRceJkhXNdV7WpjTG + XDtRj/LiYd+OAIqSLM6J2VNtOKOhaNSDydtTUnIi4imHPzYoAdESDQW5aFV8JKZqOfYx + 0oQTjw6AhdjJCsngL+bImzmnJoZsc2gUu3BAic/kW+6Uj0JCgQwoUFBH9rNaO+Q33BY+ + dZy9MdKD905LxSBE7A5xWx5GEgrqRcvfxSOu2K78FQhsJ20suhvWSobxpYE0LIrajl6s + oQGuDbTsdOO/8v7D9Xn7zObUH6qZ08AMxDZNaBLqiKpjFY/RA7LbR2eulwEnhjCLDQfK uA== +Received: from sc-exch03.marvell.com ([199.233.58.183]) + by mx0b-0016f401.pphosted.com with ESMTP id 2wd090yntp-1 + (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); + Thu, 21 Nov 2019 08:04:44 -0800 +Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com + (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 21 Nov + 2019 08:04:43 -0800 +Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com + (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend + Transport; Thu, 21 Nov 2019 08:04:43 -0800 +Received: from testmailhost.marvell.com (testmailhost.marvell.com + [10.31.130.105]) + by maili.marvell.com (Postfix) with ESMTP id 898743F703F; + Thu, 21 Nov 2019 08:04:40 -0800 (PST) +From: Ganapathi Bhat +To: +CC: Cathy Luo , Zhiyuan Yang , + James Cao , + Rakesh Parmar , + Brian Norris , + Mohammad Tausif Siddiqui , + huangwen , + Ganapathi Bhat +Subject: [PATCH] mwifiex: fix possible heap overflow in + mwifiex_process_country_ie() +Date: Thu, 21 Nov 2019 21:34:38 +0530 +Message-ID: <1574352278-7592-1-git-send-email-gbhat@marvell.com> +X-Mailer: git-send-email 1.9.1 +MIME-Version: 1.0 +X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 + definitions=2019-11-21_03:2019-11-21,2019-11-21 signatures=0 +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +mwifiex_process_country_ie() function parse elements of bss +descriptor in beacon packet. When processing WLAN_EID_COUNTRY +element, there is no upper limit check for country_ie_len before +calling memcpy. The destination buffer domain_info->triplet is an +array of length MWIFIEX_MAX_TRIPLET_802_11D(83). The remote +attacker can build a fake AP with the same ssid as real AP, and +send malicous beacon packet with long WLAN_EID_COUNTRY elemen +(country_ie_len > 83). Attacker can force STA connect to fake AP +on a different channel. When the victim STA connects to fake AP, +will trigger the heap buffer overflow. Fix this by checking for +length and if found invalid, don not connect to the AP. + +This fix addresses CVE-2019-14895. + +Reported-by: huangwen +Signed-off-by: Ganapathi Bhat +--- + drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c +index 74e5056..6dd835f 100644 +--- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c ++++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c +@@ -229,6 +229,14 @@ static int mwifiex_process_country_ie(struct mwifiex_private *priv, + "11D: skip setting domain info in FW\n"); + return 0; + } ++ ++ if (country_ie_len > ++ (IEEE80211_COUNTRY_STRING_LEN + MWIFIEX_MAX_TRIPLET_802_11D)) { ++ mwifiex_dbg(priv->adapter, ERROR, ++ "11D: country_ie_len overflow!, deauth AP\n"); ++ return -EINVAL; ++ } ++ + memcpy(priv->adapter->country_code, &country_ie[2], 2); + + domain_info->country_code[0] = country_ie[2]; +@@ -272,8 +280,9 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, + priv->scan_block = false; + + if (bss) { +- if (adapter->region_code == 0x00) +- mwifiex_process_country_ie(priv, bss); ++ if (adapter->region_code == 0x00 && ++ mwifiex_process_country_ie(priv, bss)) ++ return -EINVAL; + + /* Allocate and fill new bss descriptor */ + bss_desc = kzalloc(sizeof(struct mwifiex_bssdescriptor), From bf6e2e5c451ec4c8cf99792c5174aed9fa65c6e1 Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Tue, 26 Nov 2019 08:30:00 -0600 Subject: [PATCH 046/178] Fix CVE-2019-19082 --- ...-drm-amd-display-prevent-memory-leak.patch | 82 +++++++++++++++++++ kernel.spec | 6 ++ 2 files changed, 88 insertions(+) create mode 100644 0001-drm-amd-display-prevent-memory-leak.patch diff --git a/0001-drm-amd-display-prevent-memory-leak.patch b/0001-drm-amd-display-prevent-memory-leak.patch new file mode 100644 index 000000000..e74ad2913 --- /dev/null +++ b/0001-drm-amd-display-prevent-memory-leak.patch @@ -0,0 +1,82 @@ +From 104c307147ad379617472dd91a5bcb368d72bd6d Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Tue, 24 Sep 2019 23:23:56 -0500 +Subject: [PATCH] drm/amd/display: prevent memory leak + +In dcn*_create_resource_pool the allocated memory should be released if +construct pool fails. + +Reviewed-by: Harry Wentland +Signed-off-by: Navid Emamdoost +Signed-off-by: Alex Deucher +--- + drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 1 + + drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 1 + + drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 1 + + drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c | 1 + + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 1 + + 5 files changed, 5 insertions(+) + +diff --git a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +index afc61055eca1..1787b9bf800a 100644 +--- a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c ++++ b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +@@ -1091,6 +1091,7 @@ struct resource_pool *dce100_create_resource_pool( + if (construct(num_virtual_links, dc, pool)) + return &pool->base; + ++ kfree(pool); + BREAK_TO_DEBUGGER(); + return NULL; + } +diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +index c66fe170e1e8..318e9c2e2ca8 100644 +--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c ++++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +@@ -1462,6 +1462,7 @@ struct resource_pool *dce110_create_resource_pool( + if (construct(num_virtual_links, dc, pool, asic_id)) + return &pool->base; + ++ kfree(pool); + BREAK_TO_DEBUGGER(); + return NULL; + } +diff --git a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +index 2b3a2917c168..83e1878161c9 100644 +--- a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c ++++ b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +@@ -1342,6 +1342,7 @@ struct resource_pool *dce112_create_resource_pool( + if (construct(num_virtual_links, dc, pool)) + return &pool->base; + ++ kfree(pool); + BREAK_TO_DEBUGGER(); + return NULL; + } +diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +index 236c4c0324b1..8b85e5274bba 100644 +--- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c ++++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +@@ -1208,6 +1208,7 @@ struct resource_pool *dce120_create_resource_pool( + if (construct(num_virtual_links, dc, pool)) + return &pool->base; + ++ kfree(pool); + BREAK_TO_DEBUGGER(); + return NULL; + } +diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +index 5a89e462e7cc..59305e411a66 100644 +--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +@@ -1570,6 +1570,7 @@ struct resource_pool *dcn10_create_resource_pool( + if (construct(init_data->num_virtual_links, dc, pool)) + return &pool->base; + ++ kfree(pool); + BREAK_TO_DEBUGGER(); + return NULL; + } +-- +2.23.0 + diff --git a/kernel.spec b/kernel.spec index 5c137697e..3f5c4f2b8 100644 --- a/kernel.spec +++ b/kernel.spec @@ -667,6 +667,9 @@ Patch528: mwifiex-Fix-heap-overflow-in-mmwifiex_process_tdls_action_frame.patch # CVE-2019-19078 rhbz 1776354 1776353 Patch529: ath10k-fix-memory-leak.patch +# CVE-2019-19082 rhbz 1776832 1776833 +Patch530: 0001-drm-amd-display-prevent-memory-leak.patch + # END OF PATCH DEFINITIONS %endif @@ -1868,6 +1871,9 @@ fi # # %changelog +* Tue Nov 26 2019 Justin M. Forbes +- Fix CVE-2019-19082 (rhbz 1776832 1776833) + * Mon Nov 25 2019 Justin M. Forbes - 5.3.13-300 - Fix CVE-2019-14895 (rhbz 1774870 1776139) - Fix CVE-2019-14896 (rhbz 1774875 1776143) From fbd3f73ad4da4ae212c7eaee500e78d623b6a74b Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Mon, 2 Dec 2019 09:14:44 -0600 Subject: [PATCH 047/178] Fix CVE-2019-18808 CVE-2019-18809 CVE-2019-18811 CVE-2019-18812 CVE-2019-16232 --- ...ix-memory-leak-in-sof_dfsentry_write.patch | 37 +++++++++++++++++ ...-memory-leak-in-sof_set_get_large_ct.patch | 37 +++++++++++++++++ ...se-all-allocated-memory-if-sha-type-.patch | 37 +++++++++++++++++ ...a-potential-NULL-pointer-dereference.patch | 40 +++++++++++++++++++ ...memory-leak-in-af9005_identify_state.patch | 36 +++++++++++++++++ kernel.spec | 22 ++++++++++ 6 files changed, 209 insertions(+) create mode 100644 0001-ASoC-SOF-Fix-memory-leak-in-sof_dfsentry_write.patch create mode 100644 0001-ASoC-SOF-ipc-Fix-memory-leak-in-sof_set_get_large_ct.patch create mode 100644 0001-crypto-ccp-Release-all-allocated-memory-if-sha-type-.patch create mode 100644 0001-libertas-fix-a-potential-NULL-pointer-dereference.patch create mode 100644 0001-media-usb-fix-memory-leak-in-af9005_identify_state.patch diff --git a/0001-ASoC-SOF-Fix-memory-leak-in-sof_dfsentry_write.patch b/0001-ASoC-SOF-Fix-memory-leak-in-sof_dfsentry_write.patch new file mode 100644 index 000000000..587a2acd1 --- /dev/null +++ b/0001-ASoC-SOF-Fix-memory-leak-in-sof_dfsentry_write.patch @@ -0,0 +1,37 @@ +From c0a333d842ef67ac04adc72ff79dc1ccc3dca4ed Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Sun, 27 Oct 2019 14:48:47 -0500 +Subject: [PATCH] ASoC: SOF: Fix memory leak in sof_dfsentry_write + +In the implementation of sof_dfsentry_write() memory allocated for +string is leaked in case of an error. Go to error handling path if the +d_name.name is not valid. + +Fixes: 091c12e1f50c ("ASoC: SOF: debug: add new debugfs entries for IPC flood test") +Signed-off-by: Navid Emamdoost +Link: https://lore.kernel.org/r/20191027194856.4056-1-navid.emamdoost@gmail.com +Signed-off-by: Mark Brown +--- + sound/soc/sof/debug.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c +index 54cd431faab7..5529e8eeca46 100644 +--- a/sound/soc/sof/debug.c ++++ b/sound/soc/sof/debug.c +@@ -152,8 +152,10 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer, + * in the debugfs entry. + */ + if (strcmp(dfse->dfsentry->d_name.name, "ipc_flood_count") && +- strcmp(dfse->dfsentry->d_name.name, "ipc_flood_duration_ms")) +- return -EINVAL; ++ strcmp(dfse->dfsentry->d_name.name, "ipc_flood_duration_ms")) { ++ ret = -EINVAL; ++ goto out; ++ } + + if (!strcmp(dfse->dfsentry->d_name.name, "ipc_flood_duration_ms")) + flood_duration_test = true; +-- +2.23.0 + diff --git a/0001-ASoC-SOF-ipc-Fix-memory-leak-in-sof_set_get_large_ct.patch b/0001-ASoC-SOF-ipc-Fix-memory-leak-in-sof_set_get_large_ct.patch new file mode 100644 index 000000000..2ebcb13ab --- /dev/null +++ b/0001-ASoC-SOF-ipc-Fix-memory-leak-in-sof_set_get_large_ct.patch @@ -0,0 +1,37 @@ +From 45c1380358b12bf2d1db20a5874e9544f56b34ab Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Sun, 27 Oct 2019 16:53:24 -0500 +Subject: [PATCH] ASoC: SOF: ipc: Fix memory leak in + sof_set_get_large_ctrl_data + +In the implementation of sof_set_get_large_ctrl_data() there is a memory +leak in case an error. Release partdata if sof_get_ctrl_copy_params() +fails. + +Fixes: 54d198d5019d ("ASoC: SOF: Propagate sof_get_ctrl_copy_params() error properly") +Signed-off-by: Navid Emamdoost +Link: https://lore.kernel.org/r/20191027215330.12729-1-navid.emamdoost@gmail.com +Signed-off-by: Mark Brown +--- + sound/soc/sof/ipc.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c +index b2f359d2f7e5..086eeeab8679 100644 +--- a/sound/soc/sof/ipc.c ++++ b/sound/soc/sof/ipc.c +@@ -572,8 +572,10 @@ static int sof_set_get_large_ctrl_data(struct snd_sof_dev *sdev, + else + err = sof_get_ctrl_copy_params(cdata->type, partdata, cdata, + sparams); +- if (err < 0) ++ if (err < 0) { ++ kfree(partdata); + return err; ++ } + + msg_bytes = sparams->msg_bytes; + pl_size = sparams->pl_size; +-- +2.23.0 + diff --git a/0001-crypto-ccp-Release-all-allocated-memory-if-sha-type-.patch b/0001-crypto-ccp-Release-all-allocated-memory-if-sha-type-.patch new file mode 100644 index 000000000..fc8bde000 --- /dev/null +++ b/0001-crypto-ccp-Release-all-allocated-memory-if-sha-type-.patch @@ -0,0 +1,37 @@ +From 128c66429247add5128c03dc1e144ca56f05a4e2 Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Thu, 19 Sep 2019 11:04:48 -0500 +Subject: [PATCH] crypto: ccp - Release all allocated memory if sha type is + invalid + +Release all allocated memory if sha type is invalid: +In ccp_run_sha_cmd, if the type of sha is invalid, the allocated +hmac_buf should be released. + +v2: fix the goto. + +Signed-off-by: Navid Emamdoost +Acked-by: Gary R Hook +Signed-off-by: Herbert Xu +--- + drivers/crypto/ccp/ccp-ops.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c +index c8da8eb160da..422193690fd4 100644 +--- a/drivers/crypto/ccp/ccp-ops.c ++++ b/drivers/crypto/ccp/ccp-ops.c +@@ -1777,8 +1777,9 @@ ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd) + LSB_ITEM_SIZE); + break; + default: ++ kfree(hmac_buf); + ret = -EINVAL; +- goto e_ctx; ++ goto e_data; + } + + memset(&hmac_cmd, 0, sizeof(hmac_cmd)); +-- +2.23.0 + diff --git a/0001-libertas-fix-a-potential-NULL-pointer-dereference.patch b/0001-libertas-fix-a-potential-NULL-pointer-dereference.patch new file mode 100644 index 000000000..efdc46d68 --- /dev/null +++ b/0001-libertas-fix-a-potential-NULL-pointer-dereference.patch @@ -0,0 +1,40 @@ +From 7da413a18583baaf35dd4a8eb414fa410367d7f2 Mon Sep 17 00:00:00 2001 +From: Allen Pais +Date: Wed, 18 Sep 2019 22:05:00 +0530 +Subject: [PATCH] libertas: fix a potential NULL pointer dereference + +alloc_workqueue is not checked for errors and as a result, +a potential NULL dereference could occur. + +Signed-off-by: Allen Pais +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/marvell/libertas/if_sdio.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/net/wireless/marvell/libertas/if_sdio.c b/drivers/net/wireless/marvell/libertas/if_sdio.c +index 242d8845da3f..30f1025ecb9b 100644 +--- a/drivers/net/wireless/marvell/libertas/if_sdio.c ++++ b/drivers/net/wireless/marvell/libertas/if_sdio.c +@@ -1179,6 +1179,10 @@ static int if_sdio_probe(struct sdio_func *func, + + spin_lock_init(&card->lock); + card->workqueue = alloc_workqueue("libertas_sdio", WQ_MEM_RECLAIM, 0); ++ if (unlikely(!card->workqueue)) { ++ ret = -ENOMEM; ++ goto err_queue; ++ } + INIT_WORK(&card->packet_worker, if_sdio_host_to_card_worker); + init_waitqueue_head(&card->pwron_waitq); + +@@ -1230,6 +1234,7 @@ static int if_sdio_probe(struct sdio_func *func, + lbs_remove_card(priv); + free: + destroy_workqueue(card->workqueue); ++err_queue: + while (card->packets) { + packet = card->packets; + card->packets = card->packets->next; +-- +2.23.0 + diff --git a/0001-media-usb-fix-memory-leak-in-af9005_identify_state.patch b/0001-media-usb-fix-memory-leak-in-af9005_identify_state.patch new file mode 100644 index 000000000..13aae5af8 --- /dev/null +++ b/0001-media-usb-fix-memory-leak-in-af9005_identify_state.patch @@ -0,0 +1,36 @@ +From 2289adbfa559050d2a38bcd9caac1c18b800e928 Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Wed, 9 Oct 2019 12:01:47 -0300 +Subject: [PATCH] media: usb: fix memory leak in af9005_identify_state + +In af9005_identify_state when returning -EIO the allocated buffer should +be released. Replace the "return -EIO" with assignment into ret and move +deb_info() under a check. + +Fixes: af4e067e1dcf ("V4L/DVB (5625): Add support for the AF9005 demodulator from Afatech") +Signed-off-by: Navid Emamdoost +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +--- + drivers/media/usb/dvb-usb/af9005.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/usb/dvb-usb/af9005.c b/drivers/media/usb/dvb-usb/af9005.c +index 02697d86e8c1..ac93e88d7038 100644 +--- a/drivers/media/usb/dvb-usb/af9005.c ++++ b/drivers/media/usb/dvb-usb/af9005.c +@@ -976,8 +976,9 @@ static int af9005_identify_state(struct usb_device *udev, + else if (reply == 0x02) + *cold = 0; + else +- return -EIO; +- deb_info("Identify state cold = %d\n", *cold); ++ ret = -EIO; ++ if (!ret) ++ deb_info("Identify state cold = %d\n", *cold); + + err: + kfree(buf); +-- +2.23.0 + diff --git a/kernel.spec b/kernel.spec index 3f5c4f2b8..f45e110c5 100644 --- a/kernel.spec +++ b/kernel.spec @@ -670,6 +670,21 @@ Patch529: ath10k-fix-memory-leak.patch # CVE-2019-19082 rhbz 1776832 1776833 Patch530: 0001-drm-amd-display-prevent-memory-leak.patch +# CVE-2019-18808 rhbz 1777418 1777421 +Patch531: 0001-crypto-ccp-Release-all-allocated-memory-if-sha-type-.patch + +# CVE-2019-18809 rhbz 1777449 1777451 +Patch532: 0001-media-usb-fix-memory-leak-in-af9005_identify_state.patch + +# CVE-2019-18811 rhbz 1777455 1777456 +Patch533: 0001-ASoC-SOF-ipc-Fix-memory-leak-in-sof_set_get_large_ct.patch + +# CVE-2019-18812 rhbz 1777458 1777459 +Patch534: 0001-ASoC-SOF-Fix-memory-leak-in-sof_dfsentry_write.patch + +# CVE-2019-16232 rhbz 1760351 1760352 +Patch535: 0001-libertas-fix-a-potential-NULL-pointer-dereference.patch + # END OF PATCH DEFINITIONS %endif @@ -1871,6 +1886,13 @@ fi # # %changelog +* Mon Dec 02 2019 Justin M. Forbes +- Fix CVE-2019-18808 (rhbz 1777418 1777421) +- Fix CVE-2019-18809 (rhbz 1777449 1777451) +- Fix CVE-2019-18811 (rhbz 1777455 1777456) +- Fix CVE-2019-18812 (rhbz 1777458 1777459) +- Fix CVE-2019-16232 (rhbz 1760351 1760352) + * Tue Nov 26 2019 Justin M. Forbes - Fix CVE-2019-19082 (rhbz 1776832 1776833) From da7e076b233966319134542bfbdda46388d420ba Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Mon, 2 Dec 2019 10:20:33 -0500 Subject: [PATCH 048/178] Linux v5.3.14 --- kernel.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel.spec b/kernel.spec index f45e110c5..1a68436c9 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 13 +%define stable_update 14 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -1886,6 +1886,9 @@ fi # # %changelog +* Mon Dec 02 2019 Laura Abbott - 5.3.14-300 +- Linux v5.3.14 + * Mon Dec 02 2019 Justin M. Forbes - Fix CVE-2019-18808 (rhbz 1777418 1777421) - Fix CVE-2019-18809 (rhbz 1777449 1777451) diff --git a/sources b/sources index b89afbfd2..37ff8495b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.13.xz) = 3df94df06bc296d2edbeb5a409702da3a9d3d8394df9ffa3f01ab745726505b84078cefe352d38955d62d6bbede975450646093858e786eaf7416c46eec33972 +SHA512 (patch-5.3.14.xz) = 96ccee690694a03beffc26edde7e1d9d2e43acdc33098d56c0965cdccb321337d34190ebab0b64663b03d4aa76edb1474dd86b0943385a572aa595fc76b5ec8b From 5750778493874b553e3be9d718266c915e30d434 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Wed, 4 Dec 2019 09:56:50 -0500 Subject: [PATCH 049/178] Add powerpc virt fix (rhbz 1769600) --- kernel.spec | 6 + ...emap-of-ESB-pages-for-LSI-interrupts.patch | 175 ++++++++++++++++++ 2 files changed, 181 insertions(+) create mode 100644 powerpc-xive-skip-ioremap-of-ESB-pages-for-LSI-interrupts.patch diff --git a/kernel.spec b/kernel.spec index 1a68436c9..2805f3e8f 100644 --- a/kernel.spec +++ b/kernel.spec @@ -685,6 +685,9 @@ Patch534: 0001-ASoC-SOF-Fix-memory-leak-in-sof_dfsentry_write.patch # CVE-2019-16232 rhbz 1760351 1760352 Patch535: 0001-libertas-fix-a-potential-NULL-pointer-dereference.patch +# rhbz 1769600 +Patch536: powerpc-xive-skip-ioremap-of-ESB-pages-for-LSI-interrupts.patch + # END OF PATCH DEFINITIONS %endif @@ -1886,6 +1889,9 @@ fi # # %changelog +* Wed Dec 04 2019 Laura Abbott +- Add powerpc virt fix (rhbz 1769600) + * Mon Dec 02 2019 Laura Abbott - 5.3.14-300 - Linux v5.3.14 diff --git a/powerpc-xive-skip-ioremap-of-ESB-pages-for-LSI-interrupts.patch b/powerpc-xive-skip-ioremap-of-ESB-pages-for-LSI-interrupts.patch new file mode 100644 index 000000000..a9d5c1a85 --- /dev/null +++ b/powerpc-xive-skip-ioremap-of-ESB-pages-for-LSI-interrupts.patch @@ -0,0 +1,175 @@ +From patchwork Tue Dec 3 16:36:42 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= +X-Patchwork-Id: 1203830 +Return-Path: +X-Original-To: patchwork-incoming@ozlabs.org +Delivered-To: patchwork-incoming@ozlabs.org +Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) + (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) + key-exchange X25519 server-signature RSA-PSS (4096 bits)) + (No client certificate requested) + by ozlabs.org (Postfix) with ESMTPS id 47SCtY48Djz9sPL + for ; + Wed, 4 Dec 2019 07:16:37 +1100 (AEDT) +Authentication-Results: ozlabs.org; + dmarc=none (p=none dis=none) header.from=kaod.org +Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) + by lists.ozlabs.org (Postfix) with ESMTP id 47SCtY23XJzDqSJ + for ; + Wed, 4 Dec 2019 07:16:37 +1100 (AEDT) +X-Original-To: linuxppc-dev@lists.ozlabs.org +Delivered-To: linuxppc-dev@lists.ozlabs.org +Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) + smtp.mailfrom=kaod.org (client-ip=46.105.49.171; + helo=4.mo178.mail-out.ovh.net; + envelope-from=clg@kaod.org; receiver=) +Authentication-Results: lists.ozlabs.org; + dmarc=none (p=none dis=none) header.from=kaod.org +X-Greylist: delayed 4198 seconds by postgrey-1.36 at bilbo; + Wed, 04 Dec 2019 07:14:39 AEDT +Received: from 4.mo178.mail-out.ovh.net (4.mo178.mail-out.ovh.net + [46.105.49.171]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 + bits)) (No client certificate requested) + by lists.ozlabs.org (Postfix) with ESMTPS id 47SCrH1QlDzDqMp + for ; + Wed, 4 Dec 2019 07:14:34 +1100 (AEDT) +Received: from player758.ha.ovh.net (unknown [10.109.146.122]) + by mo178.mail-out.ovh.net (Postfix) with ESMTP id AD61B84296 + for ; + Tue, 3 Dec 2019 17:37:07 +0100 (CET) +Received: from kaod.org (lfbn-1-2229-223.w90-76.abo.wanadoo.fr + [90.76.50.223]) (Authenticated sender: clg@kaod.org) + by player758.ha.ovh.net (Postfix) with ESMTPSA id 011DDCE34EE3; + Tue, 3 Dec 2019 16:36:58 +0000 (UTC) +From: =?utf-8?q?C=C3=A9dric_Le_Goater?= +To: Michael Ellerman +Subject: [PATCH] powerpc/xive: skip ioremap() of ESB pages for LSI interrupts +Date: Tue, 3 Dec 2019 17:36:42 +0100 +Message-Id: <20191203163642.2428-1-clg@kaod.org> +X-Mailer: git-send-email 2.21.0 +MIME-Version: 1.0 +X-Ovh-Tracer-Id: 10318591172321971121 +X-VR-SPAMSTATE: OK +X-VR-SPAMSCORE: -100 +X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrudejjedgledvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdqfffguegfifdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffogggtgfesthekredtredtjeenucfhrhhomhepveorughrihgtucfnvgcuifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucfkpheptddrtddrtddrtddpledtrdejiedrhedtrddvvdefnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehplhgrhigvrhejheekrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhrtghpthhtoheplhhinhhugihpphgtqdguvghvsehlihhsthhsrdhoiihlrggsshdrohhrghenucevlhhushhtvghrufhiiigvpedt +X-BeenThere: linuxppc-dev@lists.ozlabs.org +X-Mailman-Version: 2.1.29 +Precedence: list +List-Id: Linux on PowerPC Developers Mail List +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Cc: lvivier@redhat.com, Greg Kurz , stable@vger.kernel.org, + =?utf-8?q?C=C3=A9dric_Le_Goater?= , + linuxppc-dev@lists.ozlabs.org, David Gibson +Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org +Sender: "Linuxppc-dev" + + +The PCI INTx interrupts and other LSI interrupts are handled differently +under a sPAPR platform. When the interrupt source characteristics are +queried, the hypervisor returns an H_INT_ESB flag to inform the OS +that it should be using the H_INT_ESB hcall for interrupt management +and not loads and stores on the interrupt ESB pages. + +A default -1 value is returned for the addresses of the ESB pages. The +driver ignores this condition today and performs a bogus IO mapping. +Recent changes and the DEBUG_VM configuration option make the bug +visible with : + +[ 0.015518] kernel BUG at arch/powerpc/include/asm/book3s/64/pgtable.h:612! +[ 0.015578] Oops: Exception in kernel mode, sig: 5 [#1] +[ 0.015627] LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=1024 NUMA pSeries +[ 0.015697] Modules linked in: +[ 0.015739] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-0.rc6.git0.1.fc32.ppc64le #1 +[ 0.015812] NIP: c000000000f63294 LR: c000000000f62e44 CTR: 0000000000000000 +[ 0.015889] REGS: c0000000fa45f0d0 TRAP: 0700 Not tainted (5.4.0-0.rc6.git0.1.fc32.ppc64le) +[ 0.015971] MSR: 8000000002029033 CR: 44000424 XER: 00000000 +[ 0.016050] CFAR: c000000000f63128 IRQMASK: 0 +[ 0.016050] GPR00: c000000000f62e44 c0000000fa45f360 c000000001be5400 0000000000000000 +[ 0.016050] GPR04: c0000000019c7d38 c0000000fa340030 00000000fa330009 c000000001c15e18 +[ 0.016050] GPR08: 0000000000000040 ffe0000000000000 0000000000000000 8418dd352dbd190f +[ 0.016050] GPR12: 0000000000000000 c000000001e00000 c00a000080060000 c00a000080060000 +[ 0.016050] GPR16: 0000ffffffffffff 80000000000001ae c000000001c24d98 ffffffffffff0000 +[ 0.016050] GPR20: c00a00008007ffff c000000001cafca0 c00a00008007ffff ffffffffffff0000 +[ 0.016050] GPR24: c00a000080080000 c00a000080080000 c000000001cafca8 c00a000080080000 +[ 0.016050] GPR28: c0000000fa32e010 c00a000080060000 ffffffffffff0000 c0000000fa330000 +[ 0.016711] NIP [c000000000f63294] ioremap_page_range+0x4c4/0x6e0 +[ 0.016778] LR [c000000000f62e44] ioremap_page_range+0x74/0x6e0 +[ 0.016846] Call Trace: +[ 0.016876] [c0000000fa45f360] [c000000000f62e44] ioremap_page_range+0x74/0x6e0 (unreliable) +[ 0.016969] [c0000000fa45f460] [c0000000000934bc] do_ioremap+0x8c/0x120 +[ 0.017037] [c0000000fa45f4b0] [c0000000000938e8] __ioremap_caller+0x128/0x140 +[ 0.017116] [c0000000fa45f500] [c0000000000931a0] ioremap+0x30/0x50 +[ 0.017184] [c0000000fa45f520] [c0000000000d1380] xive_spapr_populate_irq_data+0x170/0x260 +[ 0.017263] [c0000000fa45f5c0] [c0000000000cc90c] xive_irq_domain_map+0x8c/0x170 +[ 0.017344] [c0000000fa45f600] [c000000000219124] irq_domain_associate+0xb4/0x2d0 +[ 0.017424] [c0000000fa45f690] [c000000000219fe0] irq_create_mapping+0x1e0/0x3b0 +[ 0.017506] [c0000000fa45f730] [c00000000021ad6c] irq_create_fwspec_mapping+0x27c/0x3e0 +[ 0.017586] [c0000000fa45f7c0] [c00000000021af68] irq_create_of_mapping+0x98/0xb0 +[ 0.017666] [c0000000fa45f830] [c0000000008d4e48] of_irq_parse_and_map_pci+0x168/0x230 +[ 0.017746] [c0000000fa45f910] [c000000000075428] pcibios_setup_device+0x88/0x250 +[ 0.017826] [c0000000fa45f9a0] [c000000000077b84] pcibios_setup_bus_devices+0x54/0x100 +[ 0.017906] [c0000000fa45fa10] [c0000000000793f0] __of_scan_bus+0x160/0x310 +[ 0.017973] [c0000000fa45faf0] [c000000000075fc0] pcibios_scan_phb+0x330/0x390 +[ 0.018054] [c0000000fa45fba0] [c00000000139217c] pcibios_init+0x8c/0x128 +[ 0.018121] [c0000000fa45fc20] [c0000000000107b0] do_one_initcall+0x60/0x2c0 +[ 0.018201] [c0000000fa45fcf0] [c000000001384624] kernel_init_freeable+0x290/0x378 +[ 0.018280] [c0000000fa45fdb0] [c000000000010d24] kernel_init+0x2c/0x148 +[ 0.018348] [c0000000fa45fe20] [c00000000000bdbc] ret_from_kernel_thread+0x5c/0x80 +[ 0.018427] Instruction dump: +[ 0.018468] 41820014 3920fe7f 7d494838 7d290074 7929d182 f8e10038 69290001 0b090000 +[ 0.018552] 7a098420 0b090000 7bc95960 7929a802 <0b090000> 7fc68b78 e8610048 7dc47378 + +Cc: stable@vger.kernel.org # v4.14+ +Fixes: bed81ee181dd ("powerpc/xive: introduce H_INT_ESB hcall") +Signed-off-by: Cédric Le Goater +Tested-by: Daniel Axtens +Reviewed-by: Greg Kurz +--- + arch/powerpc/sysdev/xive/spapr.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c +index 33c10749edec..55dc61cb4867 100644 +--- a/arch/powerpc/sysdev/xive/spapr.c ++++ b/arch/powerpc/sysdev/xive/spapr.c +@@ -392,20 +392,28 @@ static int xive_spapr_populate_irq_data(u32 hw_irq, struct xive_irq_data *data) + data->esb_shift = esb_shift; + data->trig_page = trig_page; + ++ data->hw_irq = hw_irq; ++ + /* + * No chip-id for the sPAPR backend. This has an impact how we + * pick a target. See xive_pick_irq_target(). + */ + data->src_chip = XIVE_INVALID_CHIP_ID; + ++ /* ++ * When the H_INT_ESB flag is set, the H_INT_ESB hcall should ++ * be used for interrupt management. Skip the remapping of the ++ * ESB pages which are not available. ++ */ ++ if (data->flags & XIVE_IRQ_FLAG_H_INT_ESB) ++ return 0; ++ + data->eoi_mmio = ioremap(data->eoi_page, 1u << data->esb_shift); + if (!data->eoi_mmio) { + pr_err("Failed to map EOI page for irq 0x%x\n", hw_irq); + return -ENOMEM; + } + +- data->hw_irq = hw_irq; +- + /* Full function page supports trigger */ + if (flags & XIVE_SRC_TRIGGER) { + data->trig_mmio = data->eoi_mmio; From 85835e68c44c2b671df0e670a7b077c78402ac3c Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Thu, 5 Dec 2019 09:39:06 -0500 Subject: [PATCH 050/178] Linux v5.3.15 --- ...-memory-leak-in-sof_set_get_large_ct.patch | 37 ------------------- kernel.spec | 8 ++-- sources | 2 +- 3 files changed, 5 insertions(+), 42 deletions(-) delete mode 100644 0001-ASoC-SOF-ipc-Fix-memory-leak-in-sof_set_get_large_ct.patch diff --git a/0001-ASoC-SOF-ipc-Fix-memory-leak-in-sof_set_get_large_ct.patch b/0001-ASoC-SOF-ipc-Fix-memory-leak-in-sof_set_get_large_ct.patch deleted file mode 100644 index 2ebcb13ab..000000000 --- a/0001-ASoC-SOF-ipc-Fix-memory-leak-in-sof_set_get_large_ct.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 45c1380358b12bf2d1db20a5874e9544f56b34ab Mon Sep 17 00:00:00 2001 -From: Navid Emamdoost -Date: Sun, 27 Oct 2019 16:53:24 -0500 -Subject: [PATCH] ASoC: SOF: ipc: Fix memory leak in - sof_set_get_large_ctrl_data - -In the implementation of sof_set_get_large_ctrl_data() there is a memory -leak in case an error. Release partdata if sof_get_ctrl_copy_params() -fails. - -Fixes: 54d198d5019d ("ASoC: SOF: Propagate sof_get_ctrl_copy_params() error properly") -Signed-off-by: Navid Emamdoost -Link: https://lore.kernel.org/r/20191027215330.12729-1-navid.emamdoost@gmail.com -Signed-off-by: Mark Brown ---- - sound/soc/sof/ipc.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c -index b2f359d2f7e5..086eeeab8679 100644 ---- a/sound/soc/sof/ipc.c -+++ b/sound/soc/sof/ipc.c -@@ -572,8 +572,10 @@ static int sof_set_get_large_ctrl_data(struct snd_sof_dev *sdev, - else - err = sof_get_ctrl_copy_params(cdata->type, partdata, cdata, - sparams); -- if (err < 0) -+ if (err < 0) { -+ kfree(partdata); - return err; -+ } - - msg_bytes = sparams->msg_bytes; - pl_size = sparams->pl_size; --- -2.23.0 - diff --git a/kernel.spec b/kernel.spec index 2805f3e8f..a674f002a 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 14 +%define stable_update 15 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -676,9 +676,6 @@ Patch531: 0001-crypto-ccp-Release-all-allocated-memory-if-sha-type-.patch # CVE-2019-18809 rhbz 1777449 1777451 Patch532: 0001-media-usb-fix-memory-leak-in-af9005_identify_state.patch -# CVE-2019-18811 rhbz 1777455 1777456 -Patch533: 0001-ASoC-SOF-ipc-Fix-memory-leak-in-sof_set_get_large_ct.patch - # CVE-2019-18812 rhbz 1777458 1777459 Patch534: 0001-ASoC-SOF-Fix-memory-leak-in-sof_dfsentry_write.patch @@ -1889,6 +1886,9 @@ fi # # %changelog +* Thu Dec 05 2019 Laura Abbott - 5.3.15-300 +- Linux v5.3.15 + * Wed Dec 04 2019 Laura Abbott - Add powerpc virt fix (rhbz 1769600) diff --git a/sources b/sources index 37ff8495b..1d14d7de7 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.14.xz) = 96ccee690694a03beffc26edde7e1d9d2e43acdc33098d56c0965cdccb321337d34190ebab0b64663b03d4aa76edb1474dd86b0943385a572aa595fc76b5ec8b +SHA512 (patch-5.3.15.xz) = d9c258a5519552831956b53b68aa16e93b4b5a4edfdf7dfb315405e419b084ca31c53bd7e8b486d6f6ab5d70f8535ccf8881d30392b34fd7b3c19f2e31e785a6 From 61f347b6ff9a27c0f4a97626dc665f53d4b9732b Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Fri, 13 Dec 2019 12:24:35 -0500 Subject: [PATCH 051/178] Linux v5.3.16 --- ...fix-memory-leak-in-crypto_reportstat.patch | 107 ------------------ kernel.spec | 12 +- ...ease-skb-if-rsi_prepare_beacon-fails.patch | 101 ----------------- sources | 2 +- 4 files changed, 5 insertions(+), 217 deletions(-) delete mode 100644 crypto-user-fix-memory-leak-in-crypto_reportstat.patch delete mode 100644 rsi-release-skb-if-rsi_prepare_beacon-fails.patch diff --git a/crypto-user-fix-memory-leak-in-crypto_reportstat.patch b/crypto-user-fix-memory-leak-in-crypto_reportstat.patch deleted file mode 100644 index 2f7cc0205..000000000 --- a/crypto-user-fix-memory-leak-in-crypto_reportstat.patch +++ /dev/null @@ -1,107 +0,0 @@ -From mboxrd@z Thu Jan 1 00:00:00 1970 -Return-Path: -X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on - aws-us-west-2-korg-lkml-1.web.codeaurora.org -X-Spam-Level: -X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, - DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, - HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, - SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable - autolearn_force=no version=3.4.0 -Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) - by smtp.lore.kernel.org (Postfix) with ESMTP id 8D752C4CED1 - for ; Fri, 4 Oct 2019 19:35:05 +0000 (UTC) -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by mail.kernel.org (Postfix) with ESMTP id 696E721D81 - for ; Fri, 4 Oct 2019 19:35:05 +0000 (UTC) -Authentication-Results: mail.kernel.org; - dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KfPgoQZi" -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1730579AbfJDTfE (ORCPT - ); - Fri, 4 Oct 2019 15:35:04 -0400 -Received: from mail-io1-f66.google.com ([209.85.166.66]:36406 "EHLO - mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1725932AbfJDTfE (ORCPT - ); - Fri, 4 Oct 2019 15:35:04 -0400 -Received: by mail-io1-f66.google.com with SMTP id b136so16026274iof.3; - Fri, 04 Oct 2019 12:35:03 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=gmail.com; s=20161025; - h=from:to:cc:subject:date:message-id; - bh=YUxdWoMjBc3fq7ZEjHVbfnvWMNYpsAW2uL8SUTPJJOk=; - b=KfPgoQZiuCc2H7qvFQGzN/Y3EGPnFsu/TLq9CSR8tecMTpa9YL5eWsqgES34oDbm/Z - tBCmz9oK9X/m4/+VrPKpX573tizGffhrsfpuA+Fq69Y2qLjGgld9HOjAHd01oZ83u+Oe - IfpTdiUjqLS2q1WMSLKP4SYO6lGOL2hAK3fuICIkeFaCYYGEBCZ2DyuGyNv2KTqUkk7I - KQb1aZ8FaukkgvjqFvRKzmxBX1EAfsP/eODyKd0CEqnIZdQbkd0Y6geyteNUOKSTNqcn - /XpZgD+IsGXz2qWx9KTOw6csMacDX9jweaZEo3BHAZO4XGnVw+LP8rKJvYE92arFNI4q - +LLA== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20161025; - h=x-gm-message-state:from:to:cc:subject:date:message-id; - bh=YUxdWoMjBc3fq7ZEjHVbfnvWMNYpsAW2uL8SUTPJJOk=; - b=MZTiefsa/zD0rlKyJnXaNkjhKxyXM1RPbiOfRsBzjAXppzdpVXEsMuoNuMbb7UL0XD - StXE1INBYwfkI73zbAuORpk1uc3QBCg0KUc6/FT8QWdwM6pVw3g0pWbwPcnA3YhdqbTk - 0XWZReG3dHpnGJ+HjFibx9C5K2a5pTK2zAXRfXgJvSLWuhLdI26dNRjOdqmwW02tAThC - Z86x/deIZhaQiRbpDadvJVNEx7tRQ0TT1d27Rf93LQStQ5vJW01jA5g//b8D5aB1Q4md - mqI61eE+ughOjC7Ef3gIldPML4dtt/zOjR45rFV078yk8vaefDXDqdVnXIL309NOfiRj - iGPg== -X-Gm-Message-State: APjAAAWuXZ3QkwcdijV+oJ20x5WQPqQsko2OjLI/I2ZE5tL5mXtDiZ9P - Kn6oGyHFRVspaJiNUH3WmBs= -X-Google-Smtp-Source: APXvYqxdxqTqNQ2D2g2hs/N3xw+sie1sFybvZM7Bv8s50eW0Wl4EA5uLHeMeKaifDlU11aRt9jEhKg== -X-Received: by 2002:a5d:88d1:: with SMTP id i17mr14654011iol.235.1570217702565; - Fri, 04 Oct 2019 12:35:02 -0700 (PDT) -Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) - by smtp.googlemail.com with ESMTPSA id t8sm3372621ild.7.2019.10.04.12.35.01 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Fri, 04 Oct 2019 12:35:01 -0700 (PDT) -From: Navid Emamdoost -Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu, - Navid Emamdoost , - Herbert Xu , - "David S. Miller" , - linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org -Subject: [PATCH] crypto: user - fix memory leak in crypto_reportstat -Date: Fri, 4 Oct 2019 14:34:54 -0500 -Message-Id: <20191004193455.18348-1-navid.emamdoost@gmail.com> -X-Mailer: git-send-email 2.17.1 -To: unlisted-recipients:; (no To-header on input) -Sender: linux-kernel-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: linux-kernel@vger.kernel.org -Archived-At: -List-Archive: -List-Post: - -In crypto_reportstat, a new skb is created by nlmsg_new(). This skb is -leaked if crypto_reportstat_alg() fails. Required release for skb is -added. - -Fixes: cac5818c25d0 ("crypto: user - Implement a generic crypto statistics") -Signed-off-by: Navid Emamdoost ---- - crypto/crypto_user_stat.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/crypto/crypto_user_stat.c b/crypto/crypto_user_stat.c -index 8bad88413de1..1be95432fa23 100644 ---- a/crypto/crypto_user_stat.c -+++ b/crypto/crypto_user_stat.c -@@ -328,8 +328,10 @@ int crypto_reportstat(struct sk_buff *in_skb, struct nlmsghdr *in_nlh, - drop_alg: - crypto_mod_put(alg); - -- if (err) -+ if (err) { -+ kfree_skb(skb); - return err; -+ } - - return nlmsg_unicast(crypto_nlsk, skb, NETLINK_CB(in_skb).portid); - } --- -2.17.1 - - diff --git a/kernel.spec b/kernel.spec index a674f002a..3ca97b1eb 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 15 +%define stable_update 16 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -602,9 +602,6 @@ Patch507: 0001-ath9k_htc-release-allocated-buffer-if-timed-out.patch # CVE-2019-19072 rhbz 1774946 1774947 Patch508: 0001-tracing-Have-error-path-in-predicate_parse-free-its-.patch -# CVE-2019-19071 rhbz 1774949 1774950 -Patch509: rsi-release-skb-if-rsi_prepare_beacon-fails.patch - # CVE-2019-19070 rhbz 1774957 1774958 Patch510: spi-gpio-prevent-memory-leak-in-spi_gpio_probe.patch @@ -620,10 +617,6 @@ Patch513: scsi-bfa-release-allocated-memory-in-case-of-error.patch # CVE-2019-19046 rhbz 1774988 1774989 Patch514: ipmi-Fix-memory-leak-in-__ipmi_bmc_register.patch -# CVE-2019-19050 rhbz 1774998 1775002 -# CVE-2019-19062 rhbz 1775021 1775023 -Patch515: crypto-user-fix-memory-leak-in-crypto_reportstat.patch - # CVE-2019-19064 rhbz 1775010 1775011 Patch516: spi-lpspi-fix-memory-leak-in-fsl_lpspi_probe.patch @@ -1886,6 +1879,9 @@ fi # # %changelog +* Fri Dec 13 2019 Laura Abbott - 5.3.16-300 +- Linux v5.3.16 + * Thu Dec 05 2019 Laura Abbott - 5.3.15-300 - Linux v5.3.15 diff --git a/rsi-release-skb-if-rsi_prepare_beacon-fails.patch b/rsi-release-skb-if-rsi_prepare_beacon-fails.patch deleted file mode 100644 index 64c40f408..000000000 --- a/rsi-release-skb-if-rsi_prepare_beacon-fails.patch +++ /dev/null @@ -1,101 +0,0 @@ -From patchwork Sat Sep 14 00:08:11 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Navid Emamdoost -X-Patchwork-Id: 11145515 -X-Patchwork-Delegate: kvalo@adurom.com -Return-Path: -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BDCB14DB - for ; - Sat, 14 Sep 2019 00:08:28 +0000 (UTC) -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by mail.kernel.org (Postfix) with ESMTP id 1C8DC20692 - for ; - Sat, 14 Sep 2019 00:08:28 +0000 (UTC) -Authentication-Results: mail.kernel.org; - dkim=fail reason="signature verification failed" (2048-bit key) - header.d=gmail.com header.i=@gmail.com header.b="H4ki8bM3" -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S2390814AbfINAIX (ORCPT - ); - Fri, 13 Sep 2019 20:08:23 -0400 -Received: from mail-io1-f67.google.com ([209.85.166.67]:38748 "EHLO - mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S2390793AbfINAIX (ORCPT - ); - Fri, 13 Sep 2019 20:08:23 -0400 -Received: by mail-io1-f67.google.com with SMTP id k5so41134655iol.5; - Fri, 13 Sep 2019 17:08:22 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=gmail.com; s=20161025; - h=from:to:cc:subject:date:message-id; - bh=jwG/Aiknb+UcZynbTQk90VqogFgsnd/QMY7azs6Zupc=; - b=H4ki8bM3b9Bmty2ruf5ZSCj1ONr4jsOiep+vLMdBWcjq1+6e8umPfwLlGHYesuoz/Q - VF5OFoRIgllqVfRh1O0ob/rthiQm73toq+PTtrX9iKlZ8u3smXrOHJ2yH7252RrvcFpT - O3TQVuU3UKw0Am3Efn13+5jVOA3Oh/oH5UC9uNsla1kvJ3F/R6nBoiOSwOMnclPvgRSn - vay6xtYVjr5LkBAO60l/e/agltxV8p/eNiUH2xLAV7FcQ7951+WbMmnXr40trn8HDEj4 - 6yl80zQa8B2dbLThm6nFvE462hhCUY3BrldbuGcsFiHG7iW0/cIshuHIso8SieQZdhM+ - gIzw== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20161025; - h=x-gm-message-state:from:to:cc:subject:date:message-id; - bh=jwG/Aiknb+UcZynbTQk90VqogFgsnd/QMY7azs6Zupc=; - b=sTBiyouiK4UyXL4mE50HQlhIkI9Ns2+bLnk+9IC/vhspdjwj+xTPQI2DtQxLD94ruR - EUXt194VEVxAqhmZQJy2MmYkPLsTxt31pXvm59EGf0bFyboMEVIx/BOWcqjS1+pOKH4I - PisI3obo+CTL2hsat1wiEc2pMg+ZsZKzwlboyXVB0sL/FjH0xkEqAF1YC39sbegiiU6P - PX/iDiNXMRckuIc/hvl5JA+8DFBj6onQYoXyPjRG7Ry122UQPLyu9SCSc2nGtgiv/EqM - 0YAhTTXDm0FyknKt7MoTbOuMcDqzz/io6uTl6/oMPotLSrKVAe+8u0V/hl9WS8VvitOm - U3xw== -X-Gm-Message-State: APjAAAUnAd+MBw2rCpslu6F+1lT07zH7ui3l7LUI6IDQAbTwKXToMRDT - yPjM/YAgsdE/f2RMGo4WmJhx7rwf6+4= -X-Google-Smtp-Source: - APXvYqw7AMJKs0y62zgNzfsmBOSndsvr5y6XtYV+6wx/T/jGH6LPa1JJmCjPhOygc0/qx3csQoLVXA== -X-Received: by 2002:a6b:5b07:: with SMTP id v7mr3108833ioh.76.1568419702221; - Fri, 13 Sep 2019 17:08:22 -0700 (PDT) -Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) - by smtp.googlemail.com with ESMTPSA id - t9sm3973230iop.86.2019.09.13.17.08.21 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Fri, 13 Sep 2019 17:08:21 -0700 (PDT) -From: Navid Emamdoost -Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, - Navid Emamdoost , - Amitkumar Karwar , - Siva Rebbagondla , - Kalle Valo , - "David S. Miller" , - linux-wireless@vger.kernel.org, netdev@vger.kernel.org, - linux-kernel@vger.kernel.org -Subject: [PATCH] rsi: release skb if rsi_prepare_beacon fails -Date: Fri, 13 Sep 2019 19:08:11 -0500 -Message-Id: <20190914000812.10188-1-navid.emamdoost@gmail.com> -X-Mailer: git-send-email 2.17.1 -To: unlisted-recipients:; (no To-header on input) -Sender: linux-wireless-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: linux-wireless@vger.kernel.org - -In rsi_send_beacon, if rsi_prepare_beacon fails the allocated skb should -be released. - -Signed-off-by: Navid Emamdoost ---- - drivers/net/wireless/rsi/rsi_91x_mgmt.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c -index 6c7f26ef6476..9cc8a335d519 100644 ---- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c -+++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c -@@ -1756,6 +1756,7 @@ static int rsi_send_beacon(struct rsi_common *common) - skb_pull(skb, (64 - dword_align_bytes)); - if (rsi_prepare_beacon(common, skb)) { - rsi_dbg(ERR_ZONE, "Failed to prepare beacon\n"); -+ dev_kfree_skb(skb); - return -EINVAL; - } - skb_queue_tail(&common->tx_queue[MGMT_BEACON_Q], skb); diff --git a/sources b/sources index 1d14d7de7..3e4340384 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.15.xz) = d9c258a5519552831956b53b68aa16e93b4b5a4edfdf7dfb315405e419b084ca31c53bd7e8b486d6f6ab5d70f8535ccf8881d30392b34fd7b3c19f2e31e785a6 +SHA512 (patch-5.3.16.xz) = f9f2047009b540a40dbea9048f030eba54bec162c8132e1347c0039fbbb0b381a31c01a2deae26014b5a72c13c3032ea20c598ae7262975e2df406046a2f2ba8 From ef41d9b8169668a2be3e0cc68886e550f9c0793e Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Tue, 17 Dec 2019 17:09:43 -0500 Subject: [PATCH 052/178] Linux v5.3.17 --- kernel.spec | 8 +- ...emap-of-ESB-pages-for-LSI-interrupts.patch | 175 ------------------ sources | 2 +- 3 files changed, 5 insertions(+), 180 deletions(-) delete mode 100644 powerpc-xive-skip-ioremap-of-ESB-pages-for-LSI-interrupts.patch diff --git a/kernel.spec b/kernel.spec index 3ca97b1eb..63f6122c3 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 16 +%define stable_update 17 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -675,9 +675,6 @@ Patch534: 0001-ASoC-SOF-Fix-memory-leak-in-sof_dfsentry_write.patch # CVE-2019-16232 rhbz 1760351 1760352 Patch535: 0001-libertas-fix-a-potential-NULL-pointer-dereference.patch -# rhbz 1769600 -Patch536: powerpc-xive-skip-ioremap-of-ESB-pages-for-LSI-interrupts.patch - # END OF PATCH DEFINITIONS %endif @@ -1879,6 +1876,9 @@ fi # # %changelog +* Tue Dec 17 2019 Laura Abbott - 5.3.17-300 +- Linux v5.3.17 + * Fri Dec 13 2019 Laura Abbott - 5.3.16-300 - Linux v5.3.16 diff --git a/powerpc-xive-skip-ioremap-of-ESB-pages-for-LSI-interrupts.patch b/powerpc-xive-skip-ioremap-of-ESB-pages-for-LSI-interrupts.patch deleted file mode 100644 index a9d5c1a85..000000000 --- a/powerpc-xive-skip-ioremap-of-ESB-pages-for-LSI-interrupts.patch +++ /dev/null @@ -1,175 +0,0 @@ -From patchwork Tue Dec 3 16:36:42 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 8bit -X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= -X-Patchwork-Id: 1203830 -Return-Path: -X-Original-To: patchwork-incoming@ozlabs.org -Delivered-To: patchwork-incoming@ozlabs.org -Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits)) - (No client certificate requested) - by ozlabs.org (Postfix) with ESMTPS id 47SCtY48Djz9sPL - for ; - Wed, 4 Dec 2019 07:16:37 +1100 (AEDT) -Authentication-Results: ozlabs.org; - dmarc=none (p=none dis=none) header.from=kaod.org -Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) - by lists.ozlabs.org (Postfix) with ESMTP id 47SCtY23XJzDqSJ - for ; - Wed, 4 Dec 2019 07:16:37 +1100 (AEDT) -X-Original-To: linuxppc-dev@lists.ozlabs.org -Delivered-To: linuxppc-dev@lists.ozlabs.org -Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) - smtp.mailfrom=kaod.org (client-ip=46.105.49.171; - helo=4.mo178.mail-out.ovh.net; - envelope-from=clg@kaod.org; receiver=) -Authentication-Results: lists.ozlabs.org; - dmarc=none (p=none dis=none) header.from=kaod.org -X-Greylist: delayed 4198 seconds by postgrey-1.36 at bilbo; - Wed, 04 Dec 2019 07:14:39 AEDT -Received: from 4.mo178.mail-out.ovh.net (4.mo178.mail-out.ovh.net - [46.105.49.171]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 - bits)) (No client certificate requested) - by lists.ozlabs.org (Postfix) with ESMTPS id 47SCrH1QlDzDqMp - for ; - Wed, 4 Dec 2019 07:14:34 +1100 (AEDT) -Received: from player758.ha.ovh.net (unknown [10.109.146.122]) - by mo178.mail-out.ovh.net (Postfix) with ESMTP id AD61B84296 - for ; - Tue, 3 Dec 2019 17:37:07 +0100 (CET) -Received: from kaod.org (lfbn-1-2229-223.w90-76.abo.wanadoo.fr - [90.76.50.223]) (Authenticated sender: clg@kaod.org) - by player758.ha.ovh.net (Postfix) with ESMTPSA id 011DDCE34EE3; - Tue, 3 Dec 2019 16:36:58 +0000 (UTC) -From: =?utf-8?q?C=C3=A9dric_Le_Goater?= -To: Michael Ellerman -Subject: [PATCH] powerpc/xive: skip ioremap() of ESB pages for LSI interrupts -Date: Tue, 3 Dec 2019 17:36:42 +0100 -Message-Id: <20191203163642.2428-1-clg@kaod.org> -X-Mailer: git-send-email 2.21.0 -MIME-Version: 1.0 -X-Ovh-Tracer-Id: 10318591172321971121 -X-VR-SPAMSTATE: OK -X-VR-SPAMSCORE: -100 -X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrudejjedgledvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdqfffguegfifdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffogggtgfesthekredtredtjeenucfhrhhomhepveorughrihgtucfnvgcuifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucfkpheptddrtddrtddrtddpledtrdejiedrhedtrddvvdefnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehplhgrhigvrhejheekrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhrtghpthhtoheplhhinhhugihpphgtqdguvghvsehlihhsthhsrdhoiihlrggsshdrohhrghenucevlhhushhtvghrufhiiigvpedt -X-BeenThere: linuxppc-dev@lists.ozlabs.org -X-Mailman-Version: 2.1.29 -Precedence: list -List-Id: Linux on PowerPC Developers Mail List -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Cc: lvivier@redhat.com, Greg Kurz , stable@vger.kernel.org, - =?utf-8?q?C=C3=A9dric_Le_Goater?= , - linuxppc-dev@lists.ozlabs.org, David Gibson -Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org -Sender: "Linuxppc-dev" - - -The PCI INTx interrupts and other LSI interrupts are handled differently -under a sPAPR platform. When the interrupt source characteristics are -queried, the hypervisor returns an H_INT_ESB flag to inform the OS -that it should be using the H_INT_ESB hcall for interrupt management -and not loads and stores on the interrupt ESB pages. - -A default -1 value is returned for the addresses of the ESB pages. The -driver ignores this condition today and performs a bogus IO mapping. -Recent changes and the DEBUG_VM configuration option make the bug -visible with : - -[ 0.015518] kernel BUG at arch/powerpc/include/asm/book3s/64/pgtable.h:612! -[ 0.015578] Oops: Exception in kernel mode, sig: 5 [#1] -[ 0.015627] LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=1024 NUMA pSeries -[ 0.015697] Modules linked in: -[ 0.015739] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-0.rc6.git0.1.fc32.ppc64le #1 -[ 0.015812] NIP: c000000000f63294 LR: c000000000f62e44 CTR: 0000000000000000 -[ 0.015889] REGS: c0000000fa45f0d0 TRAP: 0700 Not tainted (5.4.0-0.rc6.git0.1.fc32.ppc64le) -[ 0.015971] MSR: 8000000002029033 CR: 44000424 XER: 00000000 -[ 0.016050] CFAR: c000000000f63128 IRQMASK: 0 -[ 0.016050] GPR00: c000000000f62e44 c0000000fa45f360 c000000001be5400 0000000000000000 -[ 0.016050] GPR04: c0000000019c7d38 c0000000fa340030 00000000fa330009 c000000001c15e18 -[ 0.016050] GPR08: 0000000000000040 ffe0000000000000 0000000000000000 8418dd352dbd190f -[ 0.016050] GPR12: 0000000000000000 c000000001e00000 c00a000080060000 c00a000080060000 -[ 0.016050] GPR16: 0000ffffffffffff 80000000000001ae c000000001c24d98 ffffffffffff0000 -[ 0.016050] GPR20: c00a00008007ffff c000000001cafca0 c00a00008007ffff ffffffffffff0000 -[ 0.016050] GPR24: c00a000080080000 c00a000080080000 c000000001cafca8 c00a000080080000 -[ 0.016050] GPR28: c0000000fa32e010 c00a000080060000 ffffffffffff0000 c0000000fa330000 -[ 0.016711] NIP [c000000000f63294] ioremap_page_range+0x4c4/0x6e0 -[ 0.016778] LR [c000000000f62e44] ioremap_page_range+0x74/0x6e0 -[ 0.016846] Call Trace: -[ 0.016876] [c0000000fa45f360] [c000000000f62e44] ioremap_page_range+0x74/0x6e0 (unreliable) -[ 0.016969] [c0000000fa45f460] [c0000000000934bc] do_ioremap+0x8c/0x120 -[ 0.017037] [c0000000fa45f4b0] [c0000000000938e8] __ioremap_caller+0x128/0x140 -[ 0.017116] [c0000000fa45f500] [c0000000000931a0] ioremap+0x30/0x50 -[ 0.017184] [c0000000fa45f520] [c0000000000d1380] xive_spapr_populate_irq_data+0x170/0x260 -[ 0.017263] [c0000000fa45f5c0] [c0000000000cc90c] xive_irq_domain_map+0x8c/0x170 -[ 0.017344] [c0000000fa45f600] [c000000000219124] irq_domain_associate+0xb4/0x2d0 -[ 0.017424] [c0000000fa45f690] [c000000000219fe0] irq_create_mapping+0x1e0/0x3b0 -[ 0.017506] [c0000000fa45f730] [c00000000021ad6c] irq_create_fwspec_mapping+0x27c/0x3e0 -[ 0.017586] [c0000000fa45f7c0] [c00000000021af68] irq_create_of_mapping+0x98/0xb0 -[ 0.017666] [c0000000fa45f830] [c0000000008d4e48] of_irq_parse_and_map_pci+0x168/0x230 -[ 0.017746] [c0000000fa45f910] [c000000000075428] pcibios_setup_device+0x88/0x250 -[ 0.017826] [c0000000fa45f9a0] [c000000000077b84] pcibios_setup_bus_devices+0x54/0x100 -[ 0.017906] [c0000000fa45fa10] [c0000000000793f0] __of_scan_bus+0x160/0x310 -[ 0.017973] [c0000000fa45faf0] [c000000000075fc0] pcibios_scan_phb+0x330/0x390 -[ 0.018054] [c0000000fa45fba0] [c00000000139217c] pcibios_init+0x8c/0x128 -[ 0.018121] [c0000000fa45fc20] [c0000000000107b0] do_one_initcall+0x60/0x2c0 -[ 0.018201] [c0000000fa45fcf0] [c000000001384624] kernel_init_freeable+0x290/0x378 -[ 0.018280] [c0000000fa45fdb0] [c000000000010d24] kernel_init+0x2c/0x148 -[ 0.018348] [c0000000fa45fe20] [c00000000000bdbc] ret_from_kernel_thread+0x5c/0x80 -[ 0.018427] Instruction dump: -[ 0.018468] 41820014 3920fe7f 7d494838 7d290074 7929d182 f8e10038 69290001 0b090000 -[ 0.018552] 7a098420 0b090000 7bc95960 7929a802 <0b090000> 7fc68b78 e8610048 7dc47378 - -Cc: stable@vger.kernel.org # v4.14+ -Fixes: bed81ee181dd ("powerpc/xive: introduce H_INT_ESB hcall") -Signed-off-by: Cédric Le Goater -Tested-by: Daniel Axtens -Reviewed-by: Greg Kurz ---- - arch/powerpc/sysdev/xive/spapr.c | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c -index 33c10749edec..55dc61cb4867 100644 ---- a/arch/powerpc/sysdev/xive/spapr.c -+++ b/arch/powerpc/sysdev/xive/spapr.c -@@ -392,20 +392,28 @@ static int xive_spapr_populate_irq_data(u32 hw_irq, struct xive_irq_data *data) - data->esb_shift = esb_shift; - data->trig_page = trig_page; - -+ data->hw_irq = hw_irq; -+ - /* - * No chip-id for the sPAPR backend. This has an impact how we - * pick a target. See xive_pick_irq_target(). - */ - data->src_chip = XIVE_INVALID_CHIP_ID; - -+ /* -+ * When the H_INT_ESB flag is set, the H_INT_ESB hcall should -+ * be used for interrupt management. Skip the remapping of the -+ * ESB pages which are not available. -+ */ -+ if (data->flags & XIVE_IRQ_FLAG_H_INT_ESB) -+ return 0; -+ - data->eoi_mmio = ioremap(data->eoi_page, 1u << data->esb_shift); - if (!data->eoi_mmio) { - pr_err("Failed to map EOI page for irq 0x%x\n", hw_irq); - return -ENOMEM; - } - -- data->hw_irq = hw_irq; -- - /* Full function page supports trigger */ - if (flags & XIVE_SRC_TRIGGER) { - data->trig_mmio = data->eoi_mmio; diff --git a/sources b/sources index 3e4340384..111683122 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.16.xz) = f9f2047009b540a40dbea9048f030eba54bec162c8132e1347c0039fbbb0b381a31c01a2deae26014b5a72c13c3032ea20c598ae7262975e2df406046a2f2ba8 +SHA512 (patch-5.3.17.xz) = 43ef381bc85fb2b8ae1be62b1a6f0b1a680f7c1381692f50745e0c4caec8311d294914916dcaaffb5f1921af9d11475750863ff650f1f6c5ae46d514b556d140 From 86e67ee11e59287bedf3e8373238a4b7fbbe823e Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Wed, 18 Dec 2019 14:53:40 -0500 Subject: [PATCH 053/178] Linux v5.3.18 --- kernel.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel.spec b/kernel.spec index 63f6122c3..285b7a732 100644 --- a/kernel.spec +++ b/kernel.spec @@ -56,7 +56,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 17 +%define stable_update 18 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -1876,6 +1876,9 @@ fi # # %changelog +* Wed Dec 18 2019 Laura Abbott - 5.3.18-300 +- Linux v5.3.18 + * Tue Dec 17 2019 Laura Abbott - 5.3.17-300 - Linux v5.3.17 diff --git a/sources b/sources index 111683122..2955a9a58 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.3.tar.xz) = 6b5edef47c319a3fa7f6c20a3e0903a5acd89ec75e32dc5f99adcb60c9fe118ea312722d9c3d27e2e3900afa2455afb86e83a8b6bb131009bc79ddbe6fb0595d -SHA512 (patch-5.3.17.xz) = 43ef381bc85fb2b8ae1be62b1a6f0b1a680f7c1381692f50745e0c4caec8311d294914916dcaaffb5f1921af9d11475750863ff650f1f6c5ae46d514b556d140 +SHA512 (patch-5.3.18.xz) = bd24cef37b19fc483d844bdfe7fafecae0bab61aa001a28f49d9339de9436aacaf264cc19d0546273ea8d0b2e9eecf3aadf4a207fcd687df24a79d5608446550 From 3c560c6bd0fe1c6561acf5e95454dae04662a42b Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Thu, 19 Dec 2019 12:47:36 -0600 Subject: [PATCH 054/178] Linux v5.4.5 rebase --- ...ix-memory-leak-in-sof_dfsentry_write.patch | 37 - ...rget-to-release-the-allocated-memory.patch | 33 - ...elease-allocated-buffer-if-timed-out.patch | 29 - ...elease-allocated-buffer-if-timed-out.patch | 46 - ...-drm-amd-display-prevent-memory-leak.patch | 82 - ...-the-declaration-of-struct-nouveau_c.patch | 158 + ...ini-fix-memory-leak-in-alloc_sgtable.patch | 29 - ...-memory-leaks-in-iwl_pcie_ctxt_info_.patch | 99 - ...ry-leak-in-nl80211_get_ftm_responder.patch | 33 - ...or-path-in-predicate_parse-free-its-.patch | 37 - ..._to_str-and-rework-efi_status_to_err.patch | 4 +- ...drm-core-using-atomic-code-paths-on-.patch | 115 + ...pin-3-touches-when-the-firmware-repo.patch | 47 - ...latform-keyring-for-module-signature.patch | 33 +- Kbuild-Add-an-option-to-enable-GCC-VTA.patch | 94 - Module.kabi_aarch64 | 0 Module.kabi_dup_aarch64 | 0 Module.kabi_dup_ppc64le | 0 Module.kabi_dup_s390x | 0 Module.kabi_dup_x86_64 | 0 Module.kabi_ppc64le | 0 Module.kabi_s390x | 0 Module.kabi_x86_64 | 0 ...ng-the-PM-driver-instead-of-firmware.patch | 78 - alsa-5.5.patch | 11957 ++++++++++++++++ alsa-5.6.patch | 390 + arm64-dts-qcom-Add-Lenovo-Yoga-C630.patch | 623 - ath9k-rx-dma-stop-check.patch | 38 - check-kabi | 0 configs/build_configs.sh | 78 +- .../CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE | 1 - .../debug/CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE | 1 + .../fedora/debug/x86/x86_64/CONFIG_NR_CPUS | 1 - configs/fedora/debug/x86/x86_64/README | 2 + configs/fedora/generic/CONFIG_ADIN_PHY | 1 + configs/fedora/generic/CONFIG_ADIS16460 | 1 + configs/fedora/generic/CONFIG_AMD_XGBE | 1 - configs/fedora/generic/CONFIG_ARCH_IOP13XX | 1 - configs/fedora/generic/CONFIG_ARCH_IOP33X | 1 - configs/fedora/generic/CONFIG_ARCH_KS8695 | 1 - configs/fedora/generic/CONFIG_ARCH_LPC32XX | 1 - configs/fedora/generic/CONFIG_ARCH_W90X900 | 1 - .../fedora/generic/CONFIG_ATH9K_PCI_NO_EEPROM | 1 + .../fedora/generic/CONFIG_BLK_CGROUP_IOCOST | 1 + configs/fedora/generic/CONFIG_CAN_F81601 | 1 + configs/fedora/generic/CONFIG_CAN_J1939 | 1 + .../fedora/generic/CONFIG_CAN_KVASER_PCIEFD | 1 + .../fedora/generic/CONFIG_CAN_M_CAN_PLATFORM | 1 + .../fedora/generic/CONFIG_CAN_M_CAN_TCAN4X5X | 1 + .../generic/CONFIG_CPU_IDLE_GOV_HALTPOLL | 1 + configs/fedora/generic/CONFIG_CRASH | 1 - configs/fedora/generic/CONFIG_CROS_EC | 1 + .../fedora/generic/CONFIG_CRYPTO_AEGIS128L | 1 - configs/fedora/generic/CONFIG_CRYPTO_AEGIS256 | 1 - .../generic/CONFIG_CRYPTO_DEV_CCP_DEBUGFS | 1 + .../fedora/generic/CONFIG_CRYPTO_DEV_SAFEXCEL | 1 + configs/fedora/generic/CONFIG_CRYPTO_ESSIV | 1 + .../fedora/generic/CONFIG_CRYPTO_MORUS1280 | 1 - configs/fedora/generic/CONFIG_CRYPTO_MORUS640 | 1 - configs/fedora/generic/CONFIG_CRYPTO_SHA512 | 2 +- configs/fedora/generic/CONFIG_DEBUG_INFO_BTF | 2 +- configs/fedora/generic/CONFIG_DEBUG_INFO_VTA | 1 - .../fedora/generic/CONFIG_DMABUF_SELFTESTS | 1 + configs/fedora/generic/CONFIG_DM_CLONE | 1 + .../CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG | 1 + configs/fedora/generic/CONFIG_DRM_GM12U320 | 1 + .../generic/CONFIG_DRM_PANEL_LG_LB035Q02 | 1 + .../generic/CONFIG_DRM_PANEL_NEC_NL8048HL11 | 1 + .../generic/CONFIG_DRM_PANEL_NOVATEK_NT39016 | 1 + .../generic/CONFIG_DRM_PANEL_RAYDIUM_RM67191 | 1 + .../CONFIG_DRM_PANEL_SHARP_LS037V7DW01 | 1 + .../generic/CONFIG_DRM_PANEL_SONY_ACX565AKM | 1 + .../generic/CONFIG_DRM_PANEL_TPO_TD028TTEC1 | 1 + .../generic/CONFIG_DRM_PANEL_TPO_TD043MTEA1 | 1 + configs/fedora/generic/CONFIG_DRM_TDFX | 2 +- configs/fedora/generic/CONFIG_DRM_TINYDRM | 1 - configs/fedora/generic/CONFIG_EFI_RCI2_TABLE | 1 + configs/fedora/generic/CONFIG_EFI_TEST | 2 +- configs/fedora/generic/CONFIG_EXFAT_FS | 1 + configs/fedora/generic/CONFIG_FSL_ENETC_MDIO | 1 + configs/fedora/generic/CONFIG_FS_VERITY | 1 + .../CONFIG_FS_VERITY_BUILTIN_SIGNATURES | 1 + configs/fedora/generic/CONFIG_FS_VERITY_DEBUG | 1 + configs/fedora/generic/CONFIG_HEADERS_INSTALL | 2 +- configs/fedora/generic/CONFIG_HEADER_TEST | 2 +- .../fedora/generic/CONFIG_HID_CREATIVE_SB0540 | 1 + configs/fedora/generic/CONFIG_I2C_BCM2048 | 1 - .../fedora/generic/CONFIG_IMA_APPRAISE_MODSIG | 1 + .../generic/CONFIG_IMA_DEFAULT_HASH_SHA512 | 1 + .../fedora/generic/CONFIG_INPUT_PWM_BEEPER | 2 +- configs/fedora/generic/CONFIG_IONIC | 1 + configs/fedora/generic/CONFIG_JOYSTICK_FSIA6B | 1 + .../fedora/generic/CONFIG_KERNEL_HEADER_TEST | 1 + configs/fedora/generic/CONFIG_LIVEPATCH | 2 +- .../fedora/generic/CONFIG_LOCK_DOWN_KERNEL | 1 - ...FIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY | 1 + .../CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY | 1 + .../CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE | 1 + configs/fedora/generic/CONFIG_MAX5432 | 1 + .../fedora/generic/CONFIG_MLX5_SW_STEERING | 1 + configs/fedora/generic/CONFIG_MLX5_TLS | 1 + .../fedora/generic/CONFIG_MMC_SDHCI_OF_ASPEED | 1 + ...FIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS | 1 + configs/fedora/generic/CONFIG_MOXTET | 1 + configs/fedora/generic/CONFIG_MTD_NAND_MXIC | 1 + configs/fedora/generic/CONFIG_NETDEVSIM | 2 +- .../generic/CONFIG_NET_DSA_MICROCHIP_KSZ8795 | 1 + .../CONFIG_NET_DSA_MICROCHIP_KSZ9477_I2C | 1 + configs/fedora/generic/CONFIG_NET_TC_SKB_EXT | 1 + .../fedora/generic/CONFIG_NET_VENDOR_PENSANDO | 1 + configs/fedora/generic/CONFIG_NFT_SOCKET | 2 +- configs/fedora/generic/CONFIG_NFT_TPROXY | 2 +- configs/fedora/generic/CONFIG_NFT_TUNNEL | 2 +- configs/fedora/generic/CONFIG_NOA1305 | 1 + .../fedora/generic/CONFIG_OPTIMIZE_INLINING | 2 +- configs/fedora/generic/CONFIG_PINCTRL_SC7180 | 1 + configs/fedora/generic/CONFIG_PREEMPT_LL | 1 - .../generic/CONFIG_RANDOM_TRUST_BOOTLOADER | 1 + configs/fedora/generic/CONFIG_RDMA_SIW | 2 +- .../generic/CONFIG_READ_ONLY_THP_FOR_FS | 1 + .../fedora/generic/CONFIG_REGULATOR_SY8824X | 1 + configs/fedora/generic/CONFIG_REMOTEPROC | 2 +- .../generic/CONFIG_SECURITY_LOCKDOWN_LSM | 1 + .../CONFIG_SECURITY_LOCKDOWN_LSM_EARLY | 1 + configs/fedora/generic/CONFIG_SENSORS_ADS1015 | 1 - configs/fedora/generic/CONFIG_SENSORS_AS370 | 1 + .../generic/CONFIG_SENSORS_INSPUR_IPSPS | 1 + .../fedora/generic/CONFIG_SERIAL_8250_MOXA | 1 - .../generic/CONFIG_SERIAL_FSL_LINFLEXUART | 1 + configs/fedora/generic/CONFIG_SGI_IOC4 | 1 - configs/fedora/generic/CONFIG_SND_HDA_INTEL | 2 +- .../generic/CONFIG_SND_HDA_INTEL_DETECT_DMIC | 1 + configs/fedora/generic/CONFIG_SND_SOC_SOF_OF | 1 + configs/fedora/generic/CONFIG_SND_SOC_UDA1334 | 1 + configs/fedora/generic/CONFIG_SOUNDWIRE_BUS | 1 - configs/fedora/generic/CONFIG_TEST_LIVEPATCH | 1 + configs/fedora/generic/CONFIG_TINYDRM_HX8357D | 1 + configs/fedora/generic/CONFIG_TINYDRM_ILI9225 | 1 + configs/fedora/generic/CONFIG_TINYDRM_ILI9341 | 1 + .../fedora/generic/CONFIG_TINYDRM_MI0283QT | 1 + configs/fedora/generic/CONFIG_TINYDRM_REPAPER | 1 + configs/fedora/generic/CONFIG_TINYDRM_ST7586 | 1 + configs/fedora/generic/CONFIG_TINYDRM_ST7735R | 1 + configs/fedora/generic/CONFIG_TLS_DEVICE | 2 +- .../fedora/generic/CONFIG_UAPI_HEADER_TEST | 1 + configs/fedora/generic/CONFIG_USB_CDNS3 | 1 + configs/fedora/generic/CONFIG_USB_CONN_GPIO | 1 + .../fedora/generic/CONFIG_USB_OHCI_HCD_SSB | 1 + configs/fedora/generic/CONFIG_USB_RIO500 | 1 - configs/fedora/generic/CONFIG_VIRTIO_FS | 1 + configs/fedora/generic/CONFIG_W1_MASTER_SGI | 1 + configs/fedora/generic/CONFIG_W1_SLAVE_DS250X | 1 + configs/fedora/generic/arm/CONFIG_APDS9960 | 1 + configs/fedora/generic/arm/CONFIG_ARCH_ASPEED | 1 + .../CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM | 1 + .../generic/arm/CONFIG_ARM_PSCI_CPUIDLE | 1 + configs/fedora/generic/arm/CONFIG_ARM_PSCI_FW | 1 + .../generic/arm/CONFIG_ARM_QCOM_CPUFREQ_KRYO | 1 - .../generic/arm/CONFIG_BATTERY_GAUGE_LTC2941 | 1 + .../generic/arm/CONFIG_BATTERY_MAX17040 | 1 + configs/fedora/generic/arm/CONFIG_CAN_MCP251X | 1 + configs/fedora/generic/arm/CONFIG_CROS_EC | 1 + .../fedora/generic/arm/CONFIG_CROS_EC_CHARDEV | 1 + .../generic/arm/CONFIG_CRYPTO_AEGIS128_SIMD | 1 + configs/fedora/generic/arm/CONFIG_DRM_TINYDRM | 1 - configs/fedora/generic/arm/CONFIG_GPIO_MOXTET | 1 + .../{armv7/armv7 => }/CONFIG_GPIO_TPS6586X | 0 configs/fedora/generic/arm/CONFIG_HDC100X | 1 + configs/fedora/generic/arm/CONFIG_HTU21 | 1 + configs/fedora/generic/arm/CONFIG_IMX7ULP_WDT | 1 + configs/fedora/generic/arm/CONFIG_IMX_DSP | 1 + .../generic/arm/CONFIG_INPUT_PWM_BEEPER | 1 - .../arm/CONFIG_INTERCONNECT_QCOM_QCS404 | 1 + .../fedora/generic/arm/CONFIG_LEDS_PCA963X | 1 + configs/fedora/generic/arm/CONFIG_MAG3110 | 1 + configs/fedora/generic/arm/CONFIG_MCP320X | 1 + configs/fedora/generic/arm/CONFIG_MCP3422 | 1 + .../generic/arm/CONFIG_MESON_EE_PM_DOMAINS | 1 + configs/fedora/generic/arm/CONFIG_MFD_CROS_EC | 1 - .../generic/arm/CONFIG_MFD_CROS_EC_CHARDEV | 1 - .../fedora/generic/arm/CONFIG_MFD_CROS_EC_DEV | 1 + configs/fedora/generic/arm/CONFIG_MOXTET | 1 + configs/fedora/generic/arm/CONFIG_PWM_PCA9685 | 1 + .../fedora/generic/arm/CONFIG_QCOM_SOCINFO | 1 + configs/fedora/generic/arm/CONFIG_RESET_SCMI | 1 + .../generic/arm/CONFIG_RTC_DRV_MESON_VRTC | 1 + .../arm/{armv7 => }/CONFIG_SENSORS_GPIO_FAN | 0 .../generic/arm/{armv7 => }/CONFIG_SI7020 | 0 configs/fedora/generic/arm/CONFIG_SM_GCC_8150 | 1 + .../generic/arm/CONFIG_SND_SOC_ADAU1977_I2C | 1 + .../fedora/generic/arm/CONFIG_SND_SOC_CS4265 | 1 + .../generic/arm/CONFIG_SND_SOC_CS4271_I2C | 1 + .../armv7 => }/CONFIG_SND_SOC_CS42XX8_I2C | 0 .../fedora/generic/arm/CONFIG_SND_SOC_DA7213 | 1 + .../generic/arm/CONFIG_SND_SOC_ICS43432 | 1 + .../{aarch64 => }/CONFIG_SND_SOC_MAX98357A | 0 .../generic/arm/CONFIG_SND_SOC_PCM5102A | 1 + .../arm/{aarch64 => }/CONFIG_SND_SOC_SGTL5000 | 0 .../armv7 => }/CONFIG_SND_SOC_TLV320AIC23 | 0 .../armv7 => }/CONFIG_SND_SOC_TLV320AIC23_I2C | 0 .../armv7 => }/CONFIG_SND_SOC_TLV320AIC23_SPI | 0 .../{armv7/armv7 => }/CONFIG_SND_SOC_WM8731 | 0 .../fedora/generic/arm/CONFIG_SND_SOC_WM8741 | 1 + .../fedora/generic/arm/CONFIG_TCG_FTPM_TEE | 1 + .../generic/arm/CONFIG_TINYDRM_MIPI_DBI | 1 - .../{armv7 => }/CONFIG_TOUCHSCREEN_ADS7846 | 0 .../generic/arm/CONFIG_TOUCHSCREEN_EXC3000 | 1 + .../generic/arm/CONFIG_TOUCHSCREEN_GOODIX | 1 + configs/fedora/generic/arm/CONFIG_TSL4531 | 1 + .../fedora/generic/arm/CONFIG_TURRIS_MOX_RWTM | 1 + .../fedora/generic/arm/CONFIG_USB_CONN_GPIO | 1 + .../fedora/generic/arm/CONFIG_USB_OHCI_HCD | 1 + configs/fedora/generic/arm/CONFIG_VEML6070 | 1 + .../fedora/generic/arm/CONFIG_VIDEO_SUN4I_CSI | 1 + .../arm/aarch64/CONFIG_ARM64_TAGGED_ADDR_ABI | 1 + .../arm/aarch64/CONFIG_ARM64_VA_BITS_52 | 1 + .../arm/aarch64/CONFIG_ARM_QCOM_CPUFREQ_NVMEM | 1 + .../CONFIG_CAVIUM_TX2_ERRATUM_219 | 0 .../generic/arm/aarch64/CONFIG_CLK_IMX8MN | 1 + .../arm/aarch64/CONFIG_CRYPTO_DEV_HISI_ZIP | 1 + .../generic/arm/aarch64/CONFIG_EDAC_BLUEFIELD | 1 + .../arm/aarch64/CONFIG_HISI_KIRIN_DW_DSI | 1 - .../generic/arm/aarch64/CONFIG_KEXEC_SIG | 1 + .../fedora/generic/arm/aarch64/CONFIG_NR_CPUS | 2 +- .../fedora/generic/arm/aarch64/CONFIG_PCIE_AL | 1 + .../generic/arm/aarch64/CONFIG_PCIE_TEGRA194 | 1 + .../arm/aarch64/CONFIG_PHY_TEGRA194_P2U | 1 + .../generic/arm/aarch64/CONFIG_QCOM_SOCINFO | 1 + .../arm/aarch64/CONFIG_RTC_DRV_FSL_FTM_ALARM | 1 + .../generic/arm/aarch64/CONFIG_SM_GCC_8150 | 1 + .../generic/arm/armv7/CONFIG_ARCH_MULTI_V5 | 1 + .../generic/arm/armv7/CONFIG_EDAC_ARMADA_XP | 1 + .../generic/arm/armv7/CONFIG_MTD_M25P80 | 1 - .../generic/arm/armv7/CONFIG_SND_SOC_SGTL5000 | 1 - .../armv7/armv7/CONFIG_ARM_TEGRA20_DEVFREQ | 1 + .../CONFIG_DRM_OMAP_PANEL_LGPHILIPS_LB035Q02 | 1 - .../CONFIG_DRM_OMAP_PANEL_NEC_NL8048HL11 | 1 - .../CONFIG_DRM_OMAP_PANEL_SHARP_LS037V7DW01 | 1 - .../CONFIG_DRM_OMAP_PANEL_SONY_ACX565AKM | 1 - .../CONFIG_DRM_OMAP_PANEL_TPO_TD028TTEC1 | 1 - .../CONFIG_DRM_OMAP_PANEL_TPO_TD043MTEA1 | 1 - .../arm/armv7/armv7/CONFIG_QCOM_COMMAND_DB | 1 + .../fedora/generic/powerpc/CONFIG_EFI_TEST | 1 + .../fedora/generic/powerpc/CONFIG_HMM_MIRROR | 2 +- .../generic/powerpc/CONFIG_INPUT_PWM_BEEPER | 1 - configs/fedora/generic/powerpc/CONFIG_NR_CPUS | 2 +- .../fedora/generic/powerpc/CONFIG_OPAL_CORE | 1 + configs/fedora/generic/powerpc/CONFIG_PPC_SVM | 1 + .../generic/powerpc/CONFIG_SND_HDA_INTEL | 1 + .../powerpc/CONFIG_SND_HDA_INTEL_DETECT_DMIC | 1 + .../generic/s390x/CONFIG_CRYPTO_SHA3_256_S390 | 1 + .../generic/s390x/CONFIG_CRYPTO_SHA3_512_S390 | 1 + configs/fedora/generic/s390x/CONFIG_EFI_TEST | 1 + .../generic/s390x/CONFIG_INPUT_PWM_BEEPER | 1 + configs/fedora/generic/s390x/CONFIG_KEXEC_SIG | 1 + .../generic/s390x/CONFIG_KEXEC_VERIFY_SIG | 1 - configs/fedora/generic/s390x/CONFIG_MARCH_Z15 | 1 + configs/fedora/generic/s390x/CONFIG_NR_CPUS | 2 +- configs/fedora/generic/s390x/CONFIG_TUNE_Z15 | 1 + .../generic/x86/CONFIG_CPU_IDLE_GOV_HALTPOLL | 1 + configs/fedora/generic/x86/CONFIG_CROS_EC | 1 + configs/fedora/generic/x86/CONFIG_CROS_EC_I2C | 1 - .../fedora/generic/x86/CONFIG_CROS_EC_PROTO | 1 - configs/fedora/generic/x86/CONFIG_CROS_EC_SPI | 1 - .../generic/x86/CONFIG_DRM_AMD_DC_DCN2_1 | 1 + .../fedora/generic/x86/CONFIG_EFI_RCI2_TABLE | 1 + .../generic/x86/CONFIG_HALTPOLL_CPUIDLE | 1 + .../fedora/generic/{ => x86}/CONFIG_KS0108 | 0 .../generic/{ => x86}/CONFIG_KS0108_DELAY | 0 .../generic/{ => x86}/CONFIG_KS0108_PORT | 0 .../generic/x86/CONFIG_LOCK_DOWN_KERNEL | 1 - .../generic/x86/CONFIG_LOCK_DOWN_KERNEL_FORCE | 1 - configs/fedora/generic/x86/CONFIG_MAXSMP | 2 +- .../generic/x86/CONFIG_PARAVIRT_SPINLOCKS | 2 +- .../fedora/generic/x86/CONFIG_SND_HDA_INTEL | 1 + .../x86/CONFIG_SND_HDA_INTEL_DETECT_DMIC | 1 + ...SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH | 1 + ...IG_SND_SOC_INTEL_GLK_DA7219_MAX98357A_MACH | 1 + ...CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC | 2 +- ...ONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC~ | 1 + ...G_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH | 2 + ..._SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH~ | 1 + .../x86/CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH | 1 + ...FIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES | 1 + .../x86/CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT | 1 + .../x86/CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT | 1 + .../x86/CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT | 1 + .../CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT | 1 + .../CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT | 1 + .../CONFIG_SND_SOC_SOF_ELKHARTLAKE_SUPPORT | 1 + .../x86/CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT | 1 + ...ONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1 | 1 + ...NFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1~ | 1 + .../x86/CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC | 1 + .../CONFIG_SND_SOC_SOF_HDA_COMMON_HDMI_CODEC | 1 + .../generic/x86/CONFIG_SND_SOC_SOF_HDA_LINK | 1 + .../x86/CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT | 1 + .../x86/CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL | 2 +- .../x86/CONFIG_SND_SOC_SOF_JASPERLAKE_SUPPORT | 1 + .../x86/CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT | 1 + .../x86/CONFIG_SND_SOC_SOF_TIGERLAKE_SUPPORT | 1 + .../generic/x86/CONFIG_VIDEO_CROS_EC_CEC | 1 - .../generic/x86/i686/CONFIG_CRYPTO_AES_586 | 1 - .../generic/x86/i686/CONFIG_INPUT_PWM_BEEPER | 1 - .../generic/x86/x86_64/CONFIG_CROS_EC_CHARDEV | 1 + .../x86_64/CONFIG_CRYPTO_AEGIS128L_AESNI_SSE2 | 1 - .../x86_64/CONFIG_CRYPTO_AEGIS256_AESNI_SSE2 | 1 - .../x86/x86_64/CONFIG_CRYPTO_AES_X86_64 | 1 - .../x86/x86_64/CONFIG_CRYPTO_MORUS1280_AVX2 | 1 - .../x86/x86_64/CONFIG_CRYPTO_MORUS1280_SSE2 | 1 - .../x86/x86_64/CONFIG_CRYPTO_MORUS640_SSE2 | 1 - .../generic/x86/x86_64/CONFIG_MFD_CROS_EC | 1 - .../x86/x86_64/CONFIG_MFD_CROS_EC_CHARDEV | 1 - .../generic/x86/x86_64/CONFIG_MFD_CROS_EC_DEV | 1 + .../fedora/generic/x86/x86_64/CONFIG_NR_CPUS | 2 +- .../x86/x86_64/CONFIG_OPTIMIZE_INLINING | 1 - .../fedora/generic/x86/x86_64/CONFIG_SGI_IOC4 | 1 - .../generic/x86/x86_64/CONFIG_X86_5LEVEL | 2 +- configs/flavors | 1 + .../{config_generation => priority.fedora} | 0 configs/process_configs.sh | 97 +- cpupower.config | 0 cpupower.service | 0 crash-driver.patch | 722 - die-floppy-die.patch | 29 - drm-i915-hush-check-crtc-state.patch | 32 - dwc3-fix.patch | 80 - efi-lockdown.patch | 2173 --- efi-secureboot.patch | 254 +- filter-aarch64.sh.fedora | 18 + filter-aarch64.sh.rhel | 0 filter-armv7hl.sh.fedora | 18 + filter-armv7hl.sh.rhel | 0 filter-i686.sh.fedora | 14 + filter-i686.sh.rhel | 0 filter-modules.sh.fedora | 153 + filter-modules.sh.rhel | 0 filter-ppc64le.sh.fedora | 14 + filter-ppc64le.sh.rhel | 0 filter-s390x.sh.fedora | 12 + filter-s390x.sh.rhel | 0 filter-x86_64.sh.fedora | 12 + filter-x86_64.sh.rhel | 0 ...RN-from-usermodehelper_read_trylock-.patch | 89 - generate_all_configs.sh | 34 +- ...-Use-correct-unit-for-debounce-times.patch | 475 + input-kill-stupid-messages.patch | 30 - ...nfig => kernel-aarch64-debug-fedora.config | 225 +- kernel-aarch64-debug-rhel.config | 1 + ...h64.config => kernel-aarch64-fedora.config | 223 +- kernel-aarch64-rhel.config | 1 + ...nfig => kernel-armv7hl-debug-fedora.config | 210 +- ...7hl.config => kernel-armv7hl-fedora.config | 208 +- ...=> kernel-armv7hl-lpae-debug-fedora.config | 211 +- ...onfig => kernel-armv7hl-lpae-fedora.config | 209 +- ....config => kernel-i686-debug-fedora.config | 167 +- ...l-i686.config => kernel-i686-fedora.config | 167 +- ...nfig => kernel-ppc64le-debug-fedora.config | 140 +- kernel-ppc64le-debug-rhel.config | 1 + ...4le.config => kernel-ppc64le-fedora.config | 138 +- kernel-ppc64le-rhel.config | 1 + ...config => kernel-s390x-debug-fedora.config | 144 +- kernel-s390x-debug-rhel.config | 1 + ...s390x.config => kernel-s390x-fedora.config | 142 +- kernel-s390x-rhel.config | 1 + kernel-s390x-zfcpdump-rhel.config | 1 + ...onfig => kernel-x86_64-debug-fedora.config | 179 +- kernel-x86_64-debug-rhel.config | 1 + ...6_64.config => kernel-x86_64-fedora.config | 181 +- kernel-x86_64-rhel.config | 1 + kernel.spec | 1211 +- ...-CPUMASK_OFFSTACK-usable-without-deb.patch | 34 - lift-lockdown-sysrq.patch | 287 + lis3-improve-handling-of-null-rate.patch | 75 - mod-extra-blacklist.sh | 48 + mod-extra.list | 2 + mod-extra.list.fedora | 196 + mod-extra.list.rhel | 0 mod-extra.sh | 62 +- mod-internal.list | 4 + namespaces-no-expert.patch | 27 - no-pcspkr-modalias.patch | 22 - parallel_xz.sh | 26 + redhatsecureboot003.cer | Bin 0 -> 829 bytes redhatsecurebootca2.cer | Bin 0 -> 872 bytes scripts/create_headers_tarball.sh | 8 +- ...validate_disk-prevent-NULL-ptr-deref.patch | 39 - secureboot.cer | Bin 0 -> 899 bytes securebootca.cer | Bin 0 -> 977 bytes sources | 5 +- update_scripts.sh | 12 + x509.genkey.fedora | 16 + x509.genkey.rhel | 16 + 393 files changed, 17256 insertions(+), 5986 deletions(-) delete mode 100644 0001-ASoC-SOF-Fix-memory-leak-in-sof_dfsentry_write.patch delete mode 100644 0001-RDMA-Fix-goto-target-to-release-the-allocated-memory.patch delete mode 100644 0001-ath9k-release-allocated-buffer-if-timed-out.patch delete mode 100644 0001-ath9k_htc-release-allocated-buffer-if-timed-out.patch delete mode 100644 0001-drm-amd-display-prevent-memory-leak.patch create mode 100644 0001-drm-nouveau-Move-the-declaration-of-struct-nouveau_c.patch delete mode 100644 0001-iwlwifi-dbg_ini-fix-memory-leak-in-alloc_sgtable.patch delete mode 100644 0001-iwlwifi-pcie-fix-memory-leaks-in-iwl_pcie_ctxt_info_.patch delete mode 100644 0001-nl80211-fix-memory-leak-in-nl80211_get_ftm_responder.patch delete mode 100644 0001-tracing-Have-error-path-in-predicate_parse-free-its-.patch create mode 100644 0002-drm-nouveau-Fix-drm-core-using-atomic-code-paths-on-.patch delete mode 100644 Input-synaptics-pin-3-touches-when-the-firmware-repo.patch delete mode 100644 Kbuild-Add-an-option-to-enable-GCC-VTA.patch create mode 100644 Module.kabi_aarch64 create mode 100644 Module.kabi_dup_aarch64 create mode 100644 Module.kabi_dup_ppc64le create mode 100644 Module.kabi_dup_s390x create mode 100644 Module.kabi_dup_x86_64 create mode 100644 Module.kabi_ppc64le create mode 100644 Module.kabi_s390x create mode 100644 Module.kabi_x86_64 delete mode 100644 Revert-ARM-bcm283x-Switch-V3D-over-to-using-the-PM-driver-instead-of-firmware.patch create mode 100644 alsa-5.5.patch create mode 100644 alsa-5.6.patch delete mode 100644 arm64-dts-qcom-Add-Lenovo-Yoga-C630.patch delete mode 100644 ath9k-rx-dma-stop-check.patch create mode 100644 check-kabi delete mode 100644 configs/fedora/debug/CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE create mode 100644 configs/fedora/debug/CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE delete mode 100644 configs/fedora/debug/x86/x86_64/CONFIG_NR_CPUS create mode 100644 configs/fedora/debug/x86/x86_64/README create mode 100644 configs/fedora/generic/CONFIG_ADIN_PHY create mode 100644 configs/fedora/generic/CONFIG_ADIS16460 delete mode 100644 configs/fedora/generic/CONFIG_AMD_XGBE delete mode 100644 configs/fedora/generic/CONFIG_ARCH_IOP13XX delete mode 100644 configs/fedora/generic/CONFIG_ARCH_IOP33X delete mode 100644 configs/fedora/generic/CONFIG_ARCH_KS8695 delete mode 100644 configs/fedora/generic/CONFIG_ARCH_LPC32XX delete mode 100644 configs/fedora/generic/CONFIG_ARCH_W90X900 create mode 100644 configs/fedora/generic/CONFIG_ATH9K_PCI_NO_EEPROM create mode 100644 configs/fedora/generic/CONFIG_BLK_CGROUP_IOCOST create mode 100644 configs/fedora/generic/CONFIG_CAN_F81601 create mode 100644 configs/fedora/generic/CONFIG_CAN_J1939 create mode 100644 configs/fedora/generic/CONFIG_CAN_KVASER_PCIEFD create mode 100644 configs/fedora/generic/CONFIG_CAN_M_CAN_PLATFORM create mode 100644 configs/fedora/generic/CONFIG_CAN_M_CAN_TCAN4X5X create mode 100644 configs/fedora/generic/CONFIG_CPU_IDLE_GOV_HALTPOLL delete mode 100644 configs/fedora/generic/CONFIG_CRASH create mode 100644 configs/fedora/generic/CONFIG_CROS_EC delete mode 100644 configs/fedora/generic/CONFIG_CRYPTO_AEGIS128L delete mode 100644 configs/fedora/generic/CONFIG_CRYPTO_AEGIS256 create mode 100644 configs/fedora/generic/CONFIG_CRYPTO_DEV_CCP_DEBUGFS create mode 100644 configs/fedora/generic/CONFIG_CRYPTO_DEV_SAFEXCEL create mode 100644 configs/fedora/generic/CONFIG_CRYPTO_ESSIV delete mode 100644 configs/fedora/generic/CONFIG_CRYPTO_MORUS1280 delete mode 100644 configs/fedora/generic/CONFIG_CRYPTO_MORUS640 delete mode 100644 configs/fedora/generic/CONFIG_DEBUG_INFO_VTA create mode 100644 configs/fedora/generic/CONFIG_DMABUF_SELFTESTS create mode 100644 configs/fedora/generic/CONFIG_DM_CLONE create mode 100644 configs/fedora/generic/CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG create mode 100644 configs/fedora/generic/CONFIG_DRM_GM12U320 create mode 100644 configs/fedora/generic/CONFIG_DRM_PANEL_LG_LB035Q02 create mode 100644 configs/fedora/generic/CONFIG_DRM_PANEL_NEC_NL8048HL11 create mode 100644 configs/fedora/generic/CONFIG_DRM_PANEL_NOVATEK_NT39016 create mode 100644 configs/fedora/generic/CONFIG_DRM_PANEL_RAYDIUM_RM67191 create mode 100644 configs/fedora/generic/CONFIG_DRM_PANEL_SHARP_LS037V7DW01 create mode 100644 configs/fedora/generic/CONFIG_DRM_PANEL_SONY_ACX565AKM create mode 100644 configs/fedora/generic/CONFIG_DRM_PANEL_TPO_TD028TTEC1 create mode 100644 configs/fedora/generic/CONFIG_DRM_PANEL_TPO_TD043MTEA1 delete mode 100644 configs/fedora/generic/CONFIG_DRM_TINYDRM create mode 100644 configs/fedora/generic/CONFIG_EFI_RCI2_TABLE create mode 100644 configs/fedora/generic/CONFIG_EXFAT_FS create mode 100644 configs/fedora/generic/CONFIG_FSL_ENETC_MDIO create mode 100644 configs/fedora/generic/CONFIG_FS_VERITY create mode 100644 configs/fedora/generic/CONFIG_FS_VERITY_BUILTIN_SIGNATURES create mode 100644 configs/fedora/generic/CONFIG_FS_VERITY_DEBUG create mode 100644 configs/fedora/generic/CONFIG_HID_CREATIVE_SB0540 delete mode 100644 configs/fedora/generic/CONFIG_I2C_BCM2048 create mode 100644 configs/fedora/generic/CONFIG_IMA_APPRAISE_MODSIG create mode 100644 configs/fedora/generic/CONFIG_IMA_DEFAULT_HASH_SHA512 create mode 100644 configs/fedora/generic/CONFIG_IONIC create mode 100644 configs/fedora/generic/CONFIG_JOYSTICK_FSIA6B create mode 100644 configs/fedora/generic/CONFIG_KERNEL_HEADER_TEST delete mode 100644 configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL create mode 100644 configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY create mode 100644 configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY create mode 100644 configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE create mode 100644 configs/fedora/generic/CONFIG_MAX5432 create mode 100644 configs/fedora/generic/CONFIG_MLX5_SW_STEERING create mode 100644 configs/fedora/generic/CONFIG_MLX5_TLS create mode 100644 configs/fedora/generic/CONFIG_MMC_SDHCI_OF_ASPEED create mode 100644 configs/fedora/generic/CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS create mode 100644 configs/fedora/generic/CONFIG_MOXTET create mode 100644 configs/fedora/generic/CONFIG_MTD_NAND_MXIC create mode 100644 configs/fedora/generic/CONFIG_NET_DSA_MICROCHIP_KSZ8795 create mode 100644 configs/fedora/generic/CONFIG_NET_DSA_MICROCHIP_KSZ9477_I2C create mode 100644 configs/fedora/generic/CONFIG_NET_TC_SKB_EXT create mode 100644 configs/fedora/generic/CONFIG_NET_VENDOR_PENSANDO create mode 100644 configs/fedora/generic/CONFIG_NOA1305 create mode 100644 configs/fedora/generic/CONFIG_PINCTRL_SC7180 delete mode 100644 configs/fedora/generic/CONFIG_PREEMPT_LL create mode 100644 configs/fedora/generic/CONFIG_RANDOM_TRUST_BOOTLOADER create mode 100644 configs/fedora/generic/CONFIG_READ_ONLY_THP_FOR_FS create mode 100644 configs/fedora/generic/CONFIG_REGULATOR_SY8824X create mode 100644 configs/fedora/generic/CONFIG_SECURITY_LOCKDOWN_LSM create mode 100644 configs/fedora/generic/CONFIG_SECURITY_LOCKDOWN_LSM_EARLY delete mode 100644 configs/fedora/generic/CONFIG_SENSORS_ADS1015 create mode 100644 configs/fedora/generic/CONFIG_SENSORS_AS370 create mode 100644 configs/fedora/generic/CONFIG_SENSORS_INSPUR_IPSPS delete mode 100644 configs/fedora/generic/CONFIG_SERIAL_8250_MOXA create mode 100644 configs/fedora/generic/CONFIG_SERIAL_FSL_LINFLEXUART delete mode 100644 configs/fedora/generic/CONFIG_SGI_IOC4 create mode 100644 configs/fedora/generic/CONFIG_SND_HDA_INTEL_DETECT_DMIC create mode 100644 configs/fedora/generic/CONFIG_SND_SOC_SOF_OF create mode 100644 configs/fedora/generic/CONFIG_SND_SOC_UDA1334 delete mode 100644 configs/fedora/generic/CONFIG_SOUNDWIRE_BUS create mode 100644 configs/fedora/generic/CONFIG_TEST_LIVEPATCH create mode 100644 configs/fedora/generic/CONFIG_TINYDRM_HX8357D create mode 100644 configs/fedora/generic/CONFIG_TINYDRM_ILI9225 create mode 100644 configs/fedora/generic/CONFIG_TINYDRM_ILI9341 create mode 100644 configs/fedora/generic/CONFIG_TINYDRM_MI0283QT create mode 100644 configs/fedora/generic/CONFIG_TINYDRM_REPAPER create mode 100644 configs/fedora/generic/CONFIG_TINYDRM_ST7586 create mode 100644 configs/fedora/generic/CONFIG_TINYDRM_ST7735R create mode 100644 configs/fedora/generic/CONFIG_UAPI_HEADER_TEST create mode 100644 configs/fedora/generic/CONFIG_USB_CDNS3 create mode 100644 configs/fedora/generic/CONFIG_USB_CONN_GPIO create mode 100644 configs/fedora/generic/CONFIG_USB_OHCI_HCD_SSB delete mode 100644 configs/fedora/generic/CONFIG_USB_RIO500 create mode 100644 configs/fedora/generic/CONFIG_VIRTIO_FS create mode 100644 configs/fedora/generic/CONFIG_W1_MASTER_SGI create mode 100644 configs/fedora/generic/CONFIG_W1_SLAVE_DS250X create mode 100644 configs/fedora/generic/arm/CONFIG_APDS9960 create mode 100644 configs/fedora/generic/arm/CONFIG_ARCH_ASPEED create mode 100644 configs/fedora/generic/arm/CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM create mode 100644 configs/fedora/generic/arm/CONFIG_ARM_PSCI_CPUIDLE create mode 100644 configs/fedora/generic/arm/CONFIG_ARM_PSCI_FW delete mode 100644 configs/fedora/generic/arm/CONFIG_ARM_QCOM_CPUFREQ_KRYO create mode 100644 configs/fedora/generic/arm/CONFIG_BATTERY_GAUGE_LTC2941 create mode 100644 configs/fedora/generic/arm/CONFIG_BATTERY_MAX17040 create mode 100644 configs/fedora/generic/arm/CONFIG_CAN_MCP251X create mode 100644 configs/fedora/generic/arm/CONFIG_CROS_EC create mode 100644 configs/fedora/generic/arm/CONFIG_CROS_EC_CHARDEV create mode 100644 configs/fedora/generic/arm/CONFIG_CRYPTO_AEGIS128_SIMD delete mode 100644 configs/fedora/generic/arm/CONFIG_DRM_TINYDRM create mode 100644 configs/fedora/generic/arm/CONFIG_GPIO_MOXTET rename configs/fedora/generic/arm/{armv7/armv7 => }/CONFIG_GPIO_TPS6586X (100%) create mode 100644 configs/fedora/generic/arm/CONFIG_HDC100X create mode 100644 configs/fedora/generic/arm/CONFIG_HTU21 create mode 100644 configs/fedora/generic/arm/CONFIG_IMX7ULP_WDT create mode 100644 configs/fedora/generic/arm/CONFIG_IMX_DSP delete mode 100644 configs/fedora/generic/arm/CONFIG_INPUT_PWM_BEEPER create mode 100644 configs/fedora/generic/arm/CONFIG_INTERCONNECT_QCOM_QCS404 create mode 100644 configs/fedora/generic/arm/CONFIG_LEDS_PCA963X create mode 100644 configs/fedora/generic/arm/CONFIG_MAG3110 create mode 100644 configs/fedora/generic/arm/CONFIG_MCP320X create mode 100644 configs/fedora/generic/arm/CONFIG_MCP3422 create mode 100644 configs/fedora/generic/arm/CONFIG_MESON_EE_PM_DOMAINS delete mode 100644 configs/fedora/generic/arm/CONFIG_MFD_CROS_EC delete mode 100644 configs/fedora/generic/arm/CONFIG_MFD_CROS_EC_CHARDEV create mode 100644 configs/fedora/generic/arm/CONFIG_MFD_CROS_EC_DEV create mode 100644 configs/fedora/generic/arm/CONFIG_MOXTET create mode 100644 configs/fedora/generic/arm/CONFIG_PWM_PCA9685 create mode 100644 configs/fedora/generic/arm/CONFIG_QCOM_SOCINFO create mode 100644 configs/fedora/generic/arm/CONFIG_RESET_SCMI create mode 100644 configs/fedora/generic/arm/CONFIG_RTC_DRV_MESON_VRTC rename configs/fedora/generic/arm/{armv7 => }/CONFIG_SENSORS_GPIO_FAN (100%) rename configs/fedora/generic/arm/{armv7 => }/CONFIG_SI7020 (100%) create mode 100644 configs/fedora/generic/arm/CONFIG_SM_GCC_8150 create mode 100644 configs/fedora/generic/arm/CONFIG_SND_SOC_ADAU1977_I2C create mode 100644 configs/fedora/generic/arm/CONFIG_SND_SOC_CS4265 create mode 100644 configs/fedora/generic/arm/CONFIG_SND_SOC_CS4271_I2C rename configs/fedora/generic/arm/{armv7/armv7 => }/CONFIG_SND_SOC_CS42XX8_I2C (100%) create mode 100644 configs/fedora/generic/arm/CONFIG_SND_SOC_DA7213 create mode 100644 configs/fedora/generic/arm/CONFIG_SND_SOC_ICS43432 rename configs/fedora/generic/arm/{aarch64 => }/CONFIG_SND_SOC_MAX98357A (100%) create mode 100644 configs/fedora/generic/arm/CONFIG_SND_SOC_PCM5102A rename configs/fedora/generic/arm/{aarch64 => }/CONFIG_SND_SOC_SGTL5000 (100%) rename configs/fedora/generic/arm/{armv7/armv7 => }/CONFIG_SND_SOC_TLV320AIC23 (100%) rename configs/fedora/generic/arm/{armv7/armv7 => }/CONFIG_SND_SOC_TLV320AIC23_I2C (100%) rename configs/fedora/generic/arm/{armv7/armv7 => }/CONFIG_SND_SOC_TLV320AIC23_SPI (100%) rename configs/fedora/generic/arm/{armv7/armv7 => }/CONFIG_SND_SOC_WM8731 (100%) create mode 100644 configs/fedora/generic/arm/CONFIG_SND_SOC_WM8741 create mode 100644 configs/fedora/generic/arm/CONFIG_TCG_FTPM_TEE delete mode 100644 configs/fedora/generic/arm/CONFIG_TINYDRM_MIPI_DBI rename configs/fedora/generic/arm/{armv7 => }/CONFIG_TOUCHSCREEN_ADS7846 (100%) create mode 100644 configs/fedora/generic/arm/CONFIG_TOUCHSCREEN_EXC3000 create mode 100644 configs/fedora/generic/arm/CONFIG_TOUCHSCREEN_GOODIX create mode 100644 configs/fedora/generic/arm/CONFIG_TSL4531 create mode 100644 configs/fedora/generic/arm/CONFIG_TURRIS_MOX_RWTM create mode 100644 configs/fedora/generic/arm/CONFIG_USB_CONN_GPIO create mode 100644 configs/fedora/generic/arm/CONFIG_USB_OHCI_HCD create mode 100644 configs/fedora/generic/arm/CONFIG_VEML6070 create mode 100644 configs/fedora/generic/arm/CONFIG_VIDEO_SUN4I_CSI create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_ARM64_TAGGED_ADDR_ABI create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_ARM64_VA_BITS_52 create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_ARM_QCOM_CPUFREQ_NVMEM rename configs/fedora/generic/arm/{ => aarch64}/CONFIG_CAVIUM_TX2_ERRATUM_219 (100%) create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_CLK_IMX8MN create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_CRYPTO_DEV_HISI_ZIP create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_EDAC_BLUEFIELD delete mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_HISI_KIRIN_DW_DSI create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_KEXEC_SIG create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_PCIE_AL create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_PCIE_TEGRA194 create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_PHY_TEGRA194_P2U create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_QCOM_SOCINFO create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_RTC_DRV_FSL_FTM_ALARM create mode 100644 configs/fedora/generic/arm/aarch64/CONFIG_SM_GCC_8150 create mode 100644 configs/fedora/generic/arm/armv7/CONFIG_ARCH_MULTI_V5 create mode 100644 configs/fedora/generic/arm/armv7/CONFIG_EDAC_ARMADA_XP delete mode 100644 configs/fedora/generic/arm/armv7/CONFIG_MTD_M25P80 delete mode 100644 configs/fedora/generic/arm/armv7/CONFIG_SND_SOC_SGTL5000 create mode 100644 configs/fedora/generic/arm/armv7/armv7/CONFIG_ARM_TEGRA20_DEVFREQ delete mode 100644 configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_LGPHILIPS_LB035Q02 delete mode 100644 configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_NEC_NL8048HL11 delete mode 100644 configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_SHARP_LS037V7DW01 delete mode 100644 configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_SONY_ACX565AKM delete mode 100644 configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_TPO_TD028TTEC1 delete mode 100644 configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_TPO_TD043MTEA1 create mode 100644 configs/fedora/generic/arm/armv7/armv7/CONFIG_QCOM_COMMAND_DB create mode 100644 configs/fedora/generic/powerpc/CONFIG_EFI_TEST delete mode 100644 configs/fedora/generic/powerpc/CONFIG_INPUT_PWM_BEEPER create mode 100644 configs/fedora/generic/powerpc/CONFIG_OPAL_CORE create mode 100644 configs/fedora/generic/powerpc/CONFIG_PPC_SVM create mode 100644 configs/fedora/generic/powerpc/CONFIG_SND_HDA_INTEL create mode 100644 configs/fedora/generic/powerpc/CONFIG_SND_HDA_INTEL_DETECT_DMIC create mode 100644 configs/fedora/generic/s390x/CONFIG_CRYPTO_SHA3_256_S390 create mode 100644 configs/fedora/generic/s390x/CONFIG_CRYPTO_SHA3_512_S390 create mode 100644 configs/fedora/generic/s390x/CONFIG_EFI_TEST create mode 100644 configs/fedora/generic/s390x/CONFIG_INPUT_PWM_BEEPER create mode 100644 configs/fedora/generic/s390x/CONFIG_KEXEC_SIG delete mode 100644 configs/fedora/generic/s390x/CONFIG_KEXEC_VERIFY_SIG create mode 100644 configs/fedora/generic/s390x/CONFIG_MARCH_Z15 create mode 100644 configs/fedora/generic/s390x/CONFIG_TUNE_Z15 create mode 100644 configs/fedora/generic/x86/CONFIG_CPU_IDLE_GOV_HALTPOLL create mode 100644 configs/fedora/generic/x86/CONFIG_CROS_EC delete mode 100644 configs/fedora/generic/x86/CONFIG_CROS_EC_I2C delete mode 100644 configs/fedora/generic/x86/CONFIG_CROS_EC_PROTO delete mode 100644 configs/fedora/generic/x86/CONFIG_CROS_EC_SPI create mode 100644 configs/fedora/generic/x86/CONFIG_DRM_AMD_DC_DCN2_1 create mode 100644 configs/fedora/generic/x86/CONFIG_EFI_RCI2_TABLE create mode 100644 configs/fedora/generic/x86/CONFIG_HALTPOLL_CPUIDLE rename configs/fedora/generic/{ => x86}/CONFIG_KS0108 (100%) rename configs/fedora/generic/{ => x86}/CONFIG_KS0108_DELAY (100%) rename configs/fedora/generic/{ => x86}/CONFIG_KS0108_PORT (100%) delete mode 100644 configs/fedora/generic/x86/CONFIG_LOCK_DOWN_KERNEL delete mode 100644 configs/fedora/generic/x86/CONFIG_LOCK_DOWN_KERNEL_FORCE create mode 100644 configs/fedora/generic/x86/CONFIG_SND_HDA_INTEL create mode 100644 configs/fedora/generic/x86/CONFIG_SND_HDA_INTEL_DETECT_DMIC create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_GLK_DA7219_MAX98357A_MACH create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC~ create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH~ create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_ELKHARTLAKE_SUPPORT create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1 create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1~ create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_COMMON_HDMI_CODEC create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_LINK create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_JASPERLAKE_SUPPORT create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT create mode 100644 configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_TIGERLAKE_SUPPORT delete mode 100644 configs/fedora/generic/x86/CONFIG_VIDEO_CROS_EC_CEC delete mode 100644 configs/fedora/generic/x86/i686/CONFIG_CRYPTO_AES_586 delete mode 100644 configs/fedora/generic/x86/i686/CONFIG_INPUT_PWM_BEEPER create mode 100644 configs/fedora/generic/x86/x86_64/CONFIG_CROS_EC_CHARDEV delete mode 100644 configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_AEGIS128L_AESNI_SSE2 delete mode 100644 configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_AEGIS256_AESNI_SSE2 delete mode 100644 configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_AES_X86_64 delete mode 100644 configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_MORUS1280_AVX2 delete mode 100644 configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_MORUS1280_SSE2 delete mode 100644 configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_MORUS640_SSE2 delete mode 100644 configs/fedora/generic/x86/x86_64/CONFIG_MFD_CROS_EC delete mode 100644 configs/fedora/generic/x86/x86_64/CONFIG_MFD_CROS_EC_CHARDEV create mode 100644 configs/fedora/generic/x86/x86_64/CONFIG_MFD_CROS_EC_DEV delete mode 100644 configs/fedora/generic/x86/x86_64/CONFIG_OPTIMIZE_INLINING delete mode 100644 configs/fedora/generic/x86/x86_64/CONFIG_SGI_IOC4 create mode 100644 configs/flavors rename configs/{config_generation => priority.fedora} (100%) create mode 100644 cpupower.config create mode 100644 cpupower.service delete mode 100644 crash-driver.patch delete mode 100644 die-floppy-die.patch delete mode 100644 drm-i915-hush-check-crtc-state.patch delete mode 100644 dwc3-fix.patch delete mode 100644 efi-lockdown.patch create mode 100644 filter-aarch64.sh.fedora create mode 100644 filter-aarch64.sh.rhel create mode 100644 filter-armv7hl.sh.fedora create mode 100644 filter-armv7hl.sh.rhel create mode 100644 filter-i686.sh.fedora create mode 100644 filter-i686.sh.rhel create mode 100755 filter-modules.sh.fedora create mode 100644 filter-modules.sh.rhel create mode 100644 filter-ppc64le.sh.fedora create mode 100644 filter-ppc64le.sh.rhel create mode 100644 filter-s390x.sh.fedora create mode 100644 filter-s390x.sh.rhel create mode 100644 filter-x86_64.sh.fedora create mode 100644 filter-x86_64.sh.rhel delete mode 100644 firmware-Drop-WARN-from-usermodehelper_read_trylock-.patch create mode 100644 gpio-max77620-Use-correct-unit-for-debounce-times.patch delete mode 100644 input-kill-stupid-messages.patch rename kernel-aarch64-debug.config => kernel-aarch64-debug-fedora.config (97%) create mode 100644 kernel-aarch64-debug-rhel.config rename kernel-aarch64.config => kernel-aarch64-fedora.config (97%) create mode 100644 kernel-aarch64-rhel.config rename kernel-armv7hl-debug.config => kernel-armv7hl-debug-fedora.config (97%) rename kernel-armv7hl.config => kernel-armv7hl-fedora.config (97%) rename kernel-armv7hl-lpae-debug.config => kernel-armv7hl-lpae-debug-fedora.config (97%) rename kernel-armv7hl-lpae.config => kernel-armv7hl-lpae-fedora.config (97%) rename kernel-i686-debug.config => kernel-i686-debug-fedora.config (97%) rename kernel-i686.config => kernel-i686-fedora.config (97%) rename kernel-ppc64le-debug.config => kernel-ppc64le-debug-fedora.config (98%) create mode 100644 kernel-ppc64le-debug-rhel.config rename kernel-ppc64le.config => kernel-ppc64le-fedora.config (98%) create mode 100644 kernel-ppc64le-rhel.config rename kernel-s390x-debug.config => kernel-s390x-debug-fedora.config (98%) create mode 100644 kernel-s390x-debug-rhel.config rename kernel-s390x.config => kernel-s390x-fedora.config (98%) create mode 100644 kernel-s390x-rhel.config create mode 100644 kernel-s390x-zfcpdump-rhel.config rename kernel-x86_64-debug.config => kernel-x86_64-debug-fedora.config (97%) create mode 100644 kernel-x86_64-debug-rhel.config rename kernel-x86_64.config => kernel-x86_64-fedora.config (97%) create mode 100644 kernel-x86_64-rhel.config delete mode 100644 lib-cpumask-Make-CPUMASK_OFFSTACK-usable-without-deb.patch create mode 100644 lift-lockdown-sysrq.patch delete mode 100644 lis3-improve-handling-of-null-rate.patch create mode 100755 mod-extra-blacklist.sh create mode 100644 mod-extra.list.fedora create mode 100644 mod-extra.list.rhel create mode 100644 mod-internal.list delete mode 100644 namespaces-no-expert.patch delete mode 100644 no-pcspkr-modalias.patch create mode 100755 parallel_xz.sh create mode 100644 redhatsecureboot003.cer create mode 100644 redhatsecurebootca2.cer delete mode 100644 scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch create mode 100644 secureboot.cer create mode 100644 securebootca.cer create mode 100755 update_scripts.sh create mode 100644 x509.genkey.fedora create mode 100644 x509.genkey.rhel diff --git a/0001-ASoC-SOF-Fix-memory-leak-in-sof_dfsentry_write.patch b/0001-ASoC-SOF-Fix-memory-leak-in-sof_dfsentry_write.patch deleted file mode 100644 index 587a2acd1..000000000 --- a/0001-ASoC-SOF-Fix-memory-leak-in-sof_dfsentry_write.patch +++ /dev/null @@ -1,37 +0,0 @@ -From c0a333d842ef67ac04adc72ff79dc1ccc3dca4ed Mon Sep 17 00:00:00 2001 -From: Navid Emamdoost -Date: Sun, 27 Oct 2019 14:48:47 -0500 -Subject: [PATCH] ASoC: SOF: Fix memory leak in sof_dfsentry_write - -In the implementation of sof_dfsentry_write() memory allocated for -string is leaked in case of an error. Go to error handling path if the -d_name.name is not valid. - -Fixes: 091c12e1f50c ("ASoC: SOF: debug: add new debugfs entries for IPC flood test") -Signed-off-by: Navid Emamdoost -Link: https://lore.kernel.org/r/20191027194856.4056-1-navid.emamdoost@gmail.com -Signed-off-by: Mark Brown ---- - sound/soc/sof/debug.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c -index 54cd431faab7..5529e8eeca46 100644 ---- a/sound/soc/sof/debug.c -+++ b/sound/soc/sof/debug.c -@@ -152,8 +152,10 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer, - * in the debugfs entry. - */ - if (strcmp(dfse->dfsentry->d_name.name, "ipc_flood_count") && -- strcmp(dfse->dfsentry->d_name.name, "ipc_flood_duration_ms")) -- return -EINVAL; -+ strcmp(dfse->dfsentry->d_name.name, "ipc_flood_duration_ms")) { -+ ret = -EINVAL; -+ goto out; -+ } - - if (!strcmp(dfse->dfsentry->d_name.name, "ipc_flood_duration_ms")) - flood_duration_test = true; --- -2.23.0 - diff --git a/0001-RDMA-Fix-goto-target-to-release-the-allocated-memory.patch b/0001-RDMA-Fix-goto-target-to-release-the-allocated-memory.patch deleted file mode 100644 index 87f4b4db7..000000000 --- a/0001-RDMA-Fix-goto-target-to-release-the-allocated-memory.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 4a9d46a9fe14401f21df69cea97c62396d5fb053 Mon Sep 17 00:00:00 2001 -From: Navid Emamdoost -Date: Tue, 10 Sep 2019 17:21:19 -0500 -Subject: [PATCH] RDMA: Fix goto target to release the allocated memory - -In bnxt_re_create_srq(), when ib_copy_to_udata() fails allocated memory -should be released by goto fail. - -Fixes: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters") -Link: https://lore.kernel.org/r/20190910222120.16517-1-navid.emamdoost@gmail.com -Signed-off-by: Navid Emamdoost -Reviewed-by: Jason Gunthorpe -Signed-off-by: Jason Gunthorpe ---- - drivers/infiniband/hw/bnxt_re/ib_verbs.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c -index f9e97d0cc459..b4149dc9e824 100644 ---- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c -+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c -@@ -1398,7 +1398,7 @@ int bnxt_re_create_srq(struct ib_srq *ib_srq, - dev_err(rdev_to_dev(rdev), "SRQ copy to udata failed!"); - bnxt_qplib_destroy_srq(&rdev->qplib_res, - &srq->qplib_srq); -- goto exit; -+ goto fail; - } - } - if (nq) --- -2.23.0 - diff --git a/0001-ath9k-release-allocated-buffer-if-timed-out.patch b/0001-ath9k-release-allocated-buffer-if-timed-out.patch deleted file mode 100644 index db71192a3..000000000 --- a/0001-ath9k-release-allocated-buffer-if-timed-out.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 728c1e2a05e4b5fc52fab3421dce772a806612a2 Mon Sep 17 00:00:00 2001 -From: Navid Emamdoost -Date: Fri, 6 Sep 2019 13:59:30 -0500 -Subject: [PATCH] ath9k: release allocated buffer if timed out - -In ath9k_wmi_cmd, the allocated network buffer needs to be released -if timeout happens. Otherwise memory will be leaked. - -Signed-off-by: Navid Emamdoost -Signed-off-by: Kalle Valo ---- - drivers/net/wireless/ath/ath9k/wmi.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c -index d1f6710ca63b..cdc146091194 100644 ---- a/drivers/net/wireless/ath/ath9k/wmi.c -+++ b/drivers/net/wireless/ath/ath9k/wmi.c -@@ -336,6 +336,7 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id, - ath_dbg(common, WMI, "Timeout waiting for WMI command: %s\n", - wmi_cmd_to_name(cmd_id)); - mutex_unlock(&wmi->op_mutex); -+ kfree_skb(skb); - return -ETIMEDOUT; - } - --- -2.23.0 - diff --git a/0001-ath9k_htc-release-allocated-buffer-if-timed-out.patch b/0001-ath9k_htc-release-allocated-buffer-if-timed-out.patch deleted file mode 100644 index 0d21d61c7..000000000 --- a/0001-ath9k_htc-release-allocated-buffer-if-timed-out.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 853acf7caf10b828102d92d05b5c101666a6142b Mon Sep 17 00:00:00 2001 -From: Navid Emamdoost -Date: Fri, 6 Sep 2019 13:26:03 -0500 -Subject: [PATCH] ath9k_htc: release allocated buffer if timed out - -In htc_config_pipe_credits, htc_setup_complete, and htc_connect_service -if time out happens, the allocated buffer needs to be released. -Otherwise there will be memory leak. - -Signed-off-by: Navid Emamdoost -Signed-off-by: Kalle Valo ---- - drivers/net/wireless/ath/ath9k/htc_hst.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c -index 1bf63a4efb4c..d091c8ebdcf0 100644 ---- a/drivers/net/wireless/ath/ath9k/htc_hst.c -+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c -@@ -170,6 +170,7 @@ static int htc_config_pipe_credits(struct htc_target *target) - time_left = wait_for_completion_timeout(&target->cmd_wait, HZ); - if (!time_left) { - dev_err(target->dev, "HTC credit config timeout\n"); -+ kfree_skb(skb); - return -ETIMEDOUT; - } - -@@ -205,6 +206,7 @@ static int htc_setup_complete(struct htc_target *target) - time_left = wait_for_completion_timeout(&target->cmd_wait, HZ); - if (!time_left) { - dev_err(target->dev, "HTC start timeout\n"); -+ kfree_skb(skb); - return -ETIMEDOUT; - } - -@@ -277,6 +279,7 @@ int htc_connect_service(struct htc_target *target, - if (!time_left) { - dev_err(target->dev, "Service connection timeout for: %d\n", - service_connreq->service_id); -+ kfree_skb(skb); - return -ETIMEDOUT; - } - --- -2.23.0 - diff --git a/0001-drm-amd-display-prevent-memory-leak.patch b/0001-drm-amd-display-prevent-memory-leak.patch deleted file mode 100644 index e74ad2913..000000000 --- a/0001-drm-amd-display-prevent-memory-leak.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 104c307147ad379617472dd91a5bcb368d72bd6d Mon Sep 17 00:00:00 2001 -From: Navid Emamdoost -Date: Tue, 24 Sep 2019 23:23:56 -0500 -Subject: [PATCH] drm/amd/display: prevent memory leak - -In dcn*_create_resource_pool the allocated memory should be released if -construct pool fails. - -Reviewed-by: Harry Wentland -Signed-off-by: Navid Emamdoost -Signed-off-by: Alex Deucher ---- - drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 1 + - drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 1 + - drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 1 + - drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c | 1 + - drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 1 + - 5 files changed, 5 insertions(+) - -diff --git a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c -index afc61055eca1..1787b9bf800a 100644 ---- a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c -+++ b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c -@@ -1091,6 +1091,7 @@ struct resource_pool *dce100_create_resource_pool( - if (construct(num_virtual_links, dc, pool)) - return &pool->base; - -+ kfree(pool); - BREAK_TO_DEBUGGER(); - return NULL; - } -diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c -index c66fe170e1e8..318e9c2e2ca8 100644 ---- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c -+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c -@@ -1462,6 +1462,7 @@ struct resource_pool *dce110_create_resource_pool( - if (construct(num_virtual_links, dc, pool, asic_id)) - return &pool->base; - -+ kfree(pool); - BREAK_TO_DEBUGGER(); - return NULL; - } -diff --git a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c -index 2b3a2917c168..83e1878161c9 100644 ---- a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c -+++ b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c -@@ -1342,6 +1342,7 @@ struct resource_pool *dce112_create_resource_pool( - if (construct(num_virtual_links, dc, pool)) - return &pool->base; - -+ kfree(pool); - BREAK_TO_DEBUGGER(); - return NULL; - } -diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c -index 236c4c0324b1..8b85e5274bba 100644 ---- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c -+++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c -@@ -1208,6 +1208,7 @@ struct resource_pool *dce120_create_resource_pool( - if (construct(num_virtual_links, dc, pool)) - return &pool->base; - -+ kfree(pool); - BREAK_TO_DEBUGGER(); - return NULL; - } -diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c -index 5a89e462e7cc..59305e411a66 100644 ---- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c -+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c -@@ -1570,6 +1570,7 @@ struct resource_pool *dcn10_create_resource_pool( - if (construct(init_data->num_virtual_links, dc, pool)) - return &pool->base; - -+ kfree(pool); - BREAK_TO_DEBUGGER(); - return NULL; - } --- -2.23.0 - diff --git a/0001-drm-nouveau-Move-the-declaration-of-struct-nouveau_c.patch b/0001-drm-nouveau-Move-the-declaration-of-struct-nouveau_c.patch new file mode 100644 index 000000000..548304eab --- /dev/null +++ b/0001-drm-nouveau-Move-the-declaration-of-struct-nouveau_c.patch @@ -0,0 +1,158 @@ +From 37a68eab4cd92b507c9e8afd760fdc18e4fecac6 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 24 Oct 2019 10:52:52 +0200 +Subject: [PATCH v2 1/2] drm/nouveau: Move the declaration of struct + nouveau_conn_atom up a bit + +Place the declaration of struct nouveau_conn_atom above that of +struct nouveau_connector. This commit makes no changes to the moved +block what so ever, it just moves it up a bit. + +This is a preparation patch to fix some issues with connector handling +on pre nv50 displays (which do not use atomic modesetting). + +Signed-off-by: Hans de Goede +Reviewed-by: Lyude Paul +Signed-off-by: Ben Skeggs +--- + drivers/gpu/drm/nouveau/nouveau_connector.h | 110 ++++++++++---------- + 1 file changed, 55 insertions(+), 55 deletions(-) + +diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.h b/drivers/gpu/drm/nouveau/nouveau_connector.h +index f43a8d63aef8..de9588420884 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_connector.h ++++ b/drivers/gpu/drm/nouveau/nouveau_connector.h +@@ -29,6 +29,7 @@ + + #include + ++#include + #include + #include + #include +@@ -44,6 +45,60 @@ struct dcb_output; + struct nouveau_backlight; + #endif + ++#define nouveau_conn_atom(p) \ ++ container_of((p), struct nouveau_conn_atom, state) ++ ++struct nouveau_conn_atom { ++ struct drm_connector_state state; ++ ++ struct { ++ /* The enum values specifically defined here match nv50/gf119 ++ * hw values, and the code relies on this. ++ */ ++ enum { ++ DITHERING_MODE_OFF = 0x00, ++ DITHERING_MODE_ON = 0x01, ++ DITHERING_MODE_DYNAMIC2X2 = 0x10 | DITHERING_MODE_ON, ++ DITHERING_MODE_STATIC2X2 = 0x18 | DITHERING_MODE_ON, ++ DITHERING_MODE_TEMPORAL = 0x20 | DITHERING_MODE_ON, ++ DITHERING_MODE_AUTO ++ } mode; ++ enum { ++ DITHERING_DEPTH_6BPC = 0x00, ++ DITHERING_DEPTH_8BPC = 0x02, ++ DITHERING_DEPTH_AUTO ++ } depth; ++ } dither; ++ ++ struct { ++ int mode; /* DRM_MODE_SCALE_* */ ++ struct { ++ enum { ++ UNDERSCAN_OFF, ++ UNDERSCAN_ON, ++ UNDERSCAN_AUTO, ++ } mode; ++ u32 hborder; ++ u32 vborder; ++ } underscan; ++ bool full; ++ } scaler; ++ ++ struct { ++ int color_vibrance; ++ int vibrant_hue; ++ } procamp; ++ ++ union { ++ struct { ++ bool dither:1; ++ bool scaler:1; ++ bool procamp:1; ++ }; ++ u8 mask; ++ } set; ++}; ++ + struct nouveau_connector { + struct drm_connector base; + enum dcb_connector_type type; +@@ -121,61 +176,6 @@ extern int nouveau_ignorelid; + extern int nouveau_duallink; + extern int nouveau_hdmimhz; + +-#include +-#define nouveau_conn_atom(p) \ +- container_of((p), struct nouveau_conn_atom, state) +- +-struct nouveau_conn_atom { +- struct drm_connector_state state; +- +- struct { +- /* The enum values specifically defined here match nv50/gf119 +- * hw values, and the code relies on this. +- */ +- enum { +- DITHERING_MODE_OFF = 0x00, +- DITHERING_MODE_ON = 0x01, +- DITHERING_MODE_DYNAMIC2X2 = 0x10 | DITHERING_MODE_ON, +- DITHERING_MODE_STATIC2X2 = 0x18 | DITHERING_MODE_ON, +- DITHERING_MODE_TEMPORAL = 0x20 | DITHERING_MODE_ON, +- DITHERING_MODE_AUTO +- } mode; +- enum { +- DITHERING_DEPTH_6BPC = 0x00, +- DITHERING_DEPTH_8BPC = 0x02, +- DITHERING_DEPTH_AUTO +- } depth; +- } dither; +- +- struct { +- int mode; /* DRM_MODE_SCALE_* */ +- struct { +- enum { +- UNDERSCAN_OFF, +- UNDERSCAN_ON, +- UNDERSCAN_AUTO, +- } mode; +- u32 hborder; +- u32 vborder; +- } underscan; +- bool full; +- } scaler; +- +- struct { +- int color_vibrance; +- int vibrant_hue; +- } procamp; +- +- union { +- struct { +- bool dither:1; +- bool scaler:1; +- bool procamp:1; +- }; +- u8 mask; +- } set; +-}; +- + void nouveau_conn_attach_properties(struct drm_connector *); + void nouveau_conn_reset(struct drm_connector *); + struct drm_connector_state * +-- +2.23.0 + diff --git a/0001-iwlwifi-dbg_ini-fix-memory-leak-in-alloc_sgtable.patch b/0001-iwlwifi-dbg_ini-fix-memory-leak-in-alloc_sgtable.patch deleted file mode 100644 index d82c3f254..000000000 --- a/0001-iwlwifi-dbg_ini-fix-memory-leak-in-alloc_sgtable.patch +++ /dev/null @@ -1,29 +0,0 @@ -From b4b814fec1a5a849383f7b3886b654a13abbda7d Mon Sep 17 00:00:00 2001 -From: Navid Emamdoost -Date: Thu, 12 Sep 2019 23:23:27 -0500 -Subject: [PATCH] iwlwifi: dbg_ini: fix memory leak in alloc_sgtable - -In alloc_sgtable if alloc_page fails, the alocated table should be -released. - -Signed-off-by: Navid Emamdoost -Signed-off-by: Luca Coelho ---- - drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c -index 5c8602de9168..87421807e040 100644 ---- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c -+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c -@@ -646,6 +646,7 @@ static struct scatterlist *alloc_sgtable(int size) - if (new_page) - __free_page(new_page); - } -+ kfree(table); - return NULL; - } - alloc_size = min_t(int, size, PAGE_SIZE); --- -2.23.0 - diff --git a/0001-iwlwifi-pcie-fix-memory-leaks-in-iwl_pcie_ctxt_info_.patch b/0001-iwlwifi-pcie-fix-memory-leaks-in-iwl_pcie_ctxt_info_.patch deleted file mode 100644 index a72e920bd..000000000 --- a/0001-iwlwifi-pcie-fix-memory-leaks-in-iwl_pcie_ctxt_info_.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 0f4f199443faca715523b0659aa536251d8b978f Mon Sep 17 00:00:00 2001 -From: Navid Emamdoost -Date: Fri, 27 Sep 2019 15:56:04 -0500 -Subject: [PATCH] iwlwifi: pcie: fix memory leaks in - iwl_pcie_ctxt_info_gen3_init - -In iwl_pcie_ctxt_info_gen3_init there are cases that the allocated dma -memory is leaked in case of error. - -DMA memories prph_scratch, prph_info, and ctxt_info_gen3 are allocated -and initialized to be later assigned to trans_pcie. But in any error case -before such assignment the allocated memories should be released. - -First of such error cases happens when iwl_pcie_init_fw_sec fails. -Current implementation correctly releases prph_scratch. But in two -sunsequent error cases where dma_alloc_coherent may fail, such -releases are missing. - -This commit adds release for prph_scratch when allocation for -prph_info fails, and adds releases for prph_scratch and prph_info when -allocation for ctxt_info_gen3 fails. - -Fixes: 2ee824026288 ("iwlwifi: pcie: support context information for 22560 devices") -Signed-off-by: Navid Emamdoost -Signed-off-by: Luca Coelho ---- - .../intel/iwlwifi/pcie/ctxt-info-gen3.c | 36 +++++++++++++------ - 1 file changed, 25 insertions(+), 11 deletions(-) - -diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c -index 75fa8a6aafee..74980382e64c 100644 ---- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c -+++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c -@@ -107,13 +107,9 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, - - /* allocate ucode sections in dram and set addresses */ - ret = iwl_pcie_init_fw_sec(trans, fw, &prph_scratch->dram); -- if (ret) { -- dma_free_coherent(trans->dev, -- sizeof(*prph_scratch), -- prph_scratch, -- trans_pcie->prph_scratch_dma_addr); -- return ret; -- } -+ if (ret) -+ goto err_free_prph_scratch; -+ - - /* Allocate prph information - * currently we don't assign to the prph info anything, but it would get -@@ -121,16 +117,20 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, - prph_info = dma_alloc_coherent(trans->dev, sizeof(*prph_info), - &trans_pcie->prph_info_dma_addr, - GFP_KERNEL); -- if (!prph_info) -- return -ENOMEM; -+ if (!prph_info) { -+ ret = -ENOMEM; -+ goto err_free_prph_scratch; -+ } - - /* Allocate context info */ - ctxt_info_gen3 = dma_alloc_coherent(trans->dev, - sizeof(*ctxt_info_gen3), - &trans_pcie->ctxt_info_dma_addr, - GFP_KERNEL); -- if (!ctxt_info_gen3) -- return -ENOMEM; -+ if (!ctxt_info_gen3) { -+ ret = -ENOMEM; -+ goto err_free_prph_info; -+ } - - ctxt_info_gen3->prph_info_base_addr = - cpu_to_le64(trans_pcie->prph_info_dma_addr); -@@ -186,6 +186,20 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, - iwl_set_bit(trans, CSR_GP_CNTRL, CSR_AUTO_FUNC_INIT); - - return 0; -+ -+err_free_prph_info: -+ dma_free_coherent(trans->dev, -+ sizeof(*prph_info), -+ prph_info, -+ trans_pcie->prph_info_dma_addr); -+ -+err_free_prph_scratch: -+ dma_free_coherent(trans->dev, -+ sizeof(*prph_scratch), -+ prph_scratch, -+ trans_pcie->prph_scratch_dma_addr); -+ return ret; -+ - } - - void iwl_pcie_ctxt_info_gen3_free(struct iwl_trans *trans) --- -2.23.0 - diff --git a/0001-nl80211-fix-memory-leak-in-nl80211_get_ftm_responder.patch b/0001-nl80211-fix-memory-leak-in-nl80211_get_ftm_responder.patch deleted file mode 100644 index e72e53ebd..000000000 --- a/0001-nl80211-fix-memory-leak-in-nl80211_get_ftm_responder.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 1399c59fa92984836db90538cf92397fe7caaa57 Mon Sep 17 00:00:00 2001 -From: Navid Emamdoost -Date: Fri, 4 Oct 2019 14:42:19 -0500 -Subject: [PATCH] nl80211: fix memory leak in nl80211_get_ftm_responder_stats - -In nl80211_get_ftm_responder_stats, a new skb is created via nlmsg_new -named msg. If nl80211hdr_put() fails, then msg should be released. The -return statement should be replace by goto to error handling code. - -Fixes: 81e54d08d9d8 ("cfg80211: support FTM responder configuration/statistics") -Signed-off-by: Navid Emamdoost -Link: https://lore.kernel.org/r/20191004194220.19412-1-navid.emamdoost@gmail.com -Signed-off-by: Johannes Berg ---- - net/wireless/nl80211.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c -index 141cdb171665..4453dd375de9 100644 ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -13682,7 +13682,7 @@ static int nl80211_get_ftm_responder_stats(struct sk_buff *skb, - hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, - NL80211_CMD_GET_FTM_RESPONDER_STATS); - if (!hdr) -- return -ENOBUFS; -+ goto nla_put_failure; - - if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) - goto nla_put_failure; --- -2.23.0 - diff --git a/0001-tracing-Have-error-path-in-predicate_parse-free-its-.patch b/0001-tracing-Have-error-path-in-predicate_parse-free-its-.patch deleted file mode 100644 index 42d4e176a..000000000 --- a/0001-tracing-Have-error-path-in-predicate_parse-free-its-.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 96c5c6e6a5b6db592acae039fed54b5c8844cd35 Mon Sep 17 00:00:00 2001 -From: Navid Emamdoost -Date: Fri, 20 Sep 2019 17:57:59 -0500 -Subject: [PATCH] tracing: Have error path in predicate_parse() free its - allocated memory - -In predicate_parse, there is an error path that is not going to -out_free instead it returns directly which leads to a memory leak. - -Link: http://lkml.kernel.org/r/20190920225800.3870-1-navid.emamdoost@gmail.com - -Signed-off-by: Navid Emamdoost -Signed-off-by: Steven Rostedt (VMware) ---- - kernel/trace/trace_events_filter.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c -index c773b8fb270c..c9a74f82b14a 100644 ---- a/kernel/trace/trace_events_filter.c -+++ b/kernel/trace/trace_events_filter.c -@@ -452,8 +452,10 @@ predicate_parse(const char *str, int nr_parens, int nr_preds, - - switch (*next) { - case '(': /* #2 */ -- if (top - op_stack > nr_parens) -- return ERR_PTR(-EINVAL); -+ if (top - op_stack > nr_parens) { -+ ret = -EINVAL; -+ goto out_free; -+ } - *(++top) = invert; - continue; - case '!': /* #3 */ --- -2.23.0 - diff --git a/0002-Add-efi_status_to_str-and-rework-efi_status_to_err.patch b/0002-Add-efi_status_to_str-and-rework-efi_status_to_err.patch index 0844550b6..871105093 100644 --- a/0002-Add-efi_status_to_str-and-rework-efi_status_to_err.patch +++ b/0002-Add-efi_status_to_str-and-rework-efi_status_to_err.patch @@ -39,9 +39,9 @@ index 557a47829d0..e8f9c7d84e9 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -31,6 +31,7 @@ - #include #include #include + #include +#include #include @@ -177,7 +177,7 @@ index 557a47829d0..e8f9c7d84e9 100644 + return found->description; } - bool efi_is_table_address(unsigned long phys_addr) + static DEFINE_SPINLOCK(efi_mem_reserve_persistent_lock); -- 2.15.0 diff --git a/0002-drm-nouveau-Fix-drm-core-using-atomic-code-paths-on-.patch b/0002-drm-nouveau-Fix-drm-core-using-atomic-code-paths-on-.patch new file mode 100644 index 000000000..077f391ca --- /dev/null +++ b/0002-drm-nouveau-Fix-drm-core-using-atomic-code-paths-on-.patch @@ -0,0 +1,115 @@ +From 64d17f25dcad518461ccf0c260544e1e379c5b35 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 24 Oct 2019 10:52:53 +0200 +Subject: [PATCH v2 2/2] drm/nouveau: Fix drm-core using atomic code-paths on + pre-nv50 hardware + +We do not support atomic modesetting on pre-nv50 hardware, but until now +our connector code was setting drm_connector->state on pre-nv50 hardware. + +This causes the core to enter atomic modesetting paths in at least: + +1. drm_connector_get_encoder(), returning connector->state->best_encoder +which is always 0, causing us to always report 0 as encoder_id in +the drmModeConnector struct returned by drmModeGetConnector(). + +2. drm_encoder_get_crtc(), returning NULL because uses_atomic get set, +causing us to always report 0 as crtc_id in the drmModeEncoder struct +returned by drmModeGetEncoder() + +Which in turn confuses userspace, at least plymouth thinks that the pipe +has changed because of this and tries to reconfigure it unnecessarily. + +More in general we should not set drm_connector->state in the non-atomic +code as this violates the drm-core's expectations. + +This commit fixes this by using a nouveau_conn_atom struct embedded in the +nouveau_connector struct for property handling in the non-atomic case. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1706557 +Signed-off-by: Hans de Goede +Signed-off-by: Ben Skeggs +--- + drivers/gpu/drm/nouveau/nouveau_connector.c | 28 +++++++++++++++------ + drivers/gpu/drm/nouveau/nouveau_connector.h | 6 +++++ + 2 files changed, 27 insertions(+), 7 deletions(-) + +diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c +index 5b413588b823..9a9a7f5003d3 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_connector.c ++++ b/drivers/gpu/drm/nouveau/nouveau_connector.c +@@ -245,14 +245,22 @@ nouveau_conn_atomic_duplicate_state(struct drm_connector *connector) + void + nouveau_conn_reset(struct drm_connector *connector) + { ++ struct nouveau_connector *nv_connector = nouveau_connector(connector); + struct nouveau_conn_atom *asyc; + +- if (WARN_ON(!(asyc = kzalloc(sizeof(*asyc), GFP_KERNEL)))) +- return; ++ if (drm_drv_uses_atomic_modeset(connector->dev)) { ++ if (WARN_ON(!(asyc = kzalloc(sizeof(*asyc), GFP_KERNEL)))) ++ return; ++ ++ if (connector->state) ++ nouveau_conn_atomic_destroy_state(connector, ++ connector->state); ++ ++ __drm_atomic_helper_connector_reset(connector, &asyc->state); ++ } else { ++ asyc = &nv_connector->properties_state; ++ } + +- if (connector->state) +- nouveau_conn_atomic_destroy_state(connector, connector->state); +- __drm_atomic_helper_connector_reset(connector, &asyc->state); + asyc->dither.mode = DITHERING_MODE_AUTO; + asyc->dither.depth = DITHERING_DEPTH_AUTO; + asyc->scaler.mode = DRM_MODE_SCALE_NONE; +@@ -276,8 +284,14 @@ void + nouveau_conn_attach_properties(struct drm_connector *connector) + { + struct drm_device *dev = connector->dev; +- struct nouveau_conn_atom *armc = nouveau_conn_atom(connector->state); + struct nouveau_display *disp = nouveau_display(dev); ++ struct nouveau_connector *nv_connector = nouveau_connector(connector); ++ struct nouveau_conn_atom *armc; ++ ++ if (drm_drv_uses_atomic_modeset(connector->dev)) ++ armc = nouveau_conn_atom(connector->state); ++ else ++ armc = &nv_connector->properties_state; + + /* Init DVI-I specific properties. */ + if (connector->connector_type == DRM_MODE_CONNECTOR_DVII) +@@ -748,9 +762,9 @@ static int + nouveau_connector_set_property(struct drm_connector *connector, + struct drm_property *property, uint64_t value) + { +- struct nouveau_conn_atom *asyc = nouveau_conn_atom(connector->state); + struct nouveau_connector *nv_connector = nouveau_connector(connector); + struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder; ++ struct nouveau_conn_atom *asyc = &nv_connector->properties_state; + struct drm_encoder *encoder = to_drm_encoder(nv_encoder); + int ret; + +diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.h b/drivers/gpu/drm/nouveau/nouveau_connector.h +index de9588420884..de84fb4708c7 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_connector.h ++++ b/drivers/gpu/drm/nouveau/nouveau_connector.h +@@ -118,6 +118,12 @@ struct nouveau_connector { + #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT + struct nouveau_backlight *backlight; + #endif ++ /* ++ * Our connector property code expects a nouveau_conn_atom struct ++ * even on pre-nv50 where we do not support atomic. This embedded ++ * version gets used in the non atomic modeset case. ++ */ ++ struct nouveau_conn_atom properties_state; + }; + + static inline struct nouveau_connector *nouveau_connector( +-- +2.23.0 + diff --git a/Input-synaptics-pin-3-touches-when-the-firmware-repo.patch b/Input-synaptics-pin-3-touches-when-the-firmware-repo.patch deleted file mode 100644 index e697968c7..000000000 --- a/Input-synaptics-pin-3-touches-when-the-firmware-repo.patch +++ /dev/null @@ -1,47 +0,0 @@ -From: Benjamin Tissoires -Date: Thu, 16 Apr 2015 13:01:46 -0400 -Subject: [PATCH] Input - synaptics: pin 3 touches when the firmware reports 3 - fingers - -Synaptics PS/2 touchpad can send only 2 touches in a report. They can -detect 4 or 5 and this information is valuable. - -In commit 63c4fda (Input: synaptics - allocate 3 slots to keep stability -in image sensors), we allocate 3 slots, but we still continue to report -the 2 available fingers. That means that the client sees 2 used slots while -there is a total of 3 fingers advertised by BTN_TOOL_TRIPLETAP. - -For old kernels this is not a problem because max_slots was 2 and libinput/ -xorg-synaptics knew how to deal with that. Now that max_slot is 3, the -clients ignore BTN_TOOL_TRIPLETAP and count the actual used slots (so 2). -It then gets confused when receiving the BTN_TOOL_TRIPLETAP and DOUBLETAP -information, and goes wild. - -We can pin the 3 slots until we get a total number of fingers below 2. - -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1212230 - -Signed-off-by: Benjamin Tissoires ---- - drivers/input/mouse/synaptics.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c -index 3a32caf06bf1..58102970f94f 100644 ---- a/drivers/input/mouse/synaptics.c -+++ b/drivers/input/mouse/synaptics.c -@@ -940,6 +940,14 @@ static void synaptics_report_mt_data(struct psmouse *psmouse, - input_report_abs(dev, ABS_MT_PRESSURE, hw[i]->z); - } - -+ /* keep (slot count <= num_fingers) by pinning all slots */ -+ if (num_fingers >= 3) { -+ for (i = 0; i < 3; i++) { -+ input_mt_slot(dev, i); -+ input_mt_report_slot_state(dev, MT_TOOL_FINGER, true); -+ } -+ } -+ - input_mt_drop_unused(dev); - - /* Don't use active slot count to generate BTN_TOOL events. */ diff --git a/KEYS-Make-use-of-platform-keyring-for-module-signature.patch b/KEYS-Make-use-of-platform-keyring-for-module-signature.patch index a13dcdba5..7c2a0b68d 100644 --- a/KEYS-Make-use-of-platform-keyring-for-module-signature.patch +++ b/KEYS-Make-use-of-platform-keyring-for-module-signature.patch @@ -13,42 +13,31 @@ As such, kernel modules signed with keys from the MokList variable were not successfully verified. Signed-off-by: Robert Holmes +Signed-off-by: Jeremy Cline --- kernel/module_signing.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/kernel/module_signing.c b/kernel/module_signing.c -index 6b9a926fd86b..cf94220e9154 100644 +index 9d9fc678c91d..84ad75a53c83 100644 --- a/kernel/module_signing.c +++ b/kernel/module_signing.c -@@ -49,6 +49,7 @@ int mod_verify_sig(const void *mod, struct load_info *info) - { - struct module_signature ms; - size_t sig_len, modlen = info->len; -+ int ret; - - pr_devel("==>%s(,%zu)\n", __func__, modlen); - -@@ -82,8 +83,15 @@ int mod_verify_sig(const void *mod, struct load_info *info) - return -EBADMSG; - } +@@ -38,8 +38,15 @@ int mod_verify_sig(const void *mod, struct load_info *info) + modlen -= sig_len + sizeof(ms); + info->len = modlen; - return verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len, -- VERIFY_USE_SECONDARY_KEYRING, -- VERIFYING_MODULE_SIGNATURE, -- NULL, NULL); + ret = verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len, -+ VERIFY_USE_SECONDARY_KEYRING, -+ VERIFYING_MODULE_SIGNATURE, -+ NULL, NULL); + VERIFY_USE_SECONDARY_KEYRING, + VERIFYING_MODULE_SIGNATURE, + NULL, NULL); + if (ret == -ENOKEY && IS_ENABLED(CONFIG_INTEGRITY_PLATFORM_KEYRING)) { + ret = verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len, -+ VERIFY_USE_PLATFORM_KEYRING, -+ VERIFYING_MODULE_SIGNATURE, -+ NULL, NULL); ++ VERIFY_USE_PLATFORM_KEYRING, ++ VERIFYING_MODULE_SIGNATURE, ++ NULL, NULL); + } + return ret; } -- 2.21.0 - diff --git a/Kbuild-Add-an-option-to-enable-GCC-VTA.patch b/Kbuild-Add-an-option-to-enable-GCC-VTA.patch deleted file mode 100644 index 6bbb0efdf..000000000 --- a/Kbuild-Add-an-option-to-enable-GCC-VTA.patch +++ /dev/null @@ -1,94 +0,0 @@ -From a446d2f94ce540689c7a46bf457d92409e9c4d7e Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 21 Nov 2014 10:40:00 -0800 -Subject: [PATCH] Kbuild: Add an option to enable GCC VTA -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Due to recent codegen issues, gcc -fvar-tracking-assignments was -unconditionally disabled in commit 2062afb4f804a ("Fix gcc-4.9.0 -miscompilation of load_balance() in scheduler"). However, this reduces -the debuginfo coverage for variable locations, especially in inline -functions. VTA is certainly not perfect either in those cases, but it -is much better than without. With compiler versions that have fixed the -codegen bugs, we would prefer to have the better details for SystemTap, -and surely other debuginfo consumers like perf will benefit as well. - -This patch simply makes CONFIG_DEBUG_INFO_VTA an option. I considered -Frank and Linus's discussion of a cc-option-like -fcompare-debug test, -but I'm convinced that a narrow test of an arch-specific codegen issue -is not really useful. GCC has their own regression tests for this, so -I'd suggest GCC_COMPARE_DEBUG=-fvar-tracking-assignments-toggle is more -useful for kernel developers to test confidence. - -In fact, I ran into a couple more issues when testing for this patch[1], -although neither of those had any codegen impact. - [1] https://bugzilla.redhat.com/show_bug.cgi?id=1140872 - -With gcc-4.9.2-1.fc22, I can now build v3.18-rc5 with Fedora's i686 and -x86_64 configs, and this is completely clean with GCC_COMPARE_DEBUG. - -Cc: Frank Ch. Eigler -Cc: Jakub Jelinek -Cc: Josh Boyer -Cc: Greg Kroah-Hartman -Cc: Linus Torvalds -Cc: Andrew Morton -Cc: Markus Trippelsdorf -Cc: Michel Dänzer -Signed-off-by: Josh Stone -Signed-off-by: Jeremy Cline ---- - Makefile | 4 ++++ - lib/Kconfig.debug | 18 +++++++++++++++++- - 2 files changed, 21 insertions(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index 9ef547fc7ffe..5777d902f8f3 100644 ---- a/Makefile -+++ b/Makefile -@@ -735,7 +735,11 @@ KBUILD_CFLAGS += -fomit-frame-pointer - KBUILD_CFLAGS += -ftrivial-auto-var-init=pattern - endif - -+ifdef CONFIG_DEBUG_INFO_VTA -+DEBUG_CFLAGS += $(call cc-option, -fvar-tracking-assignments) -+else - DEBUG_CFLAGS := $(call cc-option, -fno-var-tracking-assignments) -+endif - - ifdef CONFIG_DEBUG_INFO - ifdef CONFIG_DEBUG_INFO_SPLIT -diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug -index 0d9e81779e37..424206212931 100644 ---- a/lib/Kconfig.debug -+++ b/lib/Kconfig.debug -@@ -217,7 +217,23 @@ config DEBUG_INFO_DWARF4 - Generate dwarf4 debug info. This requires recent versions - of gcc and gdb. It makes the debug information larger. - But it significantly improves the success of resolving -- variables in gdb on optimized code. -+ variables in gdb on optimized code. The gcc docs also -+ recommend enabling -fvar-tracking-assignments for maximum -+ benefit. (see DEBUG_INFO_VTA) -+ -+config DEBUG_INFO_VTA -+ bool "Enable var-tracking-assignments for debuginfo" -+ depends on DEBUG_INFO -+ help -+ Enable gcc -fvar-tracking-assignments for improved debug -+ information on variable locations in optimized code. Per -+ gcc, DEBUG_INFO_DWARF4 is recommended for best use of VTA. -+ -+ VTA has been implicated in codegen bugs (gcc PR61801, -+ PR61904), so this may deserve some caution. One can set -+ GCC_COMPARE_DEBUG=-fvar-tracking-assignments-toggle in the -+ environment to automatically compile everything both ways, -+ generating an error if anything differs. - - config DEBUG_INFO_BTF - bool "Generate BTF typeinfo" --- -2.20.1 - diff --git a/Module.kabi_aarch64 b/Module.kabi_aarch64 new file mode 100644 index 000000000..e69de29bb diff --git a/Module.kabi_dup_aarch64 b/Module.kabi_dup_aarch64 new file mode 100644 index 000000000..e69de29bb diff --git a/Module.kabi_dup_ppc64le b/Module.kabi_dup_ppc64le new file mode 100644 index 000000000..e69de29bb diff --git a/Module.kabi_dup_s390x b/Module.kabi_dup_s390x new file mode 100644 index 000000000..e69de29bb diff --git a/Module.kabi_dup_x86_64 b/Module.kabi_dup_x86_64 new file mode 100644 index 000000000..e69de29bb diff --git a/Module.kabi_ppc64le b/Module.kabi_ppc64le new file mode 100644 index 000000000..e69de29bb diff --git a/Module.kabi_s390x b/Module.kabi_s390x new file mode 100644 index 000000000..e69de29bb diff --git a/Module.kabi_x86_64 b/Module.kabi_x86_64 new file mode 100644 index 000000000..e69de29bb diff --git a/Revert-ARM-bcm283x-Switch-V3D-over-to-using-the-PM-driver-instead-of-firmware.patch b/Revert-ARM-bcm283x-Switch-V3D-over-to-using-the-PM-driver-instead-of-firmware.patch deleted file mode 100644 index 8627b6087..000000000 --- a/Revert-ARM-bcm283x-Switch-V3D-over-to-using-the-PM-driver-instead-of-firmware.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 9d1a8ad3c56f4e84a0ec46246b4c08a6d139f638 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Sun, 13 Oct 2019 14:33:23 +0100 -Subject: [PATCH] Revert "ARM: bcm283x: Switch V3D over to using the PM driver - instead of firmware." - -Since release of the new BCM2835 PM driver there has been several reports -of V3D probing issues. This is caused by timeouts during powering-up the -GRAFX PM domain: - - bcm2835-power: Timeout waiting for grafx power OK - -I was able to reproduce this reliable on my Raspberry Pi 3B+ after setting -force_turbo=1 in the firmware configuration. Since there are no issues -using the firmware PM driver with the same setup, there must be an issue -in the BCM2835 PM driver. - -Unfortunately there hasn't been much progress in identifying the root cause -since June (mostly in the lack of documentation), so i decided to switch -back until the issue in the BCM2835 PM driver is fixed. - -Link: https://github.com/raspberrypi/linux/issues/3046 -Fixes: e1dc2b2e1bef (" ARM: bcm283x: Switch V3D over to using the PM driver instead of firmware.") -Cc: stable@vger.kernel.org -Signed-off-by: Stefan Wahren -Acked-by: Eric Anholt ---- - a/arch/arm/boot/dts/bcm2835-rpi.dtsi | 4 ++++ - b/arch/arm/boot/dts/bcm283x.dtsi | 4 +--- - 2 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi -index 715d50c64529..d136867c317f 100644 ---- a/arch/arm/boot/dts/bcm2835-rpi.dtsi -+++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi -@@ -90,6 +90,10 @@ - status = "okay"; - }; - -+&v3d { -+ power-domains = <&power RPI_POWER_DOMAIN_V3D>; -+}; -+ - &vec { - power-domains = <&power RPI_POWER_DOMAIN_VEC>; - status = "okay"; -diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi -index 4b21ddb26aa5..0c6a6611f285 100644 ---- a/arch/arm/boot/dts/bcm283x.dtsi -+++ b/arch/arm/boot/dts/bcm283x.dtsi -@@ -3,7 +3,6 @@ - #include - #include - #include --#include - - /* firmware-provided startup stubs live here, where the secondary CPUs are - * spinning. -@@ -121,7 +120,7 @@ - #interrupt-cells = <2>; - }; - -- pm: watchdog@7e100000 { -+ watchdog@7e100000 { - compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt"; - #power-domain-cells = <1>; - #reset-cells = <1>; -@@ -641,7 +640,6 @@ - compatible = "brcm,bcm2835-v3d"; - reg = <0x7ec00000 0x1000>; - interrupts = <1 10>; -- power-domains = <&pm BCM2835_POWER_DOMAIN_GRAFX_V3D>; - }; - - vc4: gpu { --- -2.21.0 - diff --git a/alsa-5.5.patch b/alsa-5.5.patch new file mode 100644 index 000000000..e9eaa0bc6 --- /dev/null +++ b/alsa-5.5.patch @@ -0,0 +1,11957 @@ +From 0ac6b457d6e7f945aa84c26effe306b83bcf7ddb Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Sun, 25 Nov 2018 23:12:08 +0000 +Subject: [PATCH 001/130] ALSA: usb-audio: fix spelling mistake "Frequence" -> + "Frequency" + +There are spelling mistakes in equalizer name fields, fix them. + +Signed-off-by: Colin Ian King +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 940f457392e684bf0005628f6a155040648c5894) +Bugzilla: 1772498 +--- + sound/usb/mixer_us16x08.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/sound/usb/mixer_us16x08.c b/sound/usb/mixer_us16x08.c +index f0e8e1539450..aea3b4ad7ded 100644 +--- a/sound/usb/mixer_us16x08.c ++++ b/sound/usb/mixer_us16x08.c +@@ -1109,7 +1109,7 @@ static const struct snd_us16x08_control_params eq_controls[] = { + .control_id = SND_US16X08_ID_EQLOWFREQ, + .type = USB_MIXER_U8, + .num_channels = 16, +- .name = "EQ Low Frequence", ++ .name = "EQ Low Frequency", + }, + { /* EQ mid low gain */ + .kcontrol_new = &snd_us16x08_eq_gain_ctl, +@@ -1123,7 +1123,7 @@ static const struct snd_us16x08_control_params eq_controls[] = { + .control_id = SND_US16X08_ID_EQLOWMIDFREQ, + .type = USB_MIXER_U8, + .num_channels = 16, +- .name = "EQ MidLow Frequence", ++ .name = "EQ MidLow Frequency", + }, + { /* EQ mid low Q */ + .kcontrol_new = &snd_us16x08_eq_mid_width_ctl, +@@ -1144,7 +1144,7 @@ static const struct snd_us16x08_control_params eq_controls[] = { + .control_id = SND_US16X08_ID_EQHIGHMIDFREQ, + .type = USB_MIXER_U8, + .num_channels = 16, +- .name = "EQ MidHigh Frequence", ++ .name = "EQ MidHigh Frequency", + }, + { /* EQ mid high Q */ + .kcontrol_new = &snd_us16x08_eq_mid_width_ctl, +@@ -1165,7 +1165,7 @@ static const struct snd_us16x08_control_params eq_controls[] = { + .control_id = SND_US16X08_ID_EQHIGHFREQ, + .type = USB_MIXER_U8, + .num_channels = 16, +- .name = "EQ High Frequence", ++ .name = "EQ High Frequency", + }, + }; + +-- +2.20.1 + + +From accf87200cc0d1411c40e577f7104c55caac01dc Mon Sep 17 00:00:00 2001 +From: Saurav Girepunje +Date: Tue, 29 Oct 2019 23:22:00 +0530 +Subject: [PATCH 002/130] ALSA: usb-audio: sound: usb: usb true/false for bool + return type + +Use true/false for bool type return in uac_clock_source_is_valid(). + +Signed-off-by: Saurav Girepunje +Link: https://lore.kernel.org/r/20191029175200.GA7320@saurav +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 1d4961d9eb1aaa498dfb44779b7e4b95d79112d0) +Bugzilla: 1772498 +--- + sound/usb/clock.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/sound/usb/clock.c b/sound/usb/clock.c +index 6b8c14f9b5d4..018b1ecb5404 100644 +--- a/sound/usb/clock.c ++++ b/sound/usb/clock.c +@@ -165,21 +165,21 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, + snd_usb_find_clock_source_v3(chip->ctrl_intf, source_id); + + if (!cs_desc) +- return 0; ++ return false; + bmControls = le32_to_cpu(cs_desc->bmControls); + } else { /* UAC_VERSION_1/2 */ + struct uac_clock_source_descriptor *cs_desc = + snd_usb_find_clock_source(chip->ctrl_intf, source_id); + + if (!cs_desc) +- return 0; ++ return false; + bmControls = cs_desc->bmControls; + } + + /* If a clock source can't tell us whether it's valid, we assume it is */ + if (!uac_v2v3_control_is_readable(bmControls, + UAC2_CS_CONTROL_CLOCK_VALID)) +- return 1; ++ return true; + + err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_CUR, + USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, +@@ -191,10 +191,10 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, + dev_warn(&dev->dev, + "%s(): cannot get clock validity for id %d\n", + __func__, source_id); +- return 0; ++ return false; + } + +- return !!data; ++ return data ? true : false; + } + + static int __uac_clock_find_source(struct snd_usb_audio *chip, int entity_id, +-- +2.20.1 + + +From 50704a502a8b9b71ca96de1bd0da70394d9576b3 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 14 Nov 2019 17:56:13 +0100 +Subject: [PATCH 003/130] ALSA: usb-audio: Add skip_validation option + +The unit descriptor validation may lead to a probe error when the +device provides a buggy descriptor or the validator detected +incorrectly. For identifying such an error and band-aiding, give a +new module option, skip_validation. With this option, the driver +ignores the validation errors with the hexdump of the unit +descriptor, so we can check it in a bit more details. + +Link: https://lore.kernel.org/r/20191114165613.7422-2-tiwai@suse.de +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit f35ef592477c5347b8f780a5f0d4970671e22c61) +Bugzilla: 1772498 +--- + sound/usb/card.c | 3 +++ + sound/usb/usbaudio.h | 1 + + sound/usb/validate.c | 23 ++++++++++++++++++++--- + 3 files changed, 24 insertions(+), 3 deletions(-) + +diff --git a/sound/usb/card.c b/sound/usb/card.c +index db91dc76cc91..9f743ebae615 100644 +--- a/sound/usb/card.c ++++ b/sound/usb/card.c +@@ -74,6 +74,7 @@ static bool autoclock = true; + static char *quirk_alias[SNDRV_CARDS]; + + bool snd_usb_use_vmalloc = true; ++bool snd_usb_skip_validation; + + module_param_array(index, int, NULL, 0444); + MODULE_PARM_DESC(index, "Index value for the USB audio adapter."); +@@ -96,6 +97,8 @@ module_param_array(quirk_alias, charp, NULL, 0444); + MODULE_PARM_DESC(quirk_alias, "Quirk aliases, e.g. 0123abcd:5678beef."); + module_param_named(use_vmalloc, snd_usb_use_vmalloc, bool, 0444); + MODULE_PARM_DESC(use_vmalloc, "Use vmalloc for PCM intermediate buffers (default: yes)."); ++module_param_named(skip_validation, snd_usb_skip_validation, bool, 0444); ++MODULE_PARM_DESC(skip_validation, "Skip unit descriptor validation (default: no)."); + + /* + * we keep the snd_usb_audio_t instances by ourselves for merging +diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h +index feb30f9c1716..ff3cbf653de8 100644 +--- a/sound/usb/usbaudio.h ++++ b/sound/usb/usbaudio.h +@@ -120,5 +120,6 @@ int snd_usb_lock_shutdown(struct snd_usb_audio *chip); + void snd_usb_unlock_shutdown(struct snd_usb_audio *chip); + + extern bool snd_usb_use_vmalloc; ++extern bool snd_usb_skip_validation; + + #endif /* __USBAUDIO_H */ +diff --git a/sound/usb/validate.c b/sound/usb/validate.c +index 389e8657434a..36ae78c3da3d 100644 +--- a/sound/usb/validate.c ++++ b/sound/usb/validate.c +@@ -322,11 +322,28 @@ static bool validate_desc(unsigned char *hdr, int protocol, + + bool snd_usb_validate_audio_desc(void *p, int protocol) + { +- return validate_desc(p, protocol, audio_validators); ++ unsigned char *c = p; ++ bool valid; ++ ++ valid = validate_desc(p, protocol, audio_validators); ++ if (!valid && snd_usb_skip_validation) { ++ print_hex_dump(KERN_ERR, "USB-audio: buggy audio desc: ", ++ DUMP_PREFIX_NONE, 16, 1, c, c[0], true); ++ valid = true; ++ } ++ return valid; + } + + bool snd_usb_validate_midi_desc(void *p) + { +- return validate_desc(p, UAC_VERSION_1, midi_validators); ++ unsigned char *c = p; ++ bool valid; ++ ++ valid = validate_desc(p, UAC_VERSION_1, midi_validators); ++ if (!valid && snd_usb_skip_validation) { ++ print_hex_dump(KERN_ERR, "USB-audio: buggy midi desc: ", ++ DUMP_PREFIX_NONE, 16, 1, c, c[0], true); ++ valid = true; ++ } ++ return valid; + } +- +-- +2.20.1 + + +From fb285eb397d32ae1edbdc4e7ad82a0e2157b2454 Mon Sep 17 00:00:00 2001 +From: Kai-Heng Feng +Date: Fri, 18 Oct 2019 15:38:47 +0800 +Subject: [PATCH 004/130] PCI: Add a helper to check Power Resource + Requirements _PR3 existence + +A driver may want to know the existence of _PR3, to choose different +runtime suspend behavior. A user will be add in next patch. + +This is mostly the same as nouveau_pr3_present(). + +Signed-off-by: Kai-Heng Feng +Acked-by: Bjorn Helgaas +Link: https://lore.kernel.org/r/20191018073848.14590-1-kai.heng.feng@canonical.com +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 52525b7a3cf82adec5c6cf0ecbd23ff228badc94) +Bugzilla: 1772498 +--- + drivers/pci/pci.c | 18 ++++++++++++++++++ + include/linux/pci.h | 2 ++ + 2 files changed, 20 insertions(+) + +diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c +index a97e2571a527..fcfaadc774ee 100644 +--- a/drivers/pci/pci.c ++++ b/drivers/pci/pci.c +@@ -5854,6 +5854,24 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode, + return 0; + } + ++#ifdef CONFIG_ACPI ++bool pci_pr3_present(struct pci_dev *pdev) ++{ ++ struct acpi_device *adev; ++ ++ if (acpi_disabled) ++ return false; ++ ++ adev = ACPI_COMPANION(&pdev->dev); ++ if (!adev) ++ return false; ++ ++ return adev->power.flags.power_resources && ++ acpi_has_method(adev->handle, "_PR3"); ++} ++EXPORT_SYMBOL_GPL(pci_pr3_present); ++#endif ++ + /** + * pci_add_dma_alias - Add a DMA devfn alias for a device + * @dev: the PCI device for which alias is added +diff --git a/include/linux/pci.h b/include/linux/pci.h +index f9088c89a534..1d15c5d49cdd 100644 +--- a/include/linux/pci.h ++++ b/include/linux/pci.h +@@ -2310,9 +2310,11 @@ struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus); + + void + pci_msi_register_fwnode_provider(struct fwnode_handle *(*fn)(struct device *)); ++bool pci_pr3_present(struct pci_dev *pdev); + #else + static inline struct irq_domain * + pci_host_bridge_acpi_msi_domain(struct pci_bus *bus) { return NULL; } ++static bool pci_pr3_present(struct pci_dev *pdev) { return false; } + #endif + + #ifdef CONFIG_EEH +-- +2.20.1 + + +From 7fbcfac9bf68e2ccccafb3736287e1b1e021c2f3 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 21 Oct 2019 16:25:20 +0200 +Subject: [PATCH 005/130] PCI: Fix missing inline for pci_pr3_present() + +The inline prefix was missing in the dummy function pci_pr3_present() +definition. Fix it. + +Reported-by: kbuild test robot +Fixes: 52525b7a3cf8 ("PCI: Add a helper to check Power Resource Requirements _PR3 existence") +Link: https://lore.kernel.org/r/201910212111.qHm6OcWx%lkp@intel.com +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 46b4bff6572b0552b1ee062043621e4b252638d8) +Bugzilla: 1772498 +--- + include/linux/pci.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/linux/pci.h b/include/linux/pci.h +index 1d15c5d49cdd..be529d311122 100644 +--- a/include/linux/pci.h ++++ b/include/linux/pci.h +@@ -2314,7 +2314,7 @@ bool pci_pr3_present(struct pci_dev *pdev); + #else + static inline struct irq_domain * + pci_host_bridge_acpi_msi_domain(struct pci_bus *bus) { return NULL; } +-static bool pci_pr3_present(struct pci_dev *pdev) { return false; } ++static inline bool pci_pr3_present(struct pci_dev *pdev) { return false; } + #endif + + #ifdef CONFIG_EEH +-- +2.20.1 + + +From 6e6ea1a80e8b33f3908fdfa4ce45c3fa684cda75 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 22 Oct 2019 19:43:12 +0200 +Subject: [PATCH 006/130] ALSA: hda: add Intel DSP configuration / probe code + +For distributions, we need one place where we can decide +which driver will be activated for the auto-configation of the +Intel's HDA hardware with DSP. Actually, we cover three drivers: + +* Legacy HDA +* Intel SST +* Intel Sound Open Firmware (SOF) + +All those drivers registers similar PCI IDs, so the first +driver probed from the PCI stack can win. But... it is not +guaranteed that the correct driver wins. + +This commit changes Intel's NHLT ACPI module to a common +DSP probe module for the Intel's hardware. All above sound +drivers calls this code. The user can force another behaviour +using the module parameter 'dsp_driver' located in +the 'snd-intel-dspcfg' module. + +This change allows to add specific dmi checks for the specific +systems. The examples are taken from the pull request: + + https://github.com/thesofproject/linux/pull/927 + +Tested on Lenovo Carbon X1 7th gen. + +Signed-off-by: Jaroslav Kysela +Tested-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191022174313.29087-1-perex@perex.cz +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 82d9d54a6c0ee8b12211fa4e59fd940a2da4e063) +Bugzilla: 1772498 +--- + include/sound/intel-dsp-config.h | 34 +++++ + sound/hda/Kconfig | 10 +- + sound/hda/Makefile | 5 +- + sound/hda/intel-dsp-config.c | 249 +++++++++++++++++++++++++++++++ + sound/hda/intel-nhlt.c | 3 - + sound/pci/hda/Kconfig | 11 +- + sound/pci/hda/hda_intel.c | 49 ++---- + sound/soc/intel/Kconfig | 2 +- + sound/soc/intel/skylake/skl.c | 19 +-- + sound/soc/sof/intel/Kconfig | 2 +- + sound/soc/sof/sof-pci-dev.c | 6 + + 11 files changed, 322 insertions(+), 68 deletions(-) + create mode 100644 include/sound/intel-dsp-config.h + create mode 100644 sound/hda/intel-dsp-config.c + +diff --git a/include/sound/intel-dsp-config.h b/include/sound/intel-dsp-config.h +new file mode 100644 +index 000000000000..c36622bee3f8 +--- /dev/null ++++ b/include/sound/intel-dsp-config.h +@@ -0,0 +1,34 @@ ++/* SPDX-License-Identifier: GPL-2.0-only */ ++/* ++ * intel-dsp-config.h - Intel DSP config ++ * ++ * Copyright (c) 2019 Jaroslav Kysela ++ */ ++ ++#ifndef __INTEL_DSP_CONFIG_H__ ++#define __INTEL_DSP_CONFIG_H__ ++ ++struct pci_dev; ++ ++enum { ++ SND_INTEL_DSP_DRIVER_ANY = 0, ++ SND_INTEL_DSP_DRIVER_LEGACY, ++ SND_INTEL_DSP_DRIVER_SST, ++ SND_INTEL_DSP_DRIVER_SOF, ++ SND_INTEL_DSP_DRIVER_LAST = SND_INTEL_DSP_DRIVER_SOF ++}; ++ ++#if IS_ENABLED(CONFIG_SND_INTEL_DSP_CONFIG) ++ ++int snd_intel_dsp_driver_probe(struct pci_dev *pci); ++ ++#else ++ ++static inline int snd_intel_dsp_driver_probe(struct pci_dev *pci) ++{ ++ return SND_INTEL_DSP_DRIVER_ANY; ++} ++ ++#endif ++ ++#endif +diff --git a/sound/hda/Kconfig b/sound/hda/Kconfig +index 3d33fc1757ba..b0c88fe040ee 100644 +--- a/sound/hda/Kconfig ++++ b/sound/hda/Kconfig +@@ -34,6 +34,12 @@ config SND_HDA_PREALLOC_SIZE + via a proc file (/proc/asound/card*/pcm*/sub*/prealloc), too. + + config SND_INTEL_NHLT +- tristate ++ bool + # this config should be selected only for Intel ACPI platforms. +- # A fallback is provided so that the code compiles in all cases. +\ No newline at end of file ++ # A fallback is provided so that the code compiles in all cases. ++ ++config SND_INTEL_DSP_CONFIG ++ tristate ++ select SND_INTEL_NHLT if ACPI ++ # this config should be selected only for Intel DSP platforms. ++ # A fallback is provided so that the code compiles in all cases. +diff --git a/sound/hda/Makefile b/sound/hda/Makefile +index 8560f6ef1b19..601e617918b8 100644 +--- a/sound/hda/Makefile ++++ b/sound/hda/Makefile +@@ -14,5 +14,6 @@ obj-$(CONFIG_SND_HDA_CORE) += snd-hda-core.o + #extended hda + obj-$(CONFIG_SND_HDA_EXT_CORE) += ext/ + +-snd-intel-nhlt-objs := intel-nhlt.o +-obj-$(CONFIG_SND_INTEL_NHLT) += snd-intel-nhlt.o ++snd-intel-dspcfg-objs := intel-dsp-config.o ++snd-intel-dspcfg-$(CONFIG_SND_INTEL_NHLT) += intel-nhlt.o ++obj-$(CONFIG_SND_INTEL_DSP_CONFIG) += snd-intel-dspcfg.o +diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c +new file mode 100644 +index 000000000000..d9f6d9e872b4 +--- /dev/null ++++ b/sound/hda/intel-dsp-config.c +@@ -0,0 +1,249 @@ ++// SPDX-License-Identifier: GPL-2.0 ++// Copyright (c) 2019 Jaroslav Kysela ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static int dsp_driver; ++ ++module_param(dsp_driver, int, 0444); ++MODULE_PARM_DESC(dsp_driver, "Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF)"); ++ ++#define FLAG_SST BIT(0) ++#define FLAG_SOF BIT(1) ++#define FLAG_SOF_ONLY_IF_DMIC BIT(16) ++ ++struct config_entry { ++ u32 flags; ++ u16 device; ++ const struct dmi_system_id *dmi_table; ++}; ++ ++/* ++ * configuration table ++ * - the order of similar PCI ID entries is important! ++ * - the first successful match will win ++ */ ++static const struct config_entry config_table[] = { ++/* Cometlake-LP */ ++#if IS_ENABLED(CONFIG_SND_SOC_INTEL_CML_LP) ++ { ++ /* prefer SST */ ++ .flags = FLAG_SST, ++ .device = 0x02c8, ++ }, ++#elif IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE_LP) ++ { ++ .flags = FLAG_SOF, ++ .device = 0x02c8, ++ }, ++#endif ++/* Cometlake-H */ ++#if IS_ENABLED(CONFIG_SND_SOC_INTEL_CML_H) ++ { ++ .flags = FLAG_SST, ++ .device = 0x06c8, ++ }, ++#elif IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE_H) ++ { ++ .flags = FLAG_SOF, ++ .device = 0x06c8, ++ }, ++#endif ++/* Merrifield */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_MERRIFIELD) ++ { ++ .flags = FLAG_SOF, ++ .device = 0x119a, ++ }, ++#endif ++/* Broxton-T */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE) ++ { ++ .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, ++ .device = 0x1a98, ++ }, ++#endif ++/* Geminilake */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_GEMINILAKE) ++ { ++ .flags = FLAG_SOF, ++ .device = 0x3198, ++ .dmi_table = (const struct dmi_system_id []) { ++ { ++ .ident = "Google Chromebooks", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Google"), ++ } ++ }, ++ {} ++ } ++ }, ++#endif ++#if IS_ENABLED(CONFIG_SND_SOC_INTEL_GLK) ++ { ++ .flags = FLAG_SST, ++ .device = 0x3198, ++ }, ++#endif ++/* Icelake */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_ICELAKE) ++ { ++ .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, ++ .device = 0x34c8, ++ }, ++#endif ++/* Elkhart Lake */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_ELKHARTLAKE) ++ { ++ .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, ++ .device = 0x4b55, ++ }, ++#endif ++/* Appololake (Broxton-P) */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE) ++ { ++ .flags = FLAG_SOF, ++ .device = 0x5a98, ++ .dmi_table = (const struct dmi_system_id []) { ++ { ++ .ident = "Up Squared", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "AAEON"), ++ DMI_MATCH(DMI_BOARD_NAME, "UP-APL01"), ++ } ++ }, ++ {} ++ } ++ }, ++#endif ++#if IS_ENABLED(CONFIG_SND_SOC_INTEL_APL) ++ { ++ .flags = FLAG_SST, ++ .device = 0x5a98, ++ }, ++#endif ++/* Cannonlake */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_CANNONLAKE) ++ { ++ .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, ++ .device = 0x9dc8, ++ }, ++#endif ++/* Sunrise Point-LP */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_SKYLAKE) ++ { ++ .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, ++ .device = 0x9d70, ++ }, ++#endif ++/* Kabylake-LP */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_KABYLAKE) ++ { ++ .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, ++ .device = 0x9d71, ++ }, ++#endif ++/* Tigerlake */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_TIGERLAKE) ++ { ++ .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, ++ .device = 0xa0c8, ++ }, ++#endif ++/* Coffelake */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_COFFEELAKE) ++ { ++ .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, ++ .device = 0xa348, ++ }, ++#endif ++}; ++ ++static const struct config_entry *snd_intel_dsp_find_config ++ (struct pci_dev *pci, const struct config_entry *table, u32 len) ++{ ++ u16 device; ++ ++ device = pci->device; ++ for (; len > 0; len--, table++) { ++ if (table->device != device) ++ continue; ++ if (table->dmi_table && !dmi_check_system(table->dmi_table)) ++ continue; ++ return table; ++ } ++ return NULL; ++} ++ ++static int snd_intel_dsp_check_dmic(struct pci_dev *pci) ++{ ++ struct nhlt_acpi_table *nhlt; ++ int ret = 0; ++ ++ nhlt = intel_nhlt_init(&pci->dev); ++ if (nhlt) { ++ if (intel_nhlt_get_dmic_geo(&pci->dev, nhlt)) ++ ret = 1; ++ intel_nhlt_free(nhlt); ++ } ++ return ret; ++} ++ ++int snd_intel_dsp_driver_probe(struct pci_dev *pci) ++{ ++ const struct config_entry *cfg; ++ ++ if (dsp_driver > 0 && dsp_driver <= SND_INTEL_DSP_DRIVER_LAST) ++ return dsp_driver; ++ ++ /* Intel vendor only */ ++ if (snd_BUG_ON(pci->vendor != 0x8086)) ++ return SND_INTEL_DSP_DRIVER_ANY; ++ ++ /* ++ * detect DSP by checking class/subclass/prog-id information ++ * class=04 subclass 03 prog-if 00: no DSP, use legacy driver ++ * class=04 subclass 01 prog-if 00: DSP is present ++ * (and may be required e.g. for DMIC or SSP support) ++ * class=04 subclass 03 prog-if 80: use DSP or legacy mode ++ */ ++ if (pci->class == 0x040300) ++ return SND_INTEL_DSP_DRIVER_LEGACY; ++ if (pci->class != 0x040100 && pci->class != 0x040380) { ++ dev_err(&pci->dev, "Unknown PCI class/subclass/prog-if information (0x%06x) found, selecting HDA legacy driver\n", pci->class); ++ return SND_INTEL_DSP_DRIVER_LEGACY; ++ } ++ ++ dev_info(&pci->dev, "DSP detected with PCI class/subclass/prog-if info 0x%06x\n", pci->class); ++ ++ /* find the configuration for the specific device */ ++ cfg = snd_intel_dsp_find_config(pci, config_table, ARRAY_SIZE(config_table)); ++ if (!cfg) ++ return SND_INTEL_DSP_DRIVER_ANY; ++ ++ if (cfg->flags & FLAG_SOF) { ++ if (cfg->flags & FLAG_SOF_ONLY_IF_DMIC) { ++ if (snd_intel_dsp_check_dmic(pci)) { ++ dev_info(&pci->dev, "Digital mics found on Skylake+ platform, using SOF driver\n"); ++ return SND_INTEL_DSP_DRIVER_SOF; ++ } ++ } else { ++ return SND_INTEL_DSP_DRIVER_SOF; ++ } ++ } ++ ++ if (cfg->flags & FLAG_SST) ++ return SND_INTEL_DSP_DRIVER_SST; ++ ++ return SND_INTEL_DSP_DRIVER_LEGACY; ++} ++EXPORT_SYMBOL_GPL(snd_intel_dsp_driver_probe); ++ ++MODULE_LICENSE("GPL v2"); ++MODULE_DESCRIPTION("Intel DSP config driver"); +diff --git a/sound/hda/intel-nhlt.c b/sound/hda/intel-nhlt.c +index daede96f28ee..097ff6c10099 100644 +--- a/sound/hda/intel-nhlt.c ++++ b/sound/hda/intel-nhlt.c +@@ -102,6 +102,3 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt) + return dmic_geo; + } + EXPORT_SYMBOL_GPL(intel_nhlt_get_dmic_geo); +- +-MODULE_LICENSE("GPL v2"); +-MODULE_DESCRIPTION("Intel NHLT driver"); +diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig +index dae47a45b2b8..bd48335d09d7 100644 +--- a/sound/pci/hda/Kconfig ++++ b/sound/pci/hda/Kconfig +@@ -12,7 +12,7 @@ config SND_HDA_INTEL + tristate "HD Audio PCI" + depends on SND_PCI + select SND_HDA +- select SND_INTEL_NHLT if ACPI ++ select SND_INTEL_DSP_CONFIG + help + Say Y here to include support for Intel "High Definition + Audio" (Azalia) and its compatible devices. +@@ -23,15 +23,6 @@ config SND_HDA_INTEL + To compile this driver as a module, choose M here: the module + will be called snd-hda-intel. + +-config SND_HDA_INTEL_DETECT_DMIC +- bool "DMIC detection and probe abort" +- depends on SND_HDA_INTEL +- help +- Say Y to detect digital microphones on SKL+ devices. DMICs +- cannot be handled by the HDaudio legacy driver and are +- currently only supported by the SOF driver. +- If unsure say N. +- + config SND_HDA_TEGRA + tristate "NVIDIA Tegra HD Audio" + depends on ARCH_TEGRA +diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c +index c52419376c74..2e5742d095ff 100644 +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -46,7 +46,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +@@ -124,7 +124,7 @@ static char *patch[SNDRV_CARDS]; + static bool beep_mode[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = + CONFIG_SND_HDA_INPUT_BEEP_MODE}; + #endif +-static bool dmic_detect = IS_ENABLED(CONFIG_SND_HDA_INTEL_DETECT_DMIC); ++static bool dsp_driver = 1; + + module_param_array(index, int, NULL, 0444); + MODULE_PARM_DESC(index, "Index value for Intel HD audio interface."); +@@ -159,8 +159,9 @@ module_param_array(beep_mode, bool, NULL, 0444); + MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode " + "(0=off, 1=on) (default=1)."); + #endif +-module_param(dmic_detect, bool, 0444); +-MODULE_PARM_DESC(dmic_detect, "DMIC detect on SKL+ platforms"); ++module_param(dsp_driver, bool, 0444); ++MODULE_PARM_DESC(dsp_driver, "Allow DSP driver selection (bypass this driver) " ++ "(0=off, 1=on) (default=1)"); + + #ifdef CONFIG_PM + static int param_set_xint(const char *val, const struct kernel_param *kp); +@@ -2020,25 +2021,6 @@ static const struct hda_controller_ops pci_hda_ops = { + .position_check = azx_position_check, + }; + +-static int azx_check_dmic(struct pci_dev *pci, struct azx *chip) +-{ +- struct nhlt_acpi_table *nhlt; +- int ret = 0; +- +- if (chip->driver_type == AZX_DRIVER_SKL && +- pci->class != 0x040300) { +- nhlt = intel_nhlt_init(&pci->dev); +- if (nhlt) { +- if (intel_nhlt_get_dmic_geo(&pci->dev, nhlt)) { +- ret = -ENODEV; +- dev_info(&pci->dev, "Digital mics found on Skylake+ platform, aborting probe\n"); +- } +- intel_nhlt_free(nhlt); +- } +- } +- return ret; +-} +- + static int azx_probe(struct pci_dev *pci, + const struct pci_device_id *pci_id) + { +@@ -2056,6 +2038,16 @@ static int azx_probe(struct pci_dev *pci, + return -ENOENT; + } + ++ /* ++ * stop probe if another Intel's DSP driver should be activated ++ */ ++ if (dsp_driver) { ++ err = snd_intel_dsp_driver_probe(pci); ++ if (err != SND_INTEL_DSP_DRIVER_ANY && ++ err != SND_INTEL_DSP_DRIVER_LEGACY) ++ return -ENODEV; ++ } ++ + err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, + 0, &card); + if (err < 0) { +@@ -2069,17 +2061,6 @@ static int azx_probe(struct pci_dev *pci, + card->private_data = chip; + hda = container_of(chip, struct hda_intel, chip); + +- /* +- * stop probe if digital microphones detected on Skylake+ platform +- * with the DSP enabled. This is an opt-in behavior defined at build +- * time or at run-time with a module parameter +- */ +- if (dmic_detect) { +- err = azx_check_dmic(pci, chip); +- if (err < 0) +- goto out_free; +- } +- + pci_set_drvdata(pci, card); + + err = register_vga_switcheroo(chip); +diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig +index 01c99750212a..9ad89d56092b 100644 +--- a/sound/soc/intel/Kconfig ++++ b/sound/soc/intel/Kconfig +@@ -215,7 +215,7 @@ config SND_SOC_INTEL_SKYLAKE_COMMON + select SND_SOC_INTEL_SST + select SND_SOC_HDAC_HDA if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC + select SND_SOC_ACPI_INTEL_MATCH +- select SND_INTEL_NHLT if ACPI ++ select SND_INTEL_DSP_CONFIG + help + If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/ + GeminiLake or CannonLake platform with the DSP enabled in the BIOS +diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c +index 141dbbf975ac..58ba3e9469ba 100644 +--- a/sound/soc/intel/skylake/skl.c ++++ b/sound/soc/intel/skylake/skl.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include "skl.h" + #include "skl-sst-dsp.h" + #include "skl-sst-ipc.h" +@@ -987,22 +988,10 @@ static int skl_probe(struct pci_dev *pci, + + switch (skl_pci_binding) { + case SND_SKL_PCI_BIND_AUTO: +- /* +- * detect DSP by checking class/subclass/prog-id information +- * class=04 subclass 03 prog-if 00: no DSP, use legacy driver +- * class=04 subclass 01 prog-if 00: DSP is present +- * (and may be required e.g. for DMIC or SSP support) +- * class=04 subclass 03 prog-if 80: use DSP or legacy mode +- */ +- if (pci->class == 0x040300) { +- dev_info(&pci->dev, "The DSP is not enabled on this platform, aborting probe\n"); ++ err = snd_intel_dsp_driver_probe(pci); ++ if (err != SND_INTEL_DSP_DRIVER_ANY && ++ err != SND_INTEL_DSP_DRIVER_SST) + return -ENODEV; +- } +- if (pci->class != 0x040100 && pci->class != 0x040380) { +- dev_err(&pci->dev, "Unknown PCI class/subclass/prog-if information (0x%06x) found, aborting probe\n", pci->class); +- return -ENODEV; +- } +- dev_info(&pci->dev, "DSP detected with PCI class/subclass/prog-if info 0x%06x\n", pci->class); + break; + case SND_SKL_PCI_BIND_LEGACY: + dev_info(&pci->dev, "Module parameter forced binding with HDaudio legacy, aborting probe\n"); +diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig +index d62f51d33be1..1be28581c328 100644 +--- a/sound/soc/sof/intel/Kconfig ++++ b/sound/soc/sof/intel/Kconfig +@@ -296,7 +296,7 @@ config SND_SOC_SOF_HDA + tristate + select SND_HDA_EXT_CORE if SND_SOC_SOF_HDA_LINK + select SND_SOC_HDAC_HDA if SND_SOC_SOF_HDA_AUDIO_CODEC +- select SND_INTEL_NHLT if ACPI ++ select SND_INTEL_DSP_CONFIG + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level +diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c +index d66412a77873..3a9e0e2a150d 100644 +--- a/sound/soc/sof/sof-pci-dev.c ++++ b/sound/soc/sof/sof-pci-dev.c +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -277,6 +278,11 @@ static int sof_pci_probe(struct pci_dev *pci, + const struct snd_sof_dsp_ops *ops; + int ret; + ++ ret = snd_intel_dsp_driver_probe(pci); ++ if (ret != SND_INTEL_DSP_DRIVER_ANY && ++ ret != SND_INTEL_DSP_DRIVER_SOF) ++ return -ENODEV; ++ + dev_dbg(&pci->dev, "PCI DSP detected"); + + /* get ops for platform */ +-- +2.20.1 + + +From 8f609dd45d5598536e5a1a7a84fe19ff7c13559a Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Tue, 22 Oct 2019 19:43:13 +0200 +Subject: [PATCH 007/130] ALSA: hda: fix intel DSP config + +Reshuffle list of devices by historical order and add correct +information as needed. + +Signed-off-by: Pierre-Louis Bossart +Signed-off-by: Jaroslav Kysela +Link: https://lore.kernel.org/r/20191022174313.29087-2-perex@perex.cz +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit cc8f81c7e625168a60843b2b39e3a327cf5170fe) +Bugzilla: 1772498 +--- + sound/hda/intel-dsp-config.c | 220 ++++++++++++++++++++++++++--------- + 1 file changed, 164 insertions(+), 56 deletions(-) + +diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c +index d9f6d9e872b4..0b2a7201a46a 100644 +--- a/sound/hda/intel-dsp-config.c ++++ b/sound/hda/intel-dsp-config.c +@@ -30,45 +30,98 @@ struct config_entry { + * - the first successful match will win + */ + static const struct config_entry config_table[] = { +-/* Cometlake-LP */ +-#if IS_ENABLED(CONFIG_SND_SOC_INTEL_CML_LP) ++/* Merrifield */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_MERRIFIELD) + { +- /* prefer SST */ +- .flags = FLAG_SST, +- .device = 0x02c8, ++ .flags = FLAG_SOF, ++ .device = 0x119a, + }, +-#elif IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE_LP) ++#endif ++/* Broxton-T */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE) + { + .flags = FLAG_SOF, +- .device = 0x02c8, ++ .device = 0x1a98, + }, + #endif +-/* Cometlake-H */ +-#if IS_ENABLED(CONFIG_SND_SOC_INTEL_CML_H) ++/* ++ * Apollolake (Broxton-P) ++ * the legacy HDaudio driver is used except on Up Squared (SOF) and ++ * Chromebooks (SST) ++ */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE) + { +- .flags = FLAG_SST, +- .device = 0x06c8, ++ .flags = FLAG_SOF, ++ .device = 0x5a98, ++ .dmi_table = (const struct dmi_system_id []) { ++ { ++ .ident = "Up Squared", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "AAEON"), ++ DMI_MATCH(DMI_BOARD_NAME, "UP-APL01"), ++ } ++ }, ++ {} ++ } + }, +-#elif IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE_H) ++#endif ++#if IS_ENABLED(CONFIG_SND_SOC_INTEL_APL) + { +- .flags = FLAG_SOF, +- .device = 0x06c8, ++ .flags = FLAG_SST, ++ .device = 0x5a98, ++ .dmi_table = (const struct dmi_system_id []) { ++ { ++ .ident = "Google Chromebooks", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Google"), ++ } ++ }, ++ {} ++ } + }, + #endif +-/* Merrifield */ +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_MERRIFIELD) ++/* ++ * Skylake and Kabylake use legacy HDaudio driver except for Google ++ * Chromebooks (SST) ++ */ ++ ++/* Sunrise Point-LP */ ++#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKL) + { +- .flags = FLAG_SOF, +- .device = 0x119a, ++ .flags = FLAG_SST, ++ .device = 0x9d70, ++ .dmi_table = (const struct dmi_system_id []) { ++ { ++ .ident = "Google Chromebooks", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Google"), ++ } ++ }, ++ {} ++ } + }, + #endif +-/* Broxton-T */ +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE) ++/* Kabylake-LP */ ++#if IS_ENABLED(CONFIG_SND_SOC_INTEL_KBL) + { +- .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, +- .device = 0x1a98, ++ .flags = FLAG_SST, ++ .device = 0x9d71, ++ .dmi_table = (const struct dmi_system_id []) { ++ { ++ .ident = "Google Chromebooks", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Google"), ++ } ++ }, ++ {} ++ } + }, + #endif ++ ++/* ++ * Geminilake uses legacy HDaudio driver except for Google ++ * Chromebooks ++ */ + /* Geminilake */ + #if IS_ENABLED(CONFIG_SND_SOC_SOF_GEMINILAKE) + { +@@ -85,84 +138,139 @@ static const struct config_entry config_table[] = { + } + }, + #endif +-#if IS_ENABLED(CONFIG_SND_SOC_INTEL_GLK) ++ ++/* ++ * CoffeeLake, CannonLake, CometLake, IceLake, TigerLake use legacy ++ * HDaudio driver except for Google Chromebooks and when DMICs are ++ * present. Two cases are required since Coreboot does not expose NHLT ++ * tables. ++ * ++ * When the Chromebook quirk is not present, it's based on information ++ * that no such device exists. When the quirk is present, it could be ++ * either based on product information or a placeholder. ++ */ ++ ++/* Cannonlake */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_CANNONLAKE) + { +- .flags = FLAG_SST, +- .device = 0x3198, ++ .flags = FLAG_SOF, ++ .device = 0x9dc8, ++ .dmi_table = (const struct dmi_system_id []) { ++ { ++ .ident = "Google Chromebooks", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Google"), ++ } ++ }, ++ {} ++ } + }, +-#endif +-/* Icelake */ +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_ICELAKE) + { + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, +- .device = 0x34c8, ++ .device = 0x9dc8, + }, + #endif +-/* Elkhart Lake */ +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_ELKHARTLAKE) ++ ++/* Coffelake */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_COFFEELAKE) ++ { ++ .flags = FLAG_SOF, ++ .device = 0xa348, ++ .dmi_table = (const struct dmi_system_id []) { ++ { ++ .ident = "Google Chromebooks", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Google"), ++ } ++ }, ++ {} ++ } ++ }, + { + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, +- .device = 0x4b55, ++ .device = 0xa348, + }, + #endif +-/* Appololake (Broxton-P) */ +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE) ++ ++/* Cometlake-LP */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE_LP) + { + .flags = FLAG_SOF, +- .device = 0x5a98, ++ .device = 0x02c8, + .dmi_table = (const struct dmi_system_id []) { + { +- .ident = "Up Squared", ++ .ident = "Google Chromebooks", + .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "AAEON"), +- DMI_MATCH(DMI_BOARD_NAME, "UP-APL01"), ++ DMI_MATCH(DMI_SYS_VENDOR, "Google"), + } + }, + {} + } + }, +-#endif +-#if IS_ENABLED(CONFIG_SND_SOC_INTEL_APL) + { +- .flags = FLAG_SST, +- .device = 0x5a98, ++ .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, ++ .device = 0x02c8, + }, + #endif +-/* Cannonlake */ +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_CANNONLAKE) ++/* Cometlake-H */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE_H) + { + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, +- .device = 0x9dc8, ++ .device = 0x06c8, + }, + #endif +-/* Sunrise Point-LP */ +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_SKYLAKE) ++ ++/* Icelake */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_ICELAKE) + { +- .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, +- .device = 0x9d70, ++ .flags = FLAG_SOF, ++ .device = 0x34c8, ++ .dmi_table = (const struct dmi_system_id []) { ++ { ++ .ident = "Google Chromebooks", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Google"), ++ } ++ }, ++ {} ++ } + }, +-#endif +-/* Kabylake-LP */ +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_KABYLAKE) + { + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, +- .device = 0x9d71, ++ .device = 0x34c8, + }, + #endif ++ + /* Tigerlake */ + #if IS_ENABLED(CONFIG_SND_SOC_SOF_TIGERLAKE) ++ { ++ .flags = FLAG_SOF, ++ .device = 0xa0c8, ++ .dmi_table = (const struct dmi_system_id []) { ++ { ++ .ident = "Google Chromebooks", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Google"), ++ } ++ }, ++ {} ++ } ++ }, ++ + { + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, + .device = 0xa0c8, + }, + #endif +-/* Coffelake */ +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_COFFEELAKE) ++ ++/* Elkhart Lake */ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_ELKHARTLAKE) + { + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC, +- .device = 0xa348, ++ .device = 0x4b55, + }, + #endif ++ + }; + + static const struct config_entry *snd_intel_dsp_find_config +-- +2.20.1 + + +From 56731f15b8cce801875906ab32fefecd7858ab1a Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 28 Oct 2019 17:46:24 +0100 +Subject: [PATCH 008/130] ASoC: intel - fix the card names + +Those strings are exposed to the user space as the +card name thus used in the GUIs. The common +standard is to avoid '_' here. The worst case +is 'sof-skl_hda_card' string. + +Signed-off-by: Jaroslav Kysela +Cc: Pierre-Louis Bossart +Cc: Mark Brown +Acked-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191028164624.14334-1-perex@perex.cz +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit d745cc1ab65945b2d17ec9c5652f38299c054649) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 2 +- + sound/soc/intel/boards/skl_hda_dsp_generic.c | 2 +- + sound/soc/intel/boards/sof_rt5682.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +index 74dda8784f1a..d14ca327c684 100644 +--- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c ++++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +@@ -623,7 +623,7 @@ static int kabylake_card_late_probe(struct snd_soc_card *card) + * kabylake audio machine driver for MAX98927 + RT5514 + RT5663 + */ + static struct snd_soc_card kabylake_audio_card = { +- .name = "kbl_r5514_5663_max", ++ .name = "kbl-r5514-5663-max", + .owner = THIS_MODULE, + .dai_link = kabylake_dais, + .num_links = ARRAY_SIZE(kabylake_dais), +diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c +index 1778acdc367c..e8d676c192f6 100644 +--- a/sound/soc/intel/boards/skl_hda_dsp_generic.c ++++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c +@@ -90,7 +90,7 @@ skl_hda_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *link) + } + + static struct snd_soc_card hda_soc_card = { +- .name = "skl_hda_card", ++ .name = "hda-dsp", + .owner = THIS_MODULE, + .dai_link = skl_hda_be_dai_links, + .dapm_widgets = skl_hda_widgets, +diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c +index 4f6e58c3954a..320a9b9273db 100644 +--- a/sound/soc/intel/boards/sof_rt5682.c ++++ b/sound/soc/intel/boards/sof_rt5682.c +@@ -370,7 +370,7 @@ static int dmic_init(struct snd_soc_pcm_runtime *rtd) + + /* sof audio machine driver for rt5682 codec */ + static struct snd_soc_card sof_audio_card_rt5682 = { +- .name = "sof_rt5682", ++ .name = "rt5682", /* the sof- prefix is added by the core */ + .owner = THIS_MODULE, + .controls = sof_controls, + .num_controls = ARRAY_SIZE(sof_controls), +-- +2.20.1 + + +From 63d4f97804a1ab4ad9e84843bdee307c2ab9e9b5 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 28 Oct 2019 14:06:34 +0100 +Subject: [PATCH 009/130] ALSA: hda: Allow non-Intel device probe gracefully + +The recent addition of snd_intel_dsp_driver_probe() check caused a +spurious kernel warning when the driver is loaded for a non-Intel +hardware due to snd_BUG_ON(). Moreover, for such a hardware, we +should always return SND_INTEL_DSP_DRIVER_ANY, not check the +dsp_driver option at all. + +This patch fixes these issues for non-Intel devices. + +Fixes: 82d9d54a6c0e ("ALSA: hda: add Intel DSP configuration / probe code") +Signed-off-by: Takashi Iwai +Link: https://lore.kernel.org/r/20191028130634.3501-1-tiwai@suse.de +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 91636a82044a2821201b54faac4d1d2425260842) +Bugzilla: 1772498 +--- + sound/hda/intel-dsp-config.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c +index 0b2a7201a46a..be1df80ed013 100644 +--- a/sound/hda/intel-dsp-config.c ++++ b/sound/hda/intel-dsp-config.c +@@ -307,13 +307,13 @@ int snd_intel_dsp_driver_probe(struct pci_dev *pci) + { + const struct config_entry *cfg; + +- if (dsp_driver > 0 && dsp_driver <= SND_INTEL_DSP_DRIVER_LAST) +- return dsp_driver; +- + /* Intel vendor only */ +- if (snd_BUG_ON(pci->vendor != 0x8086)) ++ if (pci->vendor != 0x8086) + return SND_INTEL_DSP_DRIVER_ANY; + ++ if (dsp_driver > 0 && dsp_driver <= SND_INTEL_DSP_DRIVER_LAST) ++ return dsp_driver; ++ + /* + * detect DSP by checking class/subclass/prog-id information + * class=04 subclass 03 prog-if 00: no DSP, use legacy driver +-- +2.20.1 + + +From fddf95e9cd5e5768e35aa6f60a9686f21e690dc5 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 5 Nov 2019 09:18:06 +0100 +Subject: [PATCH 010/130] ALSA: hda: Disable regmap internal locking + +Since we apply the own mutex (bus->cmd_mutex) in HDA core side, the +internal locking in regmap is superfluous. This patch adds the flag +to indicate that. + +Also, an infamous side-effect by this change is that it disables the +regmap debugfs, too, and this is seen rather good; the regmap debugfs +isn't quite useful for HD-audio as it provides the very sparse +registers and its debugfs access tends to lead to the way too high +resource usages or sometimes hang up. So it'd be rather safe to +disable it altogether. + +Link: https://lore.kernel.org/r/2029139028.10333037.1572874551626.JavaMail.zimbra@redhat.com +Link: https://lore.kernel.org/r/20191105081806.4896-1-tiwai@suse.de +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 42ec336f1f9d54049811b749f729e9e01c152ade) +Bugzilla: 1772498 +--- + sound/hda/hdac_regmap.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/hda/hdac_regmap.c b/sound/hda/hdac_regmap.c +index 286361ecd640..906b1e20bae0 100644 +--- a/sound/hda/hdac_regmap.c ++++ b/sound/hda/hdac_regmap.c +@@ -363,6 +363,7 @@ static const struct regmap_config hda_regmap_cfg = { + .reg_write = hda_reg_write, + .use_single_read = true, + .use_single_write = true, ++ .disable_locking = true, + }; + + /** +-- +2.20.1 + + +From b9f21867949f2ed530dbefed02d139c5a92e0621 Mon Sep 17 00:00:00 2001 +From: Kai-Heng Feng +Date: Fri, 18 Oct 2019 15:38:48 +0800 +Subject: [PATCH 011/130] ALSA: hda: Allow HDA to be runtime suspended when + dGPU is not bound to a driver + +Nvidia proprietary driver doesn't support runtime power management, so +when a user only wants to use the integrated GPU, it's a common practice +to let dGPU not to bind any driver, and let its upstream port to be +runtime suspended. At the end of runtime suspension the port uses +platform power management to disable power through _OFF method of power +resource, which is listed by _PR3. + +After commit b516ea586d71 ("PCI: Enable NVIDIA HDA controllers"), when +the dGPU comes with an HDA function, the HDA won't be suspended if the +dGPU is unbound, so the power resource can't be turned off by its +upstream port driver. + +Commit 37a3a98ef601 ("ALSA: hda - Enable runtime PM only for +discrete GPU") only allows HDA to be runtime suspended once GPU is +bound, to keep APU's HDA working. + +However, HDA on dGPU isn't that useful if dGPU is not bound to any +driver. So let's relax the runtime suspend requirement for dGPU's HDA +function, to disable the power source to save lots of power. + +BugLink: https://bugs.launchpad.net/bugs/1840835 +Fixes: b516ea586d71 ("PCI: Enable NVIDIA HDA controllers") +Signed-off-by: Kai-Heng Feng +Link: https://lore.kernel.org/r/20191018073848.14590-2-kai.heng.feng@canonical.com +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit bacd861452d2be86a4df341b12e32db7dac8021e) +Bugzilla: 1772498 +--- + sound/pci/hda/hda_intel.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c +index 2e5742d095ff..e0e9d4ee180d 100644 +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -1281,11 +1281,17 @@ static void init_vga_switcheroo(struct azx *chip) + { + struct hda_intel *hda = container_of(chip, struct hda_intel, chip); + struct pci_dev *p = get_bound_vga(chip->pci); ++ struct pci_dev *parent; + if (p) { + dev_info(chip->card->dev, + "Handle vga_switcheroo audio client\n"); + hda->use_vga_switcheroo = 1; +- chip->bus.keep_power = 1; /* cleared in either gpu_bound op or codec probe */ ++ ++ /* cleared in either gpu_bound op or codec probe, or when its ++ * upstream port has _PR3 (i.e. dGPU). ++ */ ++ parent = pci_upstream_bridge(p); ++ chip->bus.keep_power = parent ? !pci_pr3_present(parent) : 1; + chip->driver_caps |= AZX_DCAPS_PM_RUNTIME; + pci_dev_put(p); + } +-- +2.20.1 + + +From e3eb037a46c5b6771e9336bb493063dbffb90e04 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Tue, 29 Oct 2019 15:40:09 +0200 +Subject: [PATCH 013/130] ALSA: hda/hdmi - implement mst_no_extra_pcms flag + +To support the DP-MST multiple streams via single connector feature, +the HDMI driver was extended with the concept of backup PCMs. See +commit 9152085defb6 ("ALSA: hda - add DP MST audio support"). + +This implementation works fine with snd_hda_intel.c as PCM topology +is fully managed within the single driver. + +When the HDA codec driver is used from ASoC components, the concept +of backup PCMs no longer fits. For ASoC topologies, the physical +HDMI converters are presented as backend DAIs and these should match +with hardware capabilities. The ASoC topology may define arbitrary +PCMs (i.e. frontend DAIs) and have processing elements before eventual +routing to the HDMI BE DAIs. With backup PCMs, the link between +FE and BE DAIs would become dynamic and change when monitors are +(un)plugged. This would lead to modifying the topology every time +hotplug events happen, which is not currently possible in ASoC and +there does not seem to be any obvious benefits from this design. + +To overcome above problems and enable the HDMI driver to be used +from ASoC, this patch adds a new mode (mst_no_extra_pcms flags) to +patch_hdmi.c. In this mode, the codec driver does not assume +the backup PCMs to be created. + +Signed-off-by: Kai Vehmanen +Reviewed-by: Takashi Iwai +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191029134017.18901-2-kai.vehmanen@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 2a2edfbbfee47947dd05f5860c66c0e80ee5e09d) +Bugzilla: 1772498 +--- + include/sound/hda_codec.h | 1 + + sound/pci/hda/patch_hdmi.c | 19 ++++++++++++++----- + 2 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h +index 9a0393cf024c..ac18f428eda6 100644 +--- a/include/sound/hda_codec.h ++++ b/include/sound/hda_codec.h +@@ -254,6 +254,7 @@ struct hda_codec { + unsigned int force_pin_prefix:1; /* Add location prefix */ + unsigned int link_down_at_suspend:1; /* link down at runtime suspend */ + unsigned int relaxed_resume:1; /* don't resume forcibly for jack */ ++ unsigned int mst_no_extra_pcms:1; /* no backup PCMs for DP-MST */ + + #ifdef CONFIG_PM + unsigned long power_on_acct; +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c +index d14f6684737d..b8579cd21809 100644 +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -2075,15 +2075,24 @@ static bool is_hdmi_pcm_attached(struct hdac_device *hdac, int pcm_idx) + static int generic_hdmi_build_pcms(struct hda_codec *codec) + { + struct hdmi_spec *spec = codec->spec; +- int idx; ++ int idx, pcm_num; + + /* + * for non-mst mode, pcm number is the same as before +- * for DP MST mode, pcm number is (nid number + dev_num - 1) +- * dev_num is the device entry number in a pin +- * ++ * for DP MST mode without extra PCM, pcm number is same ++ * for DP MST mode with extra PCMs, pcm number is ++ * (nid number + dev_num - 1) ++ * dev_num is the device entry number in a pin + */ +- for (idx = 0; idx < spec->num_nids + spec->dev_num - 1; idx++) { ++ ++ if (codec->mst_no_extra_pcms) ++ pcm_num = spec->num_nids; ++ else ++ pcm_num = spec->num_nids + spec->dev_num - 1; ++ ++ codec_dbg(codec, "hdmi: pcm_num set to %d\n", pcm_num); ++ ++ for (idx = 0; idx < pcm_num; idx++) { + struct hda_pcm *info; + struct hda_pcm_stream *pstr; + +-- +2.20.1 + + +From d396423ca770d10ab33a485f118e80a1a9f70516 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 11 Nov 2019 20:09:37 +0100 +Subject: [PATCH 014/130] ALSA: hda/hdmi - Clean up Intel platform-specific + fixup checks + +Introduce a new flag in hdmi_spec to indicate the Intel platform- +specific fixups so that we can get rid of the lengthy codec ID +checks. The flag is set in intel_hsw_common_init() commonly. + +Reviewed-by: Kai Vehmanen +Link: https://lore.kernel.org/r/20191111190937.19186-1-tiwai@suse.de +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit cb45722b289b54476b68883985c2824c69a7fba9) +Bugzilla: 1772498 +--- + sound/pci/hda/patch_hdmi.c | 27 +++++---------------------- + 1 file changed, 5 insertions(+), 22 deletions(-) + +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c +index b8579cd21809..ee72d990cef3 100644 +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -37,25 +37,6 @@ static bool static_hdmi_pcm; + module_param(static_hdmi_pcm, bool, 0644); + MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info"); + +-#define is_haswell(codec) ((codec)->core.vendor_id == 0x80862807) +-#define is_broadwell(codec) ((codec)->core.vendor_id == 0x80862808) +-#define is_skylake(codec) ((codec)->core.vendor_id == 0x80862809) +-#define is_broxton(codec) ((codec)->core.vendor_id == 0x8086280a) +-#define is_kabylake(codec) ((codec)->core.vendor_id == 0x8086280b) +-#define is_geminilake(codec) (((codec)->core.vendor_id == 0x8086280d) || \ +- ((codec)->core.vendor_id == 0x80862800)) +-#define is_cannonlake(codec) ((codec)->core.vendor_id == 0x8086280c) +-#define is_icelake(codec) ((codec)->core.vendor_id == 0x8086280f) +-#define is_tigerlake(codec) ((codec)->core.vendor_id == 0x80862812) +-#define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec) \ +- || is_skylake(codec) || is_broxton(codec) \ +- || is_kabylake(codec) || is_geminilake(codec) \ +- || is_cannonlake(codec) || is_icelake(codec) \ +- || is_tigerlake(codec)) +-#define is_valleyview(codec) ((codec)->core.vendor_id == 0x80862882) +-#define is_cherryview(codec) ((codec)->core.vendor_id == 0x80862883) +-#define is_valleyview_plus(codec) (is_valleyview(codec) || is_cherryview(codec)) +- + struct hdmi_spec_per_cvt { + hda_nid_t cvt_nid; + int assigned; +@@ -162,6 +143,7 @@ struct hdmi_spec { + + bool dyn_pin_out; + bool dyn_pcm_assign; ++ bool intel_hsw_fixup; /* apply Intel platform-specific fixups */ + /* + * Non-generic VIA/NVIDIA specific + */ +@@ -925,7 +907,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid, + return err; + } + +- if (is_haswell_plus(codec)) { ++ if (spec->intel_hsw_fixup) { + + /* + * on recent platforms IEC Coding Type is required for HBR +@@ -1709,7 +1691,7 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) + * To simplify the implementation, malloc all + * the virtual pins in the initialization statically + */ +- if (is_haswell_plus(codec)) { ++ if (spec->intel_hsw_fixup) { + /* + * On Intel platforms, device entries number is + * changed dynamically. If there is a DP MST +@@ -1758,7 +1740,7 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) + per_pin->dev_id = i; + per_pin->non_pcm = false; + snd_hda_set_dev_select(codec, pin_nid, i); +- if (is_haswell_plus(codec)) ++ if (spec->intel_hsw_fixup) + intel_haswell_fixup_connect_list(codec, pin_nid); + err = hdmi_read_pin_conn(codec, pin_idx); + if (err < 0) +@@ -2825,6 +2807,7 @@ static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid, + spec->vendor_nid = vendor_nid; + spec->port_map = port_map; + spec->port_num = port_num; ++ spec->intel_hsw_fixup = true; + + intel_haswell_enable_all_pins(codec, true); + intel_haswell_fixup_enable_dp12(codec); +-- +2.20.1 + + +From 3c8372547754addd020cc95c164508fd67cb53b8 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Fri, 15 Nov 2019 14:44:47 +0200 +Subject: [PATCH 015/130] ALSA: hda: hdmi - fix port numbering for ICL and TGL + platforms + +Semantics of port#0 differ between ICL and TGL: + + ICL port#0 -> never used for HDAudio + ICL port#1 -> should be mapped to first pin (0x04) + TGL port#0 -> typically not used, but HW has the support, + so should be mapped to first pin (0x04) + TGL port#1 -> should be mapped to 2nd pin (0x06) + +Refactor the port mapping logic to allow to take the above +differences into account. Fixes issues with HDAudio on some +TGL platforms. + +Co-developed-by: Pan Xiuli +Signed-off-by: Pan Xiuli +Signed-off-by: Kai Vehmanen +Link: https://lore.kernel.org/r/20191115124449.20512-2-kai.vehmanen@linux.intel.com +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit d577cf76fa3192f9e656bb101aa54d25a6a71347) +Bugzilla: 1772498 +--- + sound/pci/hda/patch_hdmi.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c +index ee72d990cef3..cc35a8569439 100644 +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -2664,7 +2664,7 @@ static int intel_pin2port(void *audio_ptr, int pin_nid) + */ + for (i = 0; i < spec->port_num; i++) { + if (pin_nid == spec->port_map[i]) +- return i + 1; ++ return i; + } + + /* return -1 if pin number exceeds our expectation */ +@@ -2684,9 +2684,9 @@ static int intel_port2pin(struct hda_codec *codec, int port) + return port + intel_base_nid(codec) - 1; + } + +- if (port < 1 || port > spec->port_num) ++ if (port < 0 || port >= spec->port_num) + return 0; +- return spec->port_map[port - 1]; ++ return spec->port_map[port]; + } + + static void intel_pin_eld_notify(void *audio_ptr, int port, int pipe) +@@ -2838,9 +2838,9 @@ static int patch_i915_icl_hdmi(struct hda_codec *codec) + { + /* + * pin to port mapping table where the value indicate the pin number and +- * the index indicate the port number with 1 base. ++ * the index indicate the port number. + */ +- static const int map[] = {0x4, 0x6, 0x8, 0xa, 0xb}; ++ static const int map[] = {0x0, 0x4, 0x6, 0x8, 0xa, 0xb}; + + return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map)); + } +@@ -2849,7 +2849,7 @@ static int patch_i915_tgl_hdmi(struct hda_codec *codec) + { + /* + * pin to port mapping table where the value indicate the pin number and +- * the index indicate the port number with 1 base. ++ * the index indicate the port number. + */ + static const int map[] = {0x4, 0x6, 0x8, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; + +-- +2.20.1 + + +From 485ef81d2510635f707bec0fb461b199e0b6cb89 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Fri, 15 Nov 2019 14:44:48 +0200 +Subject: [PATCH 016/130] ALSA: hda: hdmi - remove redundant code comments + +Remove unnecessary comments related to pin mapping on +Intel platforms. + +Signed-off-by: Kai Vehmanen +Link: https://lore.kernel.org/r/20191115124449.20512-3-kai.vehmanen@linux.intel.com +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit c8e3eb9be57f91751aeb9397118755390dbff9a4) +Bugzilla: 1772498 +--- + sound/pci/hda/patch_hdmi.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c +index cc35a8569439..71848dce0025 100644 +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -2655,7 +2655,7 @@ static int intel_pin2port(void *audio_ptr, int pin_nid) + base_nid = intel_base_nid(codec); + if (WARN_ON(pin_nid < base_nid || pin_nid >= base_nid + 3)) + return -1; +- return pin_nid - base_nid + 1; /* intel port is 1-based */ ++ return pin_nid - base_nid + 1; + } + + /* +@@ -2667,7 +2667,6 @@ static int intel_pin2port(void *audio_ptr, int pin_nid) + return i; + } + +- /* return -1 if pin number exceeds our expectation */ + codec_info(codec, "Can't find the HDMI/DP port for pin %d\n", pin_nid); + return -1; + } +@@ -2680,7 +2679,6 @@ static int intel_port2pin(struct hda_codec *codec, int port) + /* we assume only from port-B to port-D */ + if (port < 1 || port > 3) + return 0; +- /* intel port is 1-based */ + return port + intel_base_nid(codec) - 1; + } + +@@ -2856,7 +2854,6 @@ static int patch_i915_tgl_hdmi(struct hda_codec *codec) + return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map)); + } + +- + /* Intel Baytrail and Braswell; with eld notifier */ + static int patch_i915_byt_hdmi(struct hda_codec *codec) + { +-- +2.20.1 + + +From c581baec7a7479f1767335255a7b7de405bfc707 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Fri, 15 Nov 2019 14:44:49 +0200 +Subject: [PATCH 017/130] ALSA: hda - remove forced polling workaround for CFL + and CNL + +Remove the workarounds added in commit fa763f1b2858 ("ALSA: +hda - Force polling mode on CNL for fixing codec communication") +and commit a8d7bde23e71 ("ALSA: hda - Force polling mode on CFL +for fixing codec communication"). + +The workarounds are no longer needed after the more generic +change done in commit 2756d9143aa5 ("ALSA: hda - Fix intermittent +CORB/RIRB stall on Intel chips"). This change applies to a larger +set of hardware and covers CFL and CNL as well. + +Similar change was already done to SOF DSP HDA driver with +no regressions detected. + +Signed-off-by: Kai Vehmanen +Link: https://lore.kernel.org/r/20191115124449.20512-4-kai.vehmanen@linux.intel.com +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit ee906c6b9c6e7e4ad749f5cfdf65768455f4bf43) +Bugzilla: 1772498 +--- + sound/pci/hda/hda_intel.c | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c +index 8981109e3565..e76a0bb6d3cf 100644 +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -369,8 +369,6 @@ enum { + ((pci)->device == 0x160c)) + + #define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98) +-#define IS_CFL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa348) +-#define IS_CNL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9dc8) + + static char *driver_short_names[] = { + [AZX_DRIVER_ICH] = "HDA Intel", +@@ -1763,10 +1761,6 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, + if (!azx_snoop(chip)) + azx_bus(chip)->dma_type = SNDRV_DMA_TYPE_DEV_UC; + +- /* Workaround for a communication error on CFL (bko#199007) and CNL */ +- if (IS_CFL(pci) || IS_CNL(pci)) +- azx_bus(chip)->polling_mode = 1; +- + if (chip->driver_type == AZX_DRIVER_NVIDIA) { + dev_dbg(chip->card->dev, "Enable delay in RIRB handling\n"); + chip->bus.needs_damn_long_delay = 1; +-- +2.20.1 + + +From 8de79a35aa53df66d5eec899cafff067a0908da4 Mon Sep 17 00:00:00 2001 +From: Kuninori Morimoto +Date: Tue, 15 Oct 2019 14:44:09 +0900 +Subject: [PATCH 018/130] ASoC: sof: include types.h at header.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Content-Transfer-Encoding: 8bit + +Without we will get these error + +linux/include/sound/sof/header.h:125:2: error: unknown type name ‘uint32_t’uint32_t size; +linux/include/sound/sof/header.h:136:2: error: unknown type name ‘uint32_t’uint32_t size; +linux/include/sound/sof/header.h:137:2: error: unknown type name ‘uint32_t’uint32_t cmd; +... +linux/include/sound/sof/dai-imx.h:18:2: error: unknown type name ‘uint16_t’uint16_t reserved1; +linux/include/sound/sof/dai-imx.h:30:2: error: unknown type name ‘uint16_t’uint16_t tdm_slot_width; +linux/include/sound/sof/dai-imx.h:31:2: error: unknown type name ‘uint16_t’uint16_t reserved2; + +Signed-off-by: Kuninori Morimoto +Link: https://lore.kernel.org/r/87a7a24l7r.wl-kuninori.morimoto.gx@renesas.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 03048217624a9472c1c7a205c8ea9bf8d4026e59) +Bugzilla: 1772498 +--- + include/sound/sof/header.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/sound/sof/header.h b/include/sound/sof/header.h +index 10f00c08dbb7..332143ff7278 100644 +--- a/include/sound/sof/header.h ++++ b/include/sound/sof/header.h +@@ -9,6 +9,7 @@ + #ifndef __INCLUDE_SOUND_SOF_HEADER_H__ + #define __INCLUDE_SOUND_SOF_HEADER_H__ + ++#include + #include + + /** \addtogroup sof_uapi uAPI +-- +2.20.1 + + +From eeb591355d00f4e6e077745aca5ff5a2899eca2d Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 27 Sep 2019 15:05:28 -0500 +Subject: [PATCH 019/130] ASoC: SOF: trace: move to opt-in with Kconfig and + module parameter + +In a number of debug cases, the DMA-based trace can add problems +(e.g. with HDaudio channel allocation). It also generates additional +traffic on the bus and if the DMA handling is unreliable will prevent +audio use-cases from working normally. Using the trace also requires +tools to be installed on the target. + +The trace can be instead handled as dynamic debug. We can use a +Kconfig to force the trace to be enabled in all cases, or use a module +parameter to enable it on a need-basis, e.g. by setting "options +snd_sof sof_debug=0x1" in a /etc/modprobe.d file. + +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20190927200538.660-4-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 2ab4c50f6955514150f83b47b7aee3ba5fe3ac1d) +Bugzilla: 1772498 +--- + sound/soc/sof/Kconfig | 8 ++++++++ + sound/soc/sof/core.c | 25 +++++++++++++++++++------ + sound/soc/sof/sof-priv.h | 13 +++++++++---- + sound/soc/sof/trace.c | 17 ++++++++++++++++- + 4 files changed, 52 insertions(+), 11 deletions(-) + +diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig +index bb8036ae567e..cc592bcadae7 100644 +--- a/sound/soc/sof/Kconfig ++++ b/sound/soc/sof/Kconfig +@@ -142,6 +142,14 @@ config SND_SOC_SOF_DEBUG_ENABLE_DEBUGFS_CACHE + Say Y if you want to enable caching the memory windows. + If unsure, select "N". + ++config SND_SOC_SOF_DEBUG_ENABLE_FIRMWARE_TRACE ++ bool "SOF enable firmware trace" ++ help ++ The firmware trace can be enabled either at build-time with ++ this option, or dynamically by setting flags in the SOF core ++ module parameter (similar to dynamic debug) ++ If unsure, select "N". ++ + config SND_SOC_SOF_DEBUG_IPC_FLOOD_TEST + bool "SOF enable IPC flood test" + help +diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c +index 81f28f7ff1a0..15167b8220ed 100644 +--- a/sound/soc/sof/core.c ++++ b/sound/soc/sof/core.c +@@ -16,6 +16,11 @@ + #include "sof-priv.h" + #include "ops.h" + ++/* see SOF_DBG_ flags */ ++int sof_core_debug; ++module_param_named(sof_debug, sof_core_debug, int, 0444); ++MODULE_PARM_DESC(sof_debug, "SOF core debug options (0x0 all off)"); ++ + /* SOF defaults if not provided by the platform in ms */ + #define TIMEOUT_DEFAULT_IPC_MS 500 + #define TIMEOUT_DEFAULT_BOOT_MS 2000 +@@ -350,12 +355,20 @@ static int sof_probe_continue(struct snd_sof_dev *sdev) + goto fw_run_err; + } + +- /* init DMA trace */ +- ret = snd_sof_init_trace(sdev); +- if (ret < 0) { +- /* non fatal */ +- dev_warn(sdev->dev, +- "warning: failed to initialize trace %d\n", ret); ++ if (IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_FIRMWARE_TRACE) || ++ (sof_core_debug & SOF_DBG_ENABLE_TRACE)) { ++ sdev->dtrace_is_supported = true; ++ ++ /* init DMA trace */ ++ ret = snd_sof_init_trace(sdev); ++ if (ret < 0) { ++ /* non fatal */ ++ dev_warn(sdev->dev, ++ "warning: failed to initialize trace %d\n", ++ ret); ++ } ++ } else { ++ dev_dbg(sdev->dev, "SOF firmware trace disabled\n"); + } + + /* hereafter all FW boot flows are for PM reasons */ +diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h +index 730f3259dd02..d5b1a4f895da 100644 +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -28,10 +28,14 @@ + #include + + /* debug flags */ +-#define SOF_DBG_REGS BIT(1) +-#define SOF_DBG_MBOX BIT(2) +-#define SOF_DBG_TEXT BIT(3) +-#define SOF_DBG_PCI BIT(4) ++#define SOF_DBG_ENABLE_TRACE BIT(0) ++#define SOF_DBG_REGS BIT(1) ++#define SOF_DBG_MBOX BIT(2) ++#define SOF_DBG_TEXT BIT(3) ++#define SOF_DBG_PCI BIT(4) ++ ++/* global debug state set by SOF_DBG_ flags */ ++extern int sof_core_debug; + + /* max BARs mmaped devices can use */ + #define SND_SOF_BARS 8 +@@ -434,6 +438,7 @@ struct snd_sof_dev { + int dma_trace_pages; + wait_queue_head_t trace_sleep; + u32 host_offset; ++ u32 dtrace_is_supported; /* set with Kconfig or module parameter */ + u32 dtrace_is_enabled; + u32 dtrace_error; + u32 dtrace_draining; +diff --git a/sound/soc/sof/trace.c b/sound/soc/sof/trace.c +index 4c3cff031fd6..b0e4556c8536 100644 +--- a/sound/soc/sof/trace.c ++++ b/sound/soc/sof/trace.c +@@ -162,6 +162,9 @@ int snd_sof_init_trace_ipc(struct snd_sof_dev *sdev) + struct sof_ipc_reply ipc_reply; + int ret; + ++ if (!sdev->dtrace_is_supported) ++ return 0; ++ + if (sdev->dtrace_is_enabled || !sdev->dma_trace_pages) + return -EINVAL; + +@@ -222,6 +225,9 @@ int snd_sof_init_trace(struct snd_sof_dev *sdev) + { + int ret; + ++ if (!sdev->dtrace_is_supported) ++ return 0; ++ + /* set false before start initialization */ + sdev->dtrace_is_enabled = false; + +@@ -277,6 +283,9 @@ EXPORT_SYMBOL(snd_sof_init_trace); + int snd_sof_trace_update_pos(struct snd_sof_dev *sdev, + struct sof_ipc_dma_trace_posn *posn) + { ++ if (!sdev->dtrace_is_supported) ++ return 0; ++ + if (sdev->dtrace_is_enabled && sdev->host_offset != posn->host_offset) { + sdev->host_offset = posn->host_offset; + wake_up(&sdev->trace_sleep); +@@ -293,6 +302,9 @@ int snd_sof_trace_update_pos(struct snd_sof_dev *sdev, + /* an error has occurred within the DSP that prevents further trace */ + void snd_sof_trace_notify_for_error(struct snd_sof_dev *sdev) + { ++ if (!sdev->dtrace_is_supported) ++ return; ++ + if (sdev->dtrace_is_enabled) { + dev_err(sdev->dev, "error: waking up any trace sleepers\n"); + sdev->dtrace_error = true; +@@ -305,7 +317,7 @@ void snd_sof_release_trace(struct snd_sof_dev *sdev) + { + int ret; + +- if (!sdev->dtrace_is_enabled) ++ if (!sdev->dtrace_is_supported || !sdev->dtrace_is_enabled) + return; + + ret = snd_sof_dma_trace_trigger(sdev, SNDRV_PCM_TRIGGER_STOP); +@@ -326,6 +338,9 @@ EXPORT_SYMBOL(snd_sof_release_trace); + + void snd_sof_free_trace(struct snd_sof_dev *sdev) + { ++ if (!sdev->dtrace_is_supported) ++ return; ++ + snd_sof_release_trace(sdev); + + snd_dma_free_pages(&sdev->dmatb); +-- +2.20.1 + + +From f1e8f5f928c09194078db704356af60ddaee6280 Mon Sep 17 00:00:00 2001 +From: Liam Girdwood +Date: Fri, 27 Sep 2019 15:05:29 -0500 +Subject: [PATCH 020/130] ASoC: SOF: ipc: retain DSP context after FW + exception. + +Add config option to prevent DSP entering D3 after any FW exception. +This can then be used to dump FW context for debug. + +Signed-off-by: Liam Girdwood +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20190927200538.660-5-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 9a06508bf7824ba34f2e1e9e08df505ac14a44c2) +Bugzilla: 1772498 +--- + sound/soc/sof/Kconfig | 8 ++++++++ + sound/soc/sof/debug.c | 16 ++++++++++++++++ + sound/soc/sof/ipc.c | 4 +--- + sound/soc/sof/sof-priv.h | 2 ++ + 4 files changed, 27 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig +index cc592bcadae7..56a3ab66b46b 100644 +--- a/sound/soc/sof/Kconfig ++++ b/sound/soc/sof/Kconfig +@@ -158,6 +158,14 @@ config SND_SOC_SOF_DEBUG_IPC_FLOOD_TEST + Say Y if you want to enable IPC flood test. + If unsure, select "N". + ++config SND_SOC_SOF_DEBUG_RETAIN_DSP_CONTEXT ++ bool "SOF retain DSP context on any FW exceptions" ++ help ++ This option keeps the DSP in D0 state so that firmware debug ++ information can be retained and dumped to userspace. ++ Say Y if you want to retain DSP context for FW exceptions. ++ If unsure, select "N". ++ + endif ## SND_SOC_SOF_DEBUG + + endif ## SND_SOC_SOF_OPTIONS +diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c +index 5529e8eeca46..d2b3b99d3a20 100644 +--- a/sound/soc/sof/debug.c ++++ b/sound/soc/sof/debug.c +@@ -463,3 +463,19 @@ void snd_sof_free_debug(struct snd_sof_dev *sdev) + debugfs_remove_recursive(sdev->debugfs_root); + } + EXPORT_SYMBOL_GPL(snd_sof_free_debug); ++ ++void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev) ++{ ++ if (IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_RETAIN_DSP_CONTEXT) || ++ (sof_core_debug & SOF_DBG_RETAIN_CTX)) { ++ /* should we prevent DSP entering D3 ? */ ++ dev_info(sdev->dev, "info: preventing DSP entering D3 state to preserve context\n"); ++ pm_runtime_get_noresume(sdev->dev); ++ } ++ ++ /* dump vital information to the logs */ ++ snd_sof_dsp_dbg_dump(sdev, SOF_DBG_REGS | SOF_DBG_MBOX); ++ snd_sof_ipc_dump(sdev); ++ snd_sof_trace_notify_for_error(sdev); ++} ++EXPORT_SYMBOL(snd_sof_handle_fw_exception); +diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c +index 086eeeab8679..3382a745ba5a 100644 +--- a/sound/soc/sof/ipc.c ++++ b/sound/soc/sof/ipc.c +@@ -210,9 +210,7 @@ static int tx_wait_done(struct snd_sof_ipc *ipc, struct snd_sof_ipc_msg *msg, + if (ret == 0) { + dev_err(sdev->dev, "error: ipc timed out for 0x%x size %d\n", + hdr->cmd, hdr->size); +- snd_sof_dsp_dbg_dump(ipc->sdev, SOF_DBG_REGS | SOF_DBG_MBOX); +- snd_sof_ipc_dump(ipc->sdev); +- snd_sof_trace_notify_for_error(ipc->sdev); ++ snd_sof_handle_fw_exception(ipc->sdev); + ret = -ETIMEDOUT; + } else { + /* copy the data returned from DSP */ +diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h +index d5b1a4f895da..348759035dd0 100644 +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -33,6 +33,7 @@ + #define SOF_DBG_MBOX BIT(2) + #define SOF_DBG_TEXT BIT(3) + #define SOF_DBG_PCI BIT(4) ++#define SOF_DBG_RETAIN_CTX BIT(5) /* prevent DSP D3 on FW exception */ + + /* global debug state set by SOF_DBG_ flags */ + extern int sof_core_debug; +@@ -580,6 +581,7 @@ void snd_sof_get_status(struct snd_sof_dev *sdev, u32 panic_code, + struct sof_ipc_panic_info *panic_info, + void *stack, size_t stack_words); + int snd_sof_init_trace_ipc(struct snd_sof_dev *sdev); ++void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev); + + /* + * Platform specific ops. +-- +2.20.1 + + +From 9de42cad7a0c02393de0999286b1c2cc2a3ea39f Mon Sep 17 00:00:00 2001 +From: Ranjani Sridharan +Date: Fri, 27 Sep 2019 15:05:32 -0500 +Subject: [PATCH 021/130] ASoC: SOF: core: check for mandatory fw_ready op + during SOF probe + +fw_ready should be a mandatory op. Make sure fw_ready ops is set +during probe. + +Signed-off-by: Ranjani Sridharan +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20190927200538.660-8-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 8692d498d675e2e1433274c5f03b855824f3f35d) +Bugzilla: 1772498 +--- + sound/soc/sof/core.c | 3 ++- + sound/soc/sof/ipc.c | 6 ------ + sound/soc/sof/sof-priv.h | 2 +- + 3 files changed, 3 insertions(+), 8 deletions(-) + +diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c +index 15167b8220ed..5998861a9002 100644 +--- a/sound/soc/sof/core.c ++++ b/sound/soc/sof/core.c +@@ -466,7 +466,8 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data) + if (!sof_ops(sdev) || !sof_ops(sdev)->probe || !sof_ops(sdev)->run || + !sof_ops(sdev)->block_read || !sof_ops(sdev)->block_write || + !sof_ops(sdev)->send_msg || !sof_ops(sdev)->load_firmware || +- !sof_ops(sdev)->ipc_msg_data || !sof_ops(sdev)->ipc_pcm_params) ++ !sof_ops(sdev)->ipc_msg_data || !sof_ops(sdev)->ipc_pcm_params || ++ !sof_ops(sdev)->fw_ready) + return -EINVAL; + + INIT_LIST_HEAD(&sdev->pcm_list); +diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c +index 3382a745ba5a..5994e1073364 100644 +--- a/sound/soc/sof/ipc.c ++++ b/sound/soc/sof/ipc.c +@@ -794,12 +794,6 @@ struct snd_sof_ipc *snd_sof_ipc_init(struct snd_sof_dev *sdev) + struct snd_sof_ipc *ipc; + struct snd_sof_ipc_msg *msg; + +- /* check if mandatory ops required for ipc are defined */ +- if (!sof_ops(sdev)->fw_ready) { +- dev_err(sdev->dev, "error: ipc mandatory ops not defined\n"); +- return NULL; +- } +- + ipc = devm_kzalloc(sdev->dev, sizeof(*ipc), GFP_KERNEL); + if (!ipc) + return NULL; +diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h +index 348759035dd0..44f789bf7fb0 100644 +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -133,7 +133,7 @@ struct snd_sof_dsp_ops { + * FW ready checks for ABI compatibility and creates + * memory windows at first boot + */ +- int (*fw_ready)(struct snd_sof_dev *sdev, u32 msg_id); /* optional */ ++ int (*fw_ready)(struct snd_sof_dev *sdev, u32 msg_id); /* mandatory */ + + /* connect pcm substream to a host stream */ + int (*pcm_open)(struct snd_sof_dev *sdev, +-- +2.20.1 + + +From 63398beda87ad3d6d43cc5fc90f173540b3fd1b3 Mon Sep 17 00:00:00 2001 +From: Marcin Rajwa +Date: Fri, 27 Sep 2019 15:05:33 -0500 +Subject: [PATCH 022/130] ASoC: SOF: ipc: introduce no_stream_position in + sof_ipc_stream_params struct + +The host period bytes value needs to be passed to firmware. +However current implementation uses this field for different +purpose - to indicate whether FW should send stream position +to the host. Therefore this patch introduces another field +"no_stream_position", a boolean value aimed to store information +about position tracking. This way host_period_bytes preserves its +original value. + +Signed-off-by: Marcin Rajwa +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20190927200538.660-9-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit e3ebfd0ab5b4880bfb6a9f32614c2e389cc3da56) +Bugzilla: 1772498 +--- + include/sound/sof/stream.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/sound/sof/stream.h b/include/sound/sof/stream.h +index 0b71b381b952..7facefb541b3 100644 +--- a/include/sound/sof/stream.h ++++ b/include/sound/sof/stream.h +@@ -83,10 +83,10 @@ struct sof_ipc_stream_params { + uint16_t sample_valid_bytes; + uint16_t sample_container_bytes; + +- /* for notifying host period has completed - 0 means no period IRQ */ + uint32_t host_period_bytes; ++ uint16_t no_stream_position; /**< 1 means don't send stream position */ + +- uint32_t reserved[2]; ++ uint16_t reserved[3]; + uint16_t chmap[SOF_IPC_MAX_CHANNELS]; /**< channel map - SOF_CHMAP_ */ + } __packed; + +-- +2.20.1 + + +From 0a637a33ef7f532235b1d972ee54cf8b603730e5 Mon Sep 17 00:00:00 2001 +From: Marcin Rajwa +Date: Fri, 27 Sep 2019 15:05:34 -0500 +Subject: [PATCH 023/130] ASoC: SOF: Intel: hda: fix reset of host_period_bytes + +This patch prevents the reset of host period bytes +and uses no_stream_position to record requests +for stream position. + +Signed-off-by: Marcin Rajwa +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20190927200538.660-10-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit f567ff6c76f7e9b317248fcab7a0eb3ef432dc9e) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda-pcm.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/sof/intel/hda-pcm.c b/sound/soc/sof/intel/hda-pcm.c +index 9b730f183529..575f5f5877d8 100644 +--- a/sound/soc/sof/intel/hda-pcm.c ++++ b/sound/soc/sof/intel/hda-pcm.c +@@ -89,6 +89,7 @@ int hda_dsp_pcm_hw_params(struct snd_sof_dev *sdev, + struct hdac_ext_stream *stream = stream_to_hdac_ext_stream(hstream); + struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; + struct snd_dma_buffer *dmab; ++ struct sof_ipc_fw_version *v = &sdev->fw_ready.version; + int ret; + u32 size, rate, bits; + +@@ -116,9 +117,17 @@ int hda_dsp_pcm_hw_params(struct snd_sof_dev *sdev, + /* disable SPIB, to enable buffer wrap for stream */ + hda_dsp_stream_spib_config(sdev, stream, HDA_DSP_SPIB_DISABLE, 0); + +- /* set host_period_bytes to 0 if no IPC position */ +- if (hda && hda->no_ipc_position) +- ipc_params->host_period_bytes = 0; ++ /* update no_stream_position flag for ipc params */ ++ if (hda && hda->no_ipc_position) { ++ /* For older ABIs set host_period_bytes to zero to inform ++ * FW we don't want position updates. Newer versions use ++ * no_stream_position for this purpose. ++ */ ++ if (v->abi_version < SOF_ABI_VER(3, 10, 0)) ++ ipc_params->host_period_bytes = 0; ++ else ++ ipc_params->no_stream_position = 1; ++ } + + ipc_params->stream_tag = hstream->stream_tag; + +-- +2.20.1 + + +From 7f89237bf642c6a090557db68be76c6d67658904 Mon Sep 17 00:00:00 2001 +From: Liam Girdwood +Date: Fri, 27 Sep 2019 15:05:37 -0500 +Subject: [PATCH 024/130] ASoC: SOF: Intel: Add context data to any IPC + timeout. + +Helps with FW debug as it provides DSP IPC processing context. + +Signed-off-by: Liam Girdwood +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20190927200538.660-13-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 3a9e204d4e36904a464a2e53206b053a7ffc7bad) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/bdw.c | 22 +++++++++++++++++++++- + sound/soc/sof/intel/byt.c | 23 ++++++++++++++++++++++- + 2 files changed, 43 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/sof/intel/bdw.c b/sound/soc/sof/intel/bdw.c +index 80e2826fb447..f395d0638876 100644 +--- a/sound/soc/sof/intel/bdw.c ++++ b/sound/soc/sof/intel/bdw.c +@@ -247,7 +247,7 @@ static void bdw_dump(struct snd_sof_dev *sdev, u32 flags) + struct sof_ipc_dsp_oops_xtensa xoops; + struct sof_ipc_panic_info panic_info; + u32 stack[BDW_STACK_DUMP_SIZE]; +- u32 status, panic; ++ u32 status, panic, imrx, imrd; + + /* now try generic SOF status messages */ + status = snd_sof_dsp_read(sdev, BDW_DSP_BAR, SHIM_IPCD); +@@ -256,6 +256,26 @@ static void bdw_dump(struct snd_sof_dev *sdev, u32 flags) + BDW_STACK_DUMP_SIZE); + snd_sof_get_status(sdev, status, panic, &xoops, &panic_info, stack, + BDW_STACK_DUMP_SIZE); ++ ++ /* provide some context for firmware debug */ ++ imrx = snd_sof_dsp_read(sdev, BDW_DSP_BAR, SHIM_IMRX); ++ imrd = snd_sof_dsp_read(sdev, BDW_DSP_BAR, SHIM_IMRD); ++ dev_err(sdev->dev, ++ "error: ipc host -> DSP: pending %s complete %s raw 0x%8.8x\n", ++ panic & SHIM_IPCX_BUSY ? "yes" : "no", ++ panic & SHIM_IPCX_DONE ? "yes" : "no", panic); ++ dev_err(sdev->dev, ++ "error: mask host: pending %s complete %s raw 0x%8.8x\n", ++ imrx & SHIM_IMRX_BUSY ? "yes" : "no", ++ imrx & SHIM_IMRX_DONE ? "yes" : "no", imrx); ++ dev_err(sdev->dev, ++ "error: ipc DSP -> host: pending %s complete %s raw 0x%8.8x\n", ++ status & SHIM_IPCD_BUSY ? "yes" : "no", ++ status & SHIM_IPCD_DONE ? "yes" : "no", status); ++ dev_err(sdev->dev, ++ "error: mask DSP: pending %s complete %s raw 0x%8.8x\n", ++ imrd & SHIM_IMRD_BUSY ? "yes" : "no", ++ imrd & SHIM_IMRD_DONE ? "yes" : "no", imrd); + } + + /* +diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c +index a1e514f71739..b2597ecfdc1c 100644 +--- a/sound/soc/sof/intel/byt.c ++++ b/sound/soc/sof/intel/byt.c +@@ -145,7 +145,7 @@ static void byt_dump(struct snd_sof_dev *sdev, u32 flags) + struct sof_ipc_dsp_oops_xtensa xoops; + struct sof_ipc_panic_info panic_info; + u32 stack[BYT_STACK_DUMP_SIZE]; +- u32 status, panic; ++ u32 status, panic, imrd, imrx; + + /* now try generic SOF status messages */ + status = snd_sof_dsp_read(sdev, BYT_DSP_BAR, SHIM_IPCD); +@@ -154,6 +154,27 @@ static void byt_dump(struct snd_sof_dev *sdev, u32 flags) + BYT_STACK_DUMP_SIZE); + snd_sof_get_status(sdev, status, panic, &xoops, &panic_info, stack, + BYT_STACK_DUMP_SIZE); ++ ++ /* provide some context for firmware debug */ ++ imrx = snd_sof_dsp_read(sdev, BYT_DSP_BAR, SHIM_IMRX); ++ imrd = snd_sof_dsp_read(sdev, BYT_DSP_BAR, SHIM_IMRD); ++ dev_err(sdev->dev, ++ "error: ipc host -> DSP: pending %s complete %s raw 0x%8.8x\n", ++ panic & SHIM_IPCX_BUSY ? "yes" : "no", ++ panic & SHIM_IPCX_DONE ? "yes" : "no", panic); ++ dev_err(sdev->dev, ++ "error: mask host: pending %s complete %s raw 0x%8.8x\n", ++ imrx & SHIM_IMRX_BUSY ? "yes" : "no", ++ imrx & SHIM_IMRX_DONE ? "yes" : "no", imrx); ++ dev_err(sdev->dev, ++ "error: ipc DSP -> host: pending %s complete %s raw 0x%8.8x\n", ++ status & SHIM_IPCD_BUSY ? "yes" : "no", ++ status & SHIM_IPCD_DONE ? "yes" : "no", status); ++ dev_err(sdev->dev, ++ "error: mask DSP: pending %s complete %s raw 0x%8.8x\n", ++ imrd & SHIM_IMRD_BUSY ? "yes" : "no", ++ imrd & SHIM_IMRD_DONE ? "yes" : "no", imrd); ++ + } + + /* +-- +2.20.1 + + +From 5c2784a52e77957f4c7a677296369d1ef09413db Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Tue, 8 Oct 2019 11:44:35 -0500 +Subject: [PATCH 025/130] ASoC: SOF: enable sync_write in hdac_bus + +Align SOF HDA implementation with snd-hda-intel driver and enable +sync_write flag for all supported Intel platforms in SOF. When set, +a sync is issued after each verb write. + +Sync after write has helped to overcome intermittent delays in +system resume flow on Intel Coffee Lake systems, and most recently +probe errors related to the HDMI codec on Ice Lake systems. + +Matches the snd-hda-intel driver change done in commit 2756d9143aa5 +("ALSA: hda - Fix intermittent CORB/RIRB stall on Intel chips"). + +Signed-off-by: Kai Vehmanen +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191008164443.1358-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit f3416e7144f5d4ba0fc5dcef6ebfff891266c46a) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c +index 06e84679087b..5a5163eef2ef 100644 +--- a/sound/soc/sof/intel/hda.c ++++ b/sound/soc/sof/intel/hda.c +@@ -268,6 +268,7 @@ static int hda_init(struct snd_sof_dev *sdev) + + bus->use_posbuf = 1; + bus->bdl_pos_adj = 0; ++ bus->sync_write = 1; + + mutex_init(&hbus->prepare_mutex); + hbus->pci = pci; +-- +2.20.1 + + +From e1cc39fb37b304910435e08907d9bd3f29636b89 Mon Sep 17 00:00:00 2001 +From: Jaska Uimonen +Date: Tue, 8 Oct 2019 11:44:41 -0500 +Subject: [PATCH 026/130] ASoC: SOF: enable dual control for pga + +Currently sof pga element supports only 1 kcontrol and you can't create +for example a mixer element with combined volume slider and mute switch. +So enable sof pga to have more than 1 kcontrol associated with it. Also +check for possible NULL tlv pointer as switch element might not have it. + +Signed-off-by: Jaska Uimonen +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191008164443.1358-8-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit a68c6b6cc77b841dc37c17a5d9a7074e26801af5) +Bugzilla: 1772498 +--- + sound/soc/sof/topology.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c +index 4452594c2e17..32a70ffc149d 100644 +--- a/sound/soc/sof/topology.c ++++ b/sound/soc/sof/topology.c +@@ -1581,7 +1581,7 @@ static int sof_widget_load_pga(struct snd_soc_component *scomp, int index, + if (!volume) + return -ENOMEM; + +- if (le32_to_cpu(tw->num_kcontrols) != 1) { ++ if (!le32_to_cpu(tw->num_kcontrols)) { + dev_err(sdev->dev, "error: invalid kcontrol count %d for volume\n", + tw->num_kcontrols); + ret = -EINVAL; +@@ -1618,7 +1618,8 @@ static int sof_widget_load_pga(struct snd_soc_component *scomp, int index, + swidget->private = volume; + + list_for_each_entry(scontrol, &sdev->kcontrol_list, list) { +- if (scontrol->comp_id == swidget->comp_id) { ++ if (scontrol->comp_id == swidget->comp_id && ++ scontrol->volume_table) { + min_step = scontrol->min_volume_step; + max_step = scontrol->max_volume_step; + volume->min_value = scontrol->volume_table[min_step]; +-- +2.20.1 + + +From 7e68f35584ab3b3242a91431037bc7ed5df568dd Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Tue, 8 Oct 2019 11:44:36 -0500 +Subject: [PATCH 027/130] Revert "ASoC: SOF: Force polling mode on CFL and CNL" + +This reverts commit 64ca9d9fcb3e3c86b1417e3d17a90b43dd660f81. + +The workaround is no longer needed after configuring HDAC +bus with sync_write=1. + +Signed-off-by: Kai Vehmanen +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191008164443.1358-3-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 902fd492d5ea2c02666ddadc1da977ca94e6b52c) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda.c | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c +index 5a5163eef2ef..103f4273c4d3 100644 +--- a/sound/soc/sof/intel/hda.c ++++ b/sound/soc/sof/intel/hda.c +@@ -32,9 +32,6 @@ + /* platform specific devices */ + #include "shim.h" + +-#define IS_CFL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa348) +-#define IS_CNL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9dc8) +- + #define EXCEPT_MAX_HDR_SIZE 0x400 + + /* +@@ -262,10 +259,6 @@ static int hda_init(struct snd_sof_dev *sdev) + /* HDA bus init */ + sof_hda_bus_init(bus, &pci->dev); + +- /* Workaround for a communication error on CFL (bko#199007) and CNL */ +- if (IS_CFL(pci) || IS_CNL(pci)) +- bus->polling_mode = 1; +- + bus->use_posbuf = 1; + bus->bdl_pos_adj = 0; + bus->sync_write = 1; +-- +2.20.1 + + +From beea344394167f3c1f55422f06646a4faa72e697 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Tue, 8 Oct 2019 11:44:37 -0500 +Subject: [PATCH 028/130] ASoC: SOF: acpi: add debug module param + +Add debug parameter for snd-sof-acpi. + +One of the usages for this debug parameter to disable pm_runtime, +which can be useful for platform bringup, or keep the parent device +active while enabling pm_runtime for child devices (e.g. with +SoundWire or MFD). This can also be useful to measure suspend-resume +latencies or child devices. + +Signed-off-by: Kai Vehmanen +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191008164443.1358-4-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 70b0c75ae1e3d35f829b5fe7ae5692efae63ca71) +Bugzilla: 1772498 +--- + sound/soc/sof/sof-acpi-dev.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/sof/sof-acpi-dev.c b/sound/soc/sof/sof-acpi-dev.c +index ea7b8b895412..df318f50dd0b 100644 +--- a/sound/soc/sof/sof-acpi-dev.c ++++ b/sound/soc/sof/sof-acpi-dev.c +@@ -29,6 +29,12 @@ static char *tplg_path; + module_param(tplg_path, charp, 0444); + MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology."); + ++static int sof_acpi_debug; ++module_param_named(sof_acpi_debug, sof_acpi_debug, int, 0444); ++MODULE_PARM_DESC(sof_acpi_debug, "SOF ACPI debug options (0x0 all off)"); ++ ++#define SOF_ACPI_DISABLE_PM_RUNTIME BIT(0) ++ + #if IS_ENABLED(CONFIG_SND_SOC_SOF_HASWELL) + static const struct sof_dev_desc sof_acpi_haswell_desc = { + .machines = snd_soc_acpi_intel_haswell_machines, +@@ -121,6 +127,9 @@ static const struct dev_pm_ops sof_acpi_pm = { + + static void sof_acpi_probe_complete(struct device *dev) + { ++ if (sof_acpi_debug & SOF_ACPI_DISABLE_PM_RUNTIME) ++ return; ++ + /* allow runtime_pm */ + pm_runtime_set_autosuspend_delay(dev, SND_SOF_SUSPEND_DELAY_MS); + pm_runtime_use_autosuspend(dev); +@@ -221,7 +230,8 @@ static int sof_acpi_probe(struct platform_device *pdev) + + static int sof_acpi_remove(struct platform_device *pdev) + { +- pm_runtime_disable(&pdev->dev); ++ if (!(sof_acpi_debug & SOF_ACPI_DISABLE_PM_RUNTIME)) ++ pm_runtime_disable(&pdev->dev); + + /* call sof helper for DSP hardware remove */ + snd_sof_device_remove(&pdev->dev); +-- +2.20.1 + + +From 34cbc5daae759efa7dd448def5beacd283386cc7 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Tue, 8 Oct 2019 11:44:38 -0500 +Subject: [PATCH 029/130] ASoC: SOF: pci: add debug module param + +Add debug parameter for snd-sof-pci. + +One of the usages for this debug parameter to disable pm_runtime, +which can be useful for platform bringup, or keep the parent device +active while enabling pm_runtime for child devices (e.g. with +SoundWire or MFD). This can also be useful to measure suspend-resume +latencies or child devices. + +Signed-off-by: Kai Vehmanen +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191008164443.1358-5-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 8b160dc2a92c83a566b0596c79febb5933f9a6b5) +Bugzilla: 1772498 +--- + sound/soc/sof/sof-pci-dev.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c +index 3a9e0e2a150d..be5a8da504c5 100644 +--- a/sound/soc/sof/sof-pci-dev.c ++++ b/sound/soc/sof/sof-pci-dev.c +@@ -30,6 +30,12 @@ static char *tplg_path; + module_param(tplg_path, charp, 0444); + MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology."); + ++static int sof_pci_debug; ++module_param_named(sof_pci_debug, sof_pci_debug, int, 0444); ++MODULE_PARM_DESC(sof_pci_debug, "SOF PCI debug options (0x0 all off)"); ++ ++#define SOF_PCI_DISABLE_PM_RUNTIME BIT(0) ++ + #if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE) + static const struct sof_dev_desc bxt_desc = { + .machines = snd_soc_acpi_intel_bxt_machines, +@@ -250,6 +256,9 @@ static void sof_pci_probe_complete(struct device *dev) + { + dev_dbg(dev, "Completing SOF PCI probe"); + ++ if (sof_pci_debug & SOF_PCI_DISABLE_PM_RUNTIME) ++ return; ++ + /* allow runtime_pm */ + pm_runtime_set_autosuspend_delay(dev, SND_SOF_SUSPEND_DELAY_MS); + pm_runtime_use_autosuspend(dev); +@@ -376,7 +385,8 @@ static void sof_pci_remove(struct pci_dev *pci) + snd_sof_device_remove(&pci->dev); + + /* follow recommendation in pci-driver.c to increment usage counter */ +- pm_runtime_get_noresume(&pci->dev); ++ if (!(sof_pci_debug & SOF_PCI_DISABLE_PM_RUNTIME)) ++ pm_runtime_get_noresume(&pci->dev); + + /* release pci regions and disable device */ + pci_release_regions(pci); +-- +2.20.1 + + +From 39844b2b23b8746263988926996db159a3ebbea7 Mon Sep 17 00:00:00 2001 +From: Jaska Uimonen +Date: Tue, 8 Oct 2019 11:44:43 -0500 +Subject: [PATCH 030/130] ASoC: SOF: acpi led support for switch controls + +Currently sof doesn't support acpi leds with mute switches. So implement +acpi leds following quite shamelessly existing HDA implementation by +Takashi Iwai. + +Mute leds can be enabled in topology by adding led and direction token +in switch control private data. + +Signed-off-by: Jaska Uimonen +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191008164443.1358-10-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 5d43001ae43606dc525f55c482c545afba01bb55) +Bugzilla: 1772498 +--- + include/uapi/sound/sof/tokens.h | 4 ++++ + sound/soc/sof/control.c | 32 ++++++++++++++++++++++++++++++++ + sound/soc/sof/sof-priv.h | 9 +++++++++ + sound/soc/sof/topology.c | 13 +++++++++++++ + 4 files changed, 58 insertions(+) + +diff --git a/include/uapi/sound/sof/tokens.h b/include/uapi/sound/sof/tokens.h +index 8f996857fb24..28ef01a67765 100644 +--- a/include/uapi/sound/sof/tokens.h ++++ b/include/uapi/sound/sof/tokens.h +@@ -114,4 +114,8 @@ + #define SOF_TKN_IMX_ESAI_FIRST_TOKEN 1100 + /* TODO: Add ESAI tokens */ + ++/* Led control for mute switches */ ++#define SOF_TKN_MUTE_LED_USE 1300 ++#define SOF_TKN_MUTE_LED_DIRECTION 1301 ++ + #endif +diff --git a/sound/soc/sof/control.c b/sound/soc/sof/control.c +index 2b8711eda362..b73d4587c5da 100644 +--- a/sound/soc/sof/control.c ++++ b/sound/soc/sof/control.c +@@ -11,8 +11,37 @@ + /* Mixer Controls */ + + #include ++#include + #include "sof-priv.h" + ++static void update_mute_led(struct snd_sof_control *scontrol, ++ struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ unsigned int temp = 0; ++ unsigned int mask; ++ int i; ++ ++ mask = 1U << snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); ++ ++ for (i = 0; i < scontrol->num_channels; i++) { ++ if (ucontrol->value.integer.value[i]) { ++ temp |= mask; ++ break; ++ } ++ } ++ ++ if (temp == scontrol->led_ctl.led_value) ++ return; ++ ++ scontrol->led_ctl.led_value = temp; ++ ++ if (!scontrol->led_ctl.direction) ++ ledtrig_audio_set(LED_AUDIO_MUTE, temp ? LED_OFF : LED_ON); ++ else ++ ledtrig_audio_set(LED_AUDIO_MICMUTE, temp ? LED_OFF : LED_ON); ++} ++ + static inline u32 mixer_to_ipc(unsigned int value, u32 *volume_map, int size) + { + if (value >= size) +@@ -118,6 +147,9 @@ int snd_sof_switch_put(struct snd_kcontrol *kcontrol, + cdata->chanv[i].value = value; + } + ++ if (scontrol->led_ctl.use_led) ++ update_mute_led(scontrol, kcontrol, ucontrol); ++ + /* notify DSP of mixer updates */ + if (pm_runtime_active(sdev->dev)) + snd_sof_ipc_set_get_comp_data(sdev->ipc, scontrol, +diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h +index 44f789bf7fb0..5a11a8517fa5 100644 +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -15,6 +15,7 @@ + + #include + #include ++#include + + #include + #include /* needs to be included before control.h */ +@@ -310,6 +311,12 @@ struct snd_sof_pcm { + bool prepared[2]; /* PCM_PARAMS set successfully */ + }; + ++struct snd_sof_led_control { ++ unsigned int use_led; ++ unsigned int direction; ++ unsigned int led_value; ++}; ++ + /* ALSA SOF Kcontrol device */ + struct snd_sof_control { + struct snd_sof_dev *sdev; +@@ -324,6 +331,8 @@ struct snd_sof_control { + u32 *volume_table; /* volume table computed from tlv data*/ + + struct list_head list; /* list in sdev control list */ ++ ++ struct snd_sof_led_control led_ctl; + }; + + /* ASoC SOF DAPM widget */ +diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c +index 32a70ffc149d..e150f53d2124 100644 +--- a/sound/soc/sof/topology.c ++++ b/sound/soc/sof/topology.c +@@ -494,6 +494,11 @@ static int sof_control_load_volume(struct snd_soc_component *scomp, + } + + out: ++ /* set up possible led control from mixer private data */ ++ ret = sof_parse_tokens(scomp, &scontrol->led_ctl, led_tokens, ++ ARRAY_SIZE(led_tokens), mc->priv.array, ++ le32_to_cpu(mc->priv.size)); ++ + dev_dbg(sdev->dev, "tplg: load kcontrol index %d chans %d\n", + scontrol->comp_id, scontrol->num_channels); + +@@ -840,6 +845,14 @@ static const struct sof_topology_token dmic_pdm_tokens[] = { + static const struct sof_topology_token hda_tokens[] = { + }; + ++/* Leds */ ++static const struct sof_topology_token led_tokens[] = { ++ {SOF_TKN_MUTE_LED_USE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, ++ offsetof(struct snd_sof_led_control, use_led), 0}, ++ {SOF_TKN_MUTE_LED_DIRECTION, SND_SOC_TPLG_TUPLE_TYPE_WORD, ++ get_token_u32, offsetof(struct snd_sof_led_control, direction), 0}, ++}; ++ + static void sof_parse_uuid_tokens(struct snd_soc_component *scomp, + void *object, + const struct sof_topology_token *tokens, +-- +2.20.1 + + +From 151d91920fd3e9626541fe9b3d2f6af16f765f8c Mon Sep 17 00:00:00 2001 +From: Daniel Baluta +Date: Tue, 8 Oct 2019 11:44:39 -0500 +Subject: [PATCH 031/130] ASoC: SOF: imx: Describe ESAI parameters to be sent + to DSP + +Introduce sof_ipc_dai_esai_params to keep information that +we get from topology and we send to DSP FW. + +Also bump the ABI minor to reflect the changes on DSP FW. + +Signed-off-by: Daniel Baluta +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191008164443.1358-6-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit b4be427683cf6debda331a5d6a4af34885851d19) +Bugzilla: 1772498 +--- + include/sound/sof/dai-imx.h | 34 +++++++++++++++++++++++++++++++++ + include/sound/sof/dai.h | 2 ++ + include/uapi/sound/sof/abi.h | 2 +- + include/uapi/sound/sof/tokens.h | 3 +-- + 4 files changed, 38 insertions(+), 3 deletions(-) + create mode 100644 include/sound/sof/dai-imx.h + +diff --git a/include/sound/sof/dai-imx.h b/include/sound/sof/dai-imx.h +new file mode 100644 +index 000000000000..e02fb0b0fae1 +--- /dev/null ++++ b/include/sound/sof/dai-imx.h +@@ -0,0 +1,34 @@ ++/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ ++/* ++ * Copyright 2019 NXP ++ * ++ * Author: Daniel Baluta ++ */ ++ ++#ifndef __INCLUDE_SOUND_SOF_DAI_IMX_H__ ++#define __INCLUDE_SOUND_SOF_DAI_IMX_H__ ++ ++#include ++ ++/* ESAI Configuration Request - SOF_IPC_DAI_ESAI_CONFIG */ ++struct sof_ipc_dai_esai_params { ++ struct sof_ipc_hdr hdr; ++ ++ /* MCLK */ ++ uint16_t reserved1; ++ uint16_t mclk_id; ++ uint32_t mclk_direction; ++ ++ uint32_t mclk_rate; /* MCLK frequency in Hz */ ++ uint32_t fsync_rate; /* FSYNC frequency in Hz */ ++ uint32_t bclk_rate; /* BCLK frequency in Hz */ ++ ++ /* TDM */ ++ uint32_t tdm_slots; ++ uint32_t rx_slots; ++ uint32_t tx_slots; ++ uint16_t tdm_slot_width; ++ uint16_t reserved2; /* alignment */ ++} __packed; ++ ++#endif +diff --git a/include/sound/sof/dai.h b/include/sound/sof/dai.h +index 0f1235022146..c229565767e5 100644 +--- a/include/sound/sof/dai.h ++++ b/include/sound/sof/dai.h +@@ -11,6 +11,7 @@ + + #include + #include ++#include + + /* + * DAI Configuration. +@@ -73,6 +74,7 @@ struct sof_ipc_dai_config { + struct sof_ipc_dai_dmic_params dmic; + struct sof_ipc_dai_hda_params hda; + struct sof_ipc_dai_alh_params alh; ++ struct sof_ipc_dai_esai_params esai; + }; + } __packed; + +diff --git a/include/uapi/sound/sof/abi.h b/include/uapi/sound/sof/abi.h +index a0fe0d4c4b66..ebfdc20ca081 100644 +--- a/include/uapi/sound/sof/abi.h ++++ b/include/uapi/sound/sof/abi.h +@@ -26,7 +26,7 @@ + + /* SOF ABI version major, minor and patch numbers */ + #define SOF_ABI_MAJOR 3 +-#define SOF_ABI_MINOR 10 ++#define SOF_ABI_MINOR 11 + #define SOF_ABI_PATCH 0 + + /* SOF ABI version number. Format within 32bit word is MMmmmppp */ +diff --git a/include/uapi/sound/sof/tokens.h b/include/uapi/sound/sof/tokens.h +index 28ef01a67765..d65406f34361 100644 +--- a/include/uapi/sound/sof/tokens.h ++++ b/include/uapi/sound/sof/tokens.h +@@ -111,8 +111,7 @@ + /* TODO: Add SAI tokens */ + + /* ESAI */ +-#define SOF_TKN_IMX_ESAI_FIRST_TOKEN 1100 +-/* TODO: Add ESAI tokens */ ++#define SOF_TKN_IMX_ESAI_MCLK_ID 1100 + + /* Led control for mute switches */ + #define SOF_TKN_MUTE_LED_USE 1300 +-- +2.20.1 + + +From 631932d09b78a4b8bbc939342d52631749b3e790 Mon Sep 17 00:00:00 2001 +From: Daniel Baluta +Date: Tue, 8 Oct 2019 11:44:40 -0500 +Subject: [PATCH 032/130] ASoC: SOF: imx: Read ESAI parameters and send them to + DSP + +ESAI parameters are read for topology file, packed into +sof_ipc_dai_esai_parms struct and then sent to DSP. + +Signed-off-by: Daniel Baluta +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191008164443.1358-7-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit a4eff5f86c9c5e7d07d880bd86ce8faad19d7063) +Bugzilla: 1772498 +--- + sound/soc/sof/pcm.c | 8 +++++ + sound/soc/sof/topology.c | 69 ++++++++++++++++++++++++++++++++++++++-- + 2 files changed, 75 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c +index 2b876d497447..b0f4217433e5 100644 +--- a/sound/soc/sof/pcm.c ++++ b/sound/soc/sof/pcm.c +@@ -691,6 +691,14 @@ static int sof_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, + case SOF_DAI_INTEL_ALH: + /* do nothing for ALH dai_link */ + break; ++ case SOF_DAI_IMX_ESAI: ++ channels->min = dai->dai_config->esai.tdm_slots; ++ channels->max = dai->dai_config->esai.tdm_slots; ++ ++ dev_dbg(sdev->dev, ++ "channels_min: %d channels_max: %d\n", ++ channels->min, channels->max); ++ break; + default: + dev_err(sdev->dev, "error: invalid DAI type %d\n", + dai->dai_config->type); +diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c +index e150f53d2124..0adad3246652 100644 +--- a/sound/soc/sof/topology.c ++++ b/sound/soc/sof/topology.c +@@ -804,6 +804,13 @@ static const struct sof_topology_token dmic_tokens[] = { + + }; + ++/* ESAI */ ++static const struct sof_topology_token esai_tokens[] = { ++ {SOF_TKN_IMX_ESAI_MCLK_ID, ++ SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16, ++ offsetof(struct sof_ipc_dai_esai_params, mclk_id), 0}, ++}; ++ + /* + * DMIC PDM Tokens + * SOF_TKN_INTEL_DMIC_PDM_CTRL_ID should be the first token +@@ -2550,8 +2557,66 @@ static int sof_link_esai_load(struct snd_soc_component *scomp, int index, + struct snd_soc_tplg_hw_config *hw_config, + struct sof_ipc_dai_config *config) + { +- /*TODO: Add implementation */ +- return 0; ++ struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); ++ struct snd_soc_tplg_private *private = &cfg->priv; ++ struct sof_ipc_reply reply; ++ u32 size = sizeof(*config); ++ int ret; ++ ++ /* handle master/slave and inverted clocks */ ++ sof_dai_set_format(hw_config, config); ++ ++ /* init IPC */ ++ memset(&config->esai, 0, sizeof(struct sof_ipc_dai_esai_params)); ++ config->hdr.size = size; ++ ++ ret = sof_parse_tokens(scomp, &config->esai, esai_tokens, ++ ARRAY_SIZE(esai_tokens), private->array, ++ le32_to_cpu(private->size)); ++ if (ret != 0) { ++ dev_err(sdev->dev, "error: parse esai tokens failed %d\n", ++ le32_to_cpu(private->size)); ++ return ret; ++ } ++ ++ config->esai.mclk_rate = le32_to_cpu(hw_config->mclk_rate); ++ config->esai.bclk_rate = le32_to_cpu(hw_config->bclk_rate); ++ config->esai.fsync_rate = le32_to_cpu(hw_config->fsync_rate); ++ config->esai.mclk_direction = hw_config->mclk_direction; ++ config->esai.tdm_slots = le32_to_cpu(hw_config->tdm_slots); ++ config->esai.tdm_slot_width = le32_to_cpu(hw_config->tdm_slot_width); ++ config->esai.rx_slots = le32_to_cpu(hw_config->rx_slots); ++ config->esai.tx_slots = le32_to_cpu(hw_config->tx_slots); ++ ++ dev_info(sdev->dev, ++ "tplg: config ESAI%d fmt 0x%x mclk %d width %d slots %d mclk id %d\n", ++ config->dai_index, config->format, ++ config->esai.mclk_rate, config->esai.tdm_slot_width, ++ config->esai.tdm_slots, config->esai.mclk_id); ++ ++ if (config->esai.tdm_slots < 1 || config->esai.tdm_slots > 8) { ++ dev_err(sdev->dev, "error: invalid channel count for ESAI%d\n", ++ config->dai_index); ++ return -EINVAL; ++ } ++ ++ /* send message to DSP */ ++ ret = sof_ipc_tx_message(sdev->ipc, ++ config->hdr.cmd, config, size, &reply, ++ sizeof(reply)); ++ if (ret < 0) { ++ dev_err(sdev->dev, "error: failed to set DAI config for ESAI%d\n", ++ config->dai_index); ++ return ret; ++ } ++ ++ /* set config for all DAI's with name matching the link name */ ++ ret = sof_set_dai_config(sdev, size, link, config); ++ if (ret < 0) ++ dev_err(sdev->dev, "error: failed to save DAI config for ESAI%d\n", ++ config->dai_index); ++ ++ return ret; + } + + static int sof_link_dmic_load(struct snd_soc_component *scomp, int index, +-- +2.20.1 + + +From 78da07e36b7ae563f64def77a72dc02cf010cd8f Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 11 Oct 2019 11:43:09 -0500 +Subject: [PATCH 033/130] ASoC: SOF: Intel: byt: fix operator precedence + warnings + +Address cppcheck warnings + +sound/soc/sof/intel/byt.c:163:26: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + panic & SHIM_IPCX_BUSY ? "yes" : "no", + ^ + +sound/soc/sof/intel/byt.c:164:26: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + panic & SHIM_IPCX_DONE ? "yes" : "no", panic); + ^ + +sound/soc/sof/intel/byt.c:167:25: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + imrx & SHIM_IMRX_BUSY ? "yes" : "no", + ^ + +sound/soc/sof/intel/byt.c:168:25: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + imrx & SHIM_IMRX_DONE ? "yes" : "no", imrx); + ^ + +sound/soc/sof/intel/byt.c:171:27: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + status & SHIM_IPCD_BUSY ? "yes" : "no", + ^ + +sound/soc/sof/intel/byt.c:172:27: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + status & SHIM_IPCD_DONE ? "yes" : "no", status); + ^ + +sound/soc/sof/intel/byt.c:175:25: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + imrd & SHIM_IMRD_BUSY ? "yes" : "no", + ^ + +sound/soc/sof/intel/byt.c:176:25: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + imrd & SHIM_IMRD_DONE ? "yes" : "no", imrd); + ^ + +Fixes: 3a9e204d4e369 ("ASoC: SOF: Intel: Add context data to any IPC timeout.") +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191011164312.7988-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit f9f618e7128e834db3f54d290a926c4a71104e02) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/byt.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c +index b2597ecfdc1c..07e5efe4945c 100644 +--- a/sound/soc/sof/intel/byt.c ++++ b/sound/soc/sof/intel/byt.c +@@ -160,20 +160,20 @@ static void byt_dump(struct snd_sof_dev *sdev, u32 flags) + imrd = snd_sof_dsp_read(sdev, BYT_DSP_BAR, SHIM_IMRD); + dev_err(sdev->dev, + "error: ipc host -> DSP: pending %s complete %s raw 0x%8.8x\n", +- panic & SHIM_IPCX_BUSY ? "yes" : "no", +- panic & SHIM_IPCX_DONE ? "yes" : "no", panic); ++ (panic & SHIM_IPCX_BUSY) ? "yes" : "no", ++ (panic & SHIM_IPCX_DONE) ? "yes" : "no", panic); + dev_err(sdev->dev, + "error: mask host: pending %s complete %s raw 0x%8.8x\n", +- imrx & SHIM_IMRX_BUSY ? "yes" : "no", +- imrx & SHIM_IMRX_DONE ? "yes" : "no", imrx); ++ (imrx & SHIM_IMRX_BUSY) ? "yes" : "no", ++ (imrx & SHIM_IMRX_DONE) ? "yes" : "no", imrx); + dev_err(sdev->dev, + "error: ipc DSP -> host: pending %s complete %s raw 0x%8.8x\n", +- status & SHIM_IPCD_BUSY ? "yes" : "no", +- status & SHIM_IPCD_DONE ? "yes" : "no", status); ++ (status & SHIM_IPCD_BUSY) ? "yes" : "no", ++ (status & SHIM_IPCD_DONE) ? "yes" : "no", status); + dev_err(sdev->dev, + "error: mask DSP: pending %s complete %s raw 0x%8.8x\n", +- imrd & SHIM_IMRD_BUSY ? "yes" : "no", +- imrd & SHIM_IMRD_DONE ? "yes" : "no", imrd); ++ (imrd & SHIM_IMRD_BUSY) ? "yes" : "no", ++ (imrd & SHIM_IMRD_DONE) ? "yes" : "no", imrd); + + } + +-- +2.20.1 + + +From c1b2c6fecd44be2baa21f763e26a2a98d06708e6 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 11 Oct 2019 11:43:10 -0500 +Subject: [PATCH 034/130] ASoC: SOF: Intel: bdw: fix operator precedence + warnings + +Address cppcheck warnings + +sound/soc/sof/intel/bdw.c:265:26: style: Clarify calculation precedence +for '&' and '?'. [clarifyCalculation] + panic & SHIM_IPCX_BUSY ? "yes" : "no", + ^ + +sound/soc/sof/intel/bdw.c:266:26: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + panic & SHIM_IPCX_DONE ? "yes" : "no", panic); + ^ + +sound/soc/sof/intel/bdw.c:269:25: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + imrx & SHIM_IMRX_BUSY ? "yes" : "no", + ^ + +sound/soc/sof/intel/bdw.c:270:25: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + imrx & SHIM_IMRX_DONE ? "yes" : "no", imrx); + ^ + +sound/soc/sof/intel/bdw.c:273:27: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + status & SHIM_IPCD_BUSY ? "yes" : "no", + ^ + +sound/soc/sof/intel/bdw.c:274:27: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + status & SHIM_IPCD_DONE ? "yes" : "no", status); + ^ + +sound/soc/sof/intel/bdw.c:277:25: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + imrd & SHIM_IMRD_BUSY ? "yes" : "no", + ^ + +sound/soc/sof/intel/bdw.c:278:25: style: Clarify calculation +precedence for '&' and '?'. [clarifyCalculation] + imrd & SHIM_IMRD_DONE ? "yes" : "no", imrd); + ^ + +Fixes: 3a9e204d4e369 ("ASoC: SOF: Intel: Add context data to any IPC timeout.") +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191011164312.7988-3-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 7ad03a2c848f6fb0a8dea656c9c161929696878e) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/bdw.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/sound/soc/sof/intel/bdw.c b/sound/soc/sof/intel/bdw.c +index f395d0638876..bf961a8798a7 100644 +--- a/sound/soc/sof/intel/bdw.c ++++ b/sound/soc/sof/intel/bdw.c +@@ -262,20 +262,20 @@ static void bdw_dump(struct snd_sof_dev *sdev, u32 flags) + imrd = snd_sof_dsp_read(sdev, BDW_DSP_BAR, SHIM_IMRD); + dev_err(sdev->dev, + "error: ipc host -> DSP: pending %s complete %s raw 0x%8.8x\n", +- panic & SHIM_IPCX_BUSY ? "yes" : "no", +- panic & SHIM_IPCX_DONE ? "yes" : "no", panic); ++ (panic & SHIM_IPCX_BUSY) ? "yes" : "no", ++ (panic & SHIM_IPCX_DONE) ? "yes" : "no", panic); + dev_err(sdev->dev, + "error: mask host: pending %s complete %s raw 0x%8.8x\n", +- imrx & SHIM_IMRX_BUSY ? "yes" : "no", +- imrx & SHIM_IMRX_DONE ? "yes" : "no", imrx); ++ (imrx & SHIM_IMRX_BUSY) ? "yes" : "no", ++ (imrx & SHIM_IMRX_DONE) ? "yes" : "no", imrx); + dev_err(sdev->dev, + "error: ipc DSP -> host: pending %s complete %s raw 0x%8.8x\n", +- status & SHIM_IPCD_BUSY ? "yes" : "no", +- status & SHIM_IPCD_DONE ? "yes" : "no", status); ++ (status & SHIM_IPCD_BUSY) ? "yes" : "no", ++ (status & SHIM_IPCD_DONE) ? "yes" : "no", status); + dev_err(sdev->dev, + "error: mask DSP: pending %s complete %s raw 0x%8.8x\n", +- imrd & SHIM_IMRD_BUSY ? "yes" : "no", +- imrd & SHIM_IMRD_DONE ? "yes" : "no", imrd); ++ (imrd & SHIM_IMRD_BUSY) ? "yes" : "no", ++ (imrd & SHIM_IMRD_DONE) ? "yes" : "no", imrd); + } + + /* +-- +2.20.1 + + +From 2a49b432e13f3820663d2a6210b1782ee17b0348 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 11 Oct 2019 11:43:11 -0500 +Subject: [PATCH 035/130] ASoC: SOF: topology: remove always-true redundant + test + +Address cppcheck warning: + +sound/soc/sof/topology.c:2322:6: style: Condition 'pcm' is always true +[knownConditionTrueFalse] + if (pcm) { + ^ + +sound/soc/sof/topology.c:2311:6: note: Assuming that condition '!pcm' +is not redundant + if (!pcm) + ^ + +sound/soc/sof/topology.c:2322:6: note: Condition 'pcm' is always true + if (pcm) { + ^ + +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191011164312.7988-4-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 494e8f65da24d550a5e7c6a85b9433ffb181705c) +Bugzilla: 1772498 +--- + sound/soc/sof/topology.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c +index 0adad3246652..b451e8df77d3 100644 +--- a/sound/soc/sof/topology.c ++++ b/sound/soc/sof/topology.c +@@ -2309,10 +2309,9 @@ static int sof_dai_load(struct snd_soc_component *scomp, int index, + spcm->stream[SNDRV_PCM_STREAM_PLAYBACK].comp_id = COMP_ID_UNASSIGNED; + spcm->stream[SNDRV_PCM_STREAM_CAPTURE].comp_id = COMP_ID_UNASSIGNED; + +- if (pcm) { +- spcm->pcm = *pcm; +- dev_dbg(sdev->dev, "tplg: load pcm %s\n", pcm->dai_name); +- } ++ spcm->pcm = *pcm; ++ dev_dbg(sdev->dev, "tplg: load pcm %s\n", pcm->dai_name); ++ + dai_drv->dobj.private = spcm; + list_add(&spcm->list, &sdev->pcm_list); + +-- +2.20.1 + + +From 3c7ba2805c8c4af4e61d2f40ca078fc0fdc9d17b Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 11 Oct 2019 11:43:12 -0500 +Subject: [PATCH 036/130] ASoC: SOF: topology: check errors when parsing LED + tokens + +sof_parse_tokens() returns a value that is checked on every call +except for LED tokens, fix with explicit test. + +Detected with cppcheck warning: + +sound/soc/sof/topology.c:973:6: style: Variable 'ret' is assigned a +value that is never used. [unreadVariable] + ret = sof_parse_tokens(scomp, &scontrol->led_ctl, led_tokens, + ^ + +Fixes: 5d43001ae4360 ("ASoC: SOF: acpi led support for switch controls") +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191011164312.7988-5-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 8a3ab38c36926ddbda3d2a3086c0a741fa175cff) +Bugzilla: 1772498 +--- + sound/soc/sof/topology.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c +index b451e8df77d3..8032bb8a709c 100644 +--- a/sound/soc/sof/topology.c ++++ b/sound/soc/sof/topology.c +@@ -498,6 +498,11 @@ static int sof_control_load_volume(struct snd_soc_component *scomp, + ret = sof_parse_tokens(scomp, &scontrol->led_ctl, led_tokens, + ARRAY_SIZE(led_tokens), mc->priv.array, + le32_to_cpu(mc->priv.size)); ++ if (ret != 0) { ++ dev_err(sdev->dev, "error: parse led tokens failed %d\n", ++ le32_to_cpu(mc->priv.size)); ++ return ret; ++ } + + dev_dbg(sdev->dev, "tplg: load kcontrol index %d chans %d\n", + scontrol->comp_id, scontrol->num_channels); +-- +2.20.1 + + +From 3450e41ea1124a2ee3a26849cc00a99ac8df8a67 Mon Sep 17 00:00:00 2001 +From: YueHaibing +Date: Mon, 14 Oct 2019 17:13:08 +0800 +Subject: [PATCH 037/130] ASoC: SOF: Fix randbuild error + +When LEDS_TRIGGER_AUDIO is m and SND_SOC_SOF is y, + +sound/soc/sof/control.o: In function `snd_sof_switch_put': +control.c:(.text+0x587): undefined reference to `ledtrig_audio_set' +control.c:(.text+0x593): undefined reference to `ledtrig_audio_set' + +Reported-by: Hulk Robot +Fixes: 5d43001ae436 ("ASoC: SOF: acpi led support for switch controls") +Signed-off-by: YueHaibing +Acked-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191014091308.23688-1-yuehaibing@huawei.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 9899a7a869935c4c93247b290ac7a70e0deab202) +Bugzilla: 1772498 +--- + sound/soc/sof/control.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/soc/sof/control.c b/sound/soc/sof/control.c +index b73d4587c5da..7baf7f1507c3 100644 +--- a/sound/soc/sof/control.c ++++ b/sound/soc/sof/control.c +@@ -36,10 +36,12 @@ static void update_mute_led(struct snd_sof_control *scontrol, + + scontrol->led_ctl.led_value = temp; + ++#if IS_REACHABLE(CONFIG_LEDS_TRIGGER_AUDIO) + if (!scontrol->led_ctl.direction) + ledtrig_audio_set(LED_AUDIO_MUTE, temp ? LED_OFF : LED_ON); + else + ledtrig_audio_set(LED_AUDIO_MICMUTE, temp ? LED_OFF : LED_ON); ++#endif + } + + static inline u32 mixer_to_ipc(unsigned int value, u32 *volume_map, int size) +-- +2.20.1 + + +From 46c0429ba78df9619b0c845dd0377e812cc0ceca Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Tue, 22 Oct 2019 14:28:43 -0500 +Subject: [PATCH 038/130] ASoC: SOF: Intel: hda-loader: improve error handling + +If a ROM timeout is detected, we still stop the DMA but will return +the initial error should the DMA stop also fail. + +Likewise the cleanup is handled regardless of the status, but we +return the initial error. + +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191022192844.21022-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 76dc6a2b312d15c91ff4b4d171e98cdc73ba3745) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda-loader.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c +index 65c2af3fcaab..7956dbf5be88 100644 +--- a/sound/soc/sof/intel/hda-loader.c ++++ b/sound/soc/sof/intel/hda-loader.c +@@ -253,10 +253,16 @@ static int cl_copy_fw(struct snd_sof_dev *sdev, struct hdac_ext_stream *stream) + HDA_DSP_REG_POLL_INTERVAL_US, + HDA_DSP_BASEFW_TIMEOUT_US); + ++ /* ++ * even in case of errors we still need to stop the DMAs, ++ * but we return the initial error should the DMA stop also fail ++ */ ++ + ret = cl_trigger(sdev, stream, SNDRV_PCM_TRIGGER_STOP); + if (ret < 0) { + dev_err(sdev->dev, "error: DMA trigger stop failed\n"); +- return ret; ++ if (!status) ++ status = ret; + } + + return status; +@@ -341,13 +347,15 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev) + /* + * Perform codeloader stream cleanup. + * This should be done even if firmware loading fails. ++ * If the cleanup also fails, we return the initial error + */ + ret1 = cl_cleanup(sdev, &sdev->dmab, stream); + if (ret1 < 0) { + dev_err(sdev->dev, "error: Code loader DSP cleanup failed\n"); + + /* set return value to indicate cleanup failure */ +- ret = ret1; ++ if (!ret) ++ ret = ret1; + } + + /* +-- +2.20.1 + + +From c2f63a4a75f4bd02ec46b58dee7468acc0771576 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Tue, 22 Oct 2019 14:28:44 -0500 +Subject: [PATCH 039/130] ASoC: SOF: Intel: hda: add dev_err() traces for + snd_sof_dsp_read_poll_timeout() + +Such traces should be extremely rare but extremely useful for debug. + +Report errors for all calls to sdn_sof_dsp_read_poll_timeout(), but +only on negative values for consistency. + +Add traces that enable each timeout to be uniquely identified. + +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191022192844.21022-3-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 6a414489e0f3309a221f26b3d11c19d1a96a3635) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda-dsp.c | 30 +++++++++++++++++++++++++++--- + sound/soc/sof/intel/hda-loader.c | 13 ++++++++++++- + sound/soc/sof/intel/hda-stream.c | 24 ++++++++++++++++++++---- + 3 files changed, 59 insertions(+), 8 deletions(-) + +diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c +index fb55a3c5afd0..3ea401646e0c 100644 +--- a/sound/soc/sof/intel/hda-dsp.c ++++ b/sound/soc/sof/intel/hda-dsp.c +@@ -42,6 +42,12 @@ int hda_dsp_core_reset_enter(struct snd_sof_dev *sdev, unsigned int core_mask) + ((adspcs & reset) == reset), + HDA_DSP_REG_POLL_INTERVAL_US, + HDA_DSP_RESET_TIMEOUT_US); ++ if (ret < 0) { ++ dev_err(sdev->dev, ++ "error: %s: timeout on HDA_DSP_REG_ADSPCS read\n", ++ __func__); ++ return ret; ++ } + + /* has core entered reset ? */ + adspcs = snd_sof_dsp_read(sdev, HDA_DSP_BAR, +@@ -77,6 +83,13 @@ int hda_dsp_core_reset_leave(struct snd_sof_dev *sdev, unsigned int core_mask) + HDA_DSP_REG_POLL_INTERVAL_US, + HDA_DSP_RESET_TIMEOUT_US); + ++ if (ret < 0) { ++ dev_err(sdev->dev, ++ "error: %s: timeout on HDA_DSP_REG_ADSPCS read\n", ++ __func__); ++ return ret; ++ } ++ + /* has core left reset ? */ + adspcs = snd_sof_dsp_read(sdev, HDA_DSP_BAR, + HDA_DSP_REG_ADSPCS); +@@ -151,8 +164,12 @@ int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask) + (adspcs & cpa) == cpa, + HDA_DSP_REG_POLL_INTERVAL_US, + HDA_DSP_RESET_TIMEOUT_US); +- if (ret < 0) +- dev_err(sdev->dev, "error: timeout on core powerup\n"); ++ if (ret < 0) { ++ dev_err(sdev->dev, ++ "error: %s: timeout on HDA_DSP_REG_ADSPCS read\n", ++ __func__); ++ return ret; ++ } + + /* did core power up ? */ + adspcs = snd_sof_dsp_read(sdev, HDA_DSP_BAR, +@@ -171,17 +188,24 @@ int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask) + int hda_dsp_core_power_down(struct snd_sof_dev *sdev, unsigned int core_mask) + { + u32 adspcs; ++ int ret; + + /* update bits */ + snd_sof_dsp_update_bits_unlocked(sdev, HDA_DSP_BAR, + HDA_DSP_REG_ADSPCS, + HDA_DSP_ADSPCS_SPA_MASK(core_mask), 0); + +- return snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR, ++ ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR, + HDA_DSP_REG_ADSPCS, adspcs, + !(adspcs & HDA_DSP_ADSPCS_SPA_MASK(core_mask)), + HDA_DSP_REG_POLL_INTERVAL_US, + HDA_DSP_PD_TIMEOUT * USEC_PER_MSEC); ++ if (ret < 0) ++ dev_err(sdev->dev, ++ "error: %s: timeout on HDA_DSP_REG_ADSPCS read\n", ++ __func__); ++ ++ return ret; + } + + bool hda_dsp_core_is_enabled(struct snd_sof_dev *sdev, +diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c +index 7956dbf5be88..b1783360fe10 100644 +--- a/sound/soc/sof/intel/hda-loader.c ++++ b/sound/soc/sof/intel/hda-loader.c +@@ -126,7 +126,8 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, const void *fwdata, + HDA_DSP_INIT_TIMEOUT_US); + + if (ret < 0) { +- dev_err(sdev->dev, "error: waiting for HIPCIE done\n"); ++ dev_err(sdev->dev, "error: %s: timeout for HIPCIE done\n", ++ __func__); + goto err; + } + +@@ -152,6 +153,10 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, const void *fwdata, + if (!ret) + return 0; + ++ dev_err(sdev->dev, ++ "error: %s: timeout HDA_DSP_SRAM_REG_ROM_STATUS read\n", ++ __func__); ++ + err: + hda_dsp_dump(sdev, SOF_DBG_REGS | SOF_DBG_PCI | SOF_DBG_MBOX); + hda_dsp_core_reset_power_down(sdev, chip->cores_mask); +@@ -258,6 +263,12 @@ static int cl_copy_fw(struct snd_sof_dev *sdev, struct hdac_ext_stream *stream) + * but we return the initial error should the DMA stop also fail + */ + ++ if (status < 0) { ++ dev_err(sdev->dev, ++ "error: %s: timeout HDA_DSP_SRAM_REG_ROM_STATUS read\n", ++ __func__); ++ } ++ + ret = cl_trigger(sdev, stream, SNDRV_PCM_TRIGGER_STOP); + if (ret < 0) { + dev_err(sdev->dev, "error: DMA trigger stop failed\n"); +diff --git a/sound/soc/sof/intel/hda-stream.c b/sound/soc/sof/intel/hda-stream.c +index 0c11fceb28a7..29ab43281670 100644 +--- a/sound/soc/sof/intel/hda-stream.c ++++ b/sound/soc/sof/intel/hda-stream.c +@@ -275,8 +275,12 @@ int hda_dsp_stream_trigger(struct snd_sof_dev *sdev, + HDA_DSP_REG_POLL_INTERVAL_US, + HDA_DSP_STREAM_RUN_TIMEOUT); + +- if (ret) ++ if (ret < 0) { ++ dev_err(sdev->dev, ++ "error: %s: cmd %d: timeout on STREAM_SD_OFFSET read\n", ++ __func__, cmd); + return ret; ++ } + + hstream->running = true; + break; +@@ -294,8 +298,12 @@ int hda_dsp_stream_trigger(struct snd_sof_dev *sdev, + HDA_DSP_REG_POLL_INTERVAL_US, + HDA_DSP_STREAM_RUN_TIMEOUT); + +- if (ret) ++ if (ret < 0) { ++ dev_err(sdev->dev, ++ "error: %s: cmd %d: timeout on STREAM_SD_OFFSET read\n", ++ __func__, cmd); + return ret; ++ } + + snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, sd_offset + + SOF_HDA_ADSP_REG_CL_SD_STS, +@@ -356,8 +364,12 @@ int hda_dsp_stream_hw_params(struct snd_sof_dev *sdev, + HDA_DSP_REG_POLL_INTERVAL_US, + HDA_DSP_STREAM_RUN_TIMEOUT); + +- if (ret) ++ if (ret < 0) { ++ dev_err(sdev->dev, ++ "error: %s: timeout on STREAM_SD_OFFSET read1\n", ++ __func__); + return ret; ++ } + + snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, + sd_offset + SOF_HDA_ADSP_REG_CL_SD_STS, +@@ -418,8 +430,12 @@ int hda_dsp_stream_hw_params(struct snd_sof_dev *sdev, + HDA_DSP_REG_POLL_INTERVAL_US, + HDA_DSP_STREAM_RUN_TIMEOUT); + +- if (ret) ++ if (ret < 0) { ++ dev_err(sdev->dev, ++ "error: %s: timeout on STREAM_SD_OFFSET read2\n", ++ __func__); + return ret; ++ } + + snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, + sd_offset + SOF_HDA_ADSP_REG_CL_SD_STS, +-- +2.20.1 + + +From ae6f9d27eca6aa21c2f47b7d22dacc72bc6ff71d Mon Sep 17 00:00:00 2001 +From: Pan Xiuli +Date: Tue, 22 Oct 2019 14:47:05 -0500 +Subject: [PATCH 040/130] ASoC: SOF: Intel: initial support to JasperLake. + +Add Kconfig, PCI ID and chip info for JSL platform. +The DSP only has 2 cores for this platform. + +Signed-off-by: Pan Xiuli +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191022194705.23347-3-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 6fd9903527bf103167004022a0199b8fac1b8b29) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/Kconfig | 16 ++++++++++++++++ + sound/soc/sof/intel/cnl.c | 17 +++++++++++++++++ + sound/soc/sof/intel/hda.h | 1 + + sound/soc/sof/sof-pci-dev.c | 22 ++++++++++++++++++++++ + 4 files changed, 56 insertions(+) + +diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig +index 1be28581c328..aac8d5deba3d 100644 +--- a/sound/soc/sof/intel/Kconfig ++++ b/sound/soc/sof/intel/Kconfig +@@ -29,6 +29,7 @@ config SND_SOC_SOF_INTEL_PCI + select SND_SOC_SOF_COMETLAKE_H if SND_SOC_SOF_COMETLAKE_H_SUPPORT + select SND_SOC_SOF_TIGERLAKE if SND_SOC_SOF_TIGERLAKE_SUPPORT + select SND_SOC_SOF_ELKHARTLAKE if SND_SOC_SOF_ELKHARTLAKE_SUPPORT ++ select SND_SOC_SOF_JASPERLAKE if SND_SOC_SOF_JASPERLAKE_SUPPORT + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level +@@ -244,6 +245,21 @@ config SND_SOC_SOF_ELKHARTLAKE + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + ++config SND_SOC_SOF_JASPERLAKE_SUPPORT ++ bool "SOF support for JasperLake" ++ help ++ This adds support for Sound Open Firmware for Intel(R) platforms ++ using the JasperLake processors. ++ Say Y if you have such a device. ++ If unsure select "N". ++ ++config SND_SOC_SOF_JASPERLAKE ++ tristate ++ select SND_SOC_SOF_HDA_COMMON ++ help ++ This option is not user-selectable but automagically handled by ++ 'select' statements at a higher level ++ + config SND_SOC_SOF_HDA_COMMON + tristate + select SND_SOC_SOF_INTEL_COMMON +diff --git a/sound/soc/sof/intel/cnl.c b/sound/soc/sof/intel/cnl.c +index 4ddd73762d81..5b97bdfba823 100644 +--- a/sound/soc/sof/intel/cnl.c ++++ b/sound/soc/sof/intel/cnl.c +@@ -327,3 +327,20 @@ const struct sof_intel_dsp_desc ehl_chip_info = { + .ssp_base_offset = CNL_SSP_BASE_OFFSET, + }; + EXPORT_SYMBOL(ehl_chip_info); ++ ++const struct sof_intel_dsp_desc jsl_chip_info = { ++ /* Jasperlake */ ++ .cores_num = 2, ++ .init_core_mask = 1, ++ .cores_mask = HDA_DSP_CORE_MASK(0) | ++ HDA_DSP_CORE_MASK(1), ++ .ipc_req = CNL_DSP_REG_HIPCIDR, ++ .ipc_req_mask = CNL_DSP_REG_HIPCIDR_BUSY, ++ .ipc_ack = CNL_DSP_REG_HIPCIDA, ++ .ipc_ack_mask = CNL_DSP_REG_HIPCIDA_DONE, ++ .ipc_ctl = CNL_DSP_REG_HIPCCTL, ++ .rom_init_timeout = 300, ++ .ssp_count = ICL_SSP_COUNT, ++ .ssp_base_offset = CNL_SSP_BASE_OFFSET, ++}; ++EXPORT_SYMBOL(jsl_chip_info); +diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h +index 23e430d3e056..ea02bf40cb25 100644 +--- a/sound/soc/sof/intel/hda.h ++++ b/sound/soc/sof/intel/hda.h +@@ -604,5 +604,6 @@ extern const struct sof_intel_dsp_desc skl_chip_info; + extern const struct sof_intel_dsp_desc icl_chip_info; + extern const struct sof_intel_dsp_desc tgl_chip_info; + extern const struct sof_intel_dsp_desc ehl_chip_info; ++extern const struct sof_intel_dsp_desc jsl_chip_info; + + #endif +diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c +index be5a8da504c5..e0b150f29e81 100644 +--- a/sound/soc/sof/sof-pci-dev.c ++++ b/sound/soc/sof/sof-pci-dev.c +@@ -246,6 +246,24 @@ static const struct sof_dev_desc ehl_desc = { + }; + #endif + ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_JASPERLAKE) ++static const struct sof_dev_desc jsl_desc = { ++ .machines = snd_soc_acpi_intel_jsl_machines, ++ .resindex_lpe_base = 0, ++ .resindex_pcicfg_base = -1, ++ .resindex_imr_base = -1, ++ .irqindex_host_ipc = -1, ++ .resindex_dma_base = -1, ++ .chip_info = &jsl_chip_info, ++ .default_fw_path = "intel/sof", ++ .default_tplg_path = "intel/sof-tplg", ++ .nocodec_fw_filename = "sof-jsl.ri", ++ .nocodec_tplg_filename = "sof-jsl-nocodec.tplg", ++ .ops = &sof_cnl_ops, ++ .arch_ops = &sof_xtensa_arch_ops ++}; ++#endif ++ + static const struct dev_pm_ops sof_pci_pm = { + SET_SYSTEM_SLEEP_PM_OPS(snd_sof_suspend, snd_sof_resume) + SET_RUNTIME_PM_OPS(snd_sof_runtime_suspend, snd_sof_runtime_resume, +@@ -429,6 +447,10 @@ static const struct pci_device_id sof_pci_ids[] = { + { PCI_DEVICE(0x8086, 0x34C8), + .driver_data = (unsigned long)&icl_desc}, + #endif ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_JASPERLAKE) ++ { PCI_DEVICE(0x8086, 0x38c8), ++ .driver_data = (unsigned long)&jsl_desc}, ++#endif + #if IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE_LP) + { PCI_DEVICE(0x8086, 0x02c8), + .driver_data = (unsigned long)&cml_desc}, +-- +2.20.1 + + +From 7de4b3424a30b11a2ea4d63a6c6d57c9407bf771 Mon Sep 17 00:00:00 2001 +From: Pan Xiuli +Date: Tue, 22 Oct 2019 14:47:04 -0500 +Subject: [PATCH 041/130] ASoC: Intel: common: add ACPI matching tables for JSL + +There are no upstream machine drivers just yet so just add dummy table +for compilation in nocodec-mode. + +Signed-off-by: Pan Xiuli +Link: https://lore.kernel.org/r/20191022194705.23347-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 4f0637eae56f02ef648de5ed839d572259d396e9) +Bugzilla: 1772498 +--- + include/sound/soc-acpi-intel-match.h | 1 + + sound/soc/intel/common/Makefile | 1 + + .../intel/common/soc-acpi-intel-jsl-match.c | 18 ++++++++++++++++++ + 3 files changed, 20 insertions(+) + create mode 100644 sound/soc/intel/common/soc-acpi-intel-jsl-match.c + +diff --git a/include/sound/soc-acpi-intel-match.h b/include/sound/soc-acpi-intel-match.h +index 6c9929abd90b..4e44782862df 100644 +--- a/include/sound/soc-acpi-intel-match.h ++++ b/include/sound/soc-acpi-intel-match.h +@@ -27,6 +27,7 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[]; + extern struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_machines[]; + extern struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_machines[]; + extern struct snd_soc_acpi_mach snd_soc_acpi_intel_ehl_machines[]; ++extern struct snd_soc_acpi_mach snd_soc_acpi_intel_jsl_machines[]; + + /* + * generic table used for HDA codec-based platforms, possibly with +diff --git a/sound/soc/intel/common/Makefile b/sound/soc/intel/common/Makefile +index 18d9630ae9a2..eafe95ead49b 100644 +--- a/sound/soc/intel/common/Makefile ++++ b/sound/soc/intel/common/Makefile +@@ -9,6 +9,7 @@ snd-soc-acpi-intel-match-objs := soc-acpi-intel-byt-match.o soc-acpi-intel-cht-m + soc-acpi-intel-bxt-match.o soc-acpi-intel-glk-match.o \ + soc-acpi-intel-cnl-match.o soc-acpi-intel-icl-match.o \ + soc-acpi-intel-tgl-match.o soc-acpi-intel-ehl-match.o \ ++ soc-acpi-intel-jsl-match.o \ + soc-acpi-intel-hda-match.o + + obj-$(CONFIG_SND_SOC_INTEL_SST) += snd-soc-sst-dsp.o snd-soc-sst-ipc.o +diff --git a/sound/soc/intel/common/soc-acpi-intel-jsl-match.c b/sound/soc/intel/common/soc-acpi-intel-jsl-match.c +new file mode 100644 +index 000000000000..1c68a04f0c6e +--- /dev/null ++++ b/sound/soc/intel/common/soc-acpi-intel-jsl-match.c +@@ -0,0 +1,18 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * soc-apci-intel-jsl-match.c - tables and support for JSL ACPI enumeration. ++ * ++ * Copyright (c) 2019, Intel Corporation. ++ * ++ */ ++ ++#include ++#include ++ ++struct snd_soc_acpi_mach snd_soc_acpi_intel_jsl_machines[] = { ++ {}, ++}; ++EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_jsl_machines); ++ ++MODULE_LICENSE("GPL v2"); ++MODULE_DESCRIPTION("Intel Common ACPI Match module"); +-- +2.20.1 + + +From a8fbd7629399a706abe19bbad51f2120a60f5f56 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Thu, 24 Oct 2019 16:03:17 -0500 +Subject: [PATCH 042/130] ASoC: SOF: define INFO_ flags in dsp_ops + +Currently the INFO_ flags such as PAUSE/NO_PERIOD_WAKEUP are defined +in the SOF PCM core, which doesn't scale. To account for platform +variations, these flags need to be set in DSP ops. + +This patch only moves the definitions and does not change any +functionality. + +Reviewed-by: Jaska Uimonen +Reviewed-by: Ranjani Sridharan +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191024210318.30068-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 27e322fabd508ba73ced625fc41f0b7ceee26416) +Bugzilla: 1772498 +--- + sound/soc/sof/imx/imx8.c | 7 +++++++ + sound/soc/sof/intel/apl.c | 7 +++++++ + sound/soc/sof/intel/bdw.c | 9 ++++++++- + sound/soc/sof/intel/byt.c | 21 +++++++++++++++++++++ + sound/soc/sof/intel/cnl.c | 7 +++++++ + sound/soc/sof/pcm.c | 8 +++----- + sound/soc/sof/sof-priv.h | 3 +++ + 7 files changed, 56 insertions(+), 6 deletions(-) + +diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c +index 2a22b18e5ec0..cfefcfd92798 100644 +--- a/sound/soc/sof/imx/imx8.c ++++ b/sound/soc/sof/imx/imx8.c +@@ -388,6 +388,13 @@ struct snd_sof_dsp_ops sof_imx8_ops = { + /* DAI drivers */ + .drv = imx8_dai, + .num_drv = 1, /* we have only 1 ESAI interface on i.MX8 */ ++ ++ /* ALSA HW info flags */ ++ .hw_info = SNDRV_PCM_INFO_MMAP | ++ SNDRV_PCM_INFO_MMAP_VALID | ++ SNDRV_PCM_INFO_INTERLEAVED | ++ SNDRV_PCM_INFO_PAUSE | ++ SNDRV_PCM_INFO_NO_PERIOD_WAKEUP + }; + EXPORT_SYMBOL(sof_imx8_ops); + +diff --git a/sound/soc/sof/intel/apl.c b/sound/soc/sof/intel/apl.c +index 8dc7a5558da4..15d26e8d90a9 100644 +--- a/sound/soc/sof/intel/apl.c ++++ b/sound/soc/sof/intel/apl.c +@@ -97,6 +97,13 @@ const struct snd_sof_dsp_ops sof_apl_ops = { + .runtime_resume = hda_dsp_runtime_resume, + .runtime_idle = hda_dsp_runtime_idle, + .set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume, ++ ++ /* ALSA HW info flags */ ++ .hw_info = SNDRV_PCM_INFO_MMAP | ++ SNDRV_PCM_INFO_MMAP_VALID | ++ SNDRV_PCM_INFO_INTERLEAVED | ++ SNDRV_PCM_INFO_PAUSE | ++ SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, + }; + EXPORT_SYMBOL(sof_apl_ops); + +diff --git a/sound/soc/sof/intel/bdw.c b/sound/soc/sof/intel/bdw.c +index bf961a8798a7..7b4cd1f456bf 100644 +--- a/sound/soc/sof/intel/bdw.c ++++ b/sound/soc/sof/intel/bdw.c +@@ -591,7 +591,14 @@ const struct snd_sof_dsp_ops sof_bdw_ops = { + + /* DAI drivers */ + .drv = bdw_dai, +- .num_drv = ARRAY_SIZE(bdw_dai) ++ .num_drv = ARRAY_SIZE(bdw_dai), ++ ++ /* ALSA HW info flags */ ++ .hw_info = SNDRV_PCM_INFO_MMAP | ++ SNDRV_PCM_INFO_MMAP_VALID | ++ SNDRV_PCM_INFO_INTERLEAVED | ++ SNDRV_PCM_INFO_PAUSE | ++ SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, + }; + EXPORT_SYMBOL(sof_bdw_ops); + +diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c +index 07e5efe4945c..62edb959f1fc 100644 +--- a/sound/soc/sof/intel/byt.c ++++ b/sound/soc/sof/intel/byt.c +@@ -532,6 +532,13 @@ const struct snd_sof_dsp_ops sof_tng_ops = { + /* DAI drivers */ + .drv = byt_dai, + .num_drv = 3, /* we have only 3 SSPs on byt*/ ++ ++ /* ALSA HW info flags */ ++ .hw_info = SNDRV_PCM_INFO_MMAP | ++ SNDRV_PCM_INFO_MMAP_VALID | ++ SNDRV_PCM_INFO_INTERLEAVED | ++ SNDRV_PCM_INFO_PAUSE | ++ SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, + }; + EXPORT_SYMBOL(sof_tng_ops); + +@@ -693,6 +700,13 @@ const struct snd_sof_dsp_ops sof_byt_ops = { + /* DAI drivers */ + .drv = byt_dai, + .num_drv = 3, /* we have only 3 SSPs on byt*/ ++ ++ /* ALSA HW info flags */ ++ .hw_info = SNDRV_PCM_INFO_MMAP | ++ SNDRV_PCM_INFO_MMAP_VALID | ++ SNDRV_PCM_INFO_INTERLEAVED | ++ SNDRV_PCM_INFO_PAUSE | ++ SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, + }; + EXPORT_SYMBOL(sof_byt_ops); + +@@ -753,6 +767,13 @@ const struct snd_sof_dsp_ops sof_cht_ops = { + .drv = byt_dai, + /* all 6 SSPs may be available for cherrytrail */ + .num_drv = ARRAY_SIZE(byt_dai), ++ ++ /* ALSA HW info flags */ ++ .hw_info = SNDRV_PCM_INFO_MMAP | ++ SNDRV_PCM_INFO_MMAP_VALID | ++ SNDRV_PCM_INFO_INTERLEAVED | ++ SNDRV_PCM_INFO_PAUSE | ++ SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, + }; + EXPORT_SYMBOL(sof_cht_ops); + +diff --git a/sound/soc/sof/intel/cnl.c b/sound/soc/sof/intel/cnl.c +index 5b97bdfba823..e9cdcc040fb5 100644 +--- a/sound/soc/sof/intel/cnl.c ++++ b/sound/soc/sof/intel/cnl.c +@@ -255,6 +255,13 @@ const struct snd_sof_dsp_ops sof_cnl_ops = { + .runtime_resume = hda_dsp_runtime_resume, + .runtime_idle = hda_dsp_runtime_idle, + .set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume, ++ ++ /* ALSA HW info flags */ ++ .hw_info = SNDRV_PCM_INFO_MMAP | ++ SNDRV_PCM_INFO_MMAP_VALID | ++ SNDRV_PCM_INFO_INTERLEAVED | ++ SNDRV_PCM_INFO_PAUSE | ++ SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, + }; + EXPORT_SYMBOL(sof_cnl_ops); + +diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c +index b0f4217433e5..b33928e1385b 100644 +--- a/sound/soc/sof/pcm.c ++++ b/sound/soc/sof/pcm.c +@@ -435,6 +435,7 @@ static int sof_pcm_open(struct snd_pcm_substream *substream) + struct snd_soc_component *component = + snd_soc_rtdcom_lookup(rtd, DRV_NAME); + struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); ++ const struct snd_sof_dsp_ops *ops = sof_ops(sdev); + struct snd_sof_pcm *spcm; + struct snd_soc_tplg_stream_caps *caps; + int ret; +@@ -464,11 +465,8 @@ static int sof_pcm_open(struct snd_pcm_substream *substream) + le32_to_cpu(caps->period_size_min)); + + /* set runtime config */ +- runtime->hw.info = SNDRV_PCM_INFO_MMAP | +- SNDRV_PCM_INFO_MMAP_VALID | +- SNDRV_PCM_INFO_INTERLEAVED | +- SNDRV_PCM_INFO_PAUSE | +- SNDRV_PCM_INFO_NO_PERIOD_WAKEUP; ++ runtime->hw.info = ops->hw_info; /* platform-specific */ ++ + runtime->hw.formats = le64_to_cpu(caps->formats); + runtime->hw.period_bytes_min = le32_to_cpu(caps->period_size_min); + runtime->hw.period_bytes_max = le32_to_cpu(caps->period_size_max); +diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h +index 5a11a8517fa5..2d40de5ee285 100644 +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -211,6 +211,9 @@ struct snd_sof_dsp_ops { + /* DAI ops */ + struct snd_soc_dai_driver *drv; + int num_drv; ++ ++ /* ALSA HW info flags, will be stored in snd_pcm_runtime.hw.info */ ++ u32 hw_info; + }; + + /* DSP architecture specific callbacks for oops and stack dumps */ +-- +2.20.1 + + +From 67594879a9d4b17f5510ae384b2a7ed77e6d05cc Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Thu, 24 Oct 2019 16:03:18 -0500 +Subject: [PATCH 043/130] ASoC: SOF: Intel: only support INFO_BATCH for legacy + platforms + +The current position update is not precise enough for PulseAudio to +work reliably with the timer-based scheduling on Baytrail, +Cherrytrail, Broadwell. + +Disable the NO_PERIOD_WAKEUP capability and use BATCH to signal that +the position is only reliable and updated during period_elapsed +events. + +This will be reverted when the firmware provides a more accurate +position for those platforms. + +Reviewed-by: Jaska Uimonen +Reviewed-by: Ranjani Sridharan +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191024210318.30068-3-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 4c02a7bd43e22f4de53ad55b94d24e4388f712f0) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/bdw.c | 2 +- + sound/soc/sof/intel/byt.c | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/sound/soc/sof/intel/bdw.c b/sound/soc/sof/intel/bdw.c +index 7b4cd1f456bf..141dad554764 100644 +--- a/sound/soc/sof/intel/bdw.c ++++ b/sound/soc/sof/intel/bdw.c +@@ -598,7 +598,7 @@ const struct snd_sof_dsp_ops sof_bdw_ops = { + SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_PAUSE | +- SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, ++ SNDRV_PCM_INFO_BATCH, + }; + EXPORT_SYMBOL(sof_bdw_ops); + +diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c +index 62edb959f1fc..2abf80b3eb52 100644 +--- a/sound/soc/sof/intel/byt.c ++++ b/sound/soc/sof/intel/byt.c +@@ -538,7 +538,7 @@ const struct snd_sof_dsp_ops sof_tng_ops = { + SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_PAUSE | +- SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, ++ SNDRV_PCM_INFO_BATCH, + }; + EXPORT_SYMBOL(sof_tng_ops); + +@@ -706,7 +706,7 @@ const struct snd_sof_dsp_ops sof_byt_ops = { + SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_PAUSE | +- SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, ++ SNDRV_PCM_INFO_BATCH, + }; + EXPORT_SYMBOL(sof_byt_ops); + +@@ -773,7 +773,7 @@ const struct snd_sof_dsp_ops sof_cht_ops = { + SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_PAUSE | +- SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, ++ SNDRV_PCM_INFO_BATCH, + }; + EXPORT_SYMBOL(sof_cht_ops); + +-- +2.20.1 + + +From af01764721df770ee773faae776429901a9614fe Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 28 Oct 2019 18:33:29 +0100 +Subject: [PATCH 044/130] ASoC: SOF - remove the dead code (skylake/kabylake) + +Appearently the CONFIG_SND_SOC_SOF_KABYLAKE and CONFIG_SND_SOC_SOF_SKYLAKE +options are not present in Kconfig and 'struct snd_sof_dsp_ops sof_skl_ops' +is not declared in the code, too. + +Signed-off-by: Jaroslav Kysela +Cc: Pierre-Louis Bossart +Cc: Mark Brown +Link: https://lore.kernel.org/r/20191028173329.29538-1-perex@perex.cz +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit c3ad1092e1069f27d0ca110dcaada8a5435ea3e0) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda.h | 1 - + sound/soc/sof/sof-pci-dev.c | 44 ------------------------------------- + 2 files changed, 45 deletions(-) + +diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h +index ea02bf40cb25..8e03d876a0ac 100644 +--- a/sound/soc/sof/intel/hda.h ++++ b/sound/soc/sof/intel/hda.h +@@ -596,7 +596,6 @@ extern struct snd_soc_dai_driver skl_dai[]; + */ + extern const struct snd_sof_dsp_ops sof_apl_ops; + extern const struct snd_sof_dsp_ops sof_cnl_ops; +-extern const struct snd_sof_dsp_ops sof_skl_ops; + + extern const struct sof_intel_dsp_desc apl_chip_info; + extern const struct sof_intel_dsp_desc cnl_chip_info; +diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c +index e0b150f29e81..067acf389af7 100644 +--- a/sound/soc/sof/sof-pci-dev.c ++++ b/sound/soc/sof/sof-pci-dev.c +@@ -174,42 +174,6 @@ static const struct sof_dev_desc icl_desc = { + }; + #endif + +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_SKYLAKE) +-static const struct sof_dev_desc skl_desc = { +- .machines = snd_soc_acpi_intel_skl_machines, +- .resindex_lpe_base = 0, +- .resindex_pcicfg_base = -1, +- .resindex_imr_base = -1, +- .irqindex_host_ipc = -1, +- .resindex_dma_base = -1, +- .chip_info = &skl_chip_info, +- .default_fw_path = "intel/sof", +- .default_tplg_path = "intel/sof-tplg", +- .nocodec_fw_filename = "sof-skl.ri", +- .nocodec_tplg_filename = "sof-skl-nocodec.tplg", +- .ops = &sof_skl_ops, +- .arch_ops = &sof_xtensa_arch_ops +-}; +-#endif +- +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_KABYLAKE) +-static const struct sof_dev_desc kbl_desc = { +- .machines = snd_soc_acpi_intel_kbl_machines, +- .resindex_lpe_base = 0, +- .resindex_pcicfg_base = -1, +- .resindex_imr_base = -1, +- .irqindex_host_ipc = -1, +- .resindex_dma_base = -1, +- .chip_info = &skl_chip_info, +- .default_fw_path = "intel/sof", +- .default_tplg_path = "intel/sof-tplg", +- .nocodec_fw_filename = "sof-kbl.ri", +- .nocodec_tplg_filename = "sof-kbl-nocodec.tplg", +- .ops = &sof_skl_ops, +- .arch_ops = &sof_xtensa_arch_ops +-}; +-#endif +- + #if IS_ENABLED(CONFIG_SND_SOC_SOF_TIGERLAKE) + static const struct sof_dev_desc tgl_desc = { + .machines = snd_soc_acpi_intel_tgl_machines, +@@ -435,14 +399,6 @@ static const struct pci_device_id sof_pci_ids[] = { + { PCI_DEVICE(0x8086, 0xa348), + .driver_data = (unsigned long)&cfl_desc}, + #endif +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_KABYLAKE) +- { PCI_DEVICE(0x8086, 0x9d71), +- .driver_data = (unsigned long)&kbl_desc}, +-#endif +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_SKYLAKE) +- { PCI_DEVICE(0x8086, 0x9d70), +- .driver_data = (unsigned long)&skl_desc}, +-#endif + #if IS_ENABLED(CONFIG_SND_SOC_SOF_ICELAKE) + { PCI_DEVICE(0x8086, 0x34C8), + .driver_data = (unsigned long)&icl_desc}, +-- +2.20.1 + + +From d08a87dcaa98f79927dd564cf6313b6161e33f84 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Tue, 29 Oct 2019 15:40:10 +0200 +Subject: [PATCH 045/130] ASoC: hdac_hda: add support for HDMI/DP as a HDA + codec + +Handle all HDA codecs using same logic, including HDMI/DP. + +Call to snd_hda_codec_build_controls() is delayed for HDMI/DP HDA +devices. This is needed to discover the PCM device numbers as +defined in topology. + +Signed-off-by: Kai Vehmanen +Reviewed-by: Takashi Iwai +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191029134017.18901-3-kai.vehmanen@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 608b8c36c37114289e3ea328783161f542fdf71d) +Bugzilla: 1772498 +--- + sound/soc/codecs/hdac_hda.c | 114 ++++++++++++++++++++++++++++++++---- + sound/soc/codecs/hdac_hda.h | 13 +++- + 2 files changed, 114 insertions(+), 13 deletions(-) + +diff --git a/sound/soc/codecs/hdac_hda.c b/sound/soc/codecs/hdac_hda.c +index 4570f662fb48..6803d39e09a5 100644 +--- a/sound/soc/codecs/hdac_hda.c ++++ b/sound/soc/codecs/hdac_hda.c +@@ -14,13 +14,11 @@ + #include + #include + #include ++#include + #include + #include +-#include "hdac_hda.h" + +-#define HDAC_ANALOG_DAI_ID 0 +-#define HDAC_DIGITAL_DAI_ID 1 +-#define HDAC_ALT_ANALOG_DAI_ID 2 ++#include "hdac_hda.h" + + #define STUB_FORMATS (SNDRV_PCM_FMTBIT_S8 | \ + SNDRV_PCM_FMTBIT_U8 | \ +@@ -32,6 +30,11 @@ + SNDRV_PCM_FMTBIT_U32_LE | \ + SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE) + ++#define STUB_HDMI_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\ ++ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\ ++ SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |\ ++ SNDRV_PCM_RATE_192000) ++ + static int hdac_hda_dai_open(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai); + static void hdac_hda_dai_close(struct snd_pcm_substream *substream, +@@ -121,7 +124,46 @@ static struct snd_soc_dai_driver hdac_hda_dais[] = { + .formats = STUB_FORMATS, + .sig_bits = 24, + }, +-} ++}, ++{ ++ .id = HDAC_HDMI_0_DAI_ID, ++ .name = "intel-hdmi-hifi1", ++ .ops = &hdac_hda_dai_ops, ++ .playback = { ++ .stream_name = "hifi1", ++ .channels_min = 1, ++ .channels_max = 32, ++ .rates = STUB_HDMI_RATES, ++ .formats = STUB_FORMATS, ++ .sig_bits = 24, ++ }, ++}, ++{ ++ .id = HDAC_HDMI_1_DAI_ID, ++ .name = "intel-hdmi-hifi2", ++ .ops = &hdac_hda_dai_ops, ++ .playback = { ++ .stream_name = "hifi2", ++ .channels_min = 1, ++ .channels_max = 32, ++ .rates = STUB_HDMI_RATES, ++ .formats = STUB_FORMATS, ++ .sig_bits = 24, ++ }, ++}, ++{ ++ .id = HDAC_HDMI_2_DAI_ID, ++ .name = "intel-hdmi-hifi3", ++ .ops = &hdac_hda_dai_ops, ++ .playback = { ++ .stream_name = "hifi3", ++ .channels_min = 1, ++ .channels_max = 32, ++ .rates = STUB_HDMI_RATES, ++ .formats = STUB_FORMATS, ++ .sig_bits = 24, ++ }, ++}, + + }; + +@@ -135,10 +177,11 @@ static int hdac_hda_dai_set_tdm_slot(struct snd_soc_dai *dai, + + hda_pvt = snd_soc_component_get_drvdata(component); + pcm = &hda_pvt->pcm[dai->id]; ++ + if (tx_mask) +- pcm[dai->id].stream_tag[SNDRV_PCM_STREAM_PLAYBACK] = tx_mask; ++ pcm->stream_tag[SNDRV_PCM_STREAM_PLAYBACK] = tx_mask; + else +- pcm[dai->id].stream_tag[SNDRV_PCM_STREAM_CAPTURE] = rx_mask; ++ pcm->stream_tag[SNDRV_PCM_STREAM_CAPTURE] = rx_mask; + + return 0; + } +@@ -278,6 +321,12 @@ static struct hda_pcm *snd_soc_find_pcm_from_dai(struct hdac_hda_priv *hda_pvt, + struct hda_pcm *cpcm; + const char *pcm_name; + ++ /* ++ * map DAI ID to the closest matching PCM name, using the naming ++ * scheme used by hda-codec snd_hda_gen_build_pcms() and for ++ * HDMI in hda_codec patch_hdmi.c) ++ */ ++ + switch (dai->id) { + case HDAC_ANALOG_DAI_ID: + pcm_name = "Analog"; +@@ -288,13 +337,22 @@ static struct hda_pcm *snd_soc_find_pcm_from_dai(struct hdac_hda_priv *hda_pvt, + case HDAC_ALT_ANALOG_DAI_ID: + pcm_name = "Alt Analog"; + break; ++ case HDAC_HDMI_0_DAI_ID: ++ pcm_name = "HDMI 0"; ++ break; ++ case HDAC_HDMI_1_DAI_ID: ++ pcm_name = "HDMI 1"; ++ break; ++ case HDAC_HDMI_2_DAI_ID: ++ pcm_name = "HDMI 2"; ++ break; + default: + dev_err(&hcodec->core.dev, "invalid dai id %d\n", dai->id); + return NULL; + } + + list_for_each_entry(cpcm, &hcodec->pcm_list_head, list) { +- if (strpbrk(cpcm->name, pcm_name)) ++ if (strstr(cpcm->name, pcm_name)) + return cpcm; + } + +@@ -302,6 +360,18 @@ static struct hda_pcm *snd_soc_find_pcm_from_dai(struct hdac_hda_priv *hda_pvt, + return NULL; + } + ++static bool is_hdmi_codec(struct hda_codec *hcodec) ++{ ++ struct hda_pcm *cpcm; ++ ++ list_for_each_entry(cpcm, &hcodec->pcm_list_head, list) { ++ if (cpcm->pcm_type == HDA_PCM_TYPE_HDMI) ++ return true; ++ } ++ ++ return false; ++} ++ + static int hdac_hda_codec_probe(struct snd_soc_component *component) + { + struct hdac_hda_priv *hda_pvt = +@@ -322,6 +392,15 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component) + + snd_hdac_ext_bus_link_get(hdev->bus, hlink); + ++ /* ++ * Ensure any HDA display is powered at codec probe. ++ * After snd_hda_codec_device_new(), display power is ++ * managed by runtime PM. ++ */ ++ if (hda_pvt->need_display_power) ++ snd_hdac_display_power(hdev->bus, ++ HDA_CODEC_IDX_CONTROLLER, true); ++ + ret = snd_hda_codec_device_new(hcodec->bus, component->card->snd_card, + hdev->addr, hcodec); + if (ret < 0) { +@@ -366,20 +445,31 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component) + dev_dbg(&hdev->dev, "no patch file found\n"); + } + ++ /* configure codec for 1:1 PCM:DAI mapping */ ++ hcodec->mst_no_extra_pcms = 1; ++ + ret = snd_hda_codec_parse_pcms(hcodec); + if (ret < 0) { + dev_err(&hdev->dev, "unable to map pcms to dai %d\n", ret); + goto error; + } + +- ret = snd_hda_codec_build_controls(hcodec); +- if (ret < 0) { +- dev_err(&hdev->dev, "unable to create controls %d\n", ret); +- goto error; ++ /* HDMI controls need to be created in machine drivers */ ++ if (!is_hdmi_codec(hcodec)) { ++ ret = snd_hda_codec_build_controls(hcodec); ++ if (ret < 0) { ++ dev_err(&hdev->dev, "unable to create controls %d\n", ++ ret); ++ goto error; ++ } + } + + hcodec->core.lazy_cache = true; + ++ if (hda_pvt->need_display_power) ++ snd_hdac_display_power(hdev->bus, ++ HDA_CODEC_IDX_CONTROLLER, false); ++ + /* + * hdac_device core already sets the state to active and calls + * get_noresume. So enable runtime and set the device to suspend. +diff --git a/sound/soc/codecs/hdac_hda.h b/sound/soc/codecs/hdac_hda.h +index 6b1bd4f428e7..e145cec085b8 100644 +--- a/sound/soc/codecs/hdac_hda.h ++++ b/sound/soc/codecs/hdac_hda.h +@@ -6,6 +6,16 @@ + #ifndef __HDAC_HDA_H__ + #define __HDAC_HDA_H__ + ++enum { ++ HDAC_ANALOG_DAI_ID = 0, ++ HDAC_DIGITAL_DAI_ID, ++ HDAC_ALT_ANALOG_DAI_ID, ++ HDAC_HDMI_0_DAI_ID, ++ HDAC_HDMI_1_DAI_ID, ++ HDAC_HDMI_2_DAI_ID, ++ HDAC_LAST_DAI_ID = HDAC_HDMI_2_DAI_ID, ++}; ++ + struct hdac_hda_pcm { + int stream_tag[2]; + unsigned int format_val[2]; +@@ -13,7 +23,8 @@ struct hdac_hda_pcm { + + struct hdac_hda_priv { + struct hda_codec codec; +- struct hdac_hda_pcm pcm[2]; ++ struct hdac_hda_pcm pcm[HDAC_LAST_DAI_ID]; ++ bool need_display_power; + }; + + #define hdac_to_hda_priv(_hdac) \ +-- +2.20.1 + + +From 669fa4378c36f288936e3bdc52dfba7b245ea9fe Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Tue, 29 Oct 2019 15:40:13 +0200 +Subject: [PATCH 046/130] ASoC: SOF: Intel: add support for snd-hda-codec-hdmi + +Add support to implement HDMI/DP audio by using the common +snd-hda-codec-hdmi driver. + +Change of codec driver affects user-space as the two +drivers expose different mixer controls. A new kernel +module option "use_common_hdmi" is added to user-space +to indicate which interface should be used. The default +driver can be selected via a Kconfig option. + +Signed-off-by: Kai Vehmanen +Reviewed-by: Takashi Iwai +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191029134017.18901-6-kai.vehmanen@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 139c7febad1afa221c687f3314560284e482a1f4) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/Kconfig | 10 ++++++++++ + sound/soc/sof/intel/hda-codec.c | 22 ++++++++++++++++++---- + sound/soc/sof/intel/hda.c | 6 ++++++ + sound/soc/sof/intel/hda.h | 6 ++++-- + 4 files changed, 38 insertions(+), 6 deletions(-) + +diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig +index aac8d5deba3d..95a2d1708dd9 100644 +--- a/sound/soc/sof/intel/Kconfig ++++ b/sound/soc/sof/intel/Kconfig +@@ -299,6 +299,16 @@ config SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1 + Say Y if you want to enable DMI Link L1 + If unsure, select "N". + ++config SND_SOC_SOF_HDA_COMMON_HDMI_CODEC ++ bool "SOF common HDA HDMI codec driver" ++ depends on SND_SOC_SOF_HDA_LINK ++ depends on SND_HDA_CODEC_HDMI ++ help ++ This adds support for HDMI audio by using the common HDA ++ HDMI/DisplayPort codec driver. ++ Say Y if you want to use the common codec driver with SOF. ++ If unsure select "Y". ++ + endif ## SND_SOC_SOF_HDA_COMMON + + config SND_SOC_SOF_HDA_LINK_BASELINE +diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c +index 3ca6795a89ba..827f84a0722e 100644 +--- a/sound/soc/sof/intel/hda-codec.c ++++ b/sound/soc/sof/intel/hda-codec.c +@@ -84,6 +84,8 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address) + { + #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) + struct hdac_hda_priv *hda_priv; ++ struct snd_soc_acpi_mach_params *mach_params = NULL; ++ struct snd_sof_pdata *pdata = sdev->pdata; + #endif + struct hda_bus *hbus = sof_to_hbus(sdev); + struct hdac_device *hdev; +@@ -113,8 +115,19 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address) + if (ret < 0) + return ret; + +- /* use legacy bus only for HDA codecs, idisp uses ext bus */ +- if ((resp & 0xFFFF0000) != IDISP_VID_INTEL) { ++ if (pdata->machine) ++ mach_params = (struct snd_soc_acpi_mach_params *) ++ &pdata->machine->mach_params; ++ ++ if ((resp & 0xFFFF0000) == IDISP_VID_INTEL) ++ hda_priv->need_display_power = true; ++ ++ /* ++ * if common HDMI codec driver is not used, codec load ++ * is skipped here and hdac_hdmi is used instead ++ */ ++ if ((mach_params && mach_params->common_hdmi_codec_drv) || ++ (resp & 0xFFFF0000) != IDISP_VID_INTEL) { + hdev->type = HDA_DEV_LEGACY; + hda_codec_load_module(&hda_priv->codec); + } +@@ -155,7 +168,8 @@ int hda_codec_probe_bus(struct snd_sof_dev *sdev) + } + EXPORT_SYMBOL(hda_codec_probe_bus); + +-#if IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI) ++#if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) || \ ++ IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI) + + void hda_codec_i915_get(struct snd_sof_dev *sdev) + { +@@ -204,6 +218,6 @@ int hda_codec_i915_exit(struct snd_sof_dev *sdev) + } + EXPORT_SYMBOL(hda_codec_i915_exit); + +-#endif /* CONFIG_SND_SOC_HDAC_HDMI */ ++#endif + + MODULE_LICENSE("Dual BSD/GPL"); +diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c +index 103f4273c4d3..7dc0018dc4c3 100644 +--- a/sound/soc/sof/intel/hda.c ++++ b/sound/soc/sof/intel/hda.c +@@ -53,6 +53,11 @@ MODULE_PARM_DESC(use_msi, "SOF HDA use PCI MSI mode"); + static int hda_dmic_num = -1; + module_param_named(dmic_num, hda_dmic_num, int, 0444); + MODULE_PARM_DESC(dmic_num, "SOF HDA DMIC number"); ++ ++static bool hda_codec_use_common_hdmi = ++ IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_COMMON_HDMI_CODEC); ++module_param_named(use_common_hdmi, hda_codec_use_common_hdmi, bool, 0444); ++MODULE_PARM_DESC(use_common_hdmi, "SOF HDA use common HDMI codec driver"); + #endif + + static const struct hda_dsp_msg_code hda_dsp_rom_msg[] = { +@@ -459,6 +464,7 @@ static int hda_init_caps(struct snd_sof_dev *sdev) + &pdata->machine->mach_params; + mach_params->codec_mask = bus->codec_mask; + mach_params->platform = dev_name(sdev->dev); ++ mach_params->common_hdmi_codec_drv = hda_codec_use_common_hdmi; + } + + /* create codec instances */ +diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h +index 8e03d876a0ac..d6ef657b8900 100644 +--- a/sound/soc/sof/intel/hda.h ++++ b/sound/soc/sof/intel/hda.h +@@ -565,7 +565,9 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev); + + #endif /* CONFIG_SND_SOC_SOF_HDA */ + +-#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) && IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI) ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) && \ ++ (IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) || \ ++ IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) + + void hda_codec_i915_get(struct snd_sof_dev *sdev); + void hda_codec_i915_put(struct snd_sof_dev *sdev); +@@ -579,7 +581,7 @@ static inline void hda_codec_i915_put(struct snd_sof_dev *sdev) { } + static inline int hda_codec_i915_init(struct snd_sof_dev *sdev) { return 0; } + static inline int hda_codec_i915_exit(struct snd_sof_dev *sdev) { return 0; } + +-#endif /* CONFIG_SND_SOC_SOF_HDA && CONFIG_SND_SOC_HDAC_HDMI */ ++#endif + + /* + * Trace Control. +-- +2.20.1 + + +From 480f07ccb82555912594c2b6d560fdeb35176b40 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 1 Nov 2019 12:30:35 -0500 +Subject: [PATCH 047/130] ASoC: SOF: Intel: Baytrail: clarify mutual exclusion + with Atom/SST driver + +Some distros select all options blindly, which leads to confusion and +bug reports. Since SOF does not support Baytrail-CR for now, and +UCM/topology files are still being propagated to downstream distros, +make SOF on Baytrail an opt-in option that first require distros to +opt-out of existing defaults. + +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101173045.27099-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit df7257e544faf838c3e7ad6b4e89ffe59e87f5e1) +Bugzilla: 1772498 +--- + sound/soc/intel/Kconfig | 3 +++ + sound/soc/sof/intel/Kconfig | 10 +++++++++- + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig +index 9ad89d56092b..5fd4be74b7ea 100644 +--- a/sound/soc/intel/Kconfig ++++ b/sound/soc/intel/Kconfig +@@ -101,6 +101,9 @@ config SND_SST_ATOM_HIFI2_PLATFORM_ACPI + If you have a Intel Baytrail or Cherrytrail platform with an I2S + codec, then enable this option by saying Y or m. This is a + recommended option ++ This option is mutually exclusive with the SOF support on ++ Baytrail/Cherrytrail. If you want to enable SOF on ++ Baytrail/Cherrytrail, you need to deselect this option first. + + config SND_SOC_INTEL_SKYLAKE + tristate "All Skylake/SST Platforms" +diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig +index 95a2d1708dd9..b6b509151b34 100644 +--- a/sound/soc/sof/intel/Kconfig ++++ b/sound/soc/sof/intel/Kconfig +@@ -62,10 +62,18 @@ if SND_SOC_SOF_INTEL_ACPI + + config SND_SOC_SOF_BAYTRAIL_SUPPORT + bool "SOF support for Baytrail, Braswell and Cherrytrail" ++ depends on SND_SST_ATOM_HIFI2_PLATFORM_ACPI=n + help + This adds support for Sound Open Firmware for Intel(R) platforms + using the Baytrail, Braswell or Cherrytrail processors. +- Say Y if you have such a device. ++ This option is mutually exclusive with the Atom/SST and Baytrail ++ legacy drivers. If you want to enable SOF on Baytrail/Cherrytrail, ++ you need to deselect those options first. ++ SOF does not support Baytrail-CR for now, so this option is not ++ recommended for distros. At some point all legacy drivers will be ++ deprecated but not before all userspace firmware/topology/UCM files ++ are made available to downstream distros. ++ Say Y if you want to enable SOF on Baytrail/Cherrytrail + If unsure select "N". + + config SND_SOC_SOF_BAYTRAIL +-- +2.20.1 + + +From 8a391c34be3b2140c0498675df21523b8246ceb8 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 1 Nov 2019 12:30:36 -0500 +Subject: [PATCH 048/130] ASoC: SOF: Intel: Broadwell: clarify mutual exclusion + with legacy driver + +Some distros select all options blindly, which leads to confusion and +bug reports. SOF does not fully support Broadwell due to firmware +dependencies, the machine drivers can only support one option, and +UCM/topology files are still being propagated to downstream distros, +so make SOF on Broadwell an opt-in option that first require distros +to opt-out of existing defaults. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204237 +Fixes: f35bf70f61d3 ('ASoC: Intel: Make sure BDW based machine drivers build for SOF') +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101173045.27099-3-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit a6955fe0e2309feeab5ec71e4b0dcbe498f4f497) +Bugzilla: 1772498 +--- + sound/soc/intel/Kconfig | 3 +++ + sound/soc/sof/intel/Kconfig | 10 +++++++++- + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig +index 5fd4be74b7ea..658eff2daf4e 100644 +--- a/sound/soc/intel/Kconfig ++++ b/sound/soc/intel/Kconfig +@@ -59,6 +59,9 @@ config SND_SOC_INTEL_HASWELL + If you have a Intel Haswell or Broadwell platform connected to + an I2S codec, then enable this option by saying Y or m. This is + typically used for Chromebooks. This is a recommended option. ++ This option is mutually exclusive with the SOF support on ++ Broadwell. If you want to enable SOF on Broadwell, you need to ++ deselect this option first. + + config SND_SOC_INTEL_BAYTRAIL + tristate "Baytrail (legacy) Platforms" +diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig +index b6b509151b34..0db9e80b7cef 100644 +--- a/sound/soc/sof/intel/Kconfig ++++ b/sound/soc/sof/intel/Kconfig +@@ -85,10 +85,18 @@ config SND_SOC_SOF_BAYTRAIL + + config SND_SOC_SOF_BROADWELL_SUPPORT + bool "SOF support for Broadwell" ++ depends on SND_SOC_INTEL_HASWELL=n + help + This adds support for Sound Open Firmware for Intel(R) platforms + using the Broadwell processors. +- Say Y if you have such a device. ++ This option is mutually exclusive with the Haswell/Broadwell legacy ++ driver. If you want to enable SOF on Broadwell you need to deselect ++ the legacy driver first. ++ SOF does fully support Broadwell yet, so this option is not ++ recommended for distros. At some point all legacy drivers will be ++ deprecated but not before all userspace firmware/topology/UCM files ++ are made available to downstream distros. ++ Say Y if you want to enable SOF on Broadwell + If unsure select "N". + + config SND_SOC_SOF_BROADWELL +-- +2.20.1 + + +From 95761516cf6f36ea1e2e23ca4470c756dc0acda3 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 1 Nov 2019 12:30:38 -0500 +Subject: [PATCH 049/130] ASoC: SOF: Kconfig: add EXPERT dependency for + developer options, clarify help + +Some distros select all possible options, despite existing warnings to +be careful. This leads to e.g. user reports that the HDaudio codec and +DMIC are not handled by SOF. + +Add an explicit menu item to unlock developer options, and make them +dependent on CONFIG_EXPERT. Hopefully with this double-lock these +options will only be selected by developers. + +GitHub issue: https://github.com/thesofproject/sof/issues/1885 +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101173045.27099-5-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 70ae4eb540af32ee6a6260143ccae6054ebd433f) +Bugzilla: 1772498 +--- + sound/soc/sof/Kconfig | 25 ++++++++++++++++--------- + 1 file changed, 16 insertions(+), 9 deletions(-) + +diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig +index 56a3ab66b46b..6435eb531668 100644 +--- a/sound/soc/sof/Kconfig ++++ b/sound/soc/sof/Kconfig +@@ -14,7 +14,6 @@ config SND_SOC_SOF_PCI + depends on PCI + select SND_SOC_SOF + select SND_SOC_ACPI if ACPI +- select SND_SOC_SOF_OPTIONS + select SND_SOC_SOF_INTEL_PCI if SND_SOC_SOF_INTEL_TOPLEVEL + help + This adds support for PCI enumeration. This option is +@@ -27,7 +26,6 @@ config SND_SOC_SOF_ACPI + depends on ACPI || COMPILE_TEST + select SND_SOC_SOF + select SND_SOC_ACPI if ACPI +- select SND_SOC_SOF_OPTIONS + select SND_SOC_SOF_INTEL_ACPI if SND_SOC_SOF_INTEL_TOPLEVEL + select IOSF_MBI if X86 && PCI + help +@@ -40,19 +38,23 @@ config SND_SOC_SOF_OF + tristate "SOF OF enumeration support" + depends on OF || COMPILE_TEST + select SND_SOC_SOF +- select SND_SOC_SOF_OPTIONS + help + This adds support for Device Tree enumeration. This option is + required to enable i.MX8 devices. + Say Y if you need this option. If unsure select "N". + +-config SND_SOC_SOF_OPTIONS +- tristate ++config SND_SOC_SOF_DEVELOPER_SUPPORT ++ bool "SOF developer options support" ++ depends on EXPERT + help +- This option is not user-selectable but automagically handled by +- 'select' statements at a higher level ++ This option unlock SOF developer options for debug/performance/ ++ code hardening. ++ Distributions should not select this option, only SOF development ++ teams should select it. ++ Say Y if you are involved in SOF development and need this option ++ If not, select N + +-if SND_SOC_SOF_OPTIONS ++if SND_SOC_SOF_DEVELOPER_SUPPORT + + config SND_SOC_SOF_NOCODEC + tristate +@@ -64,6 +66,11 @@ config SND_SOC_SOF_NOCODEC_SUPPORT + option if no known codec is detected. This is typically only + enabled for developers or devices where the sound card is + controlled externally ++ This option is mutually exclusive with the Intel HDaudio support, ++ selecting it may have negative impacts and prevent e.g. microphone ++ functionality from being enabled on Intel CoffeeLake and later ++ platforms. ++ Distributions should not select this option! + Say Y if you need this nocodec fallback option + If unsure select "N". + +@@ -168,7 +175,7 @@ config SND_SOC_SOF_DEBUG_RETAIN_DSP_CONTEXT + + endif ## SND_SOC_SOF_DEBUG + +-endif ## SND_SOC_SOF_OPTIONS ++endif ## SND_SOC_SOF_DEVELOPER_SUPPORT + + config SND_SOC_SOF + tristate +-- +2.20.1 + + +From 34edfaf5c61574b5156daeb173476650be7b87a0 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 1 Nov 2019 12:30:39 -0500 +Subject: [PATCH 050/130] ASoC: SOF: imx: fix reverse CONFIG_SND_SOC_SOF_OF + dependency + +updated solution to the problem reported with randconfig: + +CONFIG_SND_SOC_SOF_IMX depends on CONFIG_SND_SOC_SOF, but is in +turn referenced by the sof-of-dev driver. This creates a reverse +dependency that manifests in a link error when CONFIG_SND_SOC_SOF_OF +is built-in but CONFIG_SND_SOC_SOF_IMX=m: + +sound/soc/sof/sof-of-dev.o:(.data+0x118): undefined reference to `sof_imx8_ops' + +use def_trisate to propagate the right settings without select. + +Fixes: f4df4e4042b0 ("ASoC: SOF: imx8: Fix COMPILE_TEST error") +Fixes: 202acc565a1f ("ASoC: SOF: imx: Add i.MX8 HW support") +Suggested-by: Arnd Bergmann +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101173045.27099-6-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit f9ad75468453b019b92c5296e6a04bf7c37f49e4) +Bugzilla: 1772498 +--- + sound/soc/sof/imx/Kconfig | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/sof/imx/Kconfig b/sound/soc/sof/imx/Kconfig +index 5acae75f5750..71f318bc2c74 100644 +--- a/sound/soc/sof/imx/Kconfig ++++ b/sound/soc/sof/imx/Kconfig +@@ -11,8 +11,8 @@ config SND_SOC_SOF_IMX_TOPLEVEL + + if SND_SOC_SOF_IMX_TOPLEVEL + +-config SND_SOC_SOF_IMX8 +- tristate "SOF support for i.MX8" ++config SND_SOC_SOF_IMX8_SUPPORT ++ bool "SOF support for i.MX8" + depends on IMX_SCU + depends on IMX_DSP + help +@@ -20,4 +20,8 @@ config SND_SOC_SOF_IMX8 + Say Y if you have such a device. + If unsure select "N". + ++config SND_SOC_SOF_IMX8 ++ def_tristate SND_SOC_SOF_OF ++ depends on SND_SOC_SOF_IMX8_SUPPORT ++ + endif ## SND_SOC_SOF_IMX_IMX_TOPLEVEL +-- +2.20.1 + + +From 5efd9ba11e644ef74a0c51d543145f116a886438 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 1 Nov 2019 12:30:40 -0500 +Subject: [PATCH 051/130] ASoC: SOF: Intel: use def_tristate, avoid using + select + +So far we used select to use the relevant built-in/module options, but +this led to blurring layers between core and Intel Kconfigs. + +Use def_tristate works just as well and removes Intel stuff from the code. + +Suggested-by: Arnd Bergmann +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101173045.27099-7-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit b000135e5f272118e576e9720590e5979f0abe49) +Bugzilla: 1772498 +--- + sound/soc/sof/Kconfig | 2 -- + sound/soc/sof/intel/Kconfig | 4 ++-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig +index 6435eb531668..71a0fc075a63 100644 +--- a/sound/soc/sof/Kconfig ++++ b/sound/soc/sof/Kconfig +@@ -14,7 +14,6 @@ config SND_SOC_SOF_PCI + depends on PCI + select SND_SOC_SOF + select SND_SOC_ACPI if ACPI +- select SND_SOC_SOF_INTEL_PCI if SND_SOC_SOF_INTEL_TOPLEVEL + help + This adds support for PCI enumeration. This option is + required to enable Intel Skylake+ devices +@@ -26,7 +25,6 @@ config SND_SOC_SOF_ACPI + depends on ACPI || COMPILE_TEST + select SND_SOC_SOF + select SND_SOC_ACPI if ACPI +- select SND_SOC_SOF_INTEL_ACPI if SND_SOC_SOF_INTEL_TOPLEVEL + select IOSF_MBI if X86 && PCI + help + This adds support for ACPI enumeration. This option is required +diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig +index 0db9e80b7cef..f7c30a08ffbf 100644 +--- a/sound/soc/sof/intel/Kconfig ++++ b/sound/soc/sof/intel/Kconfig +@@ -10,7 +10,7 @@ config SND_SOC_SOF_INTEL_TOPLEVEL + if SND_SOC_SOF_INTEL_TOPLEVEL + + config SND_SOC_SOF_INTEL_ACPI +- tristate ++ def_tristate SND_SOC_SOF_ACPI + select SND_SOC_SOF_BAYTRAIL if SND_SOC_SOF_BAYTRAIL_SUPPORT + select SND_SOC_SOF_BROADWELL if SND_SOC_SOF_BROADWELL_SUPPORT + help +@@ -18,7 +18,7 @@ config SND_SOC_SOF_INTEL_ACPI + 'select' statements at a higher level + + config SND_SOC_SOF_INTEL_PCI +- tristate ++ def_tristate SND_SOC_SOF_PCI + select SND_SOC_SOF_MERRIFIELD if SND_SOC_SOF_MERRIFIELD_SUPPORT + select SND_SOC_SOF_APOLLOLAKE if SND_SOC_SOF_APOLLOLAKE_SUPPORT + select SND_SOC_SOF_GEMINILAKE if SND_SOC_SOF_GEMINILAKE_SUPPORT +-- +2.20.1 + + +From 19b52530d84901fdfb1924862f3f82458ad110bc Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Fri, 4 Oct 2019 16:49:31 +0200 +Subject: [PATCH 052/130] sound: Fix Kconfig indentation + +Adjust indentation from spaces to tab (+optional two spaces) as in +coding style with command like: + $ sed -e 's/^ /\t/' -i */Kconfig + +Signed-off-by: Krzysztof Kozlowski +Acked-by: Mark Brown +Link: https://lore.kernel.org/r/20191004144931.3851-1-krzk@kernel.org +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 82e8d723e9e6698572098bf2976223d5069b34b5) +Bugzilla: 1772498 +--- + sound/core/Kconfig | 28 ++++++++++---------- + sound/drivers/Kconfig | 20 +++++++------- + sound/firewire/Kconfig | 6 ++--- + sound/isa/Kconfig | 18 ++++++------- + sound/mips/Kconfig | 12 ++++----- + sound/pci/Kconfig | 2 +- + sound/soc/cirrus/Kconfig | 14 +++++----- + sound/soc/codecs/Kconfig | 32 +++++++++++------------ + sound/soc/intel/Kconfig | 2 +- + sound/soc/intel/boards/Kconfig | 48 +++++++++++++++++----------------- + sound/soc/pxa/Kconfig | 16 ++++++------ + sound/soc/qcom/Kconfig | 20 +++++++------- + sound/soc/samsung/Kconfig | 8 +++--- + sound/soc/sof/imx/Kconfig | 12 ++++----- + sound/soc/sof/intel/Kconfig | 22 ++++++++-------- + sound/soc/xilinx/Kconfig | 20 +++++++------- + sound/soc/zte/Kconfig | 12 ++++----- + sound/usb/Kconfig | 32 +++++++++++------------ + 18 files changed, 162 insertions(+), 162 deletions(-) + +diff --git a/sound/core/Kconfig b/sound/core/Kconfig +index 4ee79ad6ae22..4044c42d8595 100644 +--- a/sound/core/Kconfig ++++ b/sound/core/Kconfig +@@ -72,11 +72,11 @@ config SND_PCM_OSS + config SND_PCM_OSS_PLUGINS + bool "OSS PCM (digital audio) API - Include plugin system" + depends on SND_PCM_OSS +- default y ++ default y + help +- If you disable this option, the ALSA's OSS PCM API will not +- support conversion of channels, formats and rates. It will +- behave like most of new OSS/Free drivers in 2.4/2.6 kernels. ++ If you disable this option, the ALSA's OSS PCM API will not ++ support conversion of channels, formats and rates. It will ++ behave like most of new OSS/Free drivers in 2.4/2.6 kernels. + + config SND_PCM_TIMER + bool "PCM timer interface" if EXPERT +@@ -128,13 +128,13 @@ config SND_SUPPORT_OLD_API + or older). + + config SND_PROC_FS +- bool "Sound Proc FS Support" if EXPERT +- depends on PROC_FS +- default y +- help +- Say 'N' to disable Sound proc FS, which may reduce code size about +- 9KB on x86_64 platform. +- If unsure say Y. ++ bool "Sound Proc FS Support" if EXPERT ++ depends on PROC_FS ++ default y ++ help ++ Say 'N' to disable Sound proc FS, which may reduce code size about ++ 9KB on x86_64 platform. ++ If unsure say Y. + + config SND_VERBOSE_PROCFS + bool "Verbose procfs contents" +@@ -142,8 +142,8 @@ config SND_VERBOSE_PROCFS + default y + help + Say Y here to include code for verbose procfs contents (provides +- useful information to developers when a problem occurs). On the +- other side, it makes the ALSA subsystem larger. ++ useful information to developers when a problem occurs). On the ++ other side, it makes the ALSA subsystem larger. + + config SND_VERBOSE_PRINTK + bool "Verbose printk" +@@ -164,7 +164,7 @@ config SND_DEBUG_VERBOSE + depends on SND_DEBUG + help + Say Y here to enable extra-verbose debugging messages. +- ++ + Let me repeat: it enables EXTRA-VERBOSE DEBUGGING messages. + So, say Y only if you are ready to be annoyed. + +diff --git a/sound/drivers/Kconfig b/sound/drivers/Kconfig +index 09932cc98e9d..15d6d46acf9c 100644 +--- a/sound/drivers/Kconfig ++++ b/sound/drivers/Kconfig +@@ -1,7 +1,7 @@ + # SPDX-License-Identifier: GPL-2.0-only + config SND_MPU401_UART +- tristate +- select SND_RAWMIDI ++ tristate ++ select SND_RAWMIDI + + config SND_OPL3_LIB + tristate +@@ -90,16 +90,16 @@ config SND_DUMMY + will be called snd-dummy. + + config SND_ALOOP +- tristate "Generic loopback driver (PCM)" +- select SND_PCM +- help +- Say 'Y' or 'M' to include support for the PCM loopback device. ++ tristate "Generic loopback driver (PCM)" ++ select SND_PCM ++ help ++ Say 'Y' or 'M' to include support for the PCM loopback device. + This module returns played samples back to the user space using + the standard ALSA PCM device. The devices are routed 0->1 and +- 1->0, where first number is the playback PCM device and second ++ 1->0, where first number is the playback PCM device and second + number is the capture device. Module creates two PCM devices and + configured number of substreams (see the pcm_substreams module +- parameter). ++ parameter). + + The loopback device allows time sychronization with an external + timing source using the time shift universal control (+-20% +@@ -142,12 +142,12 @@ config SND_MTS64 + select SND_RAWMIDI + help + The ESI Miditerminal 4140 is a 4 In 4 Out MIDI Interface with +- additional SMPTE Timecode capabilities for the parallel port. ++ additional SMPTE Timecode capabilities for the parallel port. + + Say 'Y' to include support for this device. + + To compile this driver as a module, chose 'M' here: the module +- will be called snd-mts64. ++ will be called snd-mts64. + + config SND_SERIAL_U16550 + tristate "UART16550 serial MIDI driver" +diff --git a/sound/firewire/Kconfig b/sound/firewire/Kconfig +index b0a904cdb932..995c2cefc222 100644 +--- a/sound/firewire/Kconfig ++++ b/sound/firewire/Kconfig +@@ -77,7 +77,7 @@ config SND_BEBOB + tristate "BridgeCo DM1000/DM1100/DM1500 with BeBoB firmware" + select SND_FIREWIRE_LIB + select SND_HWDEP +- help ++ help + Say Y here to include support for FireWire devices based + on BridgeCo DM1000/DM1100/DM1500 with BeBoB firmware: + * Edirol FA-66/FA-101 +@@ -111,8 +111,8 @@ config SND_BEBOB + * M-Audio FireWire 1814/ProjectMix IO + * Digidesign Mbox 2 Pro + +- To compile this driver as a module, choose M here: the module +- will be called snd-bebob. ++ To compile this driver as a module, choose M here: the module ++ will be called snd-bebob. + + config SND_FIREWIRE_DIGI00X + tristate "Digidesign Digi 002/003 family support" +diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig +index b690ed937cbe..6ffa48dd5983 100644 +--- a/sound/isa/Kconfig ++++ b/sound/isa/Kconfig +@@ -2,22 +2,22 @@ + # ALSA ISA drivers + + config SND_WSS_LIB +- tristate +- select SND_PCM ++ tristate ++ select SND_PCM + select SND_TIMER + + config SND_SB_COMMON +- tristate ++ tristate + + config SND_SB8_DSP +- tristate +- select SND_PCM +- select SND_SB_COMMON ++ tristate ++ select SND_PCM ++ select SND_SB_COMMON + + config SND_SB16_DSP +- tristate +- select SND_PCM +- select SND_SB_COMMON ++ tristate ++ select SND_PCM ++ select SND_SB_COMMON + + menuconfig SND_ISA + bool "ISA sound devices" +diff --git a/sound/mips/Kconfig b/sound/mips/Kconfig +index 8a33402fd415..b497b803c834 100644 +--- a/sound/mips/Kconfig ++++ b/sound/mips/Kconfig +@@ -14,15 +14,15 @@ config SND_SGI_O2 + tristate "SGI O2 Audio" + depends on SGI_IP32 + select SND_PCM +- help +- Sound support for the SGI O2 Workstation. ++ help ++ Sound support for the SGI O2 Workstation. + + config SND_SGI_HAL2 +- tristate "SGI HAL2 Audio" +- depends on SGI_HAS_HAL2 ++ tristate "SGI HAL2 Audio" ++ depends on SGI_HAS_HAL2 + select SND_PCM +- help +- Sound support for the SGI Indy and Indigo2 Workstation. ++ help ++ Sound support for the SGI Indy and Indigo2 Workstation. + + endif # SND_MIPS + +diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig +index 7630f808d087..93bc9bef7641 100644 +--- a/sound/pci/Kconfig ++++ b/sound/pci/Kconfig +@@ -217,7 +217,7 @@ config SND_CMIPCI + will be called snd-cmipci. + + config SND_OXYGEN_LIB +- tristate ++ tristate + + config SND_OXYGEN + tristate "C-Media 8786, 8787, 8788 (Oxygen)" +diff --git a/sound/soc/cirrus/Kconfig b/sound/soc/cirrus/Kconfig +index 2333efac758a..8039a8febefa 100644 +--- a/sound/soc/cirrus/Kconfig ++++ b/sound/soc/cirrus/Kconfig +@@ -33,13 +33,13 @@ config SND_EP93XX_SOC_AC97 + select SND_SOC_AC97_BUS + + config SND_EP93XX_SOC_SNAPPERCL15 +- tristate "SoC Audio support for Bluewater Systems Snapper CL15 module" +- depends on SND_EP93XX_SOC && MACH_SNAPPER_CL15 && I2C +- select SND_EP93XX_SOC_I2S +- select SND_SOC_TLV320AIC23_I2C +- help +- Say Y or M here if you want to add support for I2S audio on the +- Bluewater Systems Snapper CL15 module. ++ tristate "SoC Audio support for Bluewater Systems Snapper CL15 module" ++ depends on SND_EP93XX_SOC && MACH_SNAPPER_CL15 && I2C ++ select SND_EP93XX_SOC_I2S ++ select SND_SOC_TLV320AIC23_I2C ++ help ++ Say Y or M here if you want to add support for I2S audio on the ++ Bluewater Systems Snapper CL15 module. + + config SND_EP93XX_SOC_SIMONE + tristate "SoC Audio support for Simplemachines Sim.One board" +diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig +index 229cc89f8c5a..ef9d73b89623 100644 +--- a/sound/soc/codecs/Kconfig ++++ b/sound/soc/codecs/Kconfig +@@ -257,16 +257,16 @@ config SND_SOC_ALL_CODECS + select SND_SOC_WM9705 if (SND_SOC_AC97_BUS || SND_SOC_AC97_BUS_NEW) + select SND_SOC_WM9712 if (SND_SOC_AC97_BUS || SND_SOC_AC97_BUS_NEW) + select SND_SOC_WM9713 if (SND_SOC_AC97_BUS || SND_SOC_AC97_BUS_NEW) +- help +- Normally ASoC codec drivers are only built if a machine driver which +- uses them is also built since they are only usable with a machine +- driver. Selecting this option will allow these drivers to be built +- without an explicit machine driver for test and development purposes. ++ help ++ Normally ASoC codec drivers are only built if a machine driver which ++ uses them is also built since they are only usable with a machine ++ driver. Selecting this option will allow these drivers to be built ++ without an explicit machine driver for test and development purposes. + + Support for the bus types used to access the codecs to be built must + be selected separately. + +- If unsure select "N". ++ If unsure select "N". + + config SND_SOC_88PM860X + tristate +@@ -570,8 +570,8 @@ config SND_SOC_CS42XX8_I2C + + # Cirrus Logic CS43130 HiFi DAC + config SND_SOC_CS43130 +- tristate "Cirrus Logic CS43130 CODEC" +- depends on I2C ++ tristate "Cirrus Logic CS43130 CODEC" ++ depends on I2C + + config SND_SOC_CS4341 + tristate "Cirrus Logic CS4341 CODEC" +@@ -643,19 +643,19 @@ config SND_SOC_L3 + tristate + + config SND_SOC_DA7210 +- tristate ++ tristate + + config SND_SOC_DA7213 +- tristate ++ tristate + + config SND_SOC_DA7218 + tristate + + config SND_SOC_DA7219 +- tristate ++ tristate + + config SND_SOC_DA732X +- tristate ++ tristate + + config SND_SOC_DA9055 + tristate +@@ -717,7 +717,7 @@ config SND_SOC_INNO_RK3036 + select REGMAP_MMIO + + config SND_SOC_ISABELLE +- tristate ++ tristate + + config SND_SOC_LM49453 + tristate +@@ -988,7 +988,7 @@ config SND_SOC_RT5640 + tristate + + config SND_SOC_RT5645 +- tristate ++ tristate + + config SND_SOC_RT5651 + tristate +@@ -1220,7 +1220,7 @@ config SND_SOC_UDA134X + tristate + + config SND_SOC_UDA1380 +- tristate ++ tristate + depends on I2C + + config SND_SOC_WCD9335 +@@ -1348,7 +1348,7 @@ config SND_SOC_WM8904 + depends on I2C + + config SND_SOC_WM8940 +- tristate ++ tristate + + config SND_SOC_WM8955 + tristate +diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig +index 658eff2daf4e..7e9feca333b7 100644 +--- a/sound/soc/intel/Kconfig ++++ b/sound/soc/intel/Kconfig +@@ -119,7 +119,7 @@ config SND_SOC_INTEL_SKYLAKE + select SND_SOC_INTEL_CNL + select SND_SOC_INTEL_CFL + help +- This is a backwards-compatible option to select all devices ++ This is a backwards-compatible option to select all devices + supported by the Intel SST/Skylake driver. This option is no + longer recommended and will be deprecated when the SOF + driver is introduced. Distributions should explicitly +diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig +index 5c27f7ab4a5f..882ff36a7c9c 100644 +--- a/sound/soc/intel/boards/Kconfig ++++ b/sound/soc/intel/boards/Kconfig +@@ -3,13 +3,13 @@ menuconfig SND_SOC_INTEL_MACH + bool "Intel Machine drivers" + depends on SND_SOC_INTEL_SST_TOPLEVEL || SND_SOC_SOF_INTEL_TOPLEVEL + help +- Intel ASoC Machine Drivers. If you have a Intel machine that +- has an audio controller with a DSP and I2S or DMIC port, then +- enable this option by saying Y ++ Intel ASoC Machine Drivers. If you have a Intel machine that ++ has an audio controller with a DSP and I2S or DMIC port, then ++ enable this option by saying Y + +- Note that the answer to this question doesn't directly affect the +- kernel: saying N will just cause the configurator to skip all +- the questions about Intel ASoC machine drivers. ++ Note that the answer to this question doesn't directly affect the ++ kernel: saying N will just cause the configurator to skip all ++ the questions about Intel ASoC machine drivers. + + if SND_SOC_INTEL_MACH + +@@ -114,11 +114,11 @@ config SND_SOC_INTEL_CHT_BSW_RT5672_MACH + depends on X86_INTEL_LPSS || COMPILE_TEST + select SND_SOC_ACPI + select SND_SOC_RT5670 +- help +- This adds support for ASoC machine driver for Intel(R) Cherrytrail & Braswell +- platforms with RT5672 audio codec. +- Say Y or m if you have such a device. This is a recommended option. +- If unsure select "N". ++ help ++ This adds support for ASoC machine driver for Intel(R) Cherrytrail & Braswell ++ platforms with RT5672 audio codec. ++ Say Y or m if you have such a device. This is a recommended option. ++ If unsure select "N". + + config SND_SOC_INTEL_CHT_BSW_RT5645_MACH + tristate "Cherrytrail & Braswell with RT5645/5650 codec" +@@ -311,20 +311,20 @@ config SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH + If unsure select "N". + + config SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH +- tristate "KBL with RT5663, RT5514 and MAX98927 in I2S Mode" ++ tristate "KBL with RT5663, RT5514 and MAX98927 in I2S Mode" + depends on I2C && ACPI + depends on MFD_INTEL_LPSS || COMPILE_TEST +- depends on SPI +- select SND_SOC_RT5663 +- select SND_SOC_RT5514 +- select SND_SOC_RT5514_SPI +- select SND_SOC_MAX98927 +- select SND_SOC_HDAC_HDMI +- help +- This adds support for ASoC Onboard Codec I2S machine driver. This will +- create an alsa sound card for RT5663 + RT5514 + MAX98927. +- Say Y or m if you have such a device. This is a recommended option. +- If unsure select "N". ++ depends on SPI ++ select SND_SOC_RT5663 ++ select SND_SOC_RT5514 ++ select SND_SOC_RT5514_SPI ++ select SND_SOC_MAX98927 ++ select SND_SOC_HDAC_HDMI ++ help ++ This adds support for ASoC Onboard Codec I2S machine driver. This will ++ create an alsa sound card for RT5663 + RT5514 + MAX98927. ++ Say Y or m if you have such a device. This is a recommended option. ++ If unsure select "N". + + config SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH + tristate "KBL with DA7219 and MAX98357A in I2S Mode" +@@ -393,7 +393,7 @@ config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH + help + This adds support for ASoC machine driver for Intel platforms + SKL/KBL/BXT/APL with iDisp, HDA audio codecs. +- Say Y or m if you have such a device. This is a recommended option. ++ Say Y or m if you have such a device. This is a recommended option. + If unsure select "N". + + endif ## SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC || SND_SOC_SOF_HDA_AUDIO_CODEC +diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig +index 213d4dab0346..295cfffa4646 100644 +--- a/sound/soc/pxa/Kconfig ++++ b/sound/soc/pxa/Kconfig +@@ -190,14 +190,14 @@ config SND_PXA2XX_SOC_MAGICIAN + HTC Magician. + + config SND_PXA2XX_SOC_MIOA701 +- tristate "SoC Audio support for MIO A701" +- depends on SND_PXA2XX_SOC && MACH_MIOA701 ++ tristate "SoC Audio support for MIO A701" ++ depends on SND_PXA2XX_SOC && MACH_MIOA701 + depends on AC97_BUS=n +- select SND_PXA2XX_SOC_AC97 +- select SND_SOC_WM9713 +- help +- Say Y if you want to add support for SoC audio on the +- MIO A701. ++ select SND_PXA2XX_SOC_AC97 ++ select SND_SOC_WM9713 ++ help ++ Say Y if you want to add support for SoC audio on the ++ MIO A701. + + config SND_PXA2XX_SOC_IMOTE2 + tristate "SoC Audio support for IMote 2" +@@ -205,7 +205,7 @@ config SND_PXA2XX_SOC_IMOTE2 + select SND_PXA2XX_SOC_I2S + select SND_SOC_WM8940 + help +- Say Y if you want to add support for SoC audio on the ++ Say Y if you want to add support for SoC audio on the + IMote 2. + + config SND_MMP_SOC_BROWNSTONE +diff --git a/sound/soc/qcom/Kconfig b/sound/soc/qcom/Kconfig +index 60086858e920..6530d2462a9e 100644 +--- a/sound/soc/qcom/Kconfig ++++ b/sound/soc/qcom/Kconfig +@@ -3,8 +3,8 @@ config SND_SOC_QCOM + tristate "ASoC support for QCOM platforms" + depends on ARCH_QCOM || COMPILE_TEST + help +- Say Y or M if you want to add support to use audio devices +- in Qualcomm Technologies SOC-based platforms. ++ Say Y or M if you want to add support to use audio devices ++ in Qualcomm Technologies SOC-based platforms. + + config SND_SOC_LPASS_CPU + tristate +@@ -30,17 +30,17 @@ config SND_SOC_STORM + select SND_SOC_LPASS_IPQ806X + select SND_SOC_MAX98357A + help +- Say Y or M if you want add support for SoC audio on the +- Qualcomm Technologies IPQ806X-based Storm board. ++ Say Y or M if you want add support for SoC audio on the ++ Qualcomm Technologies IPQ806X-based Storm board. + + config SND_SOC_APQ8016_SBC + tristate "SoC Audio support for APQ8016 SBC platforms" + depends on SND_SOC_QCOM + select SND_SOC_LPASS_APQ8016 + help +- Support for Qualcomm Technologies LPASS audio block in +- APQ8016 SOC-based systems. +- Say Y if you want to use audio devices on MI2S. ++ Support for Qualcomm Technologies LPASS audio block in ++ APQ8016 SOC-based systems. ++ Say Y if you want to use audio devices on MI2S. + + config SND_SOC_QCOM_COMMON + tristate +@@ -93,9 +93,9 @@ config SND_SOC_MSM8996 + select SND_SOC_QDSP6 + select SND_SOC_QCOM_COMMON + help +- Support for Qualcomm Technologies LPASS audio block in +- APQ8096 SoC-based systems. +- Say Y if you want to use audio device on this SoCs ++ Support for Qualcomm Technologies LPASS audio block in ++ APQ8096 SoC-based systems. ++ Say Y if you want to use audio device on this SoCs + + config SND_SOC_SDM845 + tristate "SoC Machine driver for SDM845 boards" +diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig +index 638983123d8f..9304177de78a 100644 +--- a/sound/soc/samsung/Kconfig ++++ b/sound/soc/samsung/Kconfig +@@ -195,10 +195,10 @@ config SND_SOC_ODROID + Say Y here to enable audio support for the Odroid XU3/XU4. + + config SND_SOC_ARNDALE_RT5631_ALC5631 +- tristate "Audio support for RT5631(ALC5631) on Arndale Board" +- depends on I2C +- select SND_SAMSUNG_I2S +- select SND_SOC_RT5631 ++ tristate "Audio support for RT5631(ALC5631) on Arndale Board" ++ depends on I2C ++ select SND_SAMSUNG_I2S ++ select SND_SOC_RT5631 + + config SND_SOC_SAMSUNG_TM2_WM5110 + tristate "SoC I2S Audio support for WM5110 on TM2 board" +diff --git a/sound/soc/sof/imx/Kconfig b/sound/soc/sof/imx/Kconfig +index 71f318bc2c74..bae4f7bf5f75 100644 +--- a/sound/soc/sof/imx/Kconfig ++++ b/sound/soc/sof/imx/Kconfig +@@ -5,9 +5,9 @@ config SND_SOC_SOF_IMX_TOPLEVEL + depends on ARM64|| COMPILE_TEST + depends on SND_SOC_SOF_OF + help +- This adds support for Sound Open Firmware for NXP i.MX platforms. +- Say Y if you have such a device. +- If unsure select "N". ++ This adds support for Sound Open Firmware for NXP i.MX platforms. ++ Say Y if you have such a device. ++ If unsure select "N". + + if SND_SOC_SOF_IMX_TOPLEVEL + +@@ -16,9 +16,9 @@ config SND_SOC_SOF_IMX8_SUPPORT + depends on IMX_SCU + depends on IMX_DSP + help +- This adds support for Sound Open Firmware for NXP i.MX8 platforms +- Say Y if you have such a device. +- If unsure select "N". ++ This adds support for Sound Open Firmware for NXP i.MX8 platforms ++ Say Y if you have such a device. ++ If unsure select "N". + + config SND_SOC_SOF_IMX8 + def_tristate SND_SOC_SOF_OF +diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig +index f7c30a08ffbf..b27fd3fdf335 100644 +--- a/sound/soc/sof/intel/Kconfig ++++ b/sound/soc/sof/intel/Kconfig +@@ -37,7 +37,7 @@ config SND_SOC_SOF_INTEL_PCI + config SND_SOC_SOF_INTEL_HIFI_EP_IPC + tristate + help +- This option is not user-selectable but automagically handled by ++ This option is not user-selectable but automagically handled by + 'select' statements at a higher level + + config SND_SOC_SOF_INTEL_ATOM_HIFI_EP +@@ -234,31 +234,31 @@ config SND_SOC_SOF_COMETLAKE_H_SUPPORT + config SND_SOC_SOF_TIGERLAKE_SUPPORT + bool "SOF support for Tigerlake" + help +- This adds support for Sound Open Firmware for Intel(R) platforms +- using the Tigerlake processors. +- Say Y if you have such a device. +- If unsure select "N". ++ This adds support for Sound Open Firmware for Intel(R) platforms ++ using the Tigerlake processors. ++ Say Y if you have such a device. ++ If unsure select "N". + + config SND_SOC_SOF_TIGERLAKE + tristate + select SND_SOC_SOF_HDA_COMMON + help +- This option is not user-selectable but automagically handled by ++ This option is not user-selectable but automagically handled by + 'select' statements at a higher level + + config SND_SOC_SOF_ELKHARTLAKE_SUPPORT + bool "SOF support for ElkhartLake" + help +- This adds support for Sound Open Firmware for Intel(R) platforms +- using the ElkhartLake processors. +- Say Y if you have such a device. +- If unsure select "N". ++ This adds support for Sound Open Firmware for Intel(R) platforms ++ using the ElkhartLake processors. ++ Say Y if you have such a device. ++ If unsure select "N". + + config SND_SOC_SOF_ELKHARTLAKE + tristate + select SND_SOC_SOF_HDA_COMMON + help +- This option is not user-selectable but automagically handled by ++ This option is not user-selectable but automagically handled by + 'select' statements at a higher level + + config SND_SOC_SOF_JASPERLAKE_SUPPORT +diff --git a/sound/soc/xilinx/Kconfig b/sound/soc/xilinx/Kconfig +index 69973179ef15..1d3586b68db7 100644 +--- a/sound/soc/xilinx/Kconfig ++++ b/sound/soc/xilinx/Kconfig +@@ -9,15 +9,15 @@ config SND_SOC_XILINX_I2S + encapsulates PCM in AES format and sends AES data. + + config SND_SOC_XILINX_AUDIO_FORMATTER +- tristate "Audio support for the the Xilinx audio formatter" +- help +- Select this option to enable Xilinx audio formatter +- support. This provides DMA platform device support for +- audio functionality. ++ tristate "Audio support for the the Xilinx audio formatter" ++ help ++ Select this option to enable Xilinx audio formatter ++ support. This provides DMA platform device support for ++ audio functionality. + + config SND_SOC_XILINX_SPDIF +- tristate "Audio support for the the Xilinx SPDIF" +- help +- Select this option to enable Xilinx SPDIF Audio. +- This provides playback and capture of SPDIF audio in +- AES format. ++ tristate "Audio support for the the Xilinx SPDIF" ++ help ++ Select this option to enable Xilinx SPDIF Audio. ++ This provides playback and capture of SPDIF audio in ++ AES format. +diff --git a/sound/soc/zte/Kconfig b/sound/soc/zte/Kconfig +index a7842e4b791c..a23d4f13ca19 100644 +--- a/sound/soc/zte/Kconfig ++++ b/sound/soc/zte/Kconfig +@@ -18,9 +18,9 @@ config ZX_I2S + ZTE ZX I2S interface + + config ZX_TDM +- tristate "ZTE ZX TDM Driver Support" +- depends on COMMON_CLK +- select SND_SOC_GENERIC_DMAENGINE_PCM +- help +- Say Y or M if you want to add support for codecs attached to the +- ZTE ZX TDM interface ++ tristate "ZTE ZX TDM Driver Support" ++ depends on COMMON_CLK ++ select SND_SOC_GENERIC_DMAENGINE_PCM ++ help ++ Say Y or M if you want to add support for codecs attached to the ++ ZTE ZX TDM interface +diff --git a/sound/usb/Kconfig b/sound/usb/Kconfig +index e2c53a0841da..059242f15d75 100644 +--- a/sound/usb/Kconfig ++++ b/sound/usb/Kconfig +@@ -107,24 +107,24 @@ config SND_USB_US122L + will be called snd-usb-us122l. + + config SND_USB_6FIRE +- tristate "TerraTec DMX 6Fire USB" +- select FW_LOADER +- select BITREVERSE +- select SND_RAWMIDI +- select SND_PCM +- select SND_VMASTER +- help +- Say Y here to include support for TerraTec 6fire DMX USB interface. +- +- You will need firmware files in order to be able to use the device +- after it has been coldstarted. An install script for the firmware +- and further help can be found at +- http://sixfireusb.sourceforge.net ++ tristate "TerraTec DMX 6Fire USB" ++ select FW_LOADER ++ select BITREVERSE ++ select SND_RAWMIDI ++ select SND_PCM ++ select SND_VMASTER ++ help ++ Say Y here to include support for TerraTec 6fire DMX USB interface. ++ ++ You will need firmware files in order to be able to use the device ++ after it has been coldstarted. An install script for the firmware ++ and further help can be found at ++ http://sixfireusb.sourceforge.net + + config SND_USB_HIFACE +- tristate "M2Tech hiFace USB-SPDIF driver" +- select SND_PCM +- help ++ tristate "M2Tech hiFace USB-SPDIF driver" ++ select SND_PCM ++ help + Select this option to include support for M2Tech hiFace USB-SPDIF + interface. + +-- +2.20.1 + + +From d04677b943723aa40149b14f28e02a51cdf68080 Mon Sep 17 00:00:00 2001 +From: Sam McNally +Date: Tue, 17 Sep 2019 15:49:33 +1000 +Subject: [PATCH 053/130] ASoC: Intel: cht_bsw_rt5645: Add quirk for boards + using pmc_plt_clk_0 + +As of commit 648e921888ad ("clk: x86: Stop marking clocks as +CLK_IS_CRITICAL"), the cht_bsw_rt5645 driver needs to enable the clock +it's using for the codec's mclk. It does this from commit 7735bce05a9c +("ASoC: Intel: boards: use devm_clk_get() unconditionally"), enabling +pmc_plt_clk_3. However, Strago family Chromebooks use pmc_plt_clk_0 for +the codec mclk, resulting in white noise with some digital microphones. +Add a DMI-based quirk for Strago family Chromebooks to use pmc_plt_clk_0 +instead - mirroring the changes made to cht_bsw_max98090_ti in +commit a182ecd3809c ("ASoC: intel: cht_bsw_max98090_ti: Add quirk for +boards using pmc_plt_clk_0") and making use of the existing +dmi_check_system() call and related infrastructure added in +commit 22af29114eb4 ("ASoC: Intel: cht-bsw-rt5645: add quirks for +SSP0/AIF1/AIF2 routing"). + +Signed-off-by: Sam McNally +Acked-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20190917054933.209335-1-sammc@chromium.org +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit adebb11139029ddf1fba6f796c4a476f17eacddc) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/cht_bsw_rt5645.c | 26 +++++++++++++++++++------ + 1 file changed, 20 insertions(+), 6 deletions(-) + +diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c +index 8879c3be29d5..c68a5b85a4a0 100644 +--- a/sound/soc/intel/boards/cht_bsw_rt5645.c ++++ b/sound/soc/intel/boards/cht_bsw_rt5645.c +@@ -48,6 +48,7 @@ struct cht_mc_private { + #define CHT_RT5645_SSP2_AIF2 BIT(16) /* default is using AIF1 */ + #define CHT_RT5645_SSP0_AIF1 BIT(17) + #define CHT_RT5645_SSP0_AIF2 BIT(18) ++#define CHT_RT5645_PMC_PLT_CLK_0 BIT(19) + + static unsigned long cht_rt5645_quirk = 0; + +@@ -59,6 +60,8 @@ static void log_quirks(struct device *dev) + dev_info(dev, "quirk SSP0_AIF1 enabled"); + if (cht_rt5645_quirk & CHT_RT5645_SSP0_AIF2) + dev_info(dev, "quirk SSP0_AIF2 enabled"); ++ if (cht_rt5645_quirk & CHT_RT5645_PMC_PLT_CLK_0) ++ dev_info(dev, "quirk PMC_PLT_CLK_0 enabled"); + } + + static int platform_clock_control(struct snd_soc_dapm_widget *w, +@@ -226,15 +229,21 @@ static int cht_aif1_hw_params(struct snd_pcm_substream *substream, + return 0; + } + +-/* uncomment when we have a real quirk + static int cht_rt5645_quirk_cb(const struct dmi_system_id *id) + { + cht_rt5645_quirk = (unsigned long)id->driver_data; + return 1; + } +-*/ + + static const struct dmi_system_id cht_rt5645_quirk_table[] = { ++ { ++ /* Strago family Chromebooks */ ++ .callback = cht_rt5645_quirk_cb, ++ .matches = { ++ DMI_MATCH(DMI_PRODUCT_FAMILY, "Intel_Strago"), ++ }, ++ .driver_data = (void *)CHT_RT5645_PMC_PLT_CLK_0, ++ }, + { + }, + }; +@@ -526,6 +535,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) + int dai_index = 0; + int ret_val = 0; + int i; ++ const char *mclk_name; + + drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); + if (!drv) +@@ -662,11 +672,15 @@ static int snd_cht_mc_probe(struct platform_device *pdev) + if (ret_val) + return ret_val; + +- drv->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3"); ++ if (cht_rt5645_quirk & CHT_RT5645_PMC_PLT_CLK_0) ++ mclk_name = "pmc_plt_clk_0"; ++ else ++ mclk_name = "pmc_plt_clk_3"; ++ ++ drv->mclk = devm_clk_get(&pdev->dev, mclk_name); + if (IS_ERR(drv->mclk)) { +- dev_err(&pdev->dev, +- "Failed to get MCLK from pmc_plt_clk_3: %ld\n", +- PTR_ERR(drv->mclk)); ++ dev_err(&pdev->dev, "Failed to get MCLK from %s: %ld\n", ++ mclk_name, PTR_ERR(drv->mclk)); + return PTR_ERR(drv->mclk); + } + +-- +2.20.1 + + +From 83c22d6aef225035385971716098b753ea2d145e Mon Sep 17 00:00:00 2001 +From: Naveen M +Date: Tue, 15 Oct 2019 00:28:00 +0800 +Subject: [PATCH 054/130] ASoC: Intel: eve: Enable mclk and ssp sclk early + +rt5663 and rt5514 needs mclk/sclk early to synchronize its internal +clocks. + +Signed-off-by: Naveen M +Signed-off-by: Harsha Priya +Signed-off-by: Subhransu S. Prusty +Signed-off-by: Brent Lu +Acked-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/1571070480-25666-1-git-send-email-brent.lu@intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 47cbea21628187c32efad562867aa2b6760d83cc) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/Kconfig | 1 + + .../intel/boards/kbl_rt5663_rt5514_max98927.c | 94 +++++++++++++++++++ + 2 files changed, 95 insertions(+) + +diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig +index 882ff36a7c9c..778422d36e61 100644 +--- a/sound/soc/intel/boards/Kconfig ++++ b/sound/soc/intel/boards/Kconfig +@@ -320,6 +320,7 @@ config SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH + select SND_SOC_RT5514_SPI + select SND_SOC_MAX98927 + select SND_SOC_HDAC_HDMI ++ select SND_SOC_INTEL_SKYLAKE_SSP_CLK + help + This adds support for ASoC Onboard Codec I2S machine driver. This will + create an alsa sound card for RT5663 + RT5514 + MAX98927. +diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +index d14ca327c684..ea0005d7d3c8 100644 +--- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c ++++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +@@ -22,6 +22,9 @@ + #include "../../codecs/rt5514.h" + #include "../../codecs/rt5663.h" + #include "../../codecs/hdac_hdmi.h" ++#include ++#include ++#include + + #define KBL_REALTEK_CODEC_DAI "rt5663-aif" + #define KBL_REALTEK_DMIC_CODEC_DAI "rt5514-aif1" +@@ -50,6 +53,8 @@ struct kbl_codec_private { + struct snd_soc_jack kabylake_headset; + struct list_head hdmi_pcm_list; + struct snd_soc_jack kabylake_hdmi[2]; ++ struct clk *mclk; ++ struct clk *sclk; + }; + + enum { +@@ -71,6 +76,61 @@ static const struct snd_kcontrol_new kabylake_controls[] = { + SOC_DAPM_PIN_SWITCH("DMIC"), + }; + ++static int platform_clock_control(struct snd_soc_dapm_widget *w, ++ struct snd_kcontrol *k, int event) ++{ ++ struct snd_soc_dapm_context *dapm = w->dapm; ++ struct snd_soc_card *card = dapm->card; ++ struct kbl_codec_private *priv = snd_soc_card_get_drvdata(card); ++ int ret = 0; ++ ++ /* ++ * MCLK/SCLK need to be ON early for a successful synchronization of ++ * codec internal clock. And the clocks are turned off during ++ * POST_PMD after the stream is stopped. ++ */ ++ switch (event) { ++ case SND_SOC_DAPM_PRE_PMU: ++ /* Enable MCLK */ ++ ret = clk_set_rate(priv->mclk, 24000000); ++ if (ret < 0) { ++ dev_err(card->dev, "Can't set rate for mclk, err: %d\n", ++ ret); ++ return ret; ++ } ++ ++ ret = clk_prepare_enable(priv->mclk); ++ if (ret < 0) { ++ dev_err(card->dev, "Can't enable mclk, err: %d\n", ret); ++ return ret; ++ } ++ ++ /* Enable SCLK */ ++ ret = clk_set_rate(priv->sclk, 3072000); ++ if (ret < 0) { ++ dev_err(card->dev, "Can't set rate for sclk, err: %d\n", ++ ret); ++ clk_disable_unprepare(priv->mclk); ++ return ret; ++ } ++ ++ ret = clk_prepare_enable(priv->sclk); ++ if (ret < 0) { ++ dev_err(card->dev, "Can't enable sclk, err: %d\n", ret); ++ clk_disable_unprepare(priv->mclk); ++ } ++ break; ++ case SND_SOC_DAPM_POST_PMD: ++ clk_disable_unprepare(priv->mclk); ++ clk_disable_unprepare(priv->sclk); ++ break; ++ default: ++ return 0; ++ } ++ ++ return 0; ++} ++ + static const struct snd_soc_dapm_widget kabylake_widgets[] = { + SND_SOC_DAPM_HP("Headphone Jack", NULL), + SND_SOC_DAPM_MIC("Headset Mic", NULL), +@@ -79,11 +139,15 @@ static const struct snd_soc_dapm_widget kabylake_widgets[] = { + SND_SOC_DAPM_MIC("DMIC", NULL), + SND_SOC_DAPM_SPK("HDMI1", NULL), + SND_SOC_DAPM_SPK("HDMI2", NULL), ++ SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0, ++ platform_clock_control, SND_SOC_DAPM_PRE_PMU | ++ SND_SOC_DAPM_POST_PMD), + + }; + + static const struct snd_soc_dapm_route kabylake_map[] = { + /* Headphones */ ++ { "Headphone Jack", NULL, "Platform Clock" }, + { "Headphone Jack", NULL, "HPOL" }, + { "Headphone Jack", NULL, "HPOR" }, + +@@ -92,6 +156,7 @@ static const struct snd_soc_dapm_route kabylake_map[] = { + { "Right Spk", NULL, "Right BE_OUT" }, + + /* other jacks */ ++ { "Headset Mic", NULL, "Platform Clock" }, + { "IN1P", NULL, "Headset Mic" }, + { "IN1N", NULL, "Headset Mic" }, + +@@ -643,6 +708,7 @@ static int kabylake_audio_probe(struct platform_device *pdev) + { + struct kbl_codec_private *ctx; + struct snd_soc_acpi_mach *mach; ++ int ret = 0; + + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); + if (!ctx) +@@ -658,6 +724,34 @@ static int kabylake_audio_probe(struct platform_device *pdev) + dmic_constraints = mach->mach_params.dmic_num == 2 ? + &constraints_dmic_2ch : &constraints_dmic_channels; + ++ ctx->mclk = devm_clk_get(&pdev->dev, "ssp1_mclk"); ++ if (IS_ERR(ctx->mclk)) { ++ ret = PTR_ERR(ctx->mclk); ++ if (ret == -ENOENT) { ++ dev_info(&pdev->dev, ++ "Failed to get ssp1_mclk, defer probe\n"); ++ return -EPROBE_DEFER; ++ } ++ ++ dev_err(&pdev->dev, "Failed to get ssp1_mclk with err:%d\n", ++ ret); ++ return ret; ++ } ++ ++ ctx->sclk = devm_clk_get(&pdev->dev, "ssp1_sclk"); ++ if (IS_ERR(ctx->sclk)) { ++ ret = PTR_ERR(ctx->sclk); ++ if (ret == -ENOENT) { ++ dev_info(&pdev->dev, ++ "Failed to get ssp1_sclk, defer probe\n"); ++ return -EPROBE_DEFER; ++ } ++ ++ dev_err(&pdev->dev, "Failed to get ssp1_sclk with err:%d\n", ++ ret); ++ return ret; ++ } ++ + return devm_snd_soc_register_card(&pdev->dev, &kabylake_audio_card); + } + +-- +2.20.1 + + +From f80cddbefe9bca88b832b053587286c56a35a6fc Mon Sep 17 00:00:00 2001 +From: Brent Lu +Date: Fri, 25 Oct 2019 17:11:31 +0800 +Subject: [PATCH 055/130] ASoC: eve: implement set_bias_level function for + rt5514 + +The first DMIC capture always fail (zero sequence data from PCM port) +after using DSP hotwording function (i.e. Google assistant). + +This rt5514 codec requires to control mclk directly in the set_bias_level +function. Implement this function in machine driver to control the +ssp1_mclk clock explicitly could fix this issue. + +Signed-off-by: Brent Lu +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/1571994691-20199-1-git-send-email-brent.lu@intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 15747a80207585fe942416025540c0ff34e2aef8) +Bugzilla: 1772498 +--- + .../intel/boards/kbl_rt5663_rt5514_max98927.c | 50 +++++++++++++++++++ + 1 file changed, 50 insertions(+) + +diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +index ea0005d7d3c8..a1056cda3dd7 100644 +--- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c ++++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +@@ -653,6 +653,55 @@ static struct snd_soc_dai_link kabylake_dais[] = { + }, + }; + ++static int kabylake_set_bias_level(struct snd_soc_card *card, ++ struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) ++{ ++ struct snd_soc_component *component = dapm->component; ++ struct kbl_codec_private *priv = snd_soc_card_get_drvdata(card); ++ int ret = 0; ++ ++ if (!component || strcmp(component->name, RT5514_DEV_NAME)) ++ return 0; ++ ++ if (IS_ERR(priv->mclk)) ++ return 0; ++ ++ /* ++ * It's required to control mclk directly in the set_bias_level ++ * function for rt5514 codec or the recording function could ++ * break. ++ */ ++ switch (level) { ++ case SND_SOC_BIAS_PREPARE: ++ if (dapm->bias_level == SND_SOC_BIAS_ON) { ++ dev_dbg(card->dev, "Disable mclk"); ++ clk_disable_unprepare(priv->mclk); ++ } else { ++ dev_dbg(card->dev, "Enable mclk"); ++ ret = clk_set_rate(priv->mclk, 24000000); ++ if (ret) { ++ dev_err(card->dev, "Can't set rate for mclk, err: %d\n", ++ ret); ++ return ret; ++ } ++ ++ ret = clk_prepare_enable(priv->mclk); ++ if (ret) { ++ dev_err(card->dev, "Can't enable mclk, err: %d\n", ++ ret); ++ ++ /* mclk is already enabled in FW */ ++ ret = 0; ++ } ++ } ++ break; ++ default: ++ break; ++ } ++ ++ return ret; ++} ++ + static int kabylake_card_late_probe(struct snd_soc_card *card) + { + struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(card); +@@ -692,6 +741,7 @@ static struct snd_soc_card kabylake_audio_card = { + .owner = THIS_MODULE, + .dai_link = kabylake_dais, + .num_links = ARRAY_SIZE(kabylake_dais), ++ .set_bias_level = kabylake_set_bias_level, + .controls = kabylake_controls, + .num_controls = ARRAY_SIZE(kabylake_controls), + .dapm_widgets = kabylake_widgets, +-- +2.20.1 + + +From 1b41ab23dfde6f139695afbb1cef0846453a8070 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Tue, 29 Oct 2019 15:40:11 +0200 +Subject: [PATCH 056/130] ASoC: Intel: skl-hda-dsp-generic: use + snd-hda-codec-hdmi + +Add support for using snd-hda-codec-hdmi driver for HDMI/DP +instead of ASoC hdac-hdmi. This is aligned with how other +HDA codecs are already handled. + +When snd-hda-codec-hdmi is used, the PCM device numbers are +parsed from card topology and passed to the codec driver. +This needs to be done at runtime as topology changes may +affect PCM device allocation. + +Signed-off-by: Kai Vehmanen +Reviewed-by: Takashi Iwai +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191029134017.18901-4-kai.vehmanen@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 7de9a47c8971bdec07cc9a62e948382003c5908f) +Bugzilla: 1772498 +--- + include/sound/soc-acpi.h | 2 + + sound/soc/intel/boards/Makefile | 2 +- + sound/soc/intel/boards/hda_dsp_common.c | 85 ++++++++++++++++++++ + sound/soc/intel/boards/hda_dsp_common.h | 32 ++++++++ + sound/soc/intel/boards/skl_hda_dsp_common.c | 6 ++ + sound/soc/intel/boards/skl_hda_dsp_common.h | 23 ++++++ + sound/soc/intel/boards/skl_hda_dsp_generic.c | 1 + + 7 files changed, 150 insertions(+), 1 deletion(-) + create mode 100644 sound/soc/intel/boards/hda_dsp_common.c + create mode 100644 sound/soc/intel/boards/hda_dsp_common.h + +diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h +index 35b38e41e5b2..26d57bc9a91e 100644 +--- a/include/sound/soc-acpi.h ++++ b/include/sound/soc-acpi.h +@@ -60,12 +60,14 @@ static inline struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg) + * @acpi_ipc_irq_index: used for BYT-CR detection + * @platform: string used for HDaudio codec support + * @codec_mask: used for HDAudio support ++ * @common_hdmi_codec_drv: use commom HDAudio HDMI codec driver + */ + struct snd_soc_acpi_mach_params { + u32 acpi_ipc_irq_index; + const char *platform; + u32 codec_mask; + u32 dmic_num; ++ bool common_hdmi_codec_drv; + }; + + /** +diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile +index 6445f90ea542..52e990b16b0d 100644 +--- a/sound/soc/intel/boards/Makefile ++++ b/sound/soc/intel/boards/Makefile +@@ -24,7 +24,7 @@ snd-soc-kbl_rt5663_max98927-objs := kbl_rt5663_max98927.o + snd-soc-kbl_rt5663_rt5514_max98927-objs := kbl_rt5663_rt5514_max98927.o + snd-soc-kbl_rt5660-objs := kbl_rt5660.o + snd-soc-skl_rt286-objs := skl_rt286.o +-snd-soc-skl_hda_dsp-objs := skl_hda_dsp_generic.o skl_hda_dsp_common.o ++snd-soc-skl_hda_dsp-objs := skl_hda_dsp_generic.o skl_hda_dsp_common.o hda_dsp_common.o + snd-skl_nau88l25_max98357a-objs := skl_nau88l25_max98357a.o + snd-soc-skl_nau88l25_ssm4567-objs := skl_nau88l25_ssm4567.o + +diff --git a/sound/soc/intel/boards/hda_dsp_common.c b/sound/soc/intel/boards/hda_dsp_common.c +new file mode 100644 +index 000000000000..ed36b68d6705 +--- /dev/null ++++ b/sound/soc/intel/boards/hda_dsp_common.c +@@ -0,0 +1,85 @@ ++// SPDX-License-Identifier: GPL-2.0 ++// ++// Copyright(c) 2019 Intel Corporation. All rights reserved. ++ ++#include ++#include ++#include ++#include ++#include "../../codecs/hdac_hda.h" ++ ++#include "hda_dsp_common.h" ++ ++/* ++ * Search card topology and return PCM device number ++ * matching Nth HDMI device (zero-based index). ++ */ ++struct snd_pcm *hda_dsp_hdmi_pcm_handle(struct snd_soc_card *card, ++ int hdmi_idx) ++{ ++ struct snd_soc_pcm_runtime *rtd; ++ struct snd_pcm *spcm; ++ int i = 0; ++ ++ for_each_card_rtds(card, rtd) { ++ spcm = rtd->pcm ? ++ rtd->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].pcm : NULL; ++ if (spcm && strstr(spcm->id, "HDMI")) { ++ if (i == hdmi_idx) ++ return rtd->pcm; ++ ++i; ++ } ++ } ++ ++ return NULL; ++} ++ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) ++/* ++ * Search card topology and register HDMI PCM related controls ++ * to codec driver. ++ */ ++int hda_dsp_hdmi_build_controls(struct snd_soc_card *card, ++ struct snd_soc_component *comp) ++{ ++ struct hdac_hda_priv *hda_pvt; ++ struct hda_codec *hcodec; ++ struct snd_pcm *spcm; ++ struct hda_pcm *hpcm; ++ int err = 0, i = 0; ++ ++ if (!comp) ++ return -EINVAL; ++ ++ hda_pvt = snd_soc_component_get_drvdata(comp); ++ hcodec = &hda_pvt->codec; ++ ++ list_for_each_entry(hpcm, &hcodec->pcm_list_head, list) { ++ spcm = hda_dsp_hdmi_pcm_handle(card, i); ++ if (spcm) { ++ hpcm->pcm = spcm; ++ hpcm->device = spcm->device; ++ dev_dbg(card->dev, ++ "%s: mapping HDMI converter %d to PCM %d (%p)\n", ++ __func__, i, hpcm->device, spcm); ++ } else { ++ hpcm->pcm = 0; ++ hpcm->device = SNDRV_PCM_INVALID_DEVICE; ++ dev_warn(card->dev, ++ "%s: no PCM in topology for HDMI converter %d\n\n", ++ __func__, i); ++ } ++ i++; ++ } ++ snd_hdac_display_power(hcodec->core.bus, ++ HDA_CODEC_IDX_CONTROLLER, true); ++ err = snd_hda_codec_build_controls(hcodec); ++ if (err < 0) ++ dev_err(card->dev, "unable to create controls %d\n", err); ++ snd_hdac_display_power(hcodec->core.bus, ++ HDA_CODEC_IDX_CONTROLLER, false); ++ ++ return err; ++} ++ ++#endif +diff --git a/sound/soc/intel/boards/hda_dsp_common.h b/sound/soc/intel/boards/hda_dsp_common.h +new file mode 100644 +index 000000000000..431f7f09dccb +--- /dev/null ++++ b/sound/soc/intel/boards/hda_dsp_common.h +@@ -0,0 +1,32 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++/* ++ * Copyright(c) 2019 Intel Corporation. ++ */ ++ ++/* ++ * This file defines helper functions used by multiple ++ * Intel HDA based machine drivers. ++ */ ++ ++#ifndef __HDA_DSP_COMMON_H ++#define __HDA_DSP_COMMON_H ++ ++#include ++#include ++#include "../../codecs/hdac_hda.h" ++ ++struct snd_pcm *hda_dsp_hdmi_pcm_handle(struct snd_soc_card *card, ++ int hdmi_idx); ++ ++#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) ++int hda_dsp_hdmi_build_controls(struct snd_soc_card *card, ++ struct snd_soc_component *comp); ++#else ++static inline int hda_dsp_hdmi_build_controls(struct snd_soc_card *card, ++ struct snd_soc_component *comp) ++{ ++ return -EINVAL; ++} ++#endif ++ ++#endif /* __HDA_DSP_COMMON_H */ +diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.c b/sound/soc/intel/boards/skl_hda_dsp_common.c +index 58409b6e476e..eb419e1ec42b 100644 +--- a/sound/soc/intel/boards/skl_hda_dsp_common.c ++++ b/sound/soc/intel/boards/skl_hda_dsp_common.c +@@ -14,6 +14,9 @@ + #include "../../codecs/hdac_hdmi.h" + #include "skl_hda_dsp_common.h" + ++#include ++#include "../../codecs/hdac_hda.h" ++ + #define NAME_SIZE 32 + + int skl_hda_hdmi_add_pcm(struct snd_soc_card *card, int device) +@@ -136,6 +139,9 @@ int skl_hda_hdmi_jack_init(struct snd_soc_card *card) + char jack_name[NAME_SIZE]; + int err; + ++ if (ctx->common_hdmi_codec_drv) ++ return skl_hda_hdmi_build_controls(card); ++ + list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { + component = pcm->codec_dai->component; + snprintf(jack_name, sizeof(jack_name), +diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.h b/sound/soc/intel/boards/skl_hda_dsp_common.h +index daa582e513b2..bbe6e2acfda3 100644 +--- a/sound/soc/intel/boards/skl_hda_dsp_common.h ++++ b/sound/soc/intel/boards/skl_hda_dsp_common.h +@@ -14,6 +14,9 @@ + #include + #include + #include ++#include ++#include "../../codecs/hdac_hda.h" ++#include "hda_dsp_common.h" + + #define HDA_DSP_MAX_BE_DAI_LINKS 7 + +@@ -29,10 +32,30 @@ struct skl_hda_private { + int pcm_count; + int dai_index; + const char *platform_name; ++ bool common_hdmi_codec_drv; + }; + + extern struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS]; + int skl_hda_hdmi_jack_init(struct snd_soc_card *card); + int skl_hda_hdmi_add_pcm(struct snd_soc_card *card, int device); + ++/* ++ * Search card topology and register HDMI PCM related controls ++ * to codec driver. ++ */ ++static inline int skl_hda_hdmi_build_controls(struct snd_soc_card *card) ++{ ++ struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card); ++ struct snd_soc_component *component; ++ struct skl_hda_hdmi_pcm *pcm; ++ ++ pcm = list_first_entry(&ctx->hdmi_pcm_list, struct skl_hda_hdmi_pcm, ++ head); ++ component = pcm->codec_dai->component; ++ if (!component) ++ return -EINVAL; ++ ++ return hda_dsp_hdmi_build_controls(card, component); ++} ++ + #endif /* __SOUND_SOC_HDA_DSP_COMMON_H */ +diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c +index e8d676c192f6..4e45901e3a2f 100644 +--- a/sound/soc/intel/boards/skl_hda_dsp_generic.c ++++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c +@@ -178,6 +178,7 @@ static int skl_hda_audio_probe(struct platform_device *pdev) + ctx->pcm_count = hda_soc_card.num_links; + ctx->dai_index = 1; /* hdmi codec dai name starts from index 1 */ + ctx->platform_name = mach->mach_params.platform; ++ ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; + + hda_soc_card.dev = &pdev->dev; + snd_soc_card_set_drvdata(&hda_soc_card, ctx); +-- +2.20.1 + + +From b07481ef39cfbbf0caadac6432121bd4d49bd69f Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Tue, 29 Oct 2019 15:40:12 +0200 +Subject: [PATCH 057/130] ASoC: Intel: skl-hda-dsp-generic: fix include guard + name + +Match the include guard define to actual filename. The source +directory now has an actual hda_dsp_common.h header, so the old +include guard may cause confusion. + +Signed-off-by: Kai Vehmanen +Reviewed-by: Takashi Iwai +Reviewed-by: Pierre-Louis Bossart +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191029134017.18901-5-kai.vehmanen@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 0f163110256ac91aee562da149838fcb8a39d518) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/skl_hda_dsp_common.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.h b/sound/soc/intel/boards/skl_hda_dsp_common.h +index bbe6e2acfda3..d6150670ca05 100644 +--- a/sound/soc/intel/boards/skl_hda_dsp_common.h ++++ b/sound/soc/intel/boards/skl_hda_dsp_common.h +@@ -8,8 +8,8 @@ + * platforms with HDA Codecs. + */ + +-#ifndef __SOUND_SOC_HDA_DSP_COMMON_H +-#define __SOUND_SOC_HDA_DSP_COMMON_H ++#ifndef __SKL_HDA_DSP_COMMON_H ++#define __SKL_HDA_DSP_COMMON_H + #include + #include + #include +-- +2.20.1 + + +From 33d568ce43c1a625611c9680c932607183716854 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Tue, 29 Oct 2019 15:40:14 +0200 +Subject: [PATCH 058/130] ASoC: Intel: bxt-da7219-max98357a: common hdmi codec + support + +Add support for using snd-hda-codec-hdmi driver for HDMI/DP +instead of ASoC hdac-hdmi. This is aligned with how other +HDA codecs are already handled. + +Signed-off-by: Kai Vehmanen +Reviewed-by: Takashi Iwai +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191029134017.18901-7-kai.vehmanen@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 57ad18906f24278893b128967551fe7fa0996129) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/Makefile | 2 +- + sound/soc/intel/boards/bxt_da7219_max98357a.c | 11 +++++++++++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile +index 52e990b16b0d..0cf4a984f083 100644 +--- a/sound/soc/intel/boards/Makefile ++++ b/sound/soc/intel/boards/Makefile +@@ -4,7 +4,7 @@ snd-soc-sst-byt-rt5640-mach-objs := byt-rt5640.o + snd-soc-sst-byt-max98090-mach-objs := byt-max98090.o + snd-soc-sst-bdw-rt5677-mach-objs := bdw-rt5677.o + snd-soc-sst-broadwell-objs := broadwell.o +-snd-soc-sst-bxt-da7219_max98357a-objs := bxt_da7219_max98357a.o ++snd-soc-sst-bxt-da7219_max98357a-objs := bxt_da7219_max98357a.o hda_dsp_common.o + snd-soc-sst-bxt-rt298-objs := bxt_rt298.o + snd-soc-sst-glk-rt5682_max98357a-objs := glk_rt5682_max98357a.o + snd-soc-sst-bytcr-rt5640-objs := bytcr_rt5640.o +diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c +index ac1dea5f9d11..5873abb46441 100644 +--- a/sound/soc/intel/boards/bxt_da7219_max98357a.c ++++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c +@@ -21,6 +21,7 @@ + #include "../../codecs/da7219.h" + #include "../../codecs/da7219-aad.h" + #include "../common/soc-intel-quirks.h" ++#include "hda_dsp_common.h" + + #define BXT_DIALOG_CODEC_DAI "da7219-hifi" + #define BXT_MAXIM_CODEC_DAI "HiFi" +@@ -38,6 +39,7 @@ struct bxt_hdmi_pcm { + + struct bxt_card_private { + struct list_head hdmi_pcm_list; ++ bool common_hdmi_codec_drv; + }; + + enum { +@@ -615,6 +617,13 @@ static int bxt_card_late_probe(struct snd_soc_card *card) + snd_soc_dapm_add_routes(&card->dapm, broxton_map, + ARRAY_SIZE(broxton_map)); + ++ pcm = list_first_entry(&ctx->hdmi_pcm_list, struct bxt_hdmi_pcm, ++ head); ++ component = pcm->codec_dai->component; ++ ++ if (ctx->common_hdmi_codec_drv) ++ return hda_dsp_hdmi_build_controls(card, component); ++ + list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { + component = pcm->codec_dai->component; + snprintf(jack_name, sizeof(jack_name), +@@ -720,6 +729,8 @@ static int broxton_audio_probe(struct platform_device *pdev) + if (ret) + return ret; + ++ ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; ++ + return devm_snd_soc_register_card(&pdev->dev, &broxton_audio_card); + } + +-- +2.20.1 + + +From 555533e73e096583395ce632a80116c059ce97d5 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Tue, 29 Oct 2019 15:40:15 +0200 +Subject: [PATCH 059/130] ASoC: Intel: glk_rt5682_max98357a: common hdmi codec + support + +Add support for using snd-hda-codec-hdmi driver for HDMI/DP +instead of ASoC hdac-hdmi. This is aligned with how other +HDA codecs are already handled. + +Signed-off-by: Kai Vehmanen +Reviewed-by: Takashi Iwai +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191029134017.18901-8-kai.vehmanen@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit dfe87aa86cd92d21603d64f4035fecae19c92e7a) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/Makefile | 2 +- + sound/soc/intel/boards/glk_rt5682_max98357a.c | 11 +++++++++++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile +index 0cf4a984f083..b36f44906c91 100644 +--- a/sound/soc/intel/boards/Makefile ++++ b/sound/soc/intel/boards/Makefile +@@ -6,7 +6,7 @@ snd-soc-sst-bdw-rt5677-mach-objs := bdw-rt5677.o + snd-soc-sst-broadwell-objs := broadwell.o + snd-soc-sst-bxt-da7219_max98357a-objs := bxt_da7219_max98357a.o hda_dsp_common.o + snd-soc-sst-bxt-rt298-objs := bxt_rt298.o +-snd-soc-sst-glk-rt5682_max98357a-objs := glk_rt5682_max98357a.o ++snd-soc-sst-glk-rt5682_max98357a-objs := glk_rt5682_max98357a.o hda_dsp_common.o + snd-soc-sst-bytcr-rt5640-objs := bytcr_rt5640.o + snd-soc-sst-bytcr-rt5651-objs := bytcr_rt5651.o + snd-soc-sst-cht-bsw-rt5672-objs := cht_bsw_rt5672.o +diff --git a/sound/soc/intel/boards/glk_rt5682_max98357a.c b/sound/soc/intel/boards/glk_rt5682_max98357a.c +index bd2d371f2acd..b36264d1d1cd 100644 +--- a/sound/soc/intel/boards/glk_rt5682_max98357a.c ++++ b/sound/soc/intel/boards/glk_rt5682_max98357a.c +@@ -19,6 +19,7 @@ + #include + #include "../../codecs/rt5682.h" + #include "../../codecs/hdac_hdmi.h" ++#include "hda_dsp_common.h" + + /* The platform clock outputs 19.2Mhz clock to codec as I2S MCLK */ + #define GLK_PLAT_CLK_FREQ 19200000 +@@ -41,6 +42,7 @@ struct glk_hdmi_pcm { + struct glk_card_private { + struct snd_soc_jack geminilake_headset; + struct list_head hdmi_pcm_list; ++ bool common_hdmi_codec_drv; + }; + + enum { +@@ -545,6 +547,13 @@ static int glk_card_late_probe(struct snd_soc_card *card) + int err = 0; + int i = 0; + ++ pcm = list_first_entry(&ctx->hdmi_pcm_list, struct glk_hdmi_pcm, ++ head); ++ component = pcm->codec_dai->component; ++ ++ if (ctx->common_hdmi_codec_drv) ++ return hda_dsp_hdmi_build_controls(card, component); ++ + list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { + component = pcm->codec_dai->component; + snprintf(jack_name, sizeof(jack_name), +@@ -612,6 +621,8 @@ static int geminilake_audio_probe(struct platform_device *pdev) + if (ret) + return ret; + ++ ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; ++ + return devm_snd_soc_register_card(&pdev->dev, card); + } + +-- +2.20.1 + + +From d186922c20154420654a00b8b6186df7c0a9f4f3 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Tue, 29 Oct 2019 15:40:16 +0200 +Subject: [PATCH 060/130] ASoC: intel: sof_rt5682: common hdmi codec support + +Add support for using snd-hda-codec-hdmi driver for HDMI/DP +instead of ASoC hdac-hdmi. This is aligned with how other +HDA codecs are already handled. + +Signed-off-by: Kai Vehmanen +Reviewed-by: Takashi Iwai +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191029134017.18901-9-kai.vehmanen@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 59bbd703ea2eae7c2766713135e4742c07fbbad7) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/Makefile | 2 +- + sound/soc/intel/boards/sof_rt5682.c | 11 +++++++++++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile +index b36f44906c91..255cee8c7906 100644 +--- a/sound/soc/intel/boards/Makefile ++++ b/sound/soc/intel/boards/Makefile +@@ -17,7 +17,7 @@ snd-soc-sst-byt-cht-cx2072x-objs := bytcht_cx2072x.o + snd-soc-sst-byt-cht-da7213-objs := bytcht_da7213.o + snd-soc-sst-byt-cht-es8316-objs := bytcht_es8316.o + snd-soc-sst-byt-cht-nocodec-objs := bytcht_nocodec.o +-snd-soc-sof_rt5682-objs := sof_rt5682.o ++snd-soc-sof_rt5682-objs := sof_rt5682.o hda_dsp_common.o + snd-soc-kbl_da7219_max98357a-objs := kbl_da7219_max98357a.o + snd-soc-kbl_da7219_max98927-objs := kbl_da7219_max98927.o + snd-soc-kbl_rt5663_max98927-objs := kbl_rt5663_max98927.o +diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c +index 320a9b9273db..751b8ea6ae1f 100644 +--- a/sound/soc/intel/boards/sof_rt5682.c ++++ b/sound/soc/intel/boards/sof_rt5682.c +@@ -21,6 +21,7 @@ + #include "../../codecs/rt5682.h" + #include "../../codecs/hdac_hdmi.h" + #include "../common/soc-intel-quirks.h" ++#include "hda_dsp_common.h" + + #define NAME_SIZE 32 + +@@ -53,6 +54,7 @@ struct sof_card_private { + struct clk *mclk; + struct snd_soc_jack sof_headset; + struct list_head hdmi_pcm_list; ++ bool common_hdmi_codec_drv; + }; + + static int sof_rt5682_quirk_cb(const struct dmi_system_id *id) +@@ -274,6 +276,13 @@ static int sof_card_late_probe(struct snd_soc_card *card) + if (is_legacy_cpu) + return 0; + ++ pcm = list_first_entry(&ctx->hdmi_pcm_list, struct sof_hdmi_pcm, ++ head); ++ component = pcm->codec_dai->component; ++ ++ if (ctx->common_hdmi_codec_drv) ++ return hda_dsp_hdmi_build_controls(card, component); ++ + list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { + component = pcm->codec_dai->component; + snprintf(jack_name, sizeof(jack_name), +@@ -651,6 +660,8 @@ static int sof_audio_probe(struct platform_device *pdev) + if (ret) + return ret; + ++ ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; ++ + snd_soc_card_set_drvdata(&sof_audio_card_rt5682, ctx); + + return devm_snd_soc_register_card(&pdev->dev, +-- +2.20.1 + + +From 3f4711fbc1d93be2c68d2eff99baef5d1ae7bb54 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Tue, 29 Oct 2019 15:40:17 +0200 +Subject: [PATCH 061/130] ASoC: Intel: bxt_rt298: common hdmi codec support + +Add support for using snd-hda-codec-hdmi driver for HDMI/DP +instead of ASoC hdac-hdmi. This is aligned with how other +HDA codecs are already handled. + +Signed-off-by: Kai Vehmanen +Reviewed-by: Takashi Iwai +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191029134017.18901-10-kai.vehmanen@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 7d2ae58376658a3ca0d8f9a53f6f065df126c432) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/Makefile | 2 +- + sound/soc/intel/boards/bxt_rt298.c | 11 +++++++++++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile +index 255cee8c7906..8bddf379cef1 100644 +--- a/sound/soc/intel/boards/Makefile ++++ b/sound/soc/intel/boards/Makefile +@@ -5,7 +5,7 @@ snd-soc-sst-byt-max98090-mach-objs := byt-max98090.o + snd-soc-sst-bdw-rt5677-mach-objs := bdw-rt5677.o + snd-soc-sst-broadwell-objs := broadwell.o + snd-soc-sst-bxt-da7219_max98357a-objs := bxt_da7219_max98357a.o hda_dsp_common.o +-snd-soc-sst-bxt-rt298-objs := bxt_rt298.o ++snd-soc-sst-bxt-rt298-objs := bxt_rt298.o hda_dsp_common.o + snd-soc-sst-glk-rt5682_max98357a-objs := glk_rt5682_max98357a.o hda_dsp_common.o + snd-soc-sst-bytcr-rt5640-objs := bytcr_rt5640.o + snd-soc-sst-bytcr-rt5651-objs := bytcr_rt5651.o +diff --git a/sound/soc/intel/boards/bxt_rt298.c b/sound/soc/intel/boards/bxt_rt298.c +index adf416a49b48..eabf9d8468ae 100644 +--- a/sound/soc/intel/boards/bxt_rt298.c ++++ b/sound/soc/intel/boards/bxt_rt298.c +@@ -18,6 +18,7 @@ + #include + #include "../../codecs/hdac_hdmi.h" + #include "../../codecs/rt298.h" ++#include "hda_dsp_common.h" + + /* Headset jack detection DAPM pins */ + static struct snd_soc_jack broxton_headset; +@@ -31,6 +32,7 @@ struct bxt_hdmi_pcm { + + struct bxt_rt286_private { + struct list_head hdmi_pcm_list; ++ bool common_hdmi_codec_drv; + }; + + enum { +@@ -527,6 +529,13 @@ static int bxt_card_late_probe(struct snd_soc_card *card) + int err, i = 0; + char jack_name[NAME_SIZE]; + ++ pcm = list_first_entry(&ctx->hdmi_pcm_list, struct bxt_hdmi_pcm, ++ head); ++ component = pcm->codec_dai->component; ++ ++ if (ctx->common_hdmi_codec_drv) ++ return hda_dsp_hdmi_build_controls(card, component); ++ + list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { + component = pcm->codec_dai->component; + snprintf(jack_name, sizeof(jack_name), +@@ -626,6 +635,8 @@ static int broxton_audio_probe(struct platform_device *pdev) + if (ret) + return ret; + ++ ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; ++ + return devm_snd_soc_register_card(&pdev->dev, card); + } + +-- +2.20.1 + + +From 03a37d6f2b29db4c976ede85c9a605471ea405b3 Mon Sep 17 00:00:00 2001 +From: Naveen Manohar +Date: Fri, 1 Nov 2019 12:18:46 -0500 +Subject: [PATCH 062/130] ASoC: Intel: Add acpi match for rt1011 based m/c + driver + +Add match for CML m/c with RT1011 and RT5682 + +Signed-off-by: Naveen Manohar +Signed-off-by: Sathya Prakash M R +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101171847.26767-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit f95ce1355944189c26e4182c813d7f018b434dbd) +Bugzilla: 1772498 +--- + sound/soc/intel/common/soc-acpi-intel-cnl-match.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/sound/soc/intel/common/soc-acpi-intel-cnl-match.c b/sound/soc/intel/common/soc-acpi-intel-cnl-match.c +index 985aa366c9e8..16d0bae8b316 100644 +--- a/sound/soc/intel/common/soc-acpi-intel-cnl-match.c ++++ b/sound/soc/intel/common/soc-acpi-intel-cnl-match.c +@@ -47,6 +47,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[] = { + .sof_fw_filename = "sof-cnl.ri", + .sof_tplg_filename = "sof-cml-rt5682-max98357a.tplg", + }, ++ { ++ .id = "10EC1011", ++ .drv_name = "cml_rt1011_rt5682", ++ .quirk_data = &cml_codecs, ++ .sof_fw_filename = "sof-cnl.ri", ++ .sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg", ++ }, + { + .id = "10EC5682", + .drv_name = "sof_rt5682", +-- +2.20.1 + + +From 90dad5c0eeccbe941c5afaca1f60339a5bb31984 Mon Sep 17 00:00:00 2001 +From: Naveen Manohar +Date: Fri, 1 Nov 2019 12:18:47 -0500 +Subject: [PATCH 063/130] ASoC: Intel: boards: Add CML m/c using RT1011 and + RT5682 + +Machine driver to enable +RT5682 on SSP0, DMIC, HDMI and +RT1011 AMP on SSP1 with +2 CH / 24 bit TDM Playback over 4 individual codecs and +4 CH / 24 bit Capture to provide feedback. + +Signed-off-by: Naveen Manohar +Signed-off-by: Sathya Prakash M R +Signed-off-by: Kai Vehmanen +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101171847.26767-3-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 17fe95d6df9320409015e5114309a3c05e31b736) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/Kconfig | 14 + + sound/soc/intel/boards/Makefile | 2 + + sound/soc/intel/boards/cml_rt1011_rt5682.c | 487 +++++++++++++++++++++ + 3 files changed, 503 insertions(+) + create mode 100644 sound/soc/intel/boards/cml_rt1011_rt5682.c + +diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig +index 778422d36e61..ef40f83e0a3b 100644 +--- a/sound/soc/intel/boards/Kconfig ++++ b/sound/soc/intel/boards/Kconfig +@@ -423,6 +423,20 @@ config SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH + depends on MFD_INTEL_LPSS || COMPILE_TEST + select SND_SOC_INTEL_DA7219_MAX98357A_GENERIC + ++config SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH ++ tristate "CML with RT1011 and RT5682 in I2S Mode" ++ depends on I2C && ACPI ++ depends on MFD_INTEL_LPSS || COMPILE_TEST ++ select SND_SOC_RT1011 ++ select SND_SOC_RT5682 ++ select SND_SOC_DMIC ++ select SND_SOC_HDAC_HDMI ++ help ++ This adds support for ASoC machine driver for SOF platform with ++ RT1011 + RT5682 I2S codec. ++ Say Y if you have such a device. ++ If unsure select "N". ++ + endif ## SND_SOC_SOF_COMETLAKE_LP && SND_SOC_SOF_HDA_LINK + + endif ## SND_SOC_INTEL_MACH +diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile +index 8bddf379cef1..9ae6544c6f3b 100644 +--- a/sound/soc/intel/boards/Makefile ++++ b/sound/soc/intel/boards/Makefile +@@ -18,6 +18,7 @@ snd-soc-sst-byt-cht-da7213-objs := bytcht_da7213.o + snd-soc-sst-byt-cht-es8316-objs := bytcht_es8316.o + snd-soc-sst-byt-cht-nocodec-objs := bytcht_nocodec.o + snd-soc-sof_rt5682-objs := sof_rt5682.o hda_dsp_common.o ++snd-soc-cml_rt1011_rt5682-objs := cml_rt1011_rt5682.o hda_dsp_common.o + snd-soc-kbl_da7219_max98357a-objs := kbl_da7219_max98357a.o + snd-soc-kbl_da7219_max98927-objs := kbl_da7219_max98927.o + snd-soc-kbl_rt5663_max98927-objs := kbl_rt5663_max98927.o +@@ -47,6 +48,7 @@ obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_CX2072X_MACH) += snd-soc-sst-byt-cht-cx2072x. + obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH) += snd-soc-sst-byt-cht-da7213.o + obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH) += snd-soc-sst-byt-cht-es8316.o + obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH) += snd-soc-sst-byt-cht-nocodec.o ++obj-$(CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH) += snd-soc-cml_rt1011_rt5682.o + obj-$(CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH) += snd-soc-kbl_da7219_max98357a.o + obj-$(CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH) += snd-soc-kbl_da7219_max98927.o + obj-$(CONFIG_SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH) += snd-soc-kbl_rt5663_max98927.o +diff --git a/sound/soc/intel/boards/cml_rt1011_rt5682.c b/sound/soc/intel/boards/cml_rt1011_rt5682.c +new file mode 100644 +index 000000000000..a22f97234201 +--- /dev/null ++++ b/sound/soc/intel/boards/cml_rt1011_rt5682.c +@@ -0,0 +1,487 @@ ++// SPDX-License-Identifier: GPL-2.0 ++// Copyright(c) 2019 Intel Corporation. ++ ++/* ++ * Intel Cometlake I2S Machine driver for RT1011 + RT5682 codec ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "../../codecs/rt1011.h" ++#include "../../codecs/rt5682.h" ++#include "../../codecs/hdac_hdmi.h" ++#include "hda_dsp_common.h" ++ ++/* The platform clock outputs 24Mhz clock to codec as I2S MCLK */ ++#define CML_PLAT_CLK 24000000 ++#define CML_RT1011_CODEC_DAI "rt1011-aif" ++#define CML_RT5682_CODEC_DAI "rt5682-aif1" ++#define NAME_SIZE 32 ++ ++static struct snd_soc_jack hdmi_jack[3]; ++ ++struct hdmi_pcm { ++ struct list_head head; ++ struct snd_soc_dai *codec_dai; ++ int device; ++}; ++ ++struct card_private { ++ char codec_name[SND_ACPI_I2C_ID_LEN]; ++ struct snd_soc_jack headset; ++ struct list_head hdmi_pcm_list; ++ bool common_hdmi_codec_drv; ++}; ++ ++static const struct snd_kcontrol_new cml_controls[] = { ++ SOC_DAPM_PIN_SWITCH("Headphone Jack"), ++ SOC_DAPM_PIN_SWITCH("Headset Mic"), ++ SOC_DAPM_PIN_SWITCH("TL Ext Spk"), ++ SOC_DAPM_PIN_SWITCH("TR Ext Spk"), ++ SOC_DAPM_PIN_SWITCH("WL Ext Spk"), ++ SOC_DAPM_PIN_SWITCH("WR Ext Spk"), ++}; ++ ++static const struct snd_soc_dapm_widget cml_rt1011_rt5682_widgets[] = { ++ SND_SOC_DAPM_SPK("TL Ext Spk", NULL), ++ SND_SOC_DAPM_SPK("TR Ext Spk", NULL), ++ SND_SOC_DAPM_SPK("WL Ext Spk", NULL), ++ SND_SOC_DAPM_SPK("WR Ext Spk", NULL), ++ SND_SOC_DAPM_HP("Headphone Jack", NULL), ++ SND_SOC_DAPM_MIC("Headset Mic", NULL), ++ SND_SOC_DAPM_MIC("SoC DMIC", NULL), ++}; ++ ++static const struct snd_soc_dapm_route cml_rt1011_rt5682_map[] = { ++ /*speaker*/ ++ {"TL Ext Spk", NULL, "TL SPO"}, ++ {"TR Ext Spk", NULL, "TR SPO"}, ++ {"WL Ext Spk", NULL, "WL SPO"}, ++ {"WR Ext Spk", NULL, "WR SPO"}, ++ ++ /* HP jack connectors - unknown if we have jack detection */ ++ { "Headphone Jack", NULL, "HPOL" }, ++ { "Headphone Jack", NULL, "HPOR" }, ++ ++ /* other jacks */ ++ { "IN1P", NULL, "Headset Mic" }, ++ ++ /* DMIC */ ++ {"DMic", NULL, "SoC DMIC"}, ++}; ++ ++static int cml_rt5682_codec_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct card_private *ctx = snd_soc_card_get_drvdata(rtd->card); ++ struct snd_soc_component *component = rtd->codec_dai->component; ++ struct snd_soc_jack *jack; ++ int ret; ++ ++ /* need to enable ASRC function for 24MHz mclk rate */ ++ rt5682_sel_asrc_clk_src(component, RT5682_DA_STEREO1_FILTER | ++ RT5682_AD_STEREO1_FILTER, ++ RT5682_CLK_SEL_I2S1_ASRC); ++ ++ /* ++ * Headset buttons map to the google Reference headset. ++ * These can be configured by userspace. ++ */ ++ ret = snd_soc_card_jack_new(rtd->card, "Headset Jack", ++ SND_JACK_HEADSET | SND_JACK_BTN_0 | ++ SND_JACK_BTN_1 | SND_JACK_BTN_2 | ++ SND_JACK_BTN_3, ++ &ctx->headset, NULL, 0); ++ if (ret) { ++ dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret); ++ return ret; ++ } ++ ++ jack = &ctx->headset; ++ ++ snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); ++ snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND); ++ snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); ++ snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); ++ ret = snd_soc_component_set_jack(component, jack, NULL); ++ if (ret) ++ dev_err(rtd->dev, "Headset Jack call-back failed: %d\n", ret); ++ ++ return ret; ++}; ++ ++static int cml_rt5682_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *codec_dai = rtd->codec_dai; ++ int clk_id, clk_freq, pll_out, ret; ++ ++ clk_id = RT5682_PLL1_S_MCLK; ++ clk_freq = CML_PLAT_CLK; ++ ++ pll_out = params_rate(params) * 512; ++ ++ ret = snd_soc_dai_set_pll(codec_dai, 0, clk_id, clk_freq, pll_out); ++ if (ret < 0) ++ dev_warn(rtd->dev, "snd_soc_dai_set_pll err = %d\n", ret); ++ ++ /* Configure sysclk for codec */ ++ ret = snd_soc_dai_set_sysclk(codec_dai, RT5682_SCLK_S_PLL1, ++ pll_out, SND_SOC_CLOCK_IN); ++ if (ret < 0) ++ dev_warn(rtd->dev, "snd_soc_dai_set_sysclk err = %d\n", ret); ++ ++ /* ++ * slot_width should be equal or large than data length, set them ++ * be the same ++ */ ++ ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x0, 0x0, 2, ++ params_width(params)); ++ if (ret < 0) ++ dev_warn(rtd->dev, "set TDM slot err:%d\n", ret); ++ return ret; ++} ++ ++static int cml_rt1011_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *codec_dai; ++ struct snd_soc_card *card = rtd->card; ++ int srate, i, ret = 0; ++ ++ srate = params_rate(params); ++ ++ for (i = 0; i < rtd->num_codecs; i++) { ++ codec_dai = rtd->codec_dais[i]; ++ ++ /* 100 Fs to drive 24 bit data */ ++ ret = snd_soc_dai_set_pll(codec_dai, 0, RT1011_PLL1_S_BCLK, ++ 100 * srate, 256 * srate); ++ if (ret < 0) { ++ dev_err(card->dev, "codec_dai clock not set\n"); ++ return ret; ++ } ++ ++ ret = snd_soc_dai_set_sysclk(codec_dai, ++ RT1011_FS_SYS_PRE_S_PLL1, ++ 256 * srate, SND_SOC_CLOCK_IN); ++ if (ret < 0) { ++ dev_err(card->dev, "codec_dai clock not set\n"); ++ return ret; ++ } ++ ++ /* ++ * Codec TDM is configured as 24 bit capture/ playback. ++ * 2 CH PB is done over 4 codecs - 2 Woofers and 2 Tweeters. ++ * The Left woofer and tweeter plays the Left playback data ++ * and similar by the Right. ++ * Hence 2 codecs (1 T and 1 W pair) share same Rx slot. ++ * The feedback is captured for each codec individually. ++ * Hence all 4 codecs use 1 Tx slot each for feedback. ++ */ ++ if (!strcmp(codec_dai->component->name, "i2c-10EC1011:00")) { ++ ret = snd_soc_dai_set_tdm_slot(codec_dai, ++ 0x4, 0x1, 4, 24); ++ if (ret < 0) ++ break; ++ } ++ if (!strcmp(codec_dai->component->name, "i2c-10EC1011:02")) { ++ ret = snd_soc_dai_set_tdm_slot(codec_dai, ++ 0x1, 0x1, 4, 24); ++ if (ret < 0) ++ break; ++ } ++ /* TDM Rx slot 2 is used for Right Woofer & Tweeters pair */ ++ if (!strcmp(codec_dai->component->name, "i2c-10EC1011:01")) { ++ ret = snd_soc_dai_set_tdm_slot(codec_dai, ++ 0x8, 0x2, 4, 24); ++ if (ret < 0) ++ break; ++ } ++ if (!strcmp(codec_dai->component->name, "i2c-10EC1011:03")) { ++ ret = snd_soc_dai_set_tdm_slot(codec_dai, ++ 0x2, 0x2, 4, 24); ++ if (ret < 0) ++ break; ++ } ++ } ++ if (ret < 0) ++ dev_err(rtd->dev, ++ "set codec TDM slot for %s failed with error %d\n", ++ codec_dai->component->name, ret); ++ return ret; ++} ++ ++static struct snd_soc_ops cml_rt5682_ops = { ++ .hw_params = cml_rt5682_hw_params, ++}; ++ ++static const struct snd_soc_ops cml_rt1011_ops = { ++ .hw_params = cml_rt1011_hw_params, ++}; ++ ++static int sof_card_late_probe(struct snd_soc_card *card) ++{ ++ struct card_private *ctx = snd_soc_card_get_drvdata(card); ++ struct snd_soc_component *component = NULL; ++ char jack_name[NAME_SIZE]; ++ struct hdmi_pcm *pcm; ++ int ret, i = 0; ++ ++ pcm = list_first_entry(&ctx->hdmi_pcm_list, struct hdmi_pcm, ++ head); ++ component = pcm->codec_dai->component; ++ ++ if (ctx->common_hdmi_codec_drv) ++ return hda_dsp_hdmi_build_controls(card, component); ++ ++ list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { ++ component = pcm->codec_dai->component; ++ snprintf(jack_name, sizeof(jack_name), ++ "HDMI/DP, pcm=%d Jack", pcm->device); ++ ret = snd_soc_card_jack_new(card, jack_name, ++ SND_JACK_AVOUT, &hdmi_jack[i], ++ NULL, 0); ++ if (ret) ++ return ret; ++ ++ ret = hdac_hdmi_jack_init(pcm->codec_dai, pcm->device, ++ &hdmi_jack[i]); ++ if (ret < 0) ++ return ret; ++ ++ i++; ++ } ++ if (!component) ++ return -EINVAL; ++ ++ return hdac_hdmi_jack_port_init(component, &card->dapm); ++} ++ ++static int hdmi_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct card_private *ctx = snd_soc_card_get_drvdata(rtd->card); ++ struct snd_soc_dai *dai = rtd->codec_dai; ++ struct hdmi_pcm *pcm; ++ ++ pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); ++ if (!pcm) ++ return -ENOMEM; ++ ++ pcm->device = dai->id; ++ pcm->codec_dai = dai; ++ ++ list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); ++ ++ return 0; ++} ++ ++/* Cometlake digital audio interface glue - connects codec <--> CPU */ ++ ++SND_SOC_DAILINK_DEF(ssp0_pin, ++ DAILINK_COMP_ARRAY(COMP_CPU("SSP0 Pin"))); ++SND_SOC_DAILINK_DEF(ssp0_codec, ++ DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5682:00", ++ CML_RT5682_CODEC_DAI))); ++ ++SND_SOC_DAILINK_DEF(ssp1_pin, ++ DAILINK_COMP_ARRAY(COMP_CPU("SSP1 Pin"))); ++SND_SOC_DAILINK_DEF(ssp1_codec, ++ DAILINK_COMP_ARRAY( ++ /* WL */ COMP_CODEC("i2c-10EC1011:00", CML_RT1011_CODEC_DAI), ++ /* WR */ COMP_CODEC("i2c-10EC1011:01", CML_RT1011_CODEC_DAI), ++ /* TL */ COMP_CODEC("i2c-10EC1011:02", CML_RT1011_CODEC_DAI), ++ /* TR */ COMP_CODEC("i2c-10EC1011:03", CML_RT1011_CODEC_DAI))); ++ ++SND_SOC_DAILINK_DEF(dmic_pin, ++ DAILINK_COMP_ARRAY(COMP_CPU("DMIC01 Pin"))); ++ ++SND_SOC_DAILINK_DEF(dmic16k_pin, ++ DAILINK_COMP_ARRAY(COMP_CPU("DMIC16k Pin"))); ++ ++SND_SOC_DAILINK_DEF(dmic_codec, ++ DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi"))); ++ ++SND_SOC_DAILINK_DEF(idisp1_pin, ++ DAILINK_COMP_ARRAY(COMP_CPU("iDisp1 Pin"))); ++SND_SOC_DAILINK_DEF(idisp1_codec, ++ DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi1"))); ++ ++SND_SOC_DAILINK_DEF(idisp2_pin, ++ DAILINK_COMP_ARRAY(COMP_CPU("iDisp2 Pin"))); ++SND_SOC_DAILINK_DEF(idisp2_codec, ++ DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi2"))); ++ ++SND_SOC_DAILINK_DEF(idisp3_pin, ++ DAILINK_COMP_ARRAY(COMP_CPU("iDisp3 Pin"))); ++SND_SOC_DAILINK_DEF(idisp3_codec, ++ DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi3"))); ++ ++SND_SOC_DAILINK_DEF(platform, ++ DAILINK_COMP_ARRAY(COMP_PLATFORM("0000:00:1f.3"))); ++ ++static struct snd_soc_dai_link cml_rt1011_rt5682_dailink[] = { ++ /* Back End DAI links */ ++ { ++ /* SSP0 - Codec */ ++ .name = "SSP0-Codec", ++ .id = 0, ++ .init = cml_rt5682_codec_init, ++ .ignore_pmdown_time = 1, ++ .ops = &cml_rt5682_ops, ++ .dpcm_playback = 1, ++ .dpcm_capture = 1, ++ .no_pcm = 1, ++ SND_SOC_DAILINK_REG(ssp0_pin, ssp0_codec, platform), ++ }, ++ { ++ .name = "dmic01", ++ .id = 1, ++ .ignore_suspend = 1, ++ .dpcm_capture = 1, ++ .no_pcm = 1, ++ SND_SOC_DAILINK_REG(dmic_pin, dmic_codec, platform), ++ }, ++ { ++ .name = "dmic16k", ++ .id = 2, ++ .ignore_suspend = 1, ++ .dpcm_capture = 1, ++ .no_pcm = 1, ++ SND_SOC_DAILINK_REG(dmic16k_pin, dmic_codec, platform), ++ }, ++ { ++ .name = "iDisp1", ++ .id = 3, ++ .init = hdmi_init, ++ .dpcm_playback = 1, ++ .no_pcm = 1, ++ SND_SOC_DAILINK_REG(idisp1_pin, idisp1_codec, platform), ++ }, ++ { ++ .name = "iDisp2", ++ .id = 4, ++ .init = hdmi_init, ++ .dpcm_playback = 1, ++ .no_pcm = 1, ++ SND_SOC_DAILINK_REG(idisp2_pin, idisp2_codec, platform), ++ }, ++ { ++ .name = "iDisp3", ++ .id = 5, ++ .init = hdmi_init, ++ .dpcm_playback = 1, ++ .no_pcm = 1, ++ SND_SOC_DAILINK_REG(idisp3_pin, idisp3_codec, platform), ++ }, ++ { ++ /* ++ * SSP1 - Codec : added to end of list ensuring ++ * reuse of common topologies for other end points ++ * and changing only SSP1's codec ++ */ ++ .name = "SSP1-Codec", ++ .id = 6, ++ .dpcm_playback = 1, ++ .dpcm_capture = 1, /* Capture stream provides Feedback */ ++ .no_pcm = 1, ++ .ops = &cml_rt1011_ops, ++ SND_SOC_DAILINK_REG(ssp1_pin, ssp1_codec, platform), ++ }, ++}; ++ ++static struct snd_soc_codec_conf rt1011_conf[] = { ++ { ++ .dev_name = "i2c-10EC1011:00", ++ .name_prefix = "WL", ++ }, ++ { ++ .dev_name = "i2c-10EC1011:01", ++ .name_prefix = "WR", ++ }, ++ { ++ .dev_name = "i2c-10EC1011:02", ++ .name_prefix = "TL", ++ }, ++ { ++ .dev_name = "i2c-10EC1011:03", ++ .name_prefix = "TR", ++ }, ++}; ++ ++/* Cometlake audio machine driver for RT1011 and RT5682 */ ++static struct snd_soc_card snd_soc_card_cml = { ++ .name = "cml_rt1011_rt5682", ++ .dai_link = cml_rt1011_rt5682_dailink, ++ .num_links = ARRAY_SIZE(cml_rt1011_rt5682_dailink), ++ .codec_conf = rt1011_conf, ++ .num_configs = ARRAY_SIZE(rt1011_conf), ++ .dapm_widgets = cml_rt1011_rt5682_widgets, ++ .num_dapm_widgets = ARRAY_SIZE(cml_rt1011_rt5682_widgets), ++ .dapm_routes = cml_rt1011_rt5682_map, ++ .num_dapm_routes = ARRAY_SIZE(cml_rt1011_rt5682_map), ++ .controls = cml_controls, ++ .num_controls = ARRAY_SIZE(cml_controls), ++ .fully_routed = true, ++ .late_probe = sof_card_late_probe, ++}; ++ ++static int snd_cml_rt1011_probe(struct platform_device *pdev) ++{ ++ struct card_private *ctx; ++ struct snd_soc_acpi_mach *mach; ++ const char *platform_name; ++ int ret; ++ ++ ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_ATOMIC); ++ if (!ctx) ++ return -ENOMEM; ++ ++ INIT_LIST_HEAD(&ctx->hdmi_pcm_list); ++ mach = (&pdev->dev)->platform_data; ++ snd_soc_card_cml.dev = &pdev->dev; ++ platform_name = mach->mach_params.platform; ++ ++ /* set platform name for each dailink */ ++ ret = snd_soc_fixup_dai_links_platform_name(&snd_soc_card_cml, ++ platform_name); ++ if (ret) ++ return ret; ++ ++ ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; ++ ++ snd_soc_card_set_drvdata(&snd_soc_card_cml, ctx); ++ ++ return devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cml); ++} ++ ++static struct platform_driver snd_cml_rt1011_rt5682_driver = { ++ .probe = snd_cml_rt1011_probe, ++ .driver = { ++ .name = "cml_rt1011_rt5682", ++ .pm = &snd_soc_pm_ops, ++ }, ++}; ++module_platform_driver(snd_cml_rt1011_rt5682_driver); ++ ++/* Module information */ ++MODULE_DESCRIPTION("Cometlake Audio Machine driver - RT1011 and RT5682 in I2S mode"); ++MODULE_AUTHOR("Naveen Manohar "); ++MODULE_AUTHOR("Sathya Prakash M R "); ++MODULE_AUTHOR("Shuming Fan "); ++MODULE_LICENSE("GPL v2"); ++MODULE_ALIAS("platform:cml_rt1011_rt5682"); +-- +2.20.1 + + +From 0ce85d8a56990759d10305784278be01bb32633b Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 1 Nov 2019 12:30:37 -0500 +Subject: [PATCH 064/130] ASoC: Intel: add mutual exclusion between SOF and + legacy Baytrail driver + +This legacy driver is already deprecated, let's make sure there is no +conflict with SOF. + +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101173045.27099-4-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 280393b712b7e338addc2f7f60b4e4da787ba19b) +Bugzilla: 1772498 +--- + sound/soc/intel/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig +index 7e9feca333b7..d6c5c68b7499 100644 +--- a/sound/soc/intel/Kconfig ++++ b/sound/soc/intel/Kconfig +@@ -65,7 +65,7 @@ config SND_SOC_INTEL_HASWELL + + config SND_SOC_INTEL_BAYTRAIL + tristate "Baytrail (legacy) Platforms" +- depends on DMADEVICES && ACPI && SND_SST_ATOM_HIFI2_PLATFORM=n ++ depends on DMADEVICES && ACPI && SND_SST_ATOM_HIFI2_PLATFORM=n && SND_SOC_SOF_BAYTRAIL=n + select SND_SOC_INTEL_SST + select SND_SOC_INTEL_SST_ACPI + select SND_SOC_INTEL_SST_FIRMWARE +-- +2.20.1 + + +From 5626167a66bddb85e0a33735c85dfb45781f4bce Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 1 Nov 2019 12:30:41 -0500 +Subject: [PATCH 065/130] ASoC: Intel: Skylake: mark HDAudio codec support as + deprecated. + +This option famously broke audio on Linus' laptop and the problem have +not been fixed. + +Mark as DEPRECATED to avoid any ambiguity with distros. + +Use SOF if you need HDaudio support w/ the DSP enabled, e.g. for DMIC +capture. + +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101173045.27099-8-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 02701b909c2fab4b49f9c9545ab921c9b2c7a768) +Bugzilla: 1772498 +--- + sound/soc/intel/Kconfig | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig +index d6c5c68b7499..c8de0bb5bed9 100644 +--- a/sound/soc/intel/Kconfig ++++ b/sound/soc/intel/Kconfig +@@ -209,9 +209,12 @@ config SND_SOC_INTEL_SKYLAKE_SSP_CLK + config SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC + bool "HDAudio codec support" + help +- If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/ +- GeminiLake or CannonLake platform with an HDaudio codec +- then enable this option by saying Y ++ This option broke audio on Linus' Skylake laptop in December 2018 ++ and the race conditions during the probe were not fixed since. ++ This option is DEPRECATED, all HDaudio codec support needs ++ to be handled by the SOF driver. ++ Distributions should not enable this option and there are no known ++ users of this capability. + + config SND_SOC_INTEL_SKYLAKE_COMMON + tristate +-- +2.20.1 + + +From 61e12eb73831fdc01c8b251a41ba4851a57c0370 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 1 Nov 2019 12:30:42 -0500 +Subject: [PATCH 066/130] ASoC: Intel: boards: remove select SND_HDA_DSP_LOADER + +This option is only required with the Skylake platform driver, there +is no reason to have this option in machine drivers. This is +e.g. useless for SOF-based solutions. + +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101173045.27099-9-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 9e7301762f6df44bb4a452b6aecbe0f322b370ee) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/Kconfig | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig +index ef40f83e0a3b..91952ffc0b67 100644 +--- a/sound/soc/intel/boards/Kconfig ++++ b/sound/soc/intel/boards/Kconfig +@@ -270,7 +270,6 @@ config SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH + depends on I2C && ACPI + depends on MFD_INTEL_LPSS || COMPILE_TEST + select SND_SOC_INTEL_DA7219_MAX98357A_GENERIC +- select SND_HDA_DSP_LOADER + help + This adds support for ASoC machine driver for Broxton-P platforms + with DA7219 + MAX98357A I2S audio codec. +@@ -284,7 +283,6 @@ config SND_SOC_INTEL_BXT_RT298_MACH + select SND_SOC_RT298 + select SND_SOC_DMIC + select SND_SOC_HDAC_HDMI +- select SND_HDA_DSP_LOADER + help + This adds support for ASoC machine driver for Broxton platforms + with RT286 I2S audio codec. +@@ -375,7 +373,6 @@ config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH + select SND_SOC_MAX98357A + select SND_SOC_DMIC + select SND_SOC_HDAC_HDMI +- select SND_HDA_DSP_LOADER + help + This adds support for ASoC machine driver for Geminilake platforms + with RT5682 + MAX98357A I2S audio codec. +-- +2.20.1 + + +From 299b13ab242eba943e1d2b54ac43e7148470d435 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 1 Nov 2019 12:30:43 -0500 +Subject: [PATCH 067/130] ASoC: Intel: boards: fix configs for + bxt-da7219-max98057a + +The same driver is reused for 3 different configurations, but the +driver will only be build if ApolloLake is selected. + +Fix and make sure each device can work without dependencies on others +(useful for minimal configurations). + +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101173045.27099-10-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit c4a09f9a523e674ef9a046e05d99c90f2c9513b1) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/Kconfig | 24 ++++++++++++++++++++++-- + sound/soc/intel/boards/Makefile | 2 +- + 2 files changed, 23 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig +index 91952ffc0b67..826694ecfdbf 100644 +--- a/sound/soc/intel/boards/Kconfig ++++ b/sound/soc/intel/boards/Kconfig +@@ -263,13 +263,17 @@ config SND_SOC_INTEL_DA7219_MAX98357A_GENERIC + select SND_SOC_DMIC + select SND_SOC_HDAC_HDMI + ++config SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON ++ tristate ++ select SND_SOC_INTEL_DA7219_MAX98357A_GENERIC ++ + if SND_SOC_INTEL_APL + + config SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH + tristate "Broxton with DA7219 and MAX98357A in I2S Mode" + depends on I2C && ACPI + depends on MFD_INTEL_LPSS || COMPILE_TEST +- select SND_SOC_INTEL_DA7219_MAX98357A_GENERIC ++ select SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON + help + This adds support for ASoC machine driver for Broxton-P platforms + with DA7219 + MAX98357A I2S audio codec. +@@ -365,6 +369,17 @@ endif ## SND_SOC_INTEL_KBL + + if SND_SOC_INTEL_GLK || (SND_SOC_SOF_GEMINILAKE && SND_SOC_SOF_HDA_LINK) + ++config SND_SOC_INTEL_GLK_DA7219_MAX98357A_MACH ++ tristate "GLK with DA7219 and MAX98357A in I2S Mode" ++ depends on I2C && ACPI ++ depends on MFD_INTEL_LPSS || COMPILE_TEST ++ select SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON ++ help ++ This adds support for ASoC machine driver for Geminilake platforms ++ with DA7219 + MAX98357A I2S audio codec. ++ Say Y or m if you have such a device. This is a recommended option. ++ If unsure select "N". ++ + config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH + tristate "GLK with RT5682 and MAX98357A in I2S Mode" + depends on I2C && ACPI +@@ -418,7 +433,12 @@ config SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH + tristate "CML_LP with DA7219 and MAX98357A in I2S Mode" + depends on I2C && ACPI + depends on MFD_INTEL_LPSS || COMPILE_TEST +- select SND_SOC_INTEL_DA7219_MAX98357A_GENERIC ++ select SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON ++ help ++ This adds support for ASoC machine driver for Cometlake platforms ++ with DA7219 + MAX98357A I2S audio codec. ++ Say Y or m if you have such a device. This is a recommended option. ++ If unsure select "N". + + config SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH + tristate "CML with RT1011 and RT5682 in I2S Mode" +diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile +index 9ae6544c6f3b..ba1aa89db09d 100644 +--- a/sound/soc/intel/boards/Makefile ++++ b/sound/soc/intel/boards/Makefile +@@ -33,7 +33,7 @@ obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o + obj-$(CONFIG_SND_SOC_INTEL_HASWELL_MACH) += snd-soc-sst-haswell.o + obj-$(CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH) += snd-soc-sst-byt-rt5640-mach.o + obj-$(CONFIG_SND_SOC_INTEL_BYT_MAX98090_MACH) += snd-soc-sst-byt-max98090-mach.o +-obj-$(CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH) += snd-soc-sst-bxt-da7219_max98357a.o ++obj-$(CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON) += snd-soc-sst-bxt-da7219_max98357a.o + obj-$(CONFIG_SND_SOC_INTEL_BXT_RT298_MACH) += snd-soc-sst-bxt-rt298.o + obj-$(CONFIG_SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH) += snd-soc-sst-glk-rt5682_max98357a.o + obj-$(CONFIG_SND_SOC_INTEL_BROADWELL_MACH) += snd-soc-sst-broadwell.o +-- +2.20.1 + + +From 39c98691a7108dbaeb9bab734553207553111ca5 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 1 Nov 2019 12:30:44 -0500 +Subject: [PATCH 068/130] ASoC: Intel: boards: Geminilake is only supported by + SOF + +Geminilake machine drivers are only tested and recommended with SOF. + +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101173045.27099-11-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 3315e5b40f59d1aab6543773d99b1f19c3ea1848) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/Kconfig | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig +index 826694ecfdbf..76d1e6ab30b5 100644 +--- a/sound/soc/intel/boards/Kconfig ++++ b/sound/soc/intel/boards/Kconfig +@@ -367,7 +367,7 @@ config SND_SOC_INTEL_KBL_RT5660_MACH + + endif ## SND_SOC_INTEL_KBL + +-if SND_SOC_INTEL_GLK || (SND_SOC_SOF_GEMINILAKE && SND_SOC_SOF_HDA_LINK) ++if SND_SOC_SOF_GEMINILAKE && SND_SOC_SOF_HDA_LINK + + config SND_SOC_INTEL_GLK_DA7219_MAX98357A_MACH + tristate "GLK with DA7219 and MAX98357A in I2S Mode" +@@ -394,7 +394,7 @@ config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH + Say Y if you have such a device. + If unsure select "N". + +-endif ## SND_SOC_INTEL_GLK || (SND_SOC_SOF_GEMINILAKE && SND_SOC_SOF_HDA_LINK) ++endif ## SND_SOC_SOF_GEMINILAKE && SND_SOC_SOF_HDA_LINK + + if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC || SND_SOC_SOF_HDA_AUDIO_CODEC + +-- +2.20.1 + + +From 7b646af780bfa2e42b8e89856172469a540e7186 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Fri, 1 Nov 2019 12:30:45 -0500 +Subject: [PATCH 069/130] ASoC: Intel: boards: sof_rt5682: use dependency on + SOF_HDA_LINK + +The wrong dependency is used and the build can be broken + +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101173045.27099-12-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 8039105987fcd8dda39074df013cfdf0025dd297) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/Kconfig | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig +index 76d1e6ab30b5..2702aefee775 100644 +--- a/sound/soc/intel/boards/Kconfig ++++ b/sound/soc/intel/boards/Kconfig +@@ -411,11 +411,11 @@ config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH + + endif ## SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC || SND_SOC_SOF_HDA_AUDIO_CODEC + +-if SND_SOC_SOF_HDA_COMMON || SND_SOC_SOF_BAYTRAIL ++if SND_SOC_SOF_HDA_LINK || SND_SOC_SOF_BAYTRAIL + config SND_SOC_INTEL_SOF_RT5682_MACH + tristate "SOF with rt5682 codec in I2S Mode" + depends on I2C && ACPI +- depends on (SND_SOC_SOF_HDA_COMMON && (MFD_INTEL_LPSS || COMPILE_TEST)) ||\ ++ depends on (SND_SOC_SOF_HDA_LINK && (MFD_INTEL_LPSS || COMPILE_TEST)) ||\ + (SND_SOC_SOF_BAYTRAIL && (X86_INTEL_LPSS || COMPILE_TEST)) + select SND_SOC_RT5682 + select SND_SOC_DMIC +@@ -425,7 +425,7 @@ config SND_SOC_INTEL_SOF_RT5682_MACH + with rt5682 codec. + Say Y if you have such a device. + If unsure select "N". +-endif ## SND_SOC_SOF_HDA_COMMON || SND_SOC_SOF_BAYTRAIL ++endif ## SND_SOC_SOF_HDA_LINK || SND_SOC_SOF_BAYTRAIL + + if (SND_SOC_SOF_COMETLAKE_LP && SND_SOC_SOF_HDA_LINK) + +-- +2.20.1 + + +From 02f03f3b08ed85cb5c0b1c270eb91bc714721641 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Fri, 8 Nov 2019 10:46:37 +0100 +Subject: [PATCH 070/130] ASoC: intel: Avoid non-standard macro usage + +Pass the device pointer from the PCI pointer directly, instead of a +non-standard macro. The macro didn't give any better readability. + +Acked-by: Mark Brown +Link: https://lore.kernel.org/r/20191108094641.20086-5-tiwai@suse.de +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 6420c24a30006e2fdbc292f88d37db56ca28f6e8) +Bugzilla: 1772498 +--- + sound/soc/intel/skylake/skl-pcm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c +index 7f287424af9b..07bc047f077e 100644 +--- a/sound/soc/intel/skylake/skl-pcm.c ++++ b/sound/soc/intel/skylake/skl-pcm.c +@@ -1310,7 +1310,7 @@ static int skl_pcm_new(struct snd_soc_pcm_runtime *rtd) + size = MAX_PREALLOC_SIZE; + snd_pcm_lib_preallocate_pages_for_all(pcm, + SNDRV_DMA_TYPE_DEV_SG, +- snd_dma_pci_data(skl->pci), ++ &skl->pci->dev, + size, MAX_PREALLOC_SIZE); + } + +-- +2.20.1 + + +From 3541bd9bf269e2df13150125f7e417632967e292 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:09 -0500 +Subject: [PATCH 071/130] ASoC: SOF: ipc: introduce message for DSP power + gating + +Add new ipc messages which will be sent from driver to FW, to ask FW to +enter specific power saving state. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-14-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 10992004e1e960c7e256ec70c7ab22895a7003d7) +Bugzilla: 1772498 +--- + include/sound/sof/header.h | 1 + + include/sound/sof/pm.h | 8 ++++++++ + 2 files changed, 9 insertions(+) + +diff --git a/include/sound/sof/header.h b/include/sound/sof/header.h +index 332143ff7278..bf3edd9c08b4 100644 +--- a/include/sound/sof/header.h ++++ b/include/sound/sof/header.h +@@ -75,6 +75,7 @@ + #define SOF_IPC_PM_CLK_GET SOF_CMD_TYPE(0x005) + #define SOF_IPC_PM_CLK_REQ SOF_CMD_TYPE(0x006) + #define SOF_IPC_PM_CORE_ENABLE SOF_CMD_TYPE(0x007) ++#define SOF_IPC_PM_GATE SOF_CMD_TYPE(0x008) + + /* component runtime config - multiple different types */ + #define SOF_IPC_COMP_SET_VALUE SOF_CMD_TYPE(0x001) +diff --git a/include/sound/sof/pm.h b/include/sound/sof/pm.h +index 003879401d63..3cf2e0f39d94 100644 +--- a/include/sound/sof/pm.h ++++ b/include/sound/sof/pm.h +@@ -45,4 +45,12 @@ struct sof_ipc_pm_core_config { + uint32_t enable_mask; + } __packed; + ++struct sof_ipc_pm_gate { ++ struct sof_ipc_cmd_hdr hdr; ++ uint32_t flags; /* platform specific */ ++ ++ /* reserved for future use */ ++ uint32_t reserved[5]; ++} __packed; ++ + #endif +-- +2.20.1 + + +From 145c89d929bcdf53b50c6528997bfc2595883513 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:40:57 -0500 +Subject: [PATCH 072/130] ASoC: SOF: add a field to store the current D0 + substate of DSP + +Add field d0_substate to struct snd_sof_dev to store the current DSP +D0 sub-state(only meaningful when DSP in D0), which could be D0I0 or +D0I3. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 4c19030c511fd6eab029bae838f736256d2f43cd) +Bugzilla: 1772498 +--- + sound/soc/sof/sof-priv.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h +index 2d40de5ee285..481dfe4ee2d0 100644 +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -68,6 +68,12 @@ extern int sof_core_debug; + + #define DMA_CHAN_INVALID 0xFFFFFFFF + ++/* DSP D0ix sub-state */ ++enum sof_d0_substate { ++ SOF_DSP_D0I0 = 0, /* DSP default D0 substate */ ++ SOF_DSP_D0I3, /* DSP D0i3(low power) substate*/ ++}; ++ + struct snd_sof_dev; + struct snd_sof_ipc_msg; + struct snd_sof_ipc; +@@ -387,6 +393,9 @@ struct snd_sof_dev { + */ + struct snd_soc_component_driver plat_drv; + ++ /* power states related */ ++ enum sof_d0_substate d0_substate; ++ + /* DSP firmware boot */ + wait_queue_head_t boot_wait; + u32 boot_complete; +-- +2.20.1 + + +From b5d42bad1c65b0b71c7a1115a9d50f25a24c2351 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:40:58 -0500 +Subject: [PATCH 073/130] ASoC: SOF: reset default d0_substate at probe() and + resume() + +We initialize/reset d0_substate to default d0i0 value when doing +transition D3-->D0, e.g. at success of probing and resuming. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-3-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 09fe6b528886c0d07ce539b837749edcc46618d0) +Bugzilla: 1772498 +--- + sound/soc/sof/core.c | 3 +++ + sound/soc/sof/pm.c | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c +index 5998861a9002..8661c2cca76b 100644 +--- a/sound/soc/sof/core.c ++++ b/sound/soc/sof/core.c +@@ -458,6 +458,9 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data) + /* initialize sof device */ + sdev->dev = dev; + ++ /* initialize default D0 sub-state */ ++ sdev->d0_substate = SOF_DSP_D0I0; ++ + sdev->pdata = plat_data; + sdev->first_boot = true; + dev_set_drvdata(dev, sdev); +diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c +index e23beaeefe00..81e623dfc7e5 100644 +--- a/sound/soc/sof/pm.c ++++ b/sound/soc/sof/pm.c +@@ -326,6 +326,9 @@ static int sof_resume(struct device *dev, bool runtime_resume) + "error: ctx_restore ipc error during resume %d\n", + ret); + ++ /* initialize default D0 sub-state */ ++ sdev->d0_substate = SOF_DSP_D0I0; ++ + return ret; + } + +-- +2.20.1 + + +From 3cf1bbbb4506efc80e8066c4d40e92264f26eec7 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:40:59 -0500 +Subject: [PATCH 074/130] ASoC: SOF: add set_power_state() to dsp_ops for power + state update + +D0i3 is a platform-defined substate of D0, so we need a +platform-specific callback in dsp_ops to handle the relevant +configurations. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-4-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit e8f112d8c29f44ded83f97828c104bf0904871ec) +Bugzilla: 1772498 +--- + sound/soc/sof/ops.h | 9 +++++++++ + sound/soc/sof/sof-priv.h | 2 ++ + 2 files changed, 11 insertions(+) + +diff --git a/sound/soc/sof/ops.h b/sound/soc/sof/ops.h +index 824d36fe59fd..d7c8fc06f961 100644 +--- a/sound/soc/sof/ops.h ++++ b/sound/soc/sof/ops.h +@@ -193,6 +193,15 @@ static inline int snd_sof_dsp_set_clk(struct snd_sof_dev *sdev, u32 freq) + return 0; + } + ++static inline int snd_sof_dsp_set_power_state(struct snd_sof_dev *sdev, ++ enum sof_d0_substate substate) ++{ ++ if (sof_ops(sdev)->set_power_state) ++ return sof_ops(sdev)->set_power_state(sdev, substate); ++ ++ return 0; ++} ++ + /* debug */ + static inline void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags) + { +diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h +index 481dfe4ee2d0..e9902e4e8e55 100644 +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -189,6 +189,8 @@ struct snd_sof_dsp_ops { + int (*runtime_resume)(struct snd_sof_dev *sof_dev); /* optional */ + int (*runtime_idle)(struct snd_sof_dev *sof_dev); /* optional */ + int (*set_hw_params_upon_resume)(struct snd_sof_dev *sdev); /* optional */ ++ int (*set_power_state)(struct snd_sof_dev *sdev, ++ enum sof_d0_substate d0_substate); /* optional */ + + /* DSP clocking */ + int (*set_clk)(struct snd_sof_dev *sof_dev, u32 freq); /* optional */ +-- +2.20.1 + + +From 00b28b09cc4fb52852651219ac1369041484770d Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:00 -0500 +Subject: [PATCH 075/130] ASoC: SOF: Intel: hda-dsp: Add helper for setting DSP + D0ix substate + +Adding helper to implement setting dsp to d0i3 or d0i0 status, this will +be needed for driver D0ix support. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-5-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 62f8f76604623980d41cf73691ca45288871efd9) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda-dsp.c | 46 +++++++++++++++++++++++++++++++++++ + sound/soc/sof/intel/hda.h | 10 ++++++++ + 2 files changed, 56 insertions(+) + +diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c +index 3ea401646e0c..fa2f1f66c72c 100644 +--- a/sound/soc/sof/intel/hda-dsp.c ++++ b/sound/soc/sof/intel/hda-dsp.c +@@ -306,6 +306,52 @@ void hda_dsp_ipc_int_disable(struct snd_sof_dev *sdev) + HDA_DSP_REG_HIPCCTL_BUSY | HDA_DSP_REG_HIPCCTL_DONE, 0); + } + ++static int hda_dsp_wait_d0i3c_done(struct snd_sof_dev *sdev, int retry) ++{ ++ struct hdac_bus *bus = sof_to_bus(sdev); ++ ++ while (snd_hdac_chip_readb(bus, VS_D0I3C) & SOF_HDA_VS_D0I3C_CIP) { ++ if (!retry--) ++ return -ETIMEDOUT; ++ usleep_range(10, 15); ++ } ++ ++ return 0; ++} ++ ++int hda_dsp_set_power_state(struct snd_sof_dev *sdev, ++ enum sof_d0_substate d0_substate) ++{ ++ struct hdac_bus *bus = sof_to_bus(sdev); ++ int retry = 50; ++ int ret; ++ u8 value; ++ ++ /* Write to D0I3C after Command-In-Progress bit is cleared */ ++ ret = hda_dsp_wait_d0i3c_done(sdev, retry); ++ if (ret < 0) { ++ dev_err(bus->dev, "CIP timeout before update D0I3C!\n"); ++ return ret; ++ } ++ ++ /* Update D0I3C register */ ++ value = d0_substate == SOF_DSP_D0I3 ? SOF_HDA_VS_D0I3C_I3 : 0; ++ snd_hdac_chip_updateb(bus, VS_D0I3C, SOF_HDA_VS_D0I3C_I3, value); ++ ++ /* Wait for cmd in progress to be cleared before exiting the function */ ++ retry = 50; ++ ret = hda_dsp_wait_d0i3c_done(sdev, retry); ++ if (ret < 0) { ++ dev_err(bus->dev, "CIP timeout after D0I3C updated!\n"); ++ return ret; ++ } ++ ++ dev_vdbg(bus->dev, "D0I3C updated, register = 0x%x\n", ++ snd_hdac_chip_readb(bus, VS_D0I3C)); ++ ++ return 0; ++} ++ + static int hda_suspend(struct snd_sof_dev *sdev, bool runtime_suspend) + { + struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; +diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h +index d6ef657b8900..21b0e180017a 100644 +--- a/sound/soc/sof/intel/hda.h ++++ b/sound/soc/sof/intel/hda.h +@@ -64,6 +64,13 @@ + #define SOF_HDA_PPCTL_PIE BIT(31) + #define SOF_HDA_PPCTL_GPROCEN BIT(30) + ++/*Vendor Specific Registers*/ ++#define SOF_HDA_VS_D0I3C 0x104A ++ ++/* D0I3C Register fields */ ++#define SOF_HDA_VS_D0I3C_CIP BIT(0) /* Command-In-Progress */ ++#define SOF_HDA_VS_D0I3C_I3 BIT(2) /* D0i3 enable bit */ ++ + /* DPIB entry size: 8 Bytes = 2 DWords */ + #define SOF_HDA_DPIB_ENTRY_SIZE 0x8 + +@@ -455,6 +462,9 @@ int hda_dsp_core_reset_power_down(struct snd_sof_dev *sdev, + void hda_dsp_ipc_int_enable(struct snd_sof_dev *sdev); + void hda_dsp_ipc_int_disable(struct snd_sof_dev *sdev); + ++int hda_dsp_set_power_state(struct snd_sof_dev *sdev, ++ enum sof_d0_substate d0_substate); ++ + int hda_dsp_suspend(struct snd_sof_dev *sdev); + int hda_dsp_resume(struct snd_sof_dev *sdev); + int hda_dsp_runtime_suspend(struct snd_sof_dev *sdev); +-- +2.20.1 + + +From d2b397a84c59634c88d3750db429f5be2e3a77ae Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:01 -0500 +Subject: [PATCH 076/130] ASoC: SOF: Intel: CNL: add set_power_state() ops + +Using hda_dsp_set_power_state() as set_power_state() ops for cnl to do +d0ix platform configuration updates. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-6-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 73b51957122dc47a40325a5359b44ef337cbf217) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/cnl.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/sof/intel/cnl.c b/sound/soc/sof/intel/cnl.c +index e9cdcc040fb5..982b81a0b13a 100644 +--- a/sound/soc/sof/intel/cnl.c ++++ b/sound/soc/sof/intel/cnl.c +@@ -255,6 +255,7 @@ const struct snd_sof_dsp_ops sof_cnl_ops = { + .runtime_resume = hda_dsp_runtime_resume, + .runtime_idle = hda_dsp_runtime_idle, + .set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume, ++ .set_power_state = hda_dsp_set_power_state, + + /* ALSA HW info flags */ + .hw_info = SNDRV_PCM_INFO_MMAP | +-- +2.20.1 + + +From 7cb0adf614bc8d756f22dddd17f9eda4d48d6ee7 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:02 -0500 +Subject: [PATCH 077/130] ASoC: SOF: Intel: APL: add set_power_state() ops + +Using hda_dsp_set_power_state() as set_power_state() ops for apl to do +d0ix platform configuration updates. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-7-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 35c930ba6025964ac71f041065ae212a0fcc7cca) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/apl.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/sof/intel/apl.c b/sound/soc/sof/intel/apl.c +index 15d26e8d90a9..7daa8eb456c8 100644 +--- a/sound/soc/sof/intel/apl.c ++++ b/sound/soc/sof/intel/apl.c +@@ -97,6 +97,7 @@ const struct snd_sof_dsp_ops sof_apl_ops = { + .runtime_resume = hda_dsp_runtime_resume, + .runtime_idle = hda_dsp_runtime_idle, + .set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume, ++ .set_power_state = hda_dsp_set_power_state, + + /* ALSA HW info flags */ + .hw_info = SNDRV_PCM_INFO_MMAP | +-- +2.20.1 + + +From e1f3cdb3b898b881acc9465773ff534a26f37cd9 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:03 -0500 +Subject: [PATCH 078/130] ASoC: SOF: add flag to snd_sof_pcm_stream for D0i3 + compatible stream + +Add flag d0i3_compatible to struct snd_sof_pcm_stream to denote if the +stream can tolerate a transition to the D0i3 substate while opened (thus +seen as 'active' by pm_runtime). + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-8-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit e5c97e88084b8dca6850eba5d2937716b88306c1) +Bugzilla: 1772498 +--- + sound/soc/sof/sof-priv.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h +index e9902e4e8e55..7a21a45d3635 100644 +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -310,6 +310,7 @@ struct snd_sof_pcm_stream { + struct sof_ipc_stream_posn posn; + struct snd_pcm_substream *substream; + struct work_struct period_elapsed_work; ++ bool d0i3_compatible; /* DSP can be in D0I3 when this pcm is opened */ + }; + + /* ALSA SOF PCM device */ +-- +2.20.1 + + +From 84bac6cfab76bb8e71b50054d9576aacb6e4c0d2 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:04 -0500 +Subject: [PATCH 079/130] ASoC: SOF: token: add tokens for PCM compatible with + D0i3 substate + +Add stream token SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3 and +SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3 to denote if the stream can be +opened at low power d0i3 status or not. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-9-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 4a94940988cc44adeb383401dea0beeac4abbe63) +Bugzilla: 1772498 +--- + include/uapi/sound/sof/tokens.h | 4 ++++ + sound/soc/sof/topology.c | 10 ++++++++++ + 2 files changed, 14 insertions(+) + +diff --git a/include/uapi/sound/sof/tokens.h b/include/uapi/sound/sof/tokens.h +index d65406f34361..76883e6fb750 100644 +--- a/include/uapi/sound/sof/tokens.h ++++ b/include/uapi/sound/sof/tokens.h +@@ -113,6 +113,10 @@ + /* ESAI */ + #define SOF_TKN_IMX_ESAI_MCLK_ID 1100 + ++/* Stream */ ++#define SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3 1200 ++#define SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3 1201 ++ + /* Led control for mute switches */ + #define SOF_TKN_MUTE_LED_USE 1300 + #define SOF_TKN_MUTE_LED_DIRECTION 1301 +diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c +index 8032bb8a709c..c4bc23163497 100644 +--- a/sound/soc/sof/topology.c ++++ b/sound/soc/sof/topology.c +@@ -735,6 +735,16 @@ static const struct sof_topology_token pcm_tokens[] = { + offsetof(struct sof_ipc_comp_host, dmac_config), 0}, + }; + ++/* PCM */ ++static const struct sof_topology_token stream_tokens[] = { ++ {SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3, ++ SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16, ++ offsetof(struct snd_sof_pcm, stream[0].d0i3_compatible), 0}, ++ {SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3, ++ SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16, ++ offsetof(struct snd_sof_pcm, stream[1].d0i3_compatible), 0}, ++}; ++ + /* Generic components */ + static const struct sof_topology_token comp_tokens[] = { + {SOF_TKN_COMP_PERIOD_SINK_COUNT, +-- +2.20.1 + + +From 178524d176b58f1c218cf1ddf701cfa7fa7a9a04 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:05 -0500 +Subject: [PATCH 080/130] ASoC: SOF: topology: parse and store d0i3_compatible + flag + +Parses the token from tplg file and store it to snd_sof_pcm_stream +d0i3_compatible flag, which can be used later for d0ix transition +management. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-10-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit c5232c0171428f005a3204e1c264231fb5999b28) +Bugzilla: 1772498 +--- + sound/soc/sof/topology.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c +index c4bc23163497..9e3996125d03 100644 +--- a/sound/soc/sof/topology.c ++++ b/sound/soc/sof/topology.c +@@ -2308,6 +2308,7 @@ static int sof_dai_load(struct snd_soc_component *scomp, int index, + { + struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); + struct snd_soc_tplg_stream_caps *caps; ++ struct snd_soc_tplg_private *private = &pcm->priv; + struct snd_sof_pcm *spcm; + int stream = SNDRV_PCM_STREAM_PLAYBACK; + int ret = 0; +@@ -2330,10 +2331,22 @@ static int sof_dai_load(struct snd_soc_component *scomp, int index, + dai_drv->dobj.private = spcm; + list_add(&spcm->list, &sdev->pcm_list); + ++ ret = sof_parse_tokens(scomp, spcm, stream_tokens, ++ ARRAY_SIZE(stream_tokens), private->array, ++ le32_to_cpu(private->size)); ++ if (ret) { ++ dev_err(sdev->dev, "error: parse stream tokens failed %d\n", ++ le32_to_cpu(private->size)); ++ return ret; ++ } ++ + /* do we need to allocate playback PCM DMA pages */ + if (!spcm->pcm.playback) + goto capture; + ++ dev_vdbg(sdev->dev, "tplg: pcm %s stream tokens: playback d0i3:%d\n", ++ spcm->pcm.pcm_name, spcm->stream[0].d0i3_compatible); ++ + caps = &spcm->pcm.caps[stream]; + + /* allocate playback page table buffer */ +@@ -2361,6 +2374,9 @@ static int sof_dai_load(struct snd_soc_component *scomp, int index, + if (!spcm->pcm.capture) + return ret; + ++ dev_vdbg(sdev->dev, "tplg: pcm %s stream tokens: capture d0i3:%d\n", ++ spcm->pcm.pcm_name, spcm->stream[1].d0i3_compatible); ++ + caps = &spcm->pcm.caps[stream]; + + /* allocate capture page table buffer */ +-- +2.20.1 + + +From 99f21fd84280a7fc9a6f33f8f82b757306db97e7 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:06 -0500 +Subject: [PATCH 081/130] ASoC: SOF: Intel: hda-dsp: align the comments for + D0I3C update + +Align the logs for CIP timeout at D0I3C.I3 updating. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-11-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit aae7c82d01219bf568a7b12f5839d7ca52b17d59) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda-dsp.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c +index fa2f1f66c72c..74805a066183 100644 +--- a/sound/soc/sof/intel/hda-dsp.c ++++ b/sound/soc/sof/intel/hda-dsp.c +@@ -330,7 +330,7 @@ int hda_dsp_set_power_state(struct snd_sof_dev *sdev, + /* Write to D0I3C after Command-In-Progress bit is cleared */ + ret = hda_dsp_wait_d0i3c_done(sdev, retry); + if (ret < 0) { +- dev_err(bus->dev, "CIP timeout before update D0I3C!\n"); ++ dev_err(bus->dev, "CIP timeout before D0I3C update!\n"); + return ret; + } + +@@ -342,7 +342,7 @@ int hda_dsp_set_power_state(struct snd_sof_dev *sdev, + retry = 50; + ret = hda_dsp_wait_d0i3c_done(sdev, retry); + if (ret < 0) { +- dev_err(bus->dev, "CIP timeout after D0I3C updated!\n"); ++ dev_err(bus->dev, "CIP timeout after D0I3C update!\n"); + return ret; + } + +-- +2.20.1 + + +From f672aa4a4452ca0d79a8f6b44c76c0139f6f99ec Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:07 -0500 +Subject: [PATCH 082/130] ASoC: SOF: Intel: HDA: use macro for register polling + retry count + +Define macro and use it for the register polling retry count. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-12-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 92f4beb718d76e93b76343a3ba872df6cb210672) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda-dsp.c | 6 ++---- + sound/soc/sof/intel/hda.h | 1 + + 2 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c +index 74805a066183..936361bd25e9 100644 +--- a/sound/soc/sof/intel/hda-dsp.c ++++ b/sound/soc/sof/intel/hda-dsp.c +@@ -323,12 +323,11 @@ int hda_dsp_set_power_state(struct snd_sof_dev *sdev, + enum sof_d0_substate d0_substate) + { + struct hdac_bus *bus = sof_to_bus(sdev); +- int retry = 50; + int ret; + u8 value; + + /* Write to D0I3C after Command-In-Progress bit is cleared */ +- ret = hda_dsp_wait_d0i3c_done(sdev, retry); ++ ret = hda_dsp_wait_d0i3c_done(sdev, HDA_DSP_REG_POLL_RETRY_COUNT); + if (ret < 0) { + dev_err(bus->dev, "CIP timeout before D0I3C update!\n"); + return ret; +@@ -339,8 +338,7 @@ int hda_dsp_set_power_state(struct snd_sof_dev *sdev, + snd_hdac_chip_updateb(bus, VS_D0I3C, SOF_HDA_VS_D0I3C_I3, value); + + /* Wait for cmd in progress to be cleared before exiting the function */ +- retry = 50; +- ret = hda_dsp_wait_d0i3c_done(sdev, retry); ++ ret = hda_dsp_wait_d0i3c_done(sdev, HDA_DSP_REG_POLL_RETRY_COUNT); + if (ret < 0) { + dev_err(bus->dev, "CIP timeout after D0I3C update!\n"); + return ret; +diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h +index 21b0e180017a..5a089efc0e4c 100644 +--- a/sound/soc/sof/intel/hda.h ++++ b/sound/soc/sof/intel/hda.h +@@ -214,6 +214,7 @@ + #define HDA_DSP_CTRL_RESET_TIMEOUT 100 + #define HDA_DSP_WAIT_TIMEOUT 500 /* 500 msec */ + #define HDA_DSP_REG_POLL_INTERVAL_US 500 /* 0.5 msec */ ++#define HDA_DSP_REG_POLL_RETRY_COUNT 50 + + #define HDA_DSP_ADSPIC_IPC 1 + #define HDA_DSP_ADSPIS_IPC 1 +-- +2.20.1 + + +From e21c6caf57e71006a145a73c117305e0fe2ea512 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:08 -0500 +Subject: [PATCH 083/130] ASoC: SOF: PM: rename sof_send_pm_ipc to + sof_send_pm_ctx_ipc + +The helper sof_send_pm_ipc() is only suitable for context save/restore +IPCs' sending, so rename it to sof_send_pm_ctx_ipc here. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-13-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 7c7eba2402c11137d1fa1d3fb964a2c6fc1ded3e) +Bugzilla: 1772498 +--- + sound/soc/sof/pm.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c +index 81e623dfc7e5..ac900fb3379e 100644 +--- a/sound/soc/sof/pm.c ++++ b/sound/soc/sof/pm.c +@@ -197,7 +197,7 @@ static int sof_restore_pipelines(struct snd_sof_dev *sdev) + return ret; + } + +-static int sof_send_pm_ipc(struct snd_sof_dev *sdev, int cmd) ++static int sof_send_pm_ctx_ipc(struct snd_sof_dev *sdev, int cmd) + { + struct sof_ipc_pm_ctx pm_ctx; + struct sof_ipc_reply reply; +@@ -320,7 +320,7 @@ static int sof_resume(struct device *dev, bool runtime_resume) + } + + /* notify DSP of system resume */ +- ret = sof_send_pm_ipc(sdev, SOF_IPC_PM_CTX_RESTORE); ++ ret = sof_send_pm_ctx_ipc(sdev, SOF_IPC_PM_CTX_RESTORE); + if (ret < 0) + dev_err(sdev->dev, + "error: ctx_restore ipc error during resume %d\n", +@@ -361,7 +361,7 @@ static int sof_suspend(struct device *dev, bool runtime_suspend) + sof_cache_debugfs(sdev); + #endif + /* notify DSP of upcoming power down */ +- ret = sof_send_pm_ipc(sdev, SOF_IPC_PM_CTX_SAVE); ++ ret = sof_send_pm_ctx_ipc(sdev, SOF_IPC_PM_CTX_SAVE); + if (ret == -EBUSY || ret == -EAGAIN) { + /* + * runtime PM has logic to handle -EBUSY/-EAGAIN so +-- +2.20.1 + + +From 0852a87eb392f8a9d735b60d3a151332da158519 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:10 -0500 +Subject: [PATCH 084/130] ASoC: SOF: Intel: hda-ipc: Don't read mailbox for + PM_GATE reply + +Memory windows could be powered off before receiving PM_GATE IPC reply +from FW, we can't read the mailbox to get reply. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-15-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 463fbf6dc03aff41e973602bbad6cb135fa6d48a) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda-ipc.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/sof/intel/hda-ipc.c b/sound/soc/sof/intel/hda-ipc.c +index 6aae6f18b3dc..0fd2153c1769 100644 +--- a/sound/soc/sof/intel/hda-ipc.c ++++ b/sound/soc/sof/intel/hda-ipc.c +@@ -83,10 +83,12 @@ void hda_dsp_ipc_get_reply(struct snd_sof_dev *sdev) + } + + hdr = msg->msg_data; +- if (hdr->cmd == (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_CTX_SAVE)) { ++ if (hdr->cmd == (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_CTX_SAVE) || ++ hdr->cmd == (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_GATE)) { + /* + * memory windows are powered off before sending IPC reply, +- * so we can't read the mailbox for CTX_SAVE reply. ++ * so we can't read the mailbox for CTX_SAVE and PM_GATE ++ * replies. + */ + reply.error = 0; + reply.hdr.cmd = SOF_IPC_GLB_REPLY; +-- +2.20.1 + + +From eee9b23d3c152581249c19f492cf21bd1e023a24 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:11 -0500 +Subject: [PATCH 085/130] ASoC: SOF: Intel: HDA: add cAVS specific compact IPC + header file + +On cAVS platforms, some IPCs are required to be sent via IPC registers +only(e.g. when in D0i3, mailbox is unaccessible), add hda-ipc.h to hold +definition of those compact IPCs. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-16-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 5056193d4d1a8b73087145add21141c46027d6a2) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda-ipc.h | 51 +++++++++++++++++++++++++++++++++++ + 1 file changed, 51 insertions(+) + create mode 100644 sound/soc/sof/intel/hda-ipc.h + +diff --git a/sound/soc/sof/intel/hda-ipc.h b/sound/soc/sof/intel/hda-ipc.h +new file mode 100644 +index 000000000000..aef0ceac9803 +--- /dev/null ++++ b/sound/soc/sof/intel/hda-ipc.h +@@ -0,0 +1,51 @@ ++/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ ++/* ++ * This file is provided under a dual BSD/GPLv2 license. When using or ++ * redistributing this file, you may do so under either license. ++ * ++ * Copyright(c) 2019 Intel Corporation. All rights reserved. ++ * ++ * Author: Keyon Jie ++ */ ++ ++#ifndef __SOF_INTEL_HDA_IPC_H ++#define __SOF_INTEL_HDA_IPC_H ++ ++/* ++ * Primary register, mapped to ++ * - DIPCTDR (HIPCIDR) in sideband IPC (cAVS 1.8+) ++ * - DIPCT in cAVS 1.5 IPC ++ * ++ * Secondary register, mapped to: ++ * - DIPCTDD (HIPCIDD) in sideband IPC (cAVS 1.8+) ++ * - DIPCTE in cAVS 1.5 IPC ++ */ ++ ++/* Common bits in primary register */ ++ ++/* Reserved for doorbell */ ++#define HDA_IPC_RSVD_31 BIT(31) ++/* Target, 0 - normal message, 1 - compact message(cAVS compatible) */ ++#define HDA_IPC_MSG_COMPACT BIT(30) ++/* Direction, 0 - request, 1 - response */ ++#define HDA_IPC_RSP BIT(29) ++ ++#define HDA_IPC_TYPE_SHIFT 24 ++#define HDA_IPC_TYPE_MASK GENMASK(28, 24) ++#define HDA_IPC_TYPE(x) ((x) << HDA_IPC_TYPE_SHIFT) ++ ++#define HDA_IPC_PM_GATE HDA_IPC_TYPE(0x8U) ++ ++/* Command specific payload bits in secondary register */ ++ ++/* Disable DMA tracing (0 - keep tracing, 1 - to disable DMA trace) */ ++#define HDA_PM_NO_DMA_TRACE BIT(4) ++/* Prevent clock gating (0 - cg allowed, 1 - DSP clock always on) */ ++#define HDA_PM_PCG BIT(3) ++/* Prevent power gating (0 - deep power state transitions allowed) */ ++#define HDA_PM_PPG BIT(2) ++/* Indicates whether streaming is active */ ++#define HDA_PM_PG_STREAMING BIT(1) ++#define HDA_PM_PG_RSVD BIT(0) ++ ++#endif +-- +2.20.1 + + +From 325dfda7c31d247932c0ec20eda966bf0ca24512 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:12 -0500 +Subject: [PATCH 086/130] ASoC: SOF: configure D0ix IPC flags in + set_power_state + +The configuration for D0ix in FW is platform specific, let's do this and +send IPC in the platform set_power_state() ops. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-17-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 534037fddd34b58be86a826d449a5a6635ecdbf5) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda-dsp.c | 32 +++++++++++++++++++++++++++++++- + 1 file changed, 31 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c +index 936361bd25e9..b5070409a5e3 100644 +--- a/sound/soc/sof/intel/hda-dsp.c ++++ b/sound/soc/sof/intel/hda-dsp.c +@@ -19,6 +19,7 @@ + #include + #include "../ops.h" + #include "hda.h" ++#include "hda-ipc.h" + + /* + * DSP Core control. +@@ -319,10 +320,28 @@ static int hda_dsp_wait_d0i3c_done(struct snd_sof_dev *sdev, int retry) + return 0; + } + ++static int hda_dsp_send_pm_gate_ipc(struct snd_sof_dev *sdev, u32 flags) ++{ ++ struct sof_ipc_pm_gate pm_gate; ++ struct sof_ipc_reply reply; ++ ++ memset(&pm_gate, 0, sizeof(pm_gate)); ++ ++ /* configure pm_gate ipc message */ ++ pm_gate.hdr.size = sizeof(pm_gate); ++ pm_gate.hdr.cmd = SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_GATE; ++ pm_gate.flags = flags; ++ ++ /* send pm_gate ipc to dsp */ ++ return sof_ipc_tx_message(sdev->ipc, pm_gate.hdr.cmd, &pm_gate, ++ sizeof(pm_gate), &reply, sizeof(reply)); ++} ++ + int hda_dsp_set_power_state(struct snd_sof_dev *sdev, + enum sof_d0_substate d0_substate) + { + struct hdac_bus *bus = sof_to_bus(sdev); ++ u32 flags; + int ret; + u8 value; + +@@ -347,7 +366,18 @@ int hda_dsp_set_power_state(struct snd_sof_dev *sdev, + dev_vdbg(bus->dev, "D0I3C updated, register = 0x%x\n", + snd_hdac_chip_readb(bus, VS_D0I3C)); + +- return 0; ++ if (d0_substate == SOF_DSP_D0I0) ++ flags = HDA_PM_PPG;/* prevent power gating in D0 */ ++ else ++ flags = HDA_PM_NO_DMA_TRACE;/* disable DMA trace in D0I3*/ ++ ++ /* sending pm_gate IPC */ ++ ret = hda_dsp_send_pm_gate_ipc(sdev, flags); ++ if (ret < 0) ++ dev_err(sdev->dev, ++ "error: PM_GATE ipc error %d\n", ret); ++ ++ return ret; + } + + static int hda_suspend(struct snd_sof_dev *sdev, bool runtime_suspend) +-- +2.20.1 + + +From 9ade30b8b3cf0e8d73a89b9ded857c50aeb91a37 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:13 -0500 +Subject: [PATCH 087/130] ASoC: SOF: PM: add helpers for setting D0 substate + for ADSP + +Add snd_sof_set_d0_substate() helper for setting ADSP to a specific D0 +substate, it will call into the platform specific implementation, and +update the d0_substate at success. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-18-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 601252869f50af6f5ab377e7f4846d7b09cc66c0) +Bugzilla: 1772498 +--- + sound/soc/sof/pm.c | 17 +++++++++++++++++ + sound/soc/sof/sof-priv.h | 2 ++ + 2 files changed, 19 insertions(+) + +diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c +index ac900fb3379e..584241e9734a 100644 +--- a/sound/soc/sof/pm.c ++++ b/sound/soc/sof/pm.c +@@ -411,6 +411,23 @@ int snd_sof_runtime_resume(struct device *dev) + } + EXPORT_SYMBOL(snd_sof_runtime_resume); + ++int snd_sof_set_d0_substate(struct snd_sof_dev *sdev, ++ enum sof_d0_substate d0_substate) ++{ ++ int ret; ++ ++ /* do platform specific set_state */ ++ ret = snd_sof_dsp_set_power_state(sdev, d0_substate); ++ if (ret < 0) ++ return ret; ++ ++ /* update dsp D0 sub-state */ ++ sdev->d0_substate = d0_substate; ++ ++ return 0; ++} ++EXPORT_SYMBOL(snd_sof_set_d0_substate); ++ + int snd_sof_resume(struct device *dev) + { + return sof_resume(dev, false); +diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h +index 7a21a45d3635..2231c673c678 100644 +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -485,6 +485,8 @@ int snd_sof_runtime_resume(struct device *dev); + int snd_sof_runtime_idle(struct device *dev); + int snd_sof_resume(struct device *dev); + int snd_sof_suspend(struct device *dev); ++int snd_sof_set_d0_substate(struct snd_sof_dev *sdev, ++ enum sof_d0_substate d0_substate); + + void snd_sof_new_platform_drv(struct snd_sof_dev *sdev); + +-- +2.20.1 + + +From cd303b2a36cdc4dd2228147f9a9518da71d88215 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:14 -0500 +Subject: [PATCH 088/130] ASoC: SOF: Intel: CNL: add support for sending + compact IPC + +For compact IPCs, we will send the IPC header/command via the HIPCIDR +register and the first 32bit payload via the HIPCIDD register, no +mailbox will be used. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-19-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 0267de58acfe5059ace739741f1533dd605ed22f) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/cnl.c | 42 ++++++++++++++++++++++++++++++++++----- + sound/soc/sof/intel/hda.h | 1 + + 2 files changed, 38 insertions(+), 5 deletions(-) + +diff --git a/sound/soc/sof/intel/cnl.c b/sound/soc/sof/intel/cnl.c +index 982b81a0b13a..0e1e265f3f3b 100644 +--- a/sound/soc/sof/intel/cnl.c ++++ b/sound/soc/sof/intel/cnl.c +@@ -17,6 +17,7 @@ + + #include "../ops.h" + #include "hda.h" ++#include "hda-ipc.h" + + static const struct snd_sof_debugfs_map cnl_dsp_debugfs[] = { + {"hda", HDA_DSP_HDA_BAR, 0, 0x4000, SOF_DEBUGFS_ACCESS_ALWAYS}, +@@ -150,14 +151,45 @@ static void cnl_ipc_dsp_done(struct snd_sof_dev *sdev) + CNL_DSP_REG_HIPCCTL_DONE); + } + ++static bool cnl_compact_ipc_compress(struct snd_sof_ipc_msg *msg, ++ u32 *dr, u32 *dd) ++{ ++ struct sof_ipc_pm_gate *pm_gate; ++ ++ if (msg->header == (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_GATE)) { ++ pm_gate = msg->msg_data; ++ ++ /* send the compact message via the primary register */ ++ *dr = HDA_IPC_MSG_COMPACT | HDA_IPC_PM_GATE; ++ ++ /* send payload via the extended data register */ ++ *dd = pm_gate->flags; ++ ++ return true; ++ } ++ ++ return false; ++} ++ + static int cnl_ipc_send_msg(struct snd_sof_dev *sdev, + struct snd_sof_ipc_msg *msg) + { +- /* send the message */ +- sof_mailbox_write(sdev, sdev->host_box.offset, msg->msg_data, +- msg->msg_size); +- snd_sof_dsp_write(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDR, +- CNL_DSP_REG_HIPCIDR_BUSY); ++ u32 dr = 0; ++ u32 dd = 0; ++ ++ if (cnl_compact_ipc_compress(msg, &dr, &dd)) { ++ /* send the message via IPC registers */ ++ snd_sof_dsp_write(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDD, ++ dd); ++ snd_sof_dsp_write(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDR, ++ CNL_DSP_REG_HIPCIDR_BUSY | dr); ++ } else { ++ /* send the message via mailbox */ ++ sof_mailbox_write(sdev, sdev->host_box.offset, msg->msg_data, ++ msg->msg_size); ++ snd_sof_dsp_write(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDR, ++ CNL_DSP_REG_HIPCIDR_BUSY); ++ } + + return 0; + } +diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h +index 5a089efc0e4c..5ad73a34b09c 100644 +--- a/sound/soc/sof/intel/hda.h ++++ b/sound/soc/sof/intel/hda.h +@@ -312,6 +312,7 @@ + #define CNL_DSP_REG_HIPCTDD (CNL_DSP_IPC_BASE + 0x08) + #define CNL_DSP_REG_HIPCIDR (CNL_DSP_IPC_BASE + 0x10) + #define CNL_DSP_REG_HIPCIDA (CNL_DSP_IPC_BASE + 0x14) ++#define CNL_DSP_REG_HIPCIDD (CNL_DSP_IPC_BASE + 0x18) + #define CNL_DSP_REG_HIPCCTL (CNL_DSP_IPC_BASE + 0x28) + + /* HIPCI */ +-- +2.20.1 + + +From 8bb4306ead5641b1f9e7d97d0db0d5705b193e79 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:15 -0500 +Subject: [PATCH 089/130] ASoC: SOF: add a flag to indicate the system suspend + target + +Add flag 's0_suspend' to indicate if the system is entering S0ix or +not. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-20-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 7367d3096b1443e55a2c730d1966f423b15d5cad) +Bugzilla: 1772498 +--- + sound/soc/sof/sof-priv.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h +index 2231c673c678..e715673f20e5 100644 +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -398,6 +398,8 @@ struct snd_sof_dev { + + /* power states related */ + enum sof_d0_substate d0_substate; ++ /* flag to track if the intended power target of suspend is S0ix */ ++ bool s0_suspend; + + /* DSP firmware boot */ + wait_queue_head_t boot_wait; +-- +2.20.1 + + +From 8d8d925e7051604e82ef12a2dbddf5d77e02e40d Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:16 -0500 +Subject: [PATCH 090/130] ASoC: SOF: add a flag suspend_ignored for sof stream + +Add a suspend_ignored flag to snd_sof_pcm_stream that will be used to +decide if the corresponding FW pipeline should be kept active to perform +always on tasks when the system is entering the S0ix state. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-21-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 4cd933abd4820da7eefe672ff439b32d199a07be) +Bugzilla: 1772498 +--- + sound/soc/sof/sof-priv.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h +index e715673f20e5..c2541d020bde 100644 +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -311,6 +311,11 @@ struct snd_sof_pcm_stream { + struct snd_pcm_substream *substream; + struct work_struct period_elapsed_work; + bool d0i3_compatible; /* DSP can be in D0I3 when this pcm is opened */ ++ /* ++ * flag to indicate that the DSP pipelines should be kept ++ * active or not while suspending the stream ++ */ ++ bool suspend_ignored; + }; + + /* ALSA SOF PCM device */ +-- +2.20.1 + + +From 3b92b523982d92ab8944be6c739da55889e44878 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:17 -0500 +Subject: [PATCH 091/130] ASoC: SOF: PM: implement prepare/complete callbacks + +Implement the prepare() and complete() callbacks for power management, +initialize s0_suspend flag at prepare(), and reset it at complete(). + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-22-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 0b50b3b1c3bc2a2c9eeab418b3de3e60e0530cf4) +Bugzilla: 1772498 +--- + sound/soc/sof/pm.c | 23 +++++++++++++++++++++++ + sound/soc/sof/sof-priv.h | 2 ++ + 2 files changed, 25 insertions(+) + +diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c +index 584241e9734a..99e4e6ffff74 100644 +--- a/sound/soc/sof/pm.c ++++ b/sound/soc/sof/pm.c +@@ -439,3 +439,26 @@ int snd_sof_suspend(struct device *dev) + return sof_suspend(dev, false); + } + EXPORT_SYMBOL(snd_sof_suspend); ++ ++int snd_sof_prepare(struct device *dev) ++{ ++ struct snd_sof_dev *sdev = dev_get_drvdata(dev); ++ ++#if defined(CONFIG_ACPI) ++ sdev->s0_suspend = acpi_target_system_state() == ACPI_STATE_S0; ++#else ++ /* will suspend to S3 by default */ ++ sdev->s0_suspend = false; ++#endif ++ ++ return 0; ++} ++EXPORT_SYMBOL(snd_sof_prepare); ++ ++void snd_sof_complete(struct device *dev) ++{ ++ struct snd_sof_dev *sdev = dev_get_drvdata(dev); ++ ++ sdev->s0_suspend = false; ++} ++EXPORT_SYMBOL(snd_sof_complete); +diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h +index c2541d020bde..6408ac88a3e5 100644 +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -492,6 +492,8 @@ int snd_sof_runtime_resume(struct device *dev); + int snd_sof_runtime_idle(struct device *dev); + int snd_sof_resume(struct device *dev); + int snd_sof_suspend(struct device *dev); ++int snd_sof_prepare(struct device *dev); ++void snd_sof_complete(struct device *dev); + int snd_sof_set_d0_substate(struct snd_sof_dev *sdev, + enum sof_d0_substate d0_substate); + +-- +2.20.1 + + +From a8161368f38eb802d5bfc2601420a94076b3527f Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:18 -0500 +Subject: [PATCH 092/130] ASoC: SOF: ignore suspend/resume for D0ix compatible + streams + +During system suspend, the PM framework will freeze all applications and +the ALSA/ASoC core will suspend all RUNNING PCM streams. + +However, D0ix-compatible PCM streams should keep the related pipelines +active in the DSP when the system is entering S0ix. The TRIGGER_SUSPEND +event is trapped in such cases to prevent the pipelines from being +stopped. Likewise, the TRIGGER_RESUME/START events should not affect the +pipeline state. + +The SOF driver also triggers some DSP Firmware pipelines based on the +DAPM widgets power events. In such cases, we also ignore PRE_PMU and +POST_PMD events to keep the pipelines active. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-23-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit ac8c046f19f94ec419c60d7a073af75a71386e97) +Bugzilla: 1772498 +--- + sound/soc/sof/pcm.c | 31 +++++++++++++++++++++++++++++++ + sound/soc/sof/topology.c | 17 ++++++++++++++++- + 2 files changed, 47 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c +index b33928e1385b..927b197c2c8d 100644 +--- a/sound/soc/sof/pcm.c ++++ b/sound/soc/sof/pcm.c +@@ -350,6 +350,16 @@ static int sof_pcm_trigger(struct snd_pcm_substream *substream, int cmd) + stream.hdr.cmd |= SOF_IPC_STREAM_TRIG_RELEASE; + break; + case SNDRV_PCM_TRIGGER_RESUME: ++ if (spcm->stream[substream->stream].suspend_ignored) { ++ /* ++ * this case will be triggered when INFO_RESUME is ++ * supported, no need to resume streams that remained ++ * enabled in D0ix. ++ */ ++ spcm->stream[substream->stream].suspend_ignored = false; ++ return 0; ++ } ++ + /* set up hw_params */ + ret = sof_pcm_prepare(substream); + if (ret < 0) { +@@ -360,9 +370,30 @@ static int sof_pcm_trigger(struct snd_pcm_substream *substream, int cmd) + + /* fallthrough */ + case SNDRV_PCM_TRIGGER_START: ++ if (spcm->stream[substream->stream].suspend_ignored) { ++ /* ++ * This case will be triggered when INFO_RESUME is ++ * not supported, no need to re-start streams that ++ * remained enabled in D0ix. ++ */ ++ spcm->stream[substream->stream].suspend_ignored = false; ++ return 0; ++ } + stream.hdr.cmd |= SOF_IPC_STREAM_TRIG_START; + break; + case SNDRV_PCM_TRIGGER_SUSPEND: ++ if (sdev->s0_suspend && ++ spcm->stream[substream->stream].d0i3_compatible) { ++ /* ++ * trap the event, not sending trigger stop to ++ * prevent the FW pipelines from being stopped, ++ * and mark the flag to ignore the upcoming DAPM ++ * PM events. ++ */ ++ spcm->stream[substream->stream].suspend_ignored = true; ++ return 0; ++ } ++ /* fallthrough */ + case SNDRV_PCM_TRIGGER_STOP: + stream.hdr.cmd |= SOF_IPC_STREAM_TRIG_STOP; + ipc_first = true; +diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c +index 9e3996125d03..ad798fb3bb32 100644 +--- a/sound/soc/sof/topology.c ++++ b/sound/soc/sof/topology.c +@@ -135,7 +135,9 @@ static int sof_keyword_dapm_event(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *k, int event) + { + struct snd_sof_widget *swidget = w->dobj.private; ++ int stream = SNDRV_PCM_STREAM_CAPTURE; + struct snd_sof_dev *sdev; ++ struct snd_sof_pcm *spcm; + int ret = 0; + + if (!swidget) +@@ -146,11 +148,19 @@ static int sof_keyword_dapm_event(struct snd_soc_dapm_widget *w, + dev_dbg(sdev->dev, "received event %d for widget %s\n", + event, w->name); + ++ /* get runtime PCM params using widget's stream name */ ++ spcm = snd_sof_find_spcm_name(sdev, swidget->widget->sname); ++ + /* process events */ + switch (event) { + case SND_SOC_DAPM_PRE_PMU: ++ if (spcm->stream[stream].suspend_ignored) { ++ dev_dbg(sdev->dev, "PRE_PMU event ignored, KWD pipeline is already RUNNING\n"); ++ return 0; ++ } ++ + /* set pcm params */ +- ret = ipc_pcm_params(swidget, SOF_IPC_STREAM_CAPTURE); ++ ret = ipc_pcm_params(swidget, stream); + if (ret < 0) { + dev_err(sdev->dev, + "error: failed to set pcm params for widget %s\n", +@@ -166,6 +176,11 @@ static int sof_keyword_dapm_event(struct snd_soc_dapm_widget *w, + swidget->widget->name); + break; + case SND_SOC_DAPM_POST_PMD: ++ if (spcm->stream[stream].suspend_ignored) { ++ dev_dbg(sdev->dev, "POST_PMD even ignored, KWD pipeline will remain RUNNING\n"); ++ return 0; ++ } ++ + /* stop trigger */ + ret = ipc_trigger(swidget, SOF_IPC_STREAM_TRIG_STOP); + if (ret < 0) +-- +2.20.1 + + +From 95a260712df9014813aaeb2e8bf3149bcf82572c Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:19 -0500 +Subject: [PATCH 093/130] ASoC: SOF: Intel: hda-dsp: implement suspend/resume + for S0ix<->S0 transition + +Enable system wake up via IPC interrupt from DSP when the system is +suspending to the S0ix state, and disable it in the corresponding +resuming. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-24-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 66e40876ddc325d892c493a6d83574bbba5770ce) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda-dsp.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c +index b5070409a5e3..d23573d9e9c4 100644 +--- a/sound/soc/sof/intel/hda-dsp.c ++++ b/sound/soc/sof/intel/hda-dsp.c +@@ -477,6 +477,15 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume) + + int hda_dsp_resume(struct snd_sof_dev *sdev) + { ++ struct pci_dev *pci = to_pci_dev(sdev->dev); ++ ++ if (sdev->s0_suspend) { ++ /* restore and disable the system wakeup */ ++ pci_restore_state(pci); ++ disable_irq_wake(pci->irq); ++ return 0; ++ } ++ + /* init hda controller. DSP cores will be powered up during fw boot */ + return hda_resume(sdev, false); + } +@@ -509,8 +518,16 @@ int hda_dsp_runtime_suspend(struct snd_sof_dev *sdev) + int hda_dsp_suspend(struct snd_sof_dev *sdev) + { + struct hdac_bus *bus = sof_to_bus(sdev); ++ struct pci_dev *pci = to_pci_dev(sdev->dev); + int ret; + ++ if (sdev->s0_suspend) { ++ /* enable the system waking up via IPC IRQ */ ++ enable_irq_wake(pci->irq); ++ pci_save_state(pci); ++ return 0; ++ } ++ + /* stop hda controller and power dsp off */ + ret = hda_suspend(sdev, false); + if (ret < 0) { +-- +2.20.1 + + +From fb1833ed7540f40d3c82371bea470e2802fee2a6 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:20 -0500 +Subject: [PATCH 094/130] ASoC: SOF: return -ENOTSUPP if D0I3 is not supported + +No set_power_state ops means that the platform doesn't support D0i3, +return -ENOTSUPP for the case. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-25-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 5655ce660a6d3eec4a3ad37feb99fb228540d1a9) +Bugzilla: 1772498 +--- + sound/soc/sof/ops.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/sof/ops.h b/sound/soc/sof/ops.h +index d7c8fc06f961..93512dcbaacd 100644 +--- a/sound/soc/sof/ops.h ++++ b/sound/soc/sof/ops.h +@@ -199,7 +199,8 @@ static inline int snd_sof_dsp_set_power_state(struct snd_sof_dev *sdev, + if (sof_ops(sdev)->set_power_state) + return sof_ops(sdev)->set_power_state(sdev, substate); + +- return 0; ++ /* D0 substate is not supported */ ++ return -ENOTSUPP; + } + + /* debug */ +-- +2.20.1 + + +From a9ff8edc56014d193031b94c32da8d1ca4cd9181 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:21 -0500 +Subject: [PATCH 095/130] ASoC: SOF: PM: Add support for DSP D0i3 state when + entering S0ix + +When system is entering into S0ix, the PCI device may transition to the +D0i3 substate instead of D3. In D0i3, some always-on functionality can +be enabled, such as acoustic event detection, voice activity detection +or hotwording. When an event is detected, the DSP firmware can wake-up +the device for a transition to D0 with an interrupt. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-26-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit c470fc3f61b25e955f8ba90fc9dc554881e4e72c) +Bugzilla: 1772498 +--- + sound/soc/sof/pm.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c +index 99e4e6ffff74..560a937e0484 100644 +--- a/sound/soc/sof/pm.c ++++ b/sound/soc/sof/pm.c +@@ -430,12 +430,58 @@ EXPORT_SYMBOL(snd_sof_set_d0_substate); + + int snd_sof_resume(struct device *dev) + { ++ struct snd_sof_dev *sdev = dev_get_drvdata(dev); ++ int ret; ++ ++ if (sdev->s0_suspend) { ++ /* resume from D0I3 */ ++ dev_dbg(sdev->dev, "DSP will exit from D0i3...\n"); ++ ret = snd_sof_set_d0_substate(sdev, SOF_DSP_D0I0); ++ if (ret == -ENOTSUPP) { ++ /* fallback to resume from D3 */ ++ dev_dbg(sdev->dev, "D0i3 not supported, fall back to resume from D3...\n"); ++ goto d3_resume; ++ } else if (ret < 0) { ++ dev_err(sdev->dev, "error: failed to exit from D0I3 %d\n", ++ ret); ++ return ret; ++ } ++ ++ /* platform-specific resume from D0i3 */ ++ return snd_sof_dsp_resume(sdev); ++ } ++ ++d3_resume: ++ /* resume from D3 */ + return sof_resume(dev, false); + } + EXPORT_SYMBOL(snd_sof_resume); + + int snd_sof_suspend(struct device *dev) + { ++ struct snd_sof_dev *sdev = dev_get_drvdata(dev); ++ int ret; ++ ++ if (sdev->s0_suspend) { ++ /* suspend to D0i3 */ ++ dev_dbg(sdev->dev, "DSP is trying to enter D0i3...\n"); ++ ret = snd_sof_set_d0_substate(sdev, SOF_DSP_D0I3); ++ if (ret == -ENOTSUPP) { ++ /* fallback to D3 suspend */ ++ dev_dbg(sdev->dev, "D0i3 not supported, fall back to D3...\n"); ++ goto d3_suspend; ++ } else if (ret < 0) { ++ dev_err(sdev->dev, "error: failed to enter D0I3, %d\n", ++ ret); ++ return ret; ++ } ++ ++ /* platform-specific suspend to D0i3 */ ++ return snd_sof_dsp_suspend(sdev); ++ } ++ ++d3_suspend: ++ /* suspend to D3 */ + return sof_suspend(dev, false); + } + EXPORT_SYMBOL(snd_sof_suspend); +-- +2.20.1 + + +From 57fa7b6018c8497dbc676a7ed19580ce413c1f93 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 25 Oct 2019 17:41:22 -0500 +Subject: [PATCH 096/130] ASoC: SOF: pci: Add prepare/complete PM callbacks + +Use the new implemented snd_sof_prepare() and snd_sof_complete() as the +power management callbacks for pci probing platforms. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191025224122.7718-27-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 6d407a39cc9619d0088b44333c6526924be00f8d) +Bugzilla: 1772498 +--- + sound/soc/sof/sof-pci-dev.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c +index 067acf389af7..3b58b91e7b9e 100644 +--- a/sound/soc/sof/sof-pci-dev.c ++++ b/sound/soc/sof/sof-pci-dev.c +@@ -229,6 +229,8 @@ static const struct sof_dev_desc jsl_desc = { + #endif + + static const struct dev_pm_ops sof_pci_pm = { ++ .prepare = snd_sof_prepare, ++ .complete = snd_sof_complete, + SET_SYSTEM_SLEEP_PM_OPS(snd_sof_suspend, snd_sof_resume) + SET_RUNTIME_PM_OPS(snd_sof_runtime_suspend, snd_sof_runtime_resume, + snd_sof_runtime_idle) +-- +2.20.1 + + +From 275c9af318fdb56701f9c336ecfdcaf8d05e7b03 Mon Sep 17 00:00:00 2001 +From: Ranjani Sridharan +Date: Fri, 1 Nov 2019 12:09:16 -0500 +Subject: [PATCH 097/130] ASoC: SOF: Intel: hda: Simplify the + hda_dsp_wait_d0i3c_done() function + +Remove the retry argument for the hda_dsp_wait_d0i3c_done() +function and use the HDA_DSP_REG_POLL_RETRY_COUNT macro +directly. + +Signed-off-by: Ranjani Sridharan +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101170916.26517-4-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 65c56f5dccc87ca2993a50672e144c7378189f2c) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda-dsp.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c +index d23573d9e9c4..8cd5ecc01b62 100644 +--- a/sound/soc/sof/intel/hda-dsp.c ++++ b/sound/soc/sof/intel/hda-dsp.c +@@ -307,9 +307,10 @@ void hda_dsp_ipc_int_disable(struct snd_sof_dev *sdev) + HDA_DSP_REG_HIPCCTL_BUSY | HDA_DSP_REG_HIPCCTL_DONE, 0); + } + +-static int hda_dsp_wait_d0i3c_done(struct snd_sof_dev *sdev, int retry) ++static int hda_dsp_wait_d0i3c_done(struct snd_sof_dev *sdev) + { + struct hdac_bus *bus = sof_to_bus(sdev); ++ int retry = HDA_DSP_REG_POLL_RETRY_COUNT; + + while (snd_hdac_chip_readb(bus, VS_D0I3C) & SOF_HDA_VS_D0I3C_CIP) { + if (!retry--) +@@ -346,7 +347,7 @@ int hda_dsp_set_power_state(struct snd_sof_dev *sdev, + u8 value; + + /* Write to D0I3C after Command-In-Progress bit is cleared */ +- ret = hda_dsp_wait_d0i3c_done(sdev, HDA_DSP_REG_POLL_RETRY_COUNT); ++ ret = hda_dsp_wait_d0i3c_done(sdev); + if (ret < 0) { + dev_err(bus->dev, "CIP timeout before D0I3C update!\n"); + return ret; +@@ -357,7 +358,7 @@ int hda_dsp_set_power_state(struct snd_sof_dev *sdev, + snd_hdac_chip_updateb(bus, VS_D0I3C, SOF_HDA_VS_D0I3C_I3, value); + + /* Wait for cmd in progress to be cleared before exiting the function */ +- ret = hda_dsp_wait_d0i3c_done(sdev, HDA_DSP_REG_POLL_RETRY_COUNT); ++ ret = hda_dsp_wait_d0i3c_done(sdev); + if (ret < 0) { + dev_err(bus->dev, "CIP timeout after D0I3C update!\n"); + return ret; +-- +2.20.1 + + +From a547d2de50bd9993d6b1723ece45ad954c042bb5 Mon Sep 17 00:00:00 2001 +From: Jaska Uimonen +Date: Tue, 8 Oct 2019 11:44:42 -0500 +Subject: [PATCH 098/130] AsoC: SOF: refactor control load code + +Move code around to enable token parsing in control load. + +Signed-off-by: Jaska Uimonen +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191008164443.1358-9-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit acf1b71cb693263c7c9373296e872a8fa61a5cf3) +Bugzilla: 1772498 +--- + sound/soc/sof/topology.c | 336 +++++++++++++++++++-------------------- + 1 file changed, 168 insertions(+), 168 deletions(-) + +diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c +index ad798fb3bb32..d4aea5422ea8 100644 +--- a/sound/soc/sof/topology.c ++++ b/sound/soc/sof/topology.c +@@ -447,174 +447,6 @@ static enum sof_comp_type find_process_comp_type(enum sof_ipc_process_type type) + return SOF_COMP_NONE; + } + +-/* +- * Standard Kcontrols. +- */ +- +-static int sof_control_load_volume(struct snd_soc_component *scomp, +- struct snd_sof_control *scontrol, +- struct snd_kcontrol_new *kc, +- struct snd_soc_tplg_ctl_hdr *hdr) +-{ +- struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); +- struct snd_soc_tplg_mixer_control *mc = +- container_of(hdr, struct snd_soc_tplg_mixer_control, hdr); +- struct sof_ipc_ctrl_data *cdata; +- int tlv[TLV_ITEMS]; +- unsigned int i; +- int ret; +- +- /* validate topology data */ +- if (le32_to_cpu(mc->num_channels) > SND_SOC_TPLG_MAX_CHAN) +- return -EINVAL; +- +- /* init the volume get/put data */ +- scontrol->size = struct_size(scontrol->control_data, chanv, +- le32_to_cpu(mc->num_channels)); +- scontrol->control_data = kzalloc(scontrol->size, GFP_KERNEL); +- if (!scontrol->control_data) +- return -ENOMEM; +- +- scontrol->comp_id = sdev->next_comp_id; +- scontrol->min_volume_step = le32_to_cpu(mc->min); +- scontrol->max_volume_step = le32_to_cpu(mc->max); +- scontrol->num_channels = le32_to_cpu(mc->num_channels); +- +- /* set cmd for mixer control */ +- if (le32_to_cpu(mc->max) == 1) { +- scontrol->cmd = SOF_CTRL_CMD_SWITCH; +- goto out; +- } +- +- scontrol->cmd = SOF_CTRL_CMD_VOLUME; +- +- /* extract tlv data */ +- if (get_tlv_data(kc->tlv.p, tlv) < 0) { +- dev_err(sdev->dev, "error: invalid TLV data\n"); +- return -EINVAL; +- } +- +- /* set up volume table */ +- ret = set_up_volume_table(scontrol, tlv, le32_to_cpu(mc->max) + 1); +- if (ret < 0) { +- dev_err(sdev->dev, "error: setting up volume table\n"); +- return ret; +- } +- +- /* set default volume values to 0dB in control */ +- cdata = scontrol->control_data; +- for (i = 0; i < scontrol->num_channels; i++) { +- cdata->chanv[i].channel = i; +- cdata->chanv[i].value = VOL_ZERO_DB; +- } +- +-out: +- /* set up possible led control from mixer private data */ +- ret = sof_parse_tokens(scomp, &scontrol->led_ctl, led_tokens, +- ARRAY_SIZE(led_tokens), mc->priv.array, +- le32_to_cpu(mc->priv.size)); +- if (ret != 0) { +- dev_err(sdev->dev, "error: parse led tokens failed %d\n", +- le32_to_cpu(mc->priv.size)); +- return ret; +- } +- +- dev_dbg(sdev->dev, "tplg: load kcontrol index %d chans %d\n", +- scontrol->comp_id, scontrol->num_channels); +- +- return 0; +-} +- +-static int sof_control_load_enum(struct snd_soc_component *scomp, +- struct snd_sof_control *scontrol, +- struct snd_kcontrol_new *kc, +- struct snd_soc_tplg_ctl_hdr *hdr) +-{ +- struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); +- struct snd_soc_tplg_enum_control *ec = +- container_of(hdr, struct snd_soc_tplg_enum_control, hdr); +- +- /* validate topology data */ +- if (le32_to_cpu(ec->num_channels) > SND_SOC_TPLG_MAX_CHAN) +- return -EINVAL; +- +- /* init the enum get/put data */ +- scontrol->size = struct_size(scontrol->control_data, chanv, +- le32_to_cpu(ec->num_channels)); +- scontrol->control_data = kzalloc(scontrol->size, GFP_KERNEL); +- if (!scontrol->control_data) +- return -ENOMEM; +- +- scontrol->comp_id = sdev->next_comp_id; +- scontrol->num_channels = le32_to_cpu(ec->num_channels); +- +- scontrol->cmd = SOF_CTRL_CMD_ENUM; +- +- dev_dbg(sdev->dev, "tplg: load kcontrol index %d chans %d comp_id %d\n", +- scontrol->comp_id, scontrol->num_channels, scontrol->comp_id); +- +- return 0; +-} +- +-static int sof_control_load_bytes(struct snd_soc_component *scomp, +- struct snd_sof_control *scontrol, +- struct snd_kcontrol_new *kc, +- struct snd_soc_tplg_ctl_hdr *hdr) +-{ +- struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); +- struct sof_ipc_ctrl_data *cdata; +- struct snd_soc_tplg_bytes_control *control = +- container_of(hdr, struct snd_soc_tplg_bytes_control, hdr); +- struct soc_bytes_ext *sbe = (struct soc_bytes_ext *)kc->private_value; +- int max_size = sbe->max; +- +- /* init the get/put bytes data */ +- scontrol->size = sizeof(struct sof_ipc_ctrl_data) + +- le32_to_cpu(control->priv.size); +- +- if (scontrol->size > max_size) { +- dev_err(sdev->dev, "err: bytes data size %d exceeds max %d.\n", +- scontrol->size, max_size); +- return -EINVAL; +- } +- +- scontrol->control_data = kzalloc(max_size, GFP_KERNEL); +- cdata = scontrol->control_data; +- if (!scontrol->control_data) +- return -ENOMEM; +- +- scontrol->comp_id = sdev->next_comp_id; +- scontrol->cmd = SOF_CTRL_CMD_BINARY; +- +- dev_dbg(sdev->dev, "tplg: load kcontrol index %d chans %d\n", +- scontrol->comp_id, scontrol->num_channels); +- +- if (le32_to_cpu(control->priv.size) > 0) { +- memcpy(cdata->data, control->priv.data, +- le32_to_cpu(control->priv.size)); +- +- if (cdata->data->magic != SOF_ABI_MAGIC) { +- dev_err(sdev->dev, "error: Wrong ABI magic 0x%08x.\n", +- cdata->data->magic); +- return -EINVAL; +- } +- if (SOF_ABI_VERSION_INCOMPATIBLE(SOF_ABI_VERSION, +- cdata->data->abi)) { +- dev_err(sdev->dev, +- "error: Incompatible ABI version 0x%08x.\n", +- cdata->data->abi); +- return -EINVAL; +- } +- if (cdata->data->size + sizeof(const struct sof_abi_hdr) != +- le32_to_cpu(control->priv.size)) { +- dev_err(sdev->dev, +- "error: Conflict in bytes vs. priv size.\n"); +- return -EINVAL; +- } +- } +- return 0; +-} +- + /* + * Topology Token Parsing. + * New tokens should be added to headers and parsing tables below. +@@ -1090,6 +922,174 @@ static void sof_dbg_comp_config(struct snd_soc_component *scomp, + config->frame_fmt); + } + ++/* ++ * Standard Kcontrols. ++ */ ++ ++static int sof_control_load_volume(struct snd_soc_component *scomp, ++ struct snd_sof_control *scontrol, ++ struct snd_kcontrol_new *kc, ++ struct snd_soc_tplg_ctl_hdr *hdr) ++{ ++ struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); ++ struct snd_soc_tplg_mixer_control *mc = ++ container_of(hdr, struct snd_soc_tplg_mixer_control, hdr); ++ struct sof_ipc_ctrl_data *cdata; ++ int tlv[TLV_ITEMS]; ++ unsigned int i; ++ int ret; ++ ++ /* validate topology data */ ++ if (le32_to_cpu(mc->num_channels) > SND_SOC_TPLG_MAX_CHAN) ++ return -EINVAL; ++ ++ /* init the volume get/put data */ ++ scontrol->size = struct_size(scontrol->control_data, chanv, ++ le32_to_cpu(mc->num_channels)); ++ scontrol->control_data = kzalloc(scontrol->size, GFP_KERNEL); ++ if (!scontrol->control_data) ++ return -ENOMEM; ++ ++ scontrol->comp_id = sdev->next_comp_id; ++ scontrol->min_volume_step = le32_to_cpu(mc->min); ++ scontrol->max_volume_step = le32_to_cpu(mc->max); ++ scontrol->num_channels = le32_to_cpu(mc->num_channels); ++ ++ /* set cmd for mixer control */ ++ if (le32_to_cpu(mc->max) == 1) { ++ scontrol->cmd = SOF_CTRL_CMD_SWITCH; ++ goto out; ++ } ++ ++ scontrol->cmd = SOF_CTRL_CMD_VOLUME; ++ ++ /* extract tlv data */ ++ if (get_tlv_data(kc->tlv.p, tlv) < 0) { ++ dev_err(sdev->dev, "error: invalid TLV data\n"); ++ return -EINVAL; ++ } ++ ++ /* set up volume table */ ++ ret = set_up_volume_table(scontrol, tlv, le32_to_cpu(mc->max) + 1); ++ if (ret < 0) { ++ dev_err(sdev->dev, "error: setting up volume table\n"); ++ return ret; ++ } ++ ++ /* set default volume values to 0dB in control */ ++ cdata = scontrol->control_data; ++ for (i = 0; i < scontrol->num_channels; i++) { ++ cdata->chanv[i].channel = i; ++ cdata->chanv[i].value = VOL_ZERO_DB; ++ } ++ ++out: ++ /* set up possible led control from mixer private data */ ++ ret = sof_parse_tokens(scomp, &scontrol->led_ctl, led_tokens, ++ ARRAY_SIZE(led_tokens), mc->priv.array, ++ le32_to_cpu(mc->priv.size)); ++ if (ret != 0) { ++ dev_err(sdev->dev, "error: parse led tokens failed %d\n", ++ le32_to_cpu(mc->priv.size)); ++ return ret; ++ } ++ ++ dev_dbg(sdev->dev, "tplg: load kcontrol index %d chans %d\n", ++ scontrol->comp_id, scontrol->num_channels); ++ ++ return 0; ++} ++ ++static int sof_control_load_enum(struct snd_soc_component *scomp, ++ struct snd_sof_control *scontrol, ++ struct snd_kcontrol_new *kc, ++ struct snd_soc_tplg_ctl_hdr *hdr) ++{ ++ struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); ++ struct snd_soc_tplg_enum_control *ec = ++ container_of(hdr, struct snd_soc_tplg_enum_control, hdr); ++ ++ /* validate topology data */ ++ if (le32_to_cpu(ec->num_channels) > SND_SOC_TPLG_MAX_CHAN) ++ return -EINVAL; ++ ++ /* init the enum get/put data */ ++ scontrol->size = struct_size(scontrol->control_data, chanv, ++ le32_to_cpu(ec->num_channels)); ++ scontrol->control_data = kzalloc(scontrol->size, GFP_KERNEL); ++ if (!scontrol->control_data) ++ return -ENOMEM; ++ ++ scontrol->comp_id = sdev->next_comp_id; ++ scontrol->num_channels = le32_to_cpu(ec->num_channels); ++ ++ scontrol->cmd = SOF_CTRL_CMD_ENUM; ++ ++ dev_dbg(sdev->dev, "tplg: load kcontrol index %d chans %d comp_id %d\n", ++ scontrol->comp_id, scontrol->num_channels, scontrol->comp_id); ++ ++ return 0; ++} ++ ++static int sof_control_load_bytes(struct snd_soc_component *scomp, ++ struct snd_sof_control *scontrol, ++ struct snd_kcontrol_new *kc, ++ struct snd_soc_tplg_ctl_hdr *hdr) ++{ ++ struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); ++ struct sof_ipc_ctrl_data *cdata; ++ struct snd_soc_tplg_bytes_control *control = ++ container_of(hdr, struct snd_soc_tplg_bytes_control, hdr); ++ struct soc_bytes_ext *sbe = (struct soc_bytes_ext *)kc->private_value; ++ int max_size = sbe->max; ++ ++ /* init the get/put bytes data */ ++ scontrol->size = sizeof(struct sof_ipc_ctrl_data) + ++ le32_to_cpu(control->priv.size); ++ ++ if (scontrol->size > max_size) { ++ dev_err(sdev->dev, "err: bytes data size %d exceeds max %d.\n", ++ scontrol->size, max_size); ++ return -EINVAL; ++ } ++ ++ scontrol->control_data = kzalloc(max_size, GFP_KERNEL); ++ cdata = scontrol->control_data; ++ if (!scontrol->control_data) ++ return -ENOMEM; ++ ++ scontrol->comp_id = sdev->next_comp_id; ++ scontrol->cmd = SOF_CTRL_CMD_BINARY; ++ ++ dev_dbg(sdev->dev, "tplg: load kcontrol index %d chans %d\n", ++ scontrol->comp_id, scontrol->num_channels); ++ ++ if (le32_to_cpu(control->priv.size) > 0) { ++ memcpy(cdata->data, control->priv.data, ++ le32_to_cpu(control->priv.size)); ++ ++ if (cdata->data->magic != SOF_ABI_MAGIC) { ++ dev_err(sdev->dev, "error: Wrong ABI magic 0x%08x.\n", ++ cdata->data->magic); ++ return -EINVAL; ++ } ++ if (SOF_ABI_VERSION_INCOMPATIBLE(SOF_ABI_VERSION, ++ cdata->data->abi)) { ++ dev_err(sdev->dev, ++ "error: Incompatible ABI version 0x%08x.\n", ++ cdata->data->abi); ++ return -EINVAL; ++ } ++ if (cdata->data->size + sizeof(const struct sof_abi_hdr) != ++ le32_to_cpu(control->priv.size)) { ++ dev_err(sdev->dev, ++ "error: Conflict in bytes vs. priv size.\n"); ++ return -EINVAL; ++ } ++ } ++ return 0; ++} ++ + /* external kcontrol init - used for any driver specific init */ + static int sof_control_load(struct snd_soc_component *scomp, int index, + struct snd_kcontrol_new *kc, +-- +2.20.1 + + +From b0ba4b0be937405c5982db296e5d9e57a9239c5a Mon Sep 17 00:00:00 2001 +From: Ranjani Sridharan +Date: Mon, 4 Nov 2019 14:48:12 -0800 +Subject: [PATCH 099/130] ASoC: SOF: topology: set trigger order for FE DAI + link + +Set trigger order for FE DAI links to SND_SOC_DPCM_TRIGGER_POST +to trigger the BE DAI's before the FE DAI's. This prevents the +xruns seen on playback pipelines using the link DMA. + +Signed-off-by: Ranjani Sridharan +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191104224812.3393-3-ranjani.sridharan@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 5eee2b3f60065a2530d13f28e771be48b989eb4c) +Bugzilla: 1772498 +--- + sound/soc/sof/topology.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c +index d4aea5422ea8..143b8259a70a 100644 +--- a/sound/soc/sof/topology.c ++++ b/sound/soc/sof/topology.c +@@ -2952,6 +2952,10 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, + if (!link->no_pcm) { + link->nonatomic = true; + ++ /* set trigger order */ ++ link->trigger[0] = SND_SOC_DPCM_TRIGGER_POST; ++ link->trigger[1] = SND_SOC_DPCM_TRIGGER_POST; ++ + /* nothing more to do for FE dai links */ + return 0; + } +-- +2.20.1 + + +From 00e0accc297d44a65b09af38a2d6813467f5b8e9 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 19 Nov 2019 18:49:32 +0100 +Subject: [PATCH 100/130] ASoC: add control components management + +This ASCII string can carry additional information about +soundcard components or configuration. Add the possibility +to set this string via the ASoC card. + +Signed-off-by: Jaroslav Kysela +Cc: Mark Brown +Link: https://lore.kernel.org/r/20191119174933.25526-1-perex@perex.cz +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit dc73d73aa7145f55412611f3eead1e85ae026785) +Bugzilla: 1772498 +--- + include/sound/soc.h | 1 + + sound/soc/soc-core.c | 13 +++++++++++++ + 2 files changed, 14 insertions(+) + +diff --git a/include/sound/soc.h b/include/sound/soc.h +index f264c6509f00..efc5fb8f3d64 100644 +--- a/include/sound/soc.h ++++ b/include/sound/soc.h +@@ -978,6 +978,7 @@ struct snd_soc_card { + const char *name; + const char *long_name; + const char *driver_name; ++ const char *components; + char dmi_longname[80]; + char topology_shortname[32]; + +diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c +index 88978a3036c4..fff910fd933e 100644 +--- a/sound/soc/soc-core.c ++++ b/sound/soc/soc-core.c +@@ -2095,6 +2095,19 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) + } + } + ++ if (card->components) { ++ /* the current implementation of snd_component_add() accepts */ ++ /* multiple components in the string separated by space, */ ++ /* but the string collision (identical string) check might */ ++ /* not work correctly */ ++ ret = snd_component_add(card->snd_card, card->components); ++ if (ret < 0) { ++ dev_err(card->dev, "ASoC: %s snd_component_add() failed: %d\n", ++ card->name, ret); ++ goto probe_end; ++ } ++ } ++ + if (card->late_probe) { + ret = card->late_probe(card); + if (ret < 0) { +-- +2.20.1 + + +From 15b3f8b52655f2e8eafb5c209c829cd09650ae1f Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 20 Nov 2019 18:44:34 +0100 +Subject: [PATCH 101/130] ASoC: improve the DMI long card code in asoc-core + +Add append_dmi_string() function and make the code more readable. + +Signed-off-by: Jaroslav Kysela +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191120174435.30920-1-perex@perex.cz +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 4e01e5dbba96f731119f3f1a6bf51b54c98c5940) +Bugzilla: 1772498 +--- + sound/soc/soc-core.c | 66 +++++++++++++++++--------------------------- + 1 file changed, 25 insertions(+), 41 deletions(-) + +diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c +index fff910fd933e..2cbd9796a25f 100644 +--- a/sound/soc/soc-core.c ++++ b/sound/soc/soc-core.c +@@ -1729,6 +1729,23 @@ static int is_dmi_valid(const char *field) + return 1; + } + ++/* ++ * Append a string to card->dmi_longname with character cleanups. ++ */ ++static void append_dmi_string(struct snd_soc_card *card, const char *str) ++{ ++ char *dst = card->dmi_longname; ++ size_t dst_len = sizeof(card->dmi_longname); ++ size_t len; ++ ++ len = strlen(dst); ++ snprintf(dst + len, dst_len - len, "-%s", str); ++ ++ len++; /* skip the separator "-" */ ++ if (len < dst_len) ++ cleanup_dmi_name(dst + len); ++} ++ + /** + * snd_soc_set_dmi_name() - Register DMI names to card + * @card: The card to register DMI names +@@ -1763,61 +1780,36 @@ static int is_dmi_valid(const char *field) + int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour) + { + const char *vendor, *product, *product_version, *board; +- size_t longname_buf_size = sizeof(card->snd_card->longname); +- size_t len; + + if (card->long_name) + return 0; /* long name already set by driver or from DMI */ + +- /* make up dmi long name as: vendor.product.version.board */ ++ /* make up dmi long name as: vendor-product-version-board */ + vendor = dmi_get_system_info(DMI_BOARD_VENDOR); + if (!vendor || !is_dmi_valid(vendor)) { + dev_warn(card->dev, "ASoC: no DMI vendor name!\n"); + return 0; + } + +- snprintf(card->dmi_longname, sizeof(card->snd_card->longname), +- "%s", vendor); ++ snprintf(card->dmi_longname, sizeof(card->dmi_longname), "%s", vendor); + cleanup_dmi_name(card->dmi_longname); + + product = dmi_get_system_info(DMI_PRODUCT_NAME); + if (product && is_dmi_valid(product)) { +- len = strlen(card->dmi_longname); +- snprintf(card->dmi_longname + len, +- longname_buf_size - len, +- "-%s", product); +- +- len++; /* skip the separator "-" */ +- if (len < longname_buf_size) +- cleanup_dmi_name(card->dmi_longname + len); ++ append_dmi_string(card, product); + + /* + * some vendors like Lenovo may only put a self-explanatory + * name in the product version field + */ + product_version = dmi_get_system_info(DMI_PRODUCT_VERSION); +- if (product_version && is_dmi_valid(product_version)) { +- len = strlen(card->dmi_longname); +- snprintf(card->dmi_longname + len, +- longname_buf_size - len, +- "-%s", product_version); +- +- len++; +- if (len < longname_buf_size) +- cleanup_dmi_name(card->dmi_longname + len); +- } ++ if (product_version && is_dmi_valid(product_version)) ++ append_dmi_string(card, product_version); + } + + board = dmi_get_system_info(DMI_BOARD_NAME); + if (board && is_dmi_valid(board)) { +- len = strlen(card->dmi_longname); +- snprintf(card->dmi_longname + len, +- longname_buf_size - len, +- "-%s", board); +- +- len++; +- if (len < longname_buf_size) +- cleanup_dmi_name(card->dmi_longname + len); ++ append_dmi_string(card, board); + } else if (!product) { + /* fall back to using legacy name */ + dev_warn(card->dev, "ASoC: no DMI board/product name!\n"); +@@ -1825,16 +1817,8 @@ int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour) + } + + /* Add flavour to dmi long name */ +- if (flavour) { +- len = strlen(card->dmi_longname); +- snprintf(card->dmi_longname + len, +- longname_buf_size - len, +- "-%s", flavour); +- +- len++; +- if (len < longname_buf_size) +- cleanup_dmi_name(card->dmi_longname + len); +- } ++ if (flavour) ++ append_dmi_string(card, flavour); + + /* set the card long name */ + card->long_name = card->dmi_longname; +-- +2.20.1 + + +From f77607883b4040fdb1791e4e81402e452a97d1d0 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 20 Nov 2019 18:44:35 +0100 +Subject: [PATCH 102/130] ASoC: DMI long name - avoid to add board name if + matches with product name + +Current code: + + LENOVO-20QE000VMC-ThinkPadX1Carbon7th-20QE000VMC + +With the patch: + + LENOVO-20QE000VMC-ThinkPadX1Carbon7th + +Signed-off-by: Jaroslav Kysela +Link: https://lore.kernel.org/r/20191120174435.30920-2-perex@perex.cz +Reviewed-by: Pierre-Louis Bossart +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 39870b0dec68ed7dd814beb697e541670975c7d8) +Bugzilla: 1772498 +--- + sound/soc/soc-core.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c +index 2cbd9796a25f..d42924ff13f1 100644 +--- a/sound/soc/soc-core.c ++++ b/sound/soc/soc-core.c +@@ -1809,7 +1809,8 @@ int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour) + + board = dmi_get_system_info(DMI_BOARD_NAME); + if (board && is_dmi_valid(board)) { +- append_dmi_string(card, board); ++ if (!product || strcasecmp(board, product)) ++ append_dmi_string(card, board); + } else if (!product) { + /* fall back to using legacy name */ + dev_warn(card->dev, "ASoC: no DMI board/product name!\n"); +-- +2.20.1 + + +From acab1a3016c11ce7262f08ee5f978ba0fd650d81 Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Thu, 21 Nov 2019 10:26:43 +0800 +Subject: [PATCH 103/130] ALSA: hda/realtek - Move some alc256 pintbls to + fallback table + +We have a new Dell machine which needs to apply the quirk +ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, try to use the fallback table +to fix it this time. And we could remove all pintbls of alc256 +for applying DELL1_MIC_NO_PRESENCE on Dell machines. + +Signed-off-by: Hui Wang +Link: https://lore.kernel.org/r/20191121022644.8078-1-hui.wang@canonical.com +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit aed8c7f40882015aad45088256231babcbc24482) +Bugzilla: 1772498 +--- + sound/pci/hda/patch_realtek.c | 35 +++-------------------------------- + 1 file changed, 3 insertions(+), 32 deletions(-) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index 80f66ba85f87..4c83ed4b0d5c 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -7608,38 +7608,6 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, + {0x1b, 0x01011020}, + {0x21, 0x02211010}), +- SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, +- {0x12, 0x90a60130}, +- {0x14, 0x90170110}, +- {0x1b, 0x01011020}, +- {0x21, 0x0221101f}), +- SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, +- {0x12, 0x90a60160}, +- {0x14, 0x90170120}, +- {0x21, 0x02211030}), +- SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, +- {0x12, 0x90a60170}, +- {0x14, 0x90170120}, +- {0x21, 0x02211030}), +- SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, +- {0x12, 0x90a60180}, +- {0x14, 0x90170120}, +- {0x21, 0x02211030}), +- SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, +- {0x12, 0xb7a60130}, +- {0x14, 0x90170110}, +- {0x21, 0x02211020}), +- SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, +- {0x12, 0x90a60130}, +- {0x14, 0x90170110}, +- {0x14, 0x01011020}, +- {0x21, 0x0221101f}), +- SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, +- ALC256_STANDARD_PINS), +- SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, +- {0x14, 0x90170110}, +- {0x1b, 0x01011020}, +- {0x21, 0x0221101f}), + SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, + {0x14, 0x90170110}, + {0x1b, 0x90a70130}, +@@ -7852,6 +7820,9 @@ static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = { + SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, + {0x19, 0x40000000}, + {0x1a, 0x40000000}), ++ SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, ++ {0x19, 0x40000000}, ++ {0x1a, 0x40000000}), + {} + }; + +-- +2.20.1 + + +From 0ea4ea7f506846d630b9c31bcc9668c34e6f0555 Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Thu, 21 Nov 2019 10:26:44 +0800 +Subject: [PATCH 104/130] ALSA: hda/realtek - Move some alc236 pintbls to + fallback table + +We have a new Dell machine which needs to apply the quirk +ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, try to use the fallback table +to fix it this time. And we could remove all pintbls of alc236 +for applying DELL1_MIC_NO_PRESENCE on Dell machines. + +Signed-off-by: Hui Wang +Link: https://lore.kernel.org/r/20191121022644.8078-2-hui.wang@canonical.com +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit d64ebdbfd4f71406f58210f5ccb16977b4cd31d2) +Bugzilla: 1772498 +--- + sound/pci/hda/patch_realtek.c | 17 +++-------------- + 1 file changed, 3 insertions(+), 14 deletions(-) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index 4c83ed4b0d5c..4ebe104cb592 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -7512,20 +7512,6 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { + {0x19, 0x02a11020}, + {0x1a, 0x02a11030}, + {0x21, 0x0221101f}), +- SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, +- {0x12, 0x90a60140}, +- {0x14, 0x90170110}, +- {0x21, 0x02211020}), +- SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, +- {0x12, 0x90a60140}, +- {0x14, 0x90170150}, +- {0x21, 0x02211020}), +- SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, +- {0x21, 0x02211020}), +- SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, +- {0x12, 0x40000000}, +- {0x14, 0x90170110}, +- {0x21, 0x02211020}), + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, + {0x14, 0x90170110}, + {0x21, 0x02211020}), +@@ -7823,6 +7809,9 @@ static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = { + SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, + {0x19, 0x40000000}, + {0x1a, 0x40000000}), ++ SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, ++ {0x19, 0x40000000}, ++ {0x1a, 0x40000000}), + {} + }; + +-- +2.20.1 + + +From 268e8ce52ad4278f6b94792483d3f8510b435b3e Mon Sep 17 00:00:00 2001 +From: Jens Verwiebe +Date: Sun, 24 Nov 2019 13:35:44 +0100 +Subject: [PATCH 107/130] ALSA: usb-audio: Fix Focusrite Scarlett 6i6 gen1 - + input handling + +The Scarlett 6i6 has no padding on rear inputs 3/4 but a gainstage. +This patch introduces this functionality as to be seen in the mac +or windows scarlett control. + +The correct address could already be found in the dump info, but was +never used. Without this patch inputs 3/4 are quite unusable else. + +Signed-off-by: Jens Verwiebe +Link: https://lore.kernel.org/r/384d65cd-5e87-91eb-9fc3-e57226f534c6@jensverwiebe.de +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit bf2aa5cadd1c7bb91af4b5b1218e643cfffb5c9a) +Bugzilla: 1772498 +--- + sound/usb/mixer_scarlett.c | 23 +++++++++++++++++++++-- + 1 file changed, 21 insertions(+), 2 deletions(-) + +diff --git a/sound/usb/mixer_scarlett.c b/sound/usb/mixer_scarlett.c +index 83715fd8dfd6..9d10cbf1b5ed 100644 +--- a/sound/usb/mixer_scarlett.c ++++ b/sound/usb/mixer_scarlett.c +@@ -142,6 +142,7 @@ enum { + SCARLETT_OUTPUTS, + SCARLETT_SWITCH_IMPEDANCE, + SCARLETT_SWITCH_PAD, ++ SCARLETT_SWITCH_GAIN, + }; + + enum { +@@ -192,6 +193,15 @@ static const struct scarlett_mixer_elem_enum_info opt_pad = { + } + }; + ++static const struct scarlett_mixer_elem_enum_info opt_gain = { ++ .start = 0, ++ .len = 2, ++ .offsets = {}, ++ .names = (char const * const []){ ++ "Lo", "Hi" ++ } ++}; ++ + static const struct scarlett_mixer_elem_enum_info opt_impedance = { + .start = 0, + .len = 2, +@@ -652,8 +662,8 @@ static struct scarlett_device_info s6i6_info = { + { .num = 1, .type = SCARLETT_SWITCH_PAD, .name = NULL}, + { .num = 2, .type = SCARLETT_SWITCH_IMPEDANCE, .name = NULL}, + { .num = 2, .type = SCARLETT_SWITCH_PAD, .name = NULL}, +- { .num = 3, .type = SCARLETT_SWITCH_PAD, .name = NULL}, +- { .num = 4, .type = SCARLETT_SWITCH_PAD, .name = NULL}, ++ { .num = 3, .type = SCARLETT_SWITCH_GAIN, .name = NULL}, ++ { .num = 4, .type = SCARLETT_SWITCH_GAIN, .name = NULL}, + }, + + .matrix_mux_init = { +@@ -883,6 +893,15 @@ static int scarlett_controls_create_generic(struct usb_mixer_interface *mixer, + if (err < 0) + return err; + break; ++ case SCARLETT_SWITCH_GAIN: ++ sprintf(mx, "Input %d Gain Switch", ctl->num); ++ err = add_new_ctl(mixer, &usb_scarlett_ctl_enum, ++ scarlett_ctl_enum_resume, 0x01, ++ 0x08, ctl->num, USB_MIXER_S16, 1, mx, ++ &opt_gain, &elem); ++ if (err < 0) ++ return err; ++ break; + } + } + +-- +2.20.1 + + +From 98db14f3c44954a5da1239328f4677808d5a3acf Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 1 Nov 2019 12:09:14 -0500 +Subject: [PATCH 108/130] ASoC: SOF: topology: fix missing NULL pointer check + +Add check to avoid possible NULL pointer dereference issue. + +This issue was reported by static analysis tools, we didn't face this +issue but we can't rule it out either as a false positive. + +Reported-by: Keqiao Zhang +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101170916.26517-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 8cd73ce7ba6381feb9df763240dee3a6d4aff1ca) +Bugzilla: 1772498 +--- + sound/soc/sof/topology.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c +index 143b8259a70a..6096731e89ce 100644 +--- a/sound/soc/sof/topology.c ++++ b/sound/soc/sof/topology.c +@@ -150,6 +150,11 @@ static int sof_keyword_dapm_event(struct snd_soc_dapm_widget *w, + + /* get runtime PCM params using widget's stream name */ + spcm = snd_sof_find_spcm_name(sdev, swidget->widget->sname); ++ if (!spcm) { ++ dev_err(sdev->dev, "error: cannot find PCM for %s\n", ++ swidget->widget->name); ++ return -EINVAL; ++ } + + /* process events */ + switch (event) { +-- +2.20.1 + + +From d00288a4c998c445288666abb202808ea2d0dd8b Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Fri, 1 Nov 2019 12:09:15 -0500 +Subject: [PATCH 109/130] ASoC: SOF: Intel: hda: set L1SEN on S0ix suspend + +Set L1SEN to make sure the system can enter S0ix, and restore it on +resume. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191101170916.26517-3-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 16299326a0cbbc88d4d6491a8ceebbfca81064c5) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda-dsp.c | 15 +++++++++++++++ + sound/soc/sof/intel/hda.h | 3 +++ + 2 files changed, 18 insertions(+) + +diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c +index 8cd5ecc01b62..4a4d318f97ff 100644 +--- a/sound/soc/sof/intel/hda-dsp.c ++++ b/sound/soc/sof/intel/hda-dsp.c +@@ -478,9 +478,16 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume) + + int hda_dsp_resume(struct snd_sof_dev *sdev) + { ++ struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; + struct pci_dev *pci = to_pci_dev(sdev->dev); + + if (sdev->s0_suspend) { ++ /* restore L1SEN bit */ ++ if (hda->l1_support_changed) ++ snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, ++ HDA_VS_INTEL_EM2, ++ HDA_VS_INTEL_EM2_L1SEN, 0); ++ + /* restore and disable the system wakeup */ + pci_restore_state(pci); + disable_irq_wake(pci->irq); +@@ -518,11 +525,19 @@ int hda_dsp_runtime_suspend(struct snd_sof_dev *sdev) + + int hda_dsp_suspend(struct snd_sof_dev *sdev) + { ++ struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; + struct hdac_bus *bus = sof_to_bus(sdev); + struct pci_dev *pci = to_pci_dev(sdev->dev); + int ret; + + if (sdev->s0_suspend) { ++ /* enable L1SEN to make sure the system can enter S0Ix */ ++ hda->l1_support_changed = ++ snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, ++ HDA_VS_INTEL_EM2, ++ HDA_VS_INTEL_EM2_L1SEN, ++ HDA_VS_INTEL_EM2_L1SEN); ++ + /* enable the system waking up via IPC IRQ */ + enable_irq_wake(pci->irq); + pci_save_state(pci); +diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h +index 5ad73a34b09c..18d7e72bf9b7 100644 +--- a/sound/soc/sof/intel/hda.h ++++ b/sound/soc/sof/intel/hda.h +@@ -408,6 +408,9 @@ struct sof_intel_hda_dev { + + int irq; + ++ /* PM related */ ++ bool l1_support_changed;/* during suspend, is L1SEN changed or not */ ++ + /* DMIC device */ + struct platform_device *dmic_dev; + }; +-- +2.20.1 + + +From d1475f9cebf57b062ca025e4d87ecaa8f0955f8e Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Mon, 11 Nov 2019 16:29:01 -0600 +Subject: [PATCH 110/130] ASoC: SOF: Intel: hda: use fallback for firmware name + +We have platforms such as CFL with no known I2S codec being used, and +the ACPI tables are currently empty, so fall-back to using the +firmware filename used in nocodec mode + +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191111222901.19892-4-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 0af237d51a4e734db959a158185f79019f022f59) +Bugzilla: 1772498 +--- + sound/soc/sof/intel/hda.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c +index 7dc0018dc4c3..91bd88fddac7 100644 +--- a/sound/soc/sof/intel/hda.c ++++ b/sound/soc/sof/intel/hda.c +@@ -415,9 +415,16 @@ static int hda_init_caps(struct snd_sof_dev *sdev) + pdata->tplg_filename = + hda_mach->sof_tplg_filename; + +- /* firmware: pick the first in machine list */ ++ /* ++ * firmware: pick the first in machine list, ++ * or use nocodec firmware name if list is empty ++ */ + mach = pdata->desc->machines; +- pdata->fw_filename = mach->sof_fw_filename; ++ if (mach->id[0]) ++ pdata->fw_filename = mach->sof_fw_filename; ++ else ++ pdata->fw_filename = ++ pdata->desc->nocodec_fw_filename; + + dev_info(bus->dev, "using HDA machine driver %s now\n", + hda_mach->drv_name); +-- +2.20.1 + + +From 15f2f0826db2cd13a243fde28d9b7a6fd4b0428e Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Mon, 11 Nov 2019 16:33:40 -0600 +Subject: [PATCH 111/130] ASoC: SOF: PM: add state machine to comments + +Add Audio DSP state machine with comments. Note that the +'D0<-->runtime D0I3' part is not implemented yet. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191111223343.19986-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 74b4dd04b19cc03e1cc369d9c371cf4206367df4) +Bugzilla: 1772498 +--- + sound/soc/sof/pm.c | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c +index 560a937e0484..3204c92f0e7d 100644 +--- a/sound/soc/sof/pm.c ++++ b/sound/soc/sof/pm.c +@@ -428,6 +428,38 @@ int snd_sof_set_d0_substate(struct snd_sof_dev *sdev, + } + EXPORT_SYMBOL(snd_sof_set_d0_substate); + ++/* ++ * Audio DSP states may transform as below:- ++ * ++ * D0I3 compatible stream ++ * Runtime +---------------------+ opened only, timeout ++ * suspend | +--------------------+ ++ * +------------+ D0(active) | | ++ * | | <---------------+ | ++ * | +--------> | | | ++ * | |Runtime +--^--+---------^--+--+ The last | | ++ * | |resume | | | | opened D0I3 | | ++ * | | | | | | compatible | | ++ * | | resume| | | | stream closed | | ++ * | | from | | D3 | | | | ++ * | | D3 | |suspend | | d0i3 | | ++ * | | | | | |suspend | | ++ * | | | | | | | | ++ * | | | | | | | | ++ * +-v---+-----------+--v-------+ | | +------+----v----+ ++ * | | | +-----------> | ++ * | D3 (suspended) | | | D0I3 +-----+ ++ * | | +--------------+ | | ++ * | | resume from | | | ++ * +-------------------^--------+ d0i3 suspend +----------------+ | ++ * | | ++ * | D3 suspend | ++ * +------------------------------------------------+ ++ * ++ * d0i3_suspend = s0_suspend && D0I3 stream opened, ++ * D3 suspend = !d0i3_suspend, ++ */ ++ + int snd_sof_resume(struct device *dev) + { + struct snd_sof_dev *sdev = dev_get_drvdata(dev); +-- +2.20.1 + + +From a42c0c91a4bb7e180473b81bf98c56384149bd1c Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Mon, 11 Nov 2019 16:33:41 -0600 +Subject: [PATCH 112/130] ASoC: SOF: PM: add check before setting d0_substate + +Add check before seeting d0_substate and return success if Audio DSP is +already in the target substate. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191111223343.19986-3-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 58a972efd21bb5adadd97f2546693ec64bfc99b9) +Bugzilla: 1772498 +--- + sound/soc/sof/pm.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c +index 3204c92f0e7d..b89810bf3230 100644 +--- a/sound/soc/sof/pm.c ++++ b/sound/soc/sof/pm.c +@@ -416,6 +416,9 @@ int snd_sof_set_d0_substate(struct snd_sof_dev *sdev, + { + int ret; + ++ if (sdev->d0_substate == d0_substate) ++ return 0; ++ + /* do platform specific set_state */ + ret = snd_sof_dsp_set_power_state(sdev, d0_substate); + if (ret < 0) +-- +2.20.1 + + +From bba0301fd9f218213736d2db9368bbc09346cbb5 Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Mon, 11 Nov 2019 16:33:42 -0600 +Subject: [PATCH 113/130] ASoC: SOF: add helper to check if we should enter + d0i3 suspend + +Add helper to check if the DSP should be put in D0i3. This function +returns true if a stream has ignored the SUSPEND trigger to keep the +pipelines running in the DSP. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191111223343.19986-4-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit a77e5d573f847d2f984c38eb711351326bc55258) +Bugzilla: 1772498 +--- + sound/soc/sof/core.c | 13 +++++++++++++ + sound/soc/sof/sof-priv.h | 2 ++ + 2 files changed, 15 insertions(+) + +diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c +index 8661c2cca76b..805918d3bcc0 100644 +--- a/sound/soc/sof/core.c ++++ b/sound/soc/sof/core.c +@@ -132,6 +132,19 @@ struct snd_sof_dai *snd_sof_find_dai(struct snd_sof_dev *sdev, + return NULL; + } + ++bool snd_sof_dsp_d0i3_on_suspend(struct snd_sof_dev *sdev) ++{ ++ struct snd_sof_pcm *spcm; ++ ++ list_for_each_entry(spcm, &sdev->pcm_list, list) { ++ if (spcm->stream[SNDRV_PCM_STREAM_PLAYBACK].suspend_ignored || ++ spcm->stream[SNDRV_PCM_STREAM_CAPTURE].suspend_ignored) ++ return true; ++ } ++ ++ return false; ++} ++ + /* + * FW Panic/fault handling. + */ +diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h +index 6408ac88a3e5..c7c2c70ee4d0 100644 +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -553,6 +553,8 @@ struct snd_sof_pcm *snd_sof_find_spcm_dai(struct snd_sof_dev *sdev, + return NULL; + } + ++bool snd_sof_dsp_d0i3_on_suspend(struct snd_sof_dev *sdev); ++ + struct snd_sof_pcm *snd_sof_find_spcm_name(struct snd_sof_dev *sdev, + const char *name); + struct snd_sof_pcm *snd_sof_find_spcm_comp(struct snd_sof_dev *sdev, +-- +2.20.1 + + +From 37c30238887254ea800b5913475bd444fe0ba46d Mon Sep 17 00:00:00 2001 +From: Keyon Jie +Date: Mon, 11 Nov 2019 16:33:43 -0600 +Subject: [PATCH 114/130] ASoC: SOF: PM: only suspend to D0I3 when needed + +We should suspend audio to D3 by default, for the sake of power saving, +change the condition of D0I3 suspending here to that when there is +stream with suspend_ignored specified. + +Signed-off-by: Keyon Jie +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191111223343.19986-5-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 5e35d5f4224adb24c2bfa814b9fb562050aba3ea) +Bugzilla: 1772498 +--- + sound/soc/sof/pm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c +index b89810bf3230..0fd5567237a8 100644 +--- a/sound/soc/sof/pm.c ++++ b/sound/soc/sof/pm.c +@@ -468,7 +468,7 @@ int snd_sof_resume(struct device *dev) + struct snd_sof_dev *sdev = dev_get_drvdata(dev); + int ret; + +- if (sdev->s0_suspend) { ++ if (snd_sof_dsp_d0i3_on_suspend(sdev)) { + /* resume from D0I3 */ + dev_dbg(sdev->dev, "DSP will exit from D0i3...\n"); + ret = snd_sof_set_d0_substate(sdev, SOF_DSP_D0I0); +@@ -497,7 +497,7 @@ int snd_sof_suspend(struct device *dev) + struct snd_sof_dev *sdev = dev_get_drvdata(dev); + int ret; + +- if (sdev->s0_suspend) { ++ if (snd_sof_dsp_d0i3_on_suspend(sdev)) { + /* suspend to D0i3 */ + dev_dbg(sdev->dev, "DSP is trying to enter D0i3...\n"); + ret = snd_sof_set_d0_substate(sdev, SOF_DSP_D0I3); +-- +2.20.1 + + +From 21fa58950c58b8b75e38f4cffac87e6058f0f01f Mon Sep 17 00:00:00 2001 +From: Dragos Tarcatu +Date: Mon, 11 Nov 2019 16:20:38 -0600 +Subject: [PATCH 115/130] ASoC: SOF: topology: free kcontrol memory on error + +The volume and bytes kcontrols are currently not freeing their +memory on initialization failures. When an error occurs, all the +widgets loaded so far are unloaded via sof_widget_unload(). +But this only happens for the widgets that got successfully loaded. + +Fix that by kfree()-ing the allocated memory on load error. + +Fixes: 311ce4fe7637d ("ASoC: SOF: Add support for loading topologies") +Reviewed-by: Paul Olaru +Reviewed-by: Ranjani Sridharan +Signed-off-by: Dragos Tarcatu +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191111222039.19651-1-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 1b4efdaf6d6053c8944cee0edba0969dc1be7d4b) +Bugzilla: 1772498 +--- + sound/soc/sof/topology.c | 67 +++++++++++++++++++++++++++++----------- + 1 file changed, 49 insertions(+), 18 deletions(-) + +diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c +index 6096731e89ce..d82ab981e840 100644 +--- a/sound/soc/sof/topology.c ++++ b/sound/soc/sof/topology.c +@@ -942,18 +942,22 @@ static int sof_control_load_volume(struct snd_soc_component *scomp, + struct sof_ipc_ctrl_data *cdata; + int tlv[TLV_ITEMS]; + unsigned int i; +- int ret; ++ int ret = 0; + + /* validate topology data */ +- if (le32_to_cpu(mc->num_channels) > SND_SOC_TPLG_MAX_CHAN) +- return -EINVAL; ++ if (le32_to_cpu(mc->num_channels) > SND_SOC_TPLG_MAX_CHAN) { ++ ret = -EINVAL; ++ goto out; ++ } + + /* init the volume get/put data */ + scontrol->size = struct_size(scontrol->control_data, chanv, + le32_to_cpu(mc->num_channels)); + scontrol->control_data = kzalloc(scontrol->size, GFP_KERNEL); +- if (!scontrol->control_data) +- return -ENOMEM; ++ if (!scontrol->control_data) { ++ ret = -ENOMEM; ++ goto out; ++ } + + scontrol->comp_id = sdev->next_comp_id; + scontrol->min_volume_step = le32_to_cpu(mc->min); +@@ -963,7 +967,7 @@ static int sof_control_load_volume(struct snd_soc_component *scomp, + /* set cmd for mixer control */ + if (le32_to_cpu(mc->max) == 1) { + scontrol->cmd = SOF_CTRL_CMD_SWITCH; +- goto out; ++ goto skip; + } + + scontrol->cmd = SOF_CTRL_CMD_VOLUME; +@@ -971,14 +975,15 @@ static int sof_control_load_volume(struct snd_soc_component *scomp, + /* extract tlv data */ + if (get_tlv_data(kc->tlv.p, tlv) < 0) { + dev_err(sdev->dev, "error: invalid TLV data\n"); +- return -EINVAL; ++ ret = -EINVAL; ++ goto out_free; + } + + /* set up volume table */ + ret = set_up_volume_table(scontrol, tlv, le32_to_cpu(mc->max) + 1); + if (ret < 0) { + dev_err(sdev->dev, "error: setting up volume table\n"); +- return ret; ++ goto out_free; + } + + /* set default volume values to 0dB in control */ +@@ -988,7 +993,7 @@ static int sof_control_load_volume(struct snd_soc_component *scomp, + cdata->chanv[i].value = VOL_ZERO_DB; + } + +-out: ++skip: + /* set up possible led control from mixer private data */ + ret = sof_parse_tokens(scomp, &scontrol->led_ctl, led_tokens, + ARRAY_SIZE(led_tokens), mc->priv.array, +@@ -996,13 +1001,21 @@ static int sof_control_load_volume(struct snd_soc_component *scomp, + if (ret != 0) { + dev_err(sdev->dev, "error: parse led tokens failed %d\n", + le32_to_cpu(mc->priv.size)); +- return ret; ++ goto out_free_table; + } + + dev_dbg(sdev->dev, "tplg: load kcontrol index %d chans %d\n", + scontrol->comp_id, scontrol->num_channels); + +- return 0; ++ return ret; ++ ++out_free_table: ++ if (le32_to_cpu(mc->max) > 1) ++ kfree(scontrol->volume_table); ++out_free: ++ kfree(scontrol->control_data); ++out: ++ return ret; + } + + static int sof_control_load_enum(struct snd_soc_component *scomp, +@@ -1047,6 +1060,7 @@ static int sof_control_load_bytes(struct snd_soc_component *scomp, + container_of(hdr, struct snd_soc_tplg_bytes_control, hdr); + struct soc_bytes_ext *sbe = (struct soc_bytes_ext *)kc->private_value; + int max_size = sbe->max; ++ int ret = 0; + + /* init the get/put bytes data */ + scontrol->size = sizeof(struct sof_ipc_ctrl_data) + +@@ -1055,13 +1069,16 @@ static int sof_control_load_bytes(struct snd_soc_component *scomp, + if (scontrol->size > max_size) { + dev_err(sdev->dev, "err: bytes data size %d exceeds max %d.\n", + scontrol->size, max_size); +- return -EINVAL; ++ ret = -EINVAL; ++ goto out; + } + + scontrol->control_data = kzalloc(max_size, GFP_KERNEL); + cdata = scontrol->control_data; +- if (!scontrol->control_data) +- return -ENOMEM; ++ if (!scontrol->control_data) { ++ ret = -ENOMEM; ++ goto out; ++ } + + scontrol->comp_id = sdev->next_comp_id; + scontrol->cmd = SOF_CTRL_CMD_BINARY; +@@ -1076,23 +1093,32 @@ static int sof_control_load_bytes(struct snd_soc_component *scomp, + if (cdata->data->magic != SOF_ABI_MAGIC) { + dev_err(sdev->dev, "error: Wrong ABI magic 0x%08x.\n", + cdata->data->magic); +- return -EINVAL; ++ ret = -EINVAL; ++ goto out_free; + } + if (SOF_ABI_VERSION_INCOMPATIBLE(SOF_ABI_VERSION, + cdata->data->abi)) { + dev_err(sdev->dev, + "error: Incompatible ABI version 0x%08x.\n", + cdata->data->abi); +- return -EINVAL; ++ ret = -EINVAL; ++ goto out_free; + } + if (cdata->data->size + sizeof(const struct sof_abi_hdr) != + le32_to_cpu(control->priv.size)) { + dev_err(sdev->dev, + "error: Conflict in bytes vs. priv size.\n"); +- return -EINVAL; ++ ret = -EINVAL; ++ goto out_free; + } + } +- return 0; ++ ++ return ret; ++ ++out_free: ++ kfree(scontrol->control_data); ++out: ++ return ret; + } + + /* external kcontrol init - used for any driver specific init */ +@@ -1150,6 +1176,11 @@ static int sof_control_load(struct snd_soc_component *scomp, int index, + return 0; + } + ++ if (ret < 0) { ++ kfree(scontrol); ++ return ret; ++ } ++ + dobj->private = scontrol; + list_add(&scontrol->list, &sdev->kcontrol_list); + return ret; +-- +2.20.1 + + +From 165ac3fd39d420dc48ff9e05142a6e07dbc249e0 Mon Sep 17 00:00:00 2001 +From: Liam Girdwood +Date: Mon, 11 Nov 2019 16:29:00 -0600 +Subject: [PATCH 116/130] ASoC: SOF: Intel: Fix CFL and CML FW nocodec binary + names. + +The manifest information is different between CNL, CML and CFL platforms +hence we need to load different files. + +Signed-off-by: Liam Girdwood +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191111222901.19892-3-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 653c28afa76b45c570370c3c3a89975c68c5fc8e) +Bugzilla: 1772498 +--- + sound/soc/sof/sof-pci-dev.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c +index 3b58b91e7b9e..bbeffd932de7 100644 +--- a/sound/soc/sof/sof-pci-dev.c ++++ b/sound/soc/sof/sof-pci-dev.c +@@ -120,7 +120,7 @@ static const struct sof_dev_desc cnl_desc = { + + #if IS_ENABLED(CONFIG_SND_SOC_SOF_COFFEELAKE) + static const struct sof_dev_desc cfl_desc = { +- .machines = snd_soc_acpi_intel_cnl_machines, ++ .machines = snd_soc_acpi_intel_cfl_machines, + .resindex_lpe_base = 0, + .resindex_pcicfg_base = -1, + .resindex_imr_base = -1, +@@ -129,7 +129,7 @@ static const struct sof_dev_desc cfl_desc = { + .chip_info = &cnl_chip_info, + .default_fw_path = "intel/sof", + .default_tplg_path = "intel/sof-tplg", +- .nocodec_fw_filename = "sof-cnl.ri", ++ .nocodec_fw_filename = "sof-cfl.ri", + .nocodec_tplg_filename = "sof-cnl-nocodec.tplg", + .ops = &sof_cnl_ops, + .arch_ops = &sof_xtensa_arch_ops +@@ -140,7 +140,7 @@ static const struct sof_dev_desc cfl_desc = { + IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE_H) + + static const struct sof_dev_desc cml_desc = { +- .machines = snd_soc_acpi_intel_cnl_machines, ++ .machines = snd_soc_acpi_intel_cml_machines, + .resindex_lpe_base = 0, + .resindex_pcicfg_base = -1, + .resindex_imr_base = -1, +@@ -149,7 +149,7 @@ static const struct sof_dev_desc cml_desc = { + .chip_info = &cnl_chip_info, + .default_fw_path = "intel/sof", + .default_tplg_path = "intel/sof-tplg", +- .nocodec_fw_filename = "sof-cnl.ri", ++ .nocodec_fw_filename = "sof-cml.ri", + .nocodec_tplg_filename = "sof-cnl-nocodec.tplg", + .ops = &sof_cnl_ops, + .arch_ops = &sof_xtensa_arch_ops +-- +2.20.1 + + +From 6f3f161ac71319c1997170719e119f315a2251f6 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Wed, 20 Nov 2019 21:32:52 +0800 +Subject: [PATCH 117/130] ASoC: Fix Kconfig indentation + +Adjust indentation from spaces to tab (+optional two spaces) as in +coding style with command like: + $ sed -e 's/^ /\t/' -i */Kconfig + +Signed-off-by: Krzysztof Kozlowski +Acked-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191120133252.6365-1-krzk@kernel.org +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 3efd72330543da44e82e9371dfb639802c886f6c) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/Kconfig | 24 ++++++++++++------------ + sound/soc/sof/intel/Kconfig | 10 +++++----- + 2 files changed, 17 insertions(+), 17 deletions(-) + +diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig +index 2702aefee775..ef20316e83d1 100644 +--- a/sound/soc/intel/boards/Kconfig ++++ b/sound/soc/intel/boards/Kconfig +@@ -441,18 +441,18 @@ config SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH + If unsure select "N". + + config SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH +- tristate "CML with RT1011 and RT5682 in I2S Mode" +- depends on I2C && ACPI +- depends on MFD_INTEL_LPSS || COMPILE_TEST +- select SND_SOC_RT1011 +- select SND_SOC_RT5682 +- select SND_SOC_DMIC +- select SND_SOC_HDAC_HDMI +- help +- This adds support for ASoC machine driver for SOF platform with +- RT1011 + RT5682 I2S codec. +- Say Y if you have such a device. +- If unsure select "N". ++ tristate "CML with RT1011 and RT5682 in I2S Mode" ++ depends on I2C && ACPI ++ depends on MFD_INTEL_LPSS || COMPILE_TEST ++ select SND_SOC_RT1011 ++ select SND_SOC_RT5682 ++ select SND_SOC_DMIC ++ select SND_SOC_HDAC_HDMI ++ help ++ This adds support for ASoC machine driver for SOF platform with ++ RT1011 + RT5682 I2S codec. ++ Say Y if you have such a device. ++ If unsure select "N". + + endif ## SND_SOC_SOF_COMETLAKE_LP && SND_SOC_SOF_HDA_LINK + +diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig +index b27fd3fdf335..cc09bb606f7d 100644 +--- a/sound/soc/sof/intel/Kconfig ++++ b/sound/soc/sof/intel/Kconfig +@@ -264,16 +264,16 @@ config SND_SOC_SOF_ELKHARTLAKE + config SND_SOC_SOF_JASPERLAKE_SUPPORT + bool "SOF support for JasperLake" + help +- This adds support for Sound Open Firmware for Intel(R) platforms +- using the JasperLake processors. +- Say Y if you have such a device. +- If unsure select "N". ++ This adds support for Sound Open Firmware for Intel(R) platforms ++ using the JasperLake processors. ++ Say Y if you have such a device. ++ If unsure select "N". + + config SND_SOC_SOF_JASPERLAKE + tristate + select SND_SOC_SOF_HDA_COMMON + help +- This option is not user-selectable but automagically handled by ++ This option is not user-selectable but automagically handled by + 'select' statements at a higher level + + config SND_SOC_SOF_HDA_COMMON +-- +2.20.1 + + +From 716051e31d6ac7c9c195f9f36e9b2d0bb7c1ee39 Mon Sep 17 00:00:00 2001 +From: Ben Zhang +Date: Tue, 5 Nov 2019 17:13:27 -0800 +Subject: [PATCH 118/130] ASoC: bdw-rt5677: Add a DAI link for rt5677 SPI PCM + device + +This link is needed for the RT5677 DSP to do hotwording + +Signed-off-by: Ben Zhang +Signed-off-by: Curtis Malainey +Link: https://lore.kernel.org/r/20191106011335.223061-3-cujomalainey@chromium.org +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 157b006f6be46be833b2941856b86e0a9d8bfb0e) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/bdw-rt5677.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/sound/soc/intel/boards/bdw-rt5677.c b/sound/soc/intel/boards/bdw-rt5677.c +index 4a4d3353e26d..eeb9a11e4e14 100644 +--- a/sound/soc/intel/boards/bdw-rt5677.c ++++ b/sound/soc/intel/boards/bdw-rt5677.c +@@ -74,6 +74,7 @@ static const struct snd_soc_dapm_route bdw_rt5677_map[] = { + /* CODEC BE connections */ + {"SSP0 CODEC IN", NULL, "AIF1 Capture"}, + {"AIF1 Playback", NULL, "SSP0 CODEC OUT"}, ++ {"DSP Capture", NULL, "DSP Buffer"}, + }; + + static const struct snd_kcontrol_new bdw_rt5677_controls[] = { +@@ -258,6 +259,12 @@ SND_SOC_DAILINK_DEF(platform, + SND_SOC_DAILINK_DEF(be, + DAILINK_COMP_ARRAY(COMP_CODEC("i2c-RT5677CE:00", "rt5677-aif1"))); + ++/* Wake on voice interface */ ++SND_SOC_DAILINK_DEFS(dsp, ++ DAILINK_COMP_ARRAY(COMP_CPU("spi-RT5677AA:00")), ++ DAILINK_COMP_ARRAY(COMP_CODEC("i2c-RT5677CE:00", "rt5677-dspbuffer")), ++ DAILINK_COMP_ARRAY(COMP_PLATFORM("spi-RT5677AA:00"))); ++ + static struct snd_soc_dai_link bdw_rt5677_dais[] = { + /* Front End DAI links */ + { +@@ -276,6 +283,13 @@ static struct snd_soc_dai_link bdw_rt5677_dais[] = { + SND_SOC_DAILINK_REG(fe, dummy, platform), + }, + ++ /* Non-DPCM links */ ++ { ++ .name = "Codec DSP", ++ .stream_name = "Wake on Voice", ++ SND_SOC_DAILINK_REG(dsp), ++ }, ++ + /* Back End DAI links */ + { + /* SSP0 - Codec */ +-- +2.20.1 + + +From 0509dabb0d84b34fe4632eabc8aae3bf699dffb4 Mon Sep 17 00:00:00 2001 +From: Curtis Malainey +Date: Tue, 5 Nov 2019 17:13:34 -0800 +Subject: [PATCH 119/130] ASoC: bdw-rt5677: Turn on MCLK1 for DSP via DAPM + +The RT5677 DSP needs the I2S MCLK1 to run its DSP. Add a dapm route to +SSP0 CODEC IN so the clock is turned on automatically when the DSP is +turned on. + +Signed-off-by: Curtis Malainey +Link: https://lore.kernel.org/r/20191106011335.223061-10-cujomalainey@chromium.org +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 55229597a94531726878229ccfcd3fe4ec572dc3) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/bdw-rt5677.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sound/soc/intel/boards/bdw-rt5677.c b/sound/soc/intel/boards/bdw-rt5677.c +index eeb9a11e4e14..b2475e3eff7b 100644 +--- a/sound/soc/intel/boards/bdw-rt5677.c ++++ b/sound/soc/intel/boards/bdw-rt5677.c +@@ -75,6 +75,10 @@ static const struct snd_soc_dapm_route bdw_rt5677_map[] = { + {"SSP0 CODEC IN", NULL, "AIF1 Capture"}, + {"AIF1 Playback", NULL, "SSP0 CODEC OUT"}, + {"DSP Capture", NULL, "DSP Buffer"}, ++ ++ /* DSP Clock Connections */ ++ { "DSP Buffer", NULL, "SSP0 CODEC IN" }, ++ { "SSP0 CODEC IN", NULL, "DSPTX" }, + }; + + static const struct snd_kcontrol_new bdw_rt5677_controls[] = { +-- +2.20.1 + + +From 4ed26c72c431638378a523c30aea7842a84b48d7 Mon Sep 17 00:00:00 2001 +From: Yu-Hsuan Hsu +Date: Tue, 24 Sep 2019 00:29:40 +0800 +Subject: [PATCH 120/130] ASoC: Intel: kbl_rt5663_rt5514_max98927: Add dmic + format constraint + +On KBL platform, the microphone is attached to external codec(rt5514) +instead of PCH. However, TDM slot between PCH and codec is 16 bits only. +In order to avoid setting wrong format, we should add a constraint to +force to use 16 bits format forever. + +Signed-off-by: Yu-Hsuan Hsu +Acked-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20190923162940.199580-1-yuhsuan@chromium.org +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit e2db787bdcb4f2722ecf410168f0583764634e45) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +index a1056cda3dd7..3e5f6bead229 100644 +--- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c ++++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +@@ -465,6 +465,9 @@ static int kabylake_dmic_startup(struct snd_pcm_substream *substream) + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, + dmic_constraints); + ++ runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE; ++ snd_pcm_hw_constraint_msbits(runtime, 0, 16, 16); ++ + return snd_pcm_hw_constraint_list(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_RATE, &constraints_rates); + } +-- +2.20.1 + + +From 0305b5a5db77305fc43a76efd39aed84c5561f96 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Mon, 11 Nov 2019 16:28:59 -0600 +Subject: [PATCH 121/130] ASoC: Intel: acpi-match: split CNL tables in three + +Due to firmware manifest/signature differences, we have to use +different firmware names, so split CNL machine table in three (CNL, +CFL, CML). + +The CFL table is currently empty since all known platforms use +HDaudio, but let's plan ahead. + +Reviewed-by: Ranjani Sridharan +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191111222901.19892-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 1f24d93c4f4ec0bb0b73c5b020060aa2d9faa756) +Bugzilla: 1772498 +--- + include/sound/soc-acpi-intel-match.h | 2 + + sound/soc/intel/common/Makefile | 3 +- + .../intel/common/soc-acpi-intel-cfl-match.c | 18 ++++++ + .../intel/common/soc-acpi-intel-cml-match.c | 56 +++++++++++++++++++ + .../intel/common/soc-acpi-intel-cnl-match.c | 38 ------------- + 5 files changed, 78 insertions(+), 39 deletions(-) + create mode 100644 sound/soc/intel/common/soc-acpi-intel-cfl-match.c + create mode 100644 sound/soc/intel/common/soc-acpi-intel-cml-match.c + +diff --git a/include/sound/soc-acpi-intel-match.h b/include/sound/soc-acpi-intel-match.h +index 4e44782862df..20c0bee3b959 100644 +--- a/include/sound/soc-acpi-intel-match.h ++++ b/include/sound/soc-acpi-intel-match.h +@@ -24,6 +24,8 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[]; + extern struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[]; + extern struct snd_soc_acpi_mach snd_soc_acpi_intel_glk_machines[]; + extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[]; ++extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cfl_machines[]; ++extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_machines[]; + extern struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_machines[]; + extern struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_machines[]; + extern struct snd_soc_acpi_mach snd_soc_acpi_intel_ehl_machines[]; +diff --git a/sound/soc/intel/common/Makefile b/sound/soc/intel/common/Makefile +index eafe95ead49b..bd352878f89a 100644 +--- a/sound/soc/intel/common/Makefile ++++ b/sound/soc/intel/common/Makefile +@@ -7,7 +7,8 @@ snd-soc-acpi-intel-match-objs := soc-acpi-intel-byt-match.o soc-acpi-intel-cht-m + soc-acpi-intel-hsw-bdw-match.o \ + soc-acpi-intel-skl-match.o soc-acpi-intel-kbl-match.o \ + soc-acpi-intel-bxt-match.o soc-acpi-intel-glk-match.o \ +- soc-acpi-intel-cnl-match.o soc-acpi-intel-icl-match.o \ ++ soc-acpi-intel-cnl-match.o soc-acpi-intel-cfl-match.o \ ++ soc-acpi-intel-cml-match.o soc-acpi-intel-icl-match.o \ + soc-acpi-intel-tgl-match.o soc-acpi-intel-ehl-match.o \ + soc-acpi-intel-jsl-match.o \ + soc-acpi-intel-hda-match.o +diff --git a/sound/soc/intel/common/soc-acpi-intel-cfl-match.c b/sound/soc/intel/common/soc-acpi-intel-cfl-match.c +new file mode 100644 +index 000000000000..d6fd2026d0b8 +--- /dev/null ++++ b/sound/soc/intel/common/soc-acpi-intel-cfl-match.c +@@ -0,0 +1,18 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * soc-apci-intel-cfl-match.c - tables and support for CFL ACPI enumeration. ++ * ++ * Copyright (c) 2019, Intel Corporation. ++ * ++ */ ++ ++#include ++#include ++ ++struct snd_soc_acpi_mach snd_soc_acpi_intel_cfl_machines[] = { ++ {}, ++}; ++EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cfl_machines); ++ ++MODULE_LICENSE("GPL v2"); ++MODULE_DESCRIPTION("Intel Common ACPI Match module"); +diff --git a/sound/soc/intel/common/soc-acpi-intel-cml-match.c b/sound/soc/intel/common/soc-acpi-intel-cml-match.c +new file mode 100644 +index 000000000000..5d08ae066738 +--- /dev/null ++++ b/sound/soc/intel/common/soc-acpi-intel-cml-match.c +@@ -0,0 +1,56 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * soc-acpi-intel-cml-match.c - tables and support for CML ACPI enumeration. ++ * ++ * Copyright (c) 2019, Intel Corporation. ++ * ++ */ ++ ++#include ++#include ++ ++static struct snd_soc_acpi_codecs cml_codecs = { ++ .num_codecs = 1, ++ .codecs = {"10EC5682"} ++}; ++ ++static struct snd_soc_acpi_codecs cml_spk_codecs = { ++ .num_codecs = 1, ++ .codecs = {"MX98357A"} ++}; ++ ++struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_machines[] = { ++ { ++ .id = "DLGS7219", ++ .drv_name = "cml_da7219_max98357a", ++ .quirk_data = &cml_spk_codecs, ++ .sof_fw_filename = "sof-cml.ri", ++ .sof_tplg_filename = "sof-cml-da7219-max98357a.tplg", ++ }, ++ { ++ .id = "MX98357A", ++ .drv_name = "sof_rt5682", ++ .quirk_data = &cml_codecs, ++ .sof_fw_filename = "sof-cml.ri", ++ .sof_tplg_filename = "sof-cml-rt5682-max98357a.tplg", ++ }, ++ { ++ .id = "10EC1011", ++ .drv_name = "cml_rt1011_rt5682", ++ .quirk_data = &cml_codecs, ++ .sof_fw_filename = "sof-cml.ri", ++ .sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg", ++ }, ++ { ++ .id = "10EC5682", ++ .drv_name = "sof_rt5682", ++ .sof_fw_filename = "sof-cml.ri", ++ .sof_tplg_filename = "sof-cml-rt5682.tplg", ++ }, ++ ++ {}, ++}; ++EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_machines); ++ ++MODULE_LICENSE("GPL v2"); ++MODULE_DESCRIPTION("Intel Common ACPI Match module"); +diff --git a/sound/soc/intel/common/soc-acpi-intel-cnl-match.c b/sound/soc/intel/common/soc-acpi-intel-cnl-match.c +index 16d0bae8b316..27588841c8b0 100644 +--- a/sound/soc/intel/common/soc-acpi-intel-cnl-match.c ++++ b/sound/soc/intel/common/soc-acpi-intel-cnl-match.c +@@ -14,16 +14,6 @@ static struct skl_machine_pdata cnl_pdata = { + .use_tplg_pcm = true, + }; + +-static struct snd_soc_acpi_codecs cml_codecs = { +- .num_codecs = 1, +- .codecs = {"10EC5682"} +-}; +- +-static struct snd_soc_acpi_codecs cml_spk_codecs = { +- .num_codecs = 1, +- .codecs = {"MX98357A"} +-}; +- + struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[] = { + { + .id = "INT34C2", +@@ -33,34 +23,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[] = { + .sof_fw_filename = "sof-cnl.ri", + .sof_tplg_filename = "sof-cnl-rt274.tplg", + }, +- { +- .id = "DLGS7219", +- .drv_name = "cml_da7219_max98357a", +- .quirk_data = &cml_spk_codecs, +- .sof_fw_filename = "sof-cnl.ri", +- .sof_tplg_filename = "sof-cml-da7219-max98357a.tplg", +- }, +- { +- .id = "MX98357A", +- .drv_name = "sof_rt5682", +- .quirk_data = &cml_codecs, +- .sof_fw_filename = "sof-cnl.ri", +- .sof_tplg_filename = "sof-cml-rt5682-max98357a.tplg", +- }, +- { +- .id = "10EC1011", +- .drv_name = "cml_rt1011_rt5682", +- .quirk_data = &cml_codecs, +- .sof_fw_filename = "sof-cnl.ri", +- .sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg", +- }, +- { +- .id = "10EC5682", +- .drv_name = "sof_rt5682", +- .sof_fw_filename = "sof-cnl.ri", +- .sof_tplg_filename = "sof-cml-rt5682.tplg", +- }, +- + {}, + }; + EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cnl_machines); +-- +2.20.1 + + +From 5013754204158edfa1252330c1120226af2dca7f Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 19 Nov 2019 15:51:38 +0100 +Subject: [PATCH 122/130] ASoC: Intel: bytcr_rt5640: Update quirk for Acer + Switch 10 SW5-012 2-in-1 + +When the Acer Switch 10 SW5-012 quirk was added we did not have +jack-detection support yet; and the builtin microphone selection of +the original quirk is wrong too. + +Fix the microphone-input quirk and add jack-detection info so that the +internal-microphone and headphone/set jack on the Switch 10 work properly. + +Signed-off-by: Hans de Goede +Reviewed-by: Andy Shevchenko +Acked-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20191119145138.59162-1-hdegoede@redhat.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 0bb887709eb16bdc4b5baddd8337abf3de72917f) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/bytcr_rt5640.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c +index 9c1aa4ec9cba..dd2b5ad08659 100644 +--- a/sound/soc/intel/boards/bytcr_rt5640.c ++++ b/sound/soc/intel/boards/bytcr_rt5640.c +@@ -405,10 +405,12 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW5-012"), + }, +- .driver_data = (void *)(BYT_RT5640_IN1_MAP | +- BYT_RT5640_MCLK_EN | +- BYT_RT5640_SSP0_AIF1), +- ++ .driver_data = (void *)(BYT_RT5640_DMIC1_MAP | ++ BYT_RT5640_JD_SRC_JD2_IN4N | ++ BYT_RT5640_OVCD_TH_2000UA | ++ BYT_RT5640_OVCD_SF_0P75 | ++ BYT_RT5640_SSP0_AIF1 | ++ BYT_RT5640_MCLK_EN), + }, + { + .matches = { +-- +2.20.1 + + +From 418156f40c1686839ff690363a6174049cebf3e8 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Fri, 29 Nov 2019 15:40:27 +0100 +Subject: [PATCH 124/130] ALSA: hda - fixup for the bass speaker on Lenovo + Carbon X1 7th gen + +The auto-parser assigns the bass speaker to DAC3 (NID 0x06) which +is without the volume control. I do not see a reason to use DAC2, +because the shared output to all speakers produces the sufficient +and well balanced sound. The stereo support is enough for this +purpose (laptop). + +Signed-off-by: Jaroslav Kysela +Link: https://lore.kernel.org/r/20191129144027.14765-1-perex@perex.cz +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit d2cd795c4ece1a24fda170c35eeb4f17d9826cbb) +Bugzilla: 1772498 +--- + sound/pci/hda/patch_realtek.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index d2bf70a1d2fd..a596790d4245 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -5544,6 +5544,16 @@ static void alc295_fixup_disable_dac3(struct hda_codec *codec, + } + } + ++/* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */ ++static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec, ++ const struct hda_fixup *fix, int action) ++{ ++ if (action == HDA_FIXUP_ACT_PRE_PROBE) { ++ hda_nid_t conn[1] = { 0x02 }; ++ snd_hda_override_conn_list(codec, 0x17, 1, conn); ++ } ++} ++ + /* Hook to update amp GPIO4 for automute */ + static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, + struct hda_jack_callback *jack) +@@ -5846,6 +5856,7 @@ enum { + ALC225_FIXUP_DISABLE_MIC_VREF, + ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, + ALC295_FIXUP_DISABLE_DAC3, ++ ALC285_FIXUP_SPEAKER2_TO_DAC1, + ALC280_FIXUP_HP_HEADSET_MIC, + ALC221_FIXUP_HP_FRONT_MIC, + ALC292_FIXUP_TPT460, +@@ -6646,6 +6657,10 @@ static const struct hda_fixup alc269_fixups[] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc295_fixup_disable_dac3, + }, ++ [ALC285_FIXUP_SPEAKER2_TO_DAC1] = { ++ .type = HDA_FIXUP_FUNC, ++ .v.func = alc285_fixup_speaker2_to_dac1, ++ }, + [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { +@@ -7221,6 +7236,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { + SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), + SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), + SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), ++ SND_PCI_QUIRK(0x17aa, 0x2293, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_SPEAKER2_TO_DAC1), + SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), + SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), + SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), +@@ -7405,6 +7421,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { + {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"}, + {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"}, + {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"}, ++ {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"}, + {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"}, + {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"}, + {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"}, +-- +2.20.1 + + +From a7ff4a018897902cb76e6946162f452e99747a0b Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Fri, 22 Nov 2019 14:26:24 +0100 +Subject: [PATCH 125/130] ALSA: hda/hdmi - Clear codec->relaxed_resume flag at + unbinding + +The HDMI codec may leave codec->relaxed_resume flag set even after +unbinding. Clear it unconditionally. + +It's very unlikely that this actually matters in the real use case, +so just a fix for consistency. + +Fixes: ade49db337a9 ("ALSA: hda/hdmi - Allow audio component for AMD/ATI and Nvidia HDMI") +Link: https://lore.kernel.org/r/20191122132624.5482-1-tiwai@suse.de +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 10a9594563415855bd99678ea4f91dea792e5499) +Bugzilla: 1772498 +--- + sound/pci/hda/patch_hdmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c +index b35652cae616..5393da45b250 100644 +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -2311,8 +2311,8 @@ static void generic_hdmi_free(struct hda_codec *codec) + snd_hdac_acomp_exit(&codec->bus->core); + } else if (codec_has_acomp(codec)) { + snd_hdac_acomp_register_notifier(&codec->bus->core, NULL); +- codec->relaxed_resume = 0; + } ++ codec->relaxed_resume = 0; + + for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { + struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); +-- +2.20.1 + + +From 396bdfdd1a2a119b724148d1e6911c6c1f76722b Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Fri, 22 Nov 2019 16:43:50 -0500 +Subject: [PATCH 126/130] ALSA: hda/hdmi - fix vgaswitcheroo detection for AMD + +Only enable the vga_switcheroo logic on systems with the +ATPX ACPI method. This logic is not needed for asics +that are not part of a PX (PowerXpress)/HG (Hybrid Graphics) +platform. + +Reviewed-by: Takashi Iwai +Acked-by: Evan Quan +Signed-off-by: Alex Deucher +Link: https://lore.kernel.org/r/20191122214353.582899-2-alexander.deucher@amd.com +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 586bc4aab878efcf672536f0cdec3d04b6990c94) +Bugzilla: 1772498 +--- + sound/pci/hda/hda_intel.c | 45 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 45 insertions(+) + +diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c +index e76a0bb6d3cf..ff098957e30f 100644 +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + + #ifdef CONFIG_X86 + /* for snoop control */ +@@ -1401,6 +1402,34 @@ static int azx_dev_free(struct snd_device *device) + } + + #ifdef SUPPORT_VGA_SWITCHEROO ++#ifdef CONFIG_ACPI ++/* ATPX is in the integrated GPU's namespace */ ++static bool atpx_present(void) ++{ ++ struct pci_dev *pdev = NULL; ++ acpi_handle dhandle, atpx_handle; ++ acpi_status status; ++ ++ while ((pdev = pci_get_class(PCI_BASE_CLASS_DISPLAY << 16, pdev)) != NULL) { ++ dhandle = ACPI_HANDLE(&pdev->dev); ++ if (dhandle) { ++ status = acpi_get_handle(dhandle, "ATPX", &atpx_handle); ++ if (!ACPI_FAILURE(status)) { ++ pci_dev_put(pdev); ++ return true; ++ } ++ } ++ pci_dev_put(pdev); ++ } ++ return false; ++} ++#else ++static bool atpx_present(void) ++{ ++ return false; ++} ++#endif ++ + /* + * Check of disabled HDMI controller by vga_switcheroo + */ +@@ -1412,6 +1441,22 @@ static struct pci_dev *get_bound_vga(struct pci_dev *pci) + switch (pci->vendor) { + case PCI_VENDOR_ID_ATI: + case PCI_VENDOR_ID_AMD: ++ if (pci->devfn == 1) { ++ p = pci_get_domain_bus_and_slot(pci_domain_nr(pci->bus), ++ pci->bus->number, 0); ++ if (p) { ++ /* ATPX is in the integrated GPU's ACPI namespace ++ * rather than the dGPU's namespace. However, ++ * the dGPU is the one who is involved in ++ * vgaswitcheroo. ++ */ ++ if (((p->class >> 16) == PCI_BASE_CLASS_DISPLAY) && ++ atpx_present()) ++ return p; ++ pci_dev_put(p); ++ } ++ } ++ break; + case PCI_VENDOR_ID_NVIDIA: + if (pci->devfn == 1) { + p = pci_get_domain_bus_and_slot(pci_domain_nr(pci->bus), +-- +2.20.1 + + +From a7347cade76e5cf325b36b01fd40fc8471c770a4 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Fri, 22 Nov 2019 16:43:51 -0500 +Subject: [PATCH 127/130] ALSA: hda/hdmi - Add new pci ids for AMD GPU display + audio + +These are needed so we can enable runtime pm in a subsequent +patch. + +Reviewed-by: Takashi Iwai +Signed-off-by: Alex Deucher +Link: https://lore.kernel.org/r/20191122214353.582899-3-alexander.deucher@amd.com +Signed-off-by: Takashi Iwai + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 8d68a87244a812323ce3f7d5022f9deda9db54b5) +Bugzilla: 1772498 +--- + sound/pci/hda/hda_intel.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c +index ff098957e30f..bc64d1565868 100644 +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -2599,6 +2599,20 @@ static const struct pci_device_id azx_ids[] = { + .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, + { PCI_DEVICE(0x1002, 0xaaf0), + .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, ++ { PCI_DEVICE(0x1002, 0xaaf8), ++ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, ++ { PCI_DEVICE(0x1002, 0xab00), ++ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, ++ { PCI_DEVICE(0x1002, 0xab08), ++ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, ++ { PCI_DEVICE(0x1002, 0xab10), ++ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, ++ { PCI_DEVICE(0x1002, 0xab18), ++ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, ++ { PCI_DEVICE(0x1002, 0xab20), ++ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, ++ { PCI_DEVICE(0x1002, 0xab38), ++ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, + /* VIA VT8251/VT8237A */ + { PCI_DEVICE(0x1106, 0x3288), .driver_data = AZX_DRIVER_VIA }, + /* VIA GFX VT7122/VX900 */ +-- +2.20.1 diff --git a/alsa-5.6.patch b/alsa-5.6.patch new file mode 100644 index 000000000..b128cc7e6 --- /dev/null +++ b/alsa-5.6.patch @@ -0,0 +1,390 @@ +From 4ef91c45a5a283dc8899402bc68adfe0aa9a026d Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 4 Dec 2019 15:15:44 -0600 +Subject: [PATCH 1/4] ASoC: intel/skl/hda - export number of digital + microphones via control components + +It is required for the auto-detection in the user space (for UCM). + +Signed-off-by: Jaroslav Kysela +Signed-off-by: Pierre-Louis Bossart +Cc: Mark Brown +Link: https://lore.kernel.org/r/20191204211556.12671-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 8cd9956f61c65022209ce6d1e55ed12aea12357d) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/skl_hda_dsp_generic.c | 8 ++++++++ + sound/soc/sof/intel/hda.c | 3 ++- + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c +index 4e45901e3a2f..11eaee9ae41f 100644 +--- a/sound/soc/intel/boards/skl_hda_dsp_generic.c ++++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c +@@ -100,6 +100,8 @@ static struct snd_soc_card hda_soc_card = { + .late_probe = skl_hda_card_late_probe, + }; + ++static char hda_soc_components[30]; ++ + #define IDISP_DAI_COUNT 3 + #define HDAC_DAI_COUNT 2 + #define DMIC_DAI_COUNT 2 +@@ -183,6 +185,12 @@ static int skl_hda_audio_probe(struct platform_device *pdev) + hda_soc_card.dev = &pdev->dev; + snd_soc_card_set_drvdata(&hda_soc_card, ctx); + ++ if (mach->mach_params.dmic_num > 0) { ++ snprintf(hda_soc_components, sizeof(hda_soc_components), ++ "cfg-dmics:%d", mach->mach_params.dmic_num); ++ hda_soc_card.components = hda_soc_components; ++ } ++ + return devm_snd_soc_register_card(&pdev->dev, &hda_soc_card); + } + +diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c +index 91bd88fddac7..eea01f75d23d 100644 +--- a/sound/soc/sof/intel/hda.c ++++ b/sound/soc/sof/intel/hda.c +@@ -351,7 +351,7 @@ static int hda_init_caps(struct snd_sof_dev *sdev) + const char *tplg_filename; + const char *idisp_str; + const char *dmic_str; +- int dmic_num; ++ int dmic_num = 0; + int codec_num = 0; + int i; + #endif +@@ -472,6 +472,7 @@ static int hda_init_caps(struct snd_sof_dev *sdev) + mach_params->codec_mask = bus->codec_mask; + mach_params->platform = dev_name(sdev->dev); + mach_params->common_hdmi_codec_drv = hda_codec_use_common_hdmi; ++ mach_params->dmic_num = dmic_num; + } + + /* create codec instances */ +-- +2.20.1 + + +From 89be5f69889f7e9aeab05279869bba3e9e0d2002 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 4 Dec 2019 15:15:45 -0600 +Subject: [PATCH 2/4] ASoC: Intel - use control components to describe card + config + +Use the control interface (field 'components' in the info structure) +to pass the I/O configuration details. The goal is to replace +the card long name with this. + +Signed-off-by: Jaroslav Kysela +Signed-off-by: Pierre-Louis Bossart +Cc: Mark Brown +Link: https://lore.kernel.org/r/20191204211556.12671-3-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit 0d5c8187562848b619a35f2ffc5e18ce703e9f3d) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/bytcht_es8316.c | 9 ++++++++- + sound/soc/intel/boards/bytcr_rt5640.c | 6 ++++++ + sound/soc/intel/boards/bytcr_rt5651.c | 18 +++++++++++------- + 3 files changed, 25 insertions(+), 8 deletions(-) + +diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c +index 46612331f5ea..efa33f30dcac 100644 +--- a/sound/soc/intel/boards/bytcht_es8316.c ++++ b/sound/soc/intel/boards/bytcht_es8316.c +@@ -361,6 +361,7 @@ static struct snd_soc_dai_link byt_cht_es8316_dais[] = { + /* SoC card */ + static char codec_name[SND_ACPI_I2C_ID_LEN]; + static char long_name[50]; /* = "bytcht-es8316-*-spk-*-mic" */ ++static char components_string[32]; /* = "cfg-spk:* cfg-mic:* */ + + static int byt_cht_es8316_suspend(struct snd_soc_card *card) + { +@@ -572,11 +573,17 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) + } + } + +- /* register the soc card */ ++ snprintf(components_string, sizeof(components_string), ++ "cfg-spk:%s cfg-mic:%s", ++ (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "1" : "2", ++ mic_name[BYT_CHT_ES8316_MAP(quirk)]); ++ byt_cht_es8316_card.components = components_string; + snprintf(long_name, sizeof(long_name), "bytcht-es8316-%s-spk-%s-mic", + (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo", + mic_name[BYT_CHT_ES8316_MAP(quirk)]); + byt_cht_es8316_card.long_name = long_name; ++ ++ /* register the soc card */ + snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv); + + ret = devm_snd_soc_register_card(dev, &byt_cht_es8316_card); +diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c +index dd2b5ad08659..7bc6d3cec94c 100644 +--- a/sound/soc/intel/boards/bytcr_rt5640.c ++++ b/sound/soc/intel/boards/bytcr_rt5640.c +@@ -1083,6 +1083,7 @@ static char byt_rt5640_codec_name[SND_ACPI_I2C_ID_LEN]; + static char byt_rt5640_codec_aif_name[12]; /* = "rt5640-aif[1|2]" */ + static char byt_rt5640_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ + static char byt_rt5640_long_name[40]; /* = "bytcr-rt5640-*-spk-*-mic" */ ++static char byt_rt5640_components[32]; /* = "cfg-spk:* cfg-mic:*" */ + + static int byt_rt5640_suspend(struct snd_soc_card *card) + { +@@ -1305,6 +1306,11 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) + } + } + ++ snprintf(byt_rt5640_components, sizeof(byt_rt5640_components), ++ "cfg-spk:%s cfg-mic:%s", ++ (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? "1" : "2", ++ map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]); ++ byt_rt5640_card.components = byt_rt5640_components; + snprintf(byt_rt5640_long_name, sizeof(byt_rt5640_long_name), + "bytcr-rt5640-%s-spk-%s-mic", + (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? +diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c +index 4606f6f582d6..80a5674ddb1b 100644 +--- a/sound/soc/intel/boards/bytcr_rt5651.c ++++ b/sound/soc/intel/boards/bytcr_rt5651.c +@@ -798,6 +798,7 @@ static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN]; + static char byt_rt5651_codec_aif_name[12]; /* = "rt5651-aif[1|2]" */ + static char byt_rt5651_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ + static char byt_rt5651_long_name[50]; /* = "bytcr-rt5651-*-spk-*-mic[-swapped-hp]" */ ++static char byt_rt5651_components[50]; /* = "cfg-spk:* cfg-mic:*" */ + + static int byt_rt5651_suspend(struct snd_soc_card *card) + { +@@ -876,7 +877,6 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) + const char *platform_name; + struct acpi_device *adev; + struct device *codec_dev; +- const char *hp_swapped; + bool is_bytcr = false; + int ret_val = 0; + int dai_index = 0; +@@ -1080,16 +1080,20 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) + } + } + +- if (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) +- hp_swapped = "-hp-swapped"; +- else +- hp_swapped = ""; +- ++ snprintf(byt_rt5651_components, sizeof(byt_rt5651_components), ++ "cfg-spk:%s cfg-mic:%s%s", ++ (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ? "1" : "2", ++ mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)], ++ (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ? ++ " cfg-hp:lrswap" : ""); ++ byt_rt5651_card.components = byt_rt5651_components; + snprintf(byt_rt5651_long_name, sizeof(byt_rt5651_long_name), + "bytcr-rt5651-%s-spk-%s-mic%s", + (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ? + "mono" : "stereo", +- mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)], hp_swapped); ++ mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)], ++ (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ? ++ "-hp-swapped" : ""); + byt_rt5651_card.long_name = byt_rt5651_long_name; + + /* override plaform name, if required */ +-- +2.20.1 + + +From 36c175e19e9cbb685708519d41e27cd803206737 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 4 Dec 2019 15:15:46 -0600 +Subject: [PATCH 3/4] ASoC: Intel - do not describe I/O configuration in the + long card name + +The long card name might be used in GUI. This information should be hidden. + +Add CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES configuration option. + +Signed-off-by: Jaroslav Kysela +Signed-off-by: Pierre-Louis Bossart +Cc: Mark Brown +Link: https://lore.kernel.org/r/20191204211556.12671-4-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown + +Signed-off-by: Jaroslav Kysela +(cherry picked from commit b5706f8ec29fb461571d25e3e813ede121fe31cd) +Bugzilla: 1772498 +--- + sound/soc/intel/boards/Kconfig | 13 +++++++++++++ + sound/soc/intel/boards/bytcht_es8316.c | 4 ++++ + sound/soc/intel/boards/bytcr_rt5640.c | 4 ++++ + sound/soc/intel/boards/bytcr_rt5651.c | 4 ++++ + 4 files changed, 25 insertions(+) + +diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig +index ef20316e83d1..145eb55bd691 100644 +--- a/sound/soc/intel/boards/Kconfig ++++ b/sound/soc/intel/boards/Kconfig +@@ -13,6 +13,19 @@ menuconfig SND_SOC_INTEL_MACH + + if SND_SOC_INTEL_MACH + ++config SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES ++ bool "Use more user friendly long card names" ++ help ++ Some drivers report the I/O configuration to userspace through the ++ soundcard's long card name in the control user space AP. An unfortunate ++ side effect is that this long name may also be used by the GUI, ++ confusing users with information they don't need. ++ This option prevents the long name from being modified, and the I/O ++ configuration will be provided through a different component interface. ++ Select Y if userspace like UCM (Use Case Manager) uses the component ++ interface. ++ If unsure select N. ++ + if SND_SOC_INTEL_HASWELL + + config SND_SOC_INTEL_HASWELL_MACH +diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c +index efa33f30dcac..12a1c5255484 100644 +--- a/sound/soc/intel/boards/bytcht_es8316.c ++++ b/sound/soc/intel/boards/bytcht_es8316.c +@@ -360,7 +360,9 @@ static struct snd_soc_dai_link byt_cht_es8316_dais[] = { + + /* SoC card */ + static char codec_name[SND_ACPI_I2C_ID_LEN]; ++#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES) + static char long_name[50]; /* = "bytcht-es8316-*-spk-*-mic" */ ++#endif + static char components_string[32]; /* = "cfg-spk:* cfg-mic:* */ + + static int byt_cht_es8316_suspend(struct snd_soc_card *card) +@@ -578,10 +580,12 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) + (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "1" : "2", + mic_name[BYT_CHT_ES8316_MAP(quirk)]); + byt_cht_es8316_card.components = components_string; ++#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES) + snprintf(long_name, sizeof(long_name), "bytcht-es8316-%s-spk-%s-mic", + (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo", + mic_name[BYT_CHT_ES8316_MAP(quirk)]); + byt_cht_es8316_card.long_name = long_name; ++#endif + + /* register the soc card */ + snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv); +diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c +index 7bc6d3cec94c..648fcc1d07b5 100644 +--- a/sound/soc/intel/boards/bytcr_rt5640.c ++++ b/sound/soc/intel/boards/bytcr_rt5640.c +@@ -1082,7 +1082,9 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = { + static char byt_rt5640_codec_name[SND_ACPI_I2C_ID_LEN]; + static char byt_rt5640_codec_aif_name[12]; /* = "rt5640-aif[1|2]" */ + static char byt_rt5640_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ ++#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES) + static char byt_rt5640_long_name[40]; /* = "bytcr-rt5640-*-spk-*-mic" */ ++#endif + static char byt_rt5640_components[32]; /* = "cfg-spk:* cfg-mic:*" */ + + static int byt_rt5640_suspend(struct snd_soc_card *card) +@@ -1311,12 +1313,14 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) + (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? "1" : "2", + map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]); + byt_rt5640_card.components = byt_rt5640_components; ++#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES) + snprintf(byt_rt5640_long_name, sizeof(byt_rt5640_long_name), + "bytcr-rt5640-%s-spk-%s-mic", + (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? + "mono" : "stereo", + map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]); + byt_rt5640_card.long_name = byt_rt5640_long_name; ++#endif + + /* override plaform name, if required */ + platform_name = mach->mach_params.platform; +diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c +index 80a5674ddb1b..c0d322a859f7 100644 +--- a/sound/soc/intel/boards/bytcr_rt5651.c ++++ b/sound/soc/intel/boards/bytcr_rt5651.c +@@ -797,7 +797,9 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = { + static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN]; + static char byt_rt5651_codec_aif_name[12]; /* = "rt5651-aif[1|2]" */ + static char byt_rt5651_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ ++#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES) + static char byt_rt5651_long_name[50]; /* = "bytcr-rt5651-*-spk-*-mic[-swapped-hp]" */ ++#endif + static char byt_rt5651_components[50]; /* = "cfg-spk:* cfg-mic:*" */ + + static int byt_rt5651_suspend(struct snd_soc_card *card) +@@ -1087,6 +1089,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) + (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ? + " cfg-hp:lrswap" : ""); + byt_rt5651_card.components = byt_rt5651_components; ++#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES) + snprintf(byt_rt5651_long_name, sizeof(byt_rt5651_long_name), + "bytcr-rt5651-%s-spk-%s-mic%s", + (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ? +@@ -1095,6 +1098,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) + (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ? + "-hp-swapped" : ""); + byt_rt5651_card.long_name = byt_rt5651_long_name; ++#endif + + /* override plaform name, if required */ + platform_name = mach->mach_params.platform; +-- +2.20.1 + + +From 9aa9b367e35494f2d02112ca440a78908f645a04 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Fri, 22 Nov 2019 09:31:03 +0100 +Subject: [PATCH 4/4] ASoC: SOF - topology - do not change the link triger + order for old firmare + +This is patch for SOF v1.3 firmware. The DSP firmware will crash +without this patch. The 1.4.1 firmare has this issue fixed. + +BugLink: https://github.com/thesofproject/sof/issues/2102 +Signed-off-by: Jaroslav Kysela +--- + sound/soc/sof/topology.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c +index d82ab981e840..cbbbf96416ef 100644 +--- a/sound/soc/sof/topology.c ++++ b/sound/soc/sof/topology.c +@@ -2971,6 +2971,7 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, + struct snd_soc_tplg_private *private = &cfg->priv; + struct sof_ipc_dai_config config; + struct snd_soc_tplg_hw_config *hw_config; ++ struct sof_ipc_fw_version *v = &sdev->fw_ready.version; + int num_hw_configs; + int ret; + int i = 0; +@@ -2988,9 +2989,12 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, + if (!link->no_pcm) { + link->nonatomic = true; + +- /* set trigger order */ +- link->trigger[0] = SND_SOC_DPCM_TRIGGER_POST; +- link->trigger[1] = SND_SOC_DPCM_TRIGGER_POST; ++ /* this causes DSP panic on firmware v1.3 */ ++ if (SOF_ABI_VER(v->major, v->minor, v->micro) > SOF_ABI_VER(3, 7, 0)) { ++ /* set trigger order */ ++ link->trigger[0] = SND_SOC_DPCM_TRIGGER_POST; ++ link->trigger[1] = SND_SOC_DPCM_TRIGGER_POST; ++ } + + /* nothing more to do for FE dai links */ + return 0; +-- +2.20.1 + diff --git a/arm64-dts-qcom-Add-Lenovo-Yoga-C630.patch b/arm64-dts-qcom-Add-Lenovo-Yoga-C630.patch deleted file mode 100644 index f823a810b..000000000 --- a/arm64-dts-qcom-Add-Lenovo-Yoga-C630.patch +++ /dev/null @@ -1,623 +0,0 @@ -From patchwork Thu Sep 5 14:51:12 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Lee Jones -X-Patchwork-Id: 11133293 -Return-Path: - -Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org - [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF29913BD - for ; - Thu, 5 Sep 2019 14:51:26 +0000 (UTC) -Received: from bombadil.infradead.org (bombadil.infradead.org - [198.137.202.133]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) - (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id 1997020820 - for ; - Thu, 5 Sep 2019 14:51:27 +0000 (UTC) -Authentication-Results: mail.kernel.org; - dkim=pass (2048-bit key) header.d=lists.infradead.org - header.i=@lists.infradead.org header.b="QcCmRfwJ"; - dkim=fail reason="signature verification failed" (2048-bit key) - header.d=linaro.org header.i=@linaro.org header.b="UUIx2S2a" -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1997020820 -Authentication-Results: mail.kernel.org; - dmarc=fail (p=none dis=none) header.from=linaro.org -Authentication-Results: mail.kernel.org; - spf=none - smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=lists.infradead.org; s=bombadil.20170209; h=Sender: - Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: - List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: - Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: - Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: - References:List-Owner; bh=RFMjkhfiAb3mDQJcei/M3ErXIrcuIvXho1uY3CGaFs8=; b=QcC - mRfwJTEzsniFc2PQTDfopo/phWmprscia3e6OqRIHx0I6F8qNt3pLneLcx7MATAHPJHeD2Bfz/d1W - vk/w8leYRcdrNca/SkMK3grqwTP3XueqwIC3W59cpisOR1/MTcmZZ05pTYnppFox5HNzWRfOL6Z6r - CZvdTV7DVN0DYpv+NU1GnegQ3L8w/B1BaXGHVCPJjH/dHMLJ4OqBor2LD0dBQpYwROMamQbE3enrN - WGMNjdb3YYZU47m5stsgoivzulIOlOF5PKp+VY75IwHxck1S07mqhqxB9cmIvdEke7S9T1EpoIOJs - 2cu8v9rxofEpJNocOcSJeYiEpGj6qIA==; -Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) - by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) - id 1i5t6X-0000ra-3X; Thu, 05 Sep 2019 14:51:21 +0000 -Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) - by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) - id 1i5t6S-0000r9-W3 - for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2019 14:51:18 +0000 -Received: by mail-wm1-x343.google.com with SMTP id n10so3441823wmj.0 - for ; - Thu, 05 Sep 2019 07:51:16 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; - h=from:to:cc:subject:date:message-id; - bh=hP6dTKrGhmI4Li1vYBwvA5G00RWYLdiehRQLahBt/08=; - b=UUIx2S2a1OTzLYcxsOGi8vjYvnpXjIXXfjjInQmQhJrOoLVMUI4bMk0pP8K4hv5+v1 - bC+ahF3FezFlzFIlypiny7EYPPxM79sdZHZnnpe6qgrTfl/6guRvEmNJy8vpPadhocR8 - IW0JAJGxuc7RH4bWScdjpjBLvTYEo3MLTNDGuJOCB05O5AH8D6gSDZPqwaUWbITmdboy - JTOLJ37XUMxPF83r7F6BQwynpfcnLc9Ytv9w1tMp0R82MmO52QP457mar3d7PWPJu/Rw - YJb6IDjcjSjZJrr3aGvnJVnETp/zGeRsmeTgNtJe37OYQ5blm4tzTlx1dRxuMiRRs6DS - rUaA== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20161025; - h=x-gm-message-state:from:to:cc:subject:date:message-id; - bh=hP6dTKrGhmI4Li1vYBwvA5G00RWYLdiehRQLahBt/08=; - b=d2RovY2av4Dyx8Ou6LJ+nAvLFVrruV6de3b6OWCOF5mnVZA2T2tJEcsrZEGXSSpkiz - 1YxSkV7YgJJElZhqlfudvkyyxth7A1ZDQnU4x3QyppMQ5lWeHg/xT9+q+h7orxiRjQeX - 2J+SRG4WqZwcpbUSe95Wy2tPFVB5GYv1eyARjCARCpYOECeprtSl1ckDVyBJ/3G4AVLm - kB1xk3Ua101/bad3LA8IW1Zo0ld7x7u42jPYO7kJhPH8Ec/l0mrAVSIJn54PKoLu/DhW - yH6q+kD4LffmAtpj4ICo/rQdtmjV7msTJZ/Dcos9IpUPi5KoXbxWdP+NoUyaVleKhEIl - IYMA== -X-Gm-Message-State: APjAAAUQgezKycPxaZ7DvJWRiVy/0dp867xlik7J0fXQ60D99YKcuW0q - aRR9aWXTADWPSkrcTkd0a071Qw== -X-Google-Smtp-Source: - APXvYqybUDyw7bzKyC0JJlkse2i6lXau2tHY0+7iUxCwZcbyfwIDTqmYWXxNn26wfhgBAKudt68zBQ== -X-Received: by 2002:a1c:a404:: with SMTP id n4mr3206745wme.137.1567695075383; - Thu, 05 Sep 2019 07:51:15 -0700 (PDT) -Received: from localhost.localdomain ([95.147.198.36]) - by smtp.gmail.com with ESMTPSA id g201sm4376858wmg.34.2019.09.05.07.51.14 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Thu, 05 Sep 2019 07:51:14 -0700 (PDT) -From: Lee Jones -To: agross@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, - bjorn.andersson@linaro.org, arnd@arndb.de -Subject: [PATCH v4 1/1] arm64: dts: qcom: Add Lenovo Yoga C630 -Date: Thu, 5 Sep 2019 15:51:12 +0100 -Message-Id: <20190905145112.7366-1-lee.jones@linaro.org> -X-Mailer: git-send-email 2.17.1 -X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20190905_075117_040430_5C619449 -X-CRM114-Status: GOOD ( 14.05 ) -X-Spam-Score: -0.2 (/) -X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: - Content analysis details: (-0.2 points) - pts rule name description - ---- ---------------------- - -------------------------------------------------- - -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, - no trust [2a00:1450:4864:20:0:0:0:343 listed in] - [list.dnswl.org] - -0.0 SPF_PASS SPF: sender matches SPF record - 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record - -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from - envelope-from domain - -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from - author's domain - 0.1 DKIM_SIGNED Message has a DKIM or DK signature, - not necessarily - valid - -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -X-BeenThere: linux-arm-kernel@lists.infradead.org -X-Mailman-Version: 2.1.29 -Precedence: list -List-Id: -List-Unsubscribe: - , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: - , - -Cc: devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, - linux-kernel@vger.kernel.org, soc@kernel.org, - Lee Jones , - linux-arm-kernel@lists.infradead.org -MIME-Version: 1.0 -Content-Type: text/plain; charset="us-ascii" -Sender: "linux-arm-kernel" -Errors-To: - linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org - -From: Bjorn Andersson - -The Lenovo Yoga C630 is built on the SDM850 from Qualcomm, but this seem -to be similar enough to the SDM845 that we can reuse the sdm845.dtsi. - -Supported by this patch is: keyboard, battery monitoring, UFS storage, -USB host and Bluetooth. - -Signed-off-by: Bjorn Andersson -Reviewed-by: Vinod Koul -Acked-by: Sudeep Holla -[Lee] Reorder, change licence, remove non-upstream device node -Signed-off-by: Lee Jones ---- - -Changelog: - * Reorder nodes alphabetically - * Remove superfluous node for driver not yet upstream - * Add (then remove) 'no-dma' property - * Change licence to BSD - -arch/arm64/boot/dts/qcom/Makefile | 1 + - .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 446 ++++++++++++++++++ - 2 files changed, 447 insertions(+) - create mode 100644 arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts - -diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile -index 0a7e5dfce6f7..670c6c65f9e9 100644 ---- a/arch/arm64/boot/dts/qcom/Makefile -+++ b/arch/arm64/boot/dts/qcom/Makefile -@@ -12,5 +12,6 @@ dtb-$(CONFIG_ARCH_QCOM) += sdm845-cheza-r2.dtb - dtb-$(CONFIG_ARCH_QCOM) += sdm845-cheza-r3.dtb - dtb-$(CONFIG_ARCH_QCOM) += sdm845-db845c.dtb - dtb-$(CONFIG_ARCH_QCOM) += sdm845-mtp.dtb -+dtb-$(CONFIG_ARCH_QCOM) += sdm850-lenovo-yoga-c630.dtb - dtb-$(CONFIG_ARCH_QCOM) += qcs404-evb-1000.dtb - dtb-$(CONFIG_ARCH_QCOM) += qcs404-evb-4000.dtb -diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts -new file mode 100644 -index 000000000000..ded120d3aef5 ---- /dev/null -+++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts -@@ -0,0 +1,446 @@ -+// SPDX-License-Identifier: BSD-3-Clause -+/* -+ * Lenovo Yoga C630 -+ * -+ * Copyright (c) 2019, Linaro Ltd. -+ */ -+ -+/dts-v1/; -+ -+#include -+#include "sdm845.dtsi" -+#include "pm8998.dtsi" -+ -+/ { -+ model = "Lenovo Yoga C630"; -+ compatible = "lenovo,yoga-c630", "qcom,sdm845"; -+ -+ aliases { -+ hsuart0 = &uart6; -+ }; -+}; -+ -+&apps_rsc { -+ pm8998-rpmh-regulators { -+ compatible = "qcom,pm8998-rpmh-regulators"; -+ qcom,pmic-id = "a"; -+ -+ vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>; -+ vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>; -+ -+ vreg_s2a_1p125: smps2 { -+ }; -+ -+ vreg_s3a_1p35: smps3 { -+ regulator-min-microvolt = <1352000>; -+ regulator-max-microvolt = <1352000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vreg_s4a_1p8: smps4 { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vreg_s5a_2p04: smps5 { -+ regulator-min-microvolt = <2040000>; -+ regulator-max-microvolt = <2040000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vreg_s7a_1p025: smps7 { -+ }; -+ -+ vdd_qusb_hs0: -+ vdda_hp_pcie_core: -+ vdda_mipi_csi0_0p9: -+ vdda_mipi_csi1_0p9: -+ vdda_mipi_csi2_0p9: -+ vdda_mipi_dsi0_pll: -+ vdda_mipi_dsi1_pll: -+ vdda_qlink_lv: -+ vdda_qlink_lv_ck: -+ vdda_qrefs_0p875: -+ vdda_pcie_core: -+ vdda_pll_cc_ebi01: -+ vdda_pll_cc_ebi23: -+ vdda_sp_sensor: -+ vdda_ufs1_core: -+ vdda_ufs2_core: -+ vdda_usb1_ss_core: -+ vdda_usb2_ss_core: -+ vreg_l1a_0p875: ldo1 { -+ regulator-min-microvolt = <880000>; -+ regulator-max-microvolt = <880000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vddpx_10: -+ vreg_l2a_1p2: ldo2 { -+ regulator-min-microvolt = <1200000>; -+ regulator-max-microvolt = <1200000>; -+ regulator-initial-mode = ; -+ regulator-always-on; -+ }; -+ -+ vreg_l3a_1p0: ldo3 { -+ }; -+ -+ vdd_wcss_cx: -+ vdd_wcss_mx: -+ vdda_wcss_pll: -+ vreg_l5a_0p8: ldo5 { -+ regulator-min-microvolt = <800000>; -+ regulator-max-microvolt = <800000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vddpx_13: -+ vreg_l6a_1p8: ldo6 { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vreg_l7a_1p8: ldo7 { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vreg_l8a_1p2: ldo8 { -+ }; -+ -+ vreg_l9a_1p8: ldo9 { -+ }; -+ -+ vreg_l10a_1p8: ldo10 { -+ }; -+ -+ vreg_l11a_1p0: ldo11 { -+ }; -+ -+ vdd_qfprom: -+ vdd_qfprom_sp: -+ vdda_apc1_cs_1p8: -+ vdda_gfx_cs_1p8: -+ vdda_qrefs_1p8: -+ vdda_qusb_hs0_1p8: -+ vddpx_11: -+ vreg_l12a_1p8: ldo12 { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vddpx_2: -+ vreg_l13a_2p95: ldo13 { -+ }; -+ -+ vreg_l14a_1p88: ldo14 { -+ regulator-min-microvolt = <1880000>; -+ regulator-max-microvolt = <1880000>; -+ regulator-initial-mode = ; -+ regulator-always-on; -+ }; -+ -+ vreg_l15a_1p8: ldo15 { -+ }; -+ -+ vreg_l16a_2p7: ldo16 { -+ }; -+ -+ vreg_l17a_1p3: ldo17 { -+ regulator-min-microvolt = <1304000>; -+ regulator-max-microvolt = <1304000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vreg_l18a_2p7: ldo18 { -+ }; -+ -+ vreg_l19a_3p0: ldo19 { -+ regulator-min-microvolt = <3100000>; -+ regulator-max-microvolt = <3108000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vreg_l20a_2p95: ldo20 { -+ regulator-min-microvolt = <2960000>; -+ regulator-max-microvolt = <2960000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vreg_l21a_2p95: ldo21 { -+ }; -+ -+ vreg_l22a_2p85: ldo22 { -+ }; -+ -+ vreg_l23a_3p3: ldo23 { -+ }; -+ -+ vdda_qusb_hs0_3p1: -+ vreg_l24a_3p075: ldo24 { -+ regulator-min-microvolt = <3075000>; -+ regulator-max-microvolt = <3083000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vreg_l25a_3p3: ldo25 { -+ regulator-min-microvolt = <3104000>; -+ regulator-max-microvolt = <3112000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vdda_hp_pcie_1p2: -+ vdda_hv_ebi0: -+ vdda_hv_ebi1: -+ vdda_hv_ebi2: -+ vdda_hv_ebi3: -+ vdda_mipi_csi_1p25: -+ vdda_mipi_dsi0_1p2: -+ vdda_mipi_dsi1_1p2: -+ vdda_pcie_1p2: -+ vdda_ufs1_1p2: -+ vdda_ufs2_1p2: -+ vdda_usb1_ss_1p2: -+ vdda_usb2_ss_1p2: -+ vreg_l26a_1p2: ldo26 { -+ regulator-min-microvolt = <1200000>; -+ regulator-max-microvolt = <1208000>; -+ regulator-initial-mode = ; -+ }; -+ -+ vreg_l28a_3p0: ldo28 { -+ }; -+ -+ vreg_lvs1a_1p8: lvs1 { -+ }; -+ -+ vreg_lvs2a_1p8: lvs2 { -+ }; -+ }; -+}; -+ -+&apps_smmu { -+ /* TODO: Figure out how to survive booting with this enabled */ -+ status = "disabled"; -+}; -+ -+&gcc { -+ protected-clocks = , -+ , -+ ; -+}; -+ -+&i2c1 { -+ status = "okay"; -+ clock-frequency = <400000>; -+}; -+ -+&i2c3 { -+ status = "okay"; -+ clock-frequency = <400000>; -+ -+ hid@15 { -+ compatible = "hid-over-i2c"; -+ reg = <0x15>; -+ hid-descr-addr = <0x1>; -+ -+ interrupts-extended = <&tlmm 37 IRQ_TYPE_EDGE_RISING>; -+ }; -+ -+ hid@2c { -+ compatible = "hid-over-i2c"; -+ reg = <0x2c>; -+ hid-descr-addr = <0x20>; -+ -+ interrupts-extended = <&tlmm 37 IRQ_TYPE_EDGE_RISING>; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_hid_active>; -+ }; -+}; -+ -+&i2c5 { -+ status = "okay"; -+ clock-frequency = <400000>; -+ -+ hid@10 { -+ compatible = "hid-over-i2c"; -+ reg = <0x10>; -+ hid-descr-addr = <0x1>; -+ -+ interrupts-extended = <&tlmm 125 IRQ_TYPE_EDGE_FALLING>; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c6_hid_active>; -+ }; -+}; -+ -+&i2c11 { -+ status = "okay"; -+ clock-frequency = <400000>; -+ -+ hid@5c { -+ compatible = "hid-over-i2c"; -+ reg = <0x5c>; -+ hid-descr-addr = <0x1>; -+ -+ interrupts-extended = <&tlmm 92 IRQ_TYPE_LEVEL_LOW>; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c12_hid_active>; -+ }; -+}; -+ -+&qup_i2c12_default { -+ drive-strength = <2>; -+ bias-disable; -+}; -+ -+&qup_uart6_default { -+ pinmux { -+ pins = "gpio45", "gpio46", "gpio47", "gpio48"; -+ function = "qup6"; -+ }; -+ -+ cts { -+ pins = "gpio45"; -+ bias-pull-down; -+ }; -+ -+ rts-tx { -+ pins = "gpio46", "gpio47"; -+ drive-strength = <2>; -+ bias-disable; -+ }; -+ -+ rx { -+ pins = "gpio48"; -+ bias-pull-up; -+ }; -+}; -+ -+&qupv3_id_0 { -+ status = "okay"; -+}; -+ -+&qupv3_id_1 { -+ status = "okay"; -+}; -+ -+&tlmm { -+ gpio-reserved-ranges = <0 4>, <81 4>; -+ -+ i2c2_hid_active: i2c2-hid-active { -+ pins = <37>; -+ function = "gpio"; -+ -+ input-enable; -+ bias-pull-up; -+ drive-strength = <2>; -+ }; -+ -+ i2c6_hid_active: i2c6-hid-active { -+ pins = <125>; -+ function = "gpio"; -+ -+ input-enable; -+ bias-pull-up; -+ drive-strength = <2>; -+ }; -+ -+ i2c12_hid_active: i2c12-hid-active { -+ pins = <92>; -+ function = "gpio"; -+ -+ input-enable; -+ bias-pull-up; -+ drive-strength = <2>; -+ }; -+}; -+ -+&uart6 { -+ status = "okay"; -+ -+ bluetooth { -+ compatible = "qcom,wcn3990-bt"; -+ -+ vddio-supply = <&vreg_s4a_1p8>; -+ vddxo-supply = <&vreg_l7a_1p8>; -+ vddrf-supply = <&vreg_l17a_1p3>; -+ vddch0-supply = <&vreg_l25a_3p3>; -+ max-speed = <3200000>; -+ }; -+}; -+ -+&ufs_mem_hc { -+ status = "okay"; -+ -+ vcc-supply = <&vreg_l20a_2p95>; -+ vcc-max-microamp = <600000>; -+}; -+ -+&ufs_mem_phy { -+ status = "okay"; -+ -+ vdda-phy-supply = <&vdda_ufs1_core>; -+ vdda-pll-supply = <&vdda_ufs1_1p2>; -+}; -+ -+&usb_1 { -+ status = "okay"; -+}; -+ -+&usb_1_dwc3 { -+ dr_mode = "host"; -+}; -+ -+&usb_1_hsphy { -+ status = "okay"; -+ -+ vdd-supply = <&vdda_usb1_ss_core>; -+ vdda-pll-supply = <&vdda_qusb_hs0_1p8>; -+ vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>; -+ -+ qcom,imp-res-offset-value = <8>; -+ qcom,hstx-trim-value = ; -+ qcom,preemphasis-level = ; -+ qcom,preemphasis-width = ; -+}; -+ -+&usb_1_qmpphy { -+ status = "okay"; -+ -+ vdda-phy-supply = <&vdda_usb1_ss_1p2>; -+ vdda-pll-supply = <&vdda_usb1_ss_core>; -+}; -+ -+&usb_2 { -+ status = "okay"; -+}; -+ -+&usb_2_dwc3 { -+ dr_mode = "host"; -+}; -+ -+&usb_2_hsphy { -+ status = "okay"; -+ -+ vdd-supply = <&vdda_usb2_ss_core>; -+ vdda-pll-supply = <&vdda_qusb_hs0_1p8>; -+ vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>; -+ -+ qcom,imp-res-offset-value = <8>; -+ qcom,hstx-trim-value = ; -+}; -+ -+&usb_2_qmpphy { -+ status = "okay"; -+ -+ vdda-phy-supply = <&vdda_usb2_ss_1p2>; -+ vdda-pll-supply = <&vdda_usb2_ss_core>; -+}; diff --git a/ath9k-rx-dma-stop-check.patch b/ath9k-rx-dma-stop-check.patch deleted file mode 100644 index 40cbafc7b..000000000 --- a/ath9k-rx-dma-stop-check.patch +++ /dev/null @@ -1,38 +0,0 @@ -From: "kernel-team@fedoraproject.org" -Date: Wed, 6 Feb 2013 09:57:47 -0500 -Subject: [PATCH] ath9k: rx dma stop check - ---- - drivers/net/wireless/ath/ath9k/mac.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c -index bba85d1a6cd1..ebbee8f17130 100644 ---- a/drivers/net/wireless/ath/ath9k/mac.c -+++ b/drivers/net/wireless/ath/ath9k/mac.c -@@ -693,7 +693,7 @@ bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset) - { - #define AH_RX_STOP_DMA_TIMEOUT 10000 /* usec */ - struct ath_common *common = ath9k_hw_common(ah); -- u32 mac_status, last_mac_status = 0; -+ u32 mac_status = 0, last_mac_status = 0; - int i; - - /* Enable access to the DMA observation bus */ -@@ -723,6 +723,16 @@ bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset) - } - - if (i == 0) { -+ if (!AR_SREV_9300_20_OR_LATER(ah) && -+ (mac_status & 0x700) == 0) { -+ /* -+ * DMA is idle but the MAC is still stuck -+ * processing events -+ */ -+ *reset = true; -+ return true; -+ } -+ - ath_err(common, - "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x DMADBG_7=0x%08x\n", - AH_RX_STOP_DMA_TIMEOUT / 1000, diff --git a/check-kabi b/check-kabi new file mode 100644 index 000000000..e69de29bb diff --git a/configs/build_configs.sh b/configs/build_configs.sh index 61c3c0455..4ccb0dc2e 100755 --- a/configs/build_configs.sh +++ b/configs/build_configs.sh @@ -19,8 +19,6 @@ cd $SCRIPT_DIR set errexit set nounset -control_file="config_generation" - cleanup() { rm -f config-* @@ -52,7 +50,9 @@ function merge_configs() arch=$(echo "$archvar" | cut -f1 -d"-") configs=$2 order=$3 - name=$OUTPUT_DIR/$PACKAGE_NAME-$archvar.config + flavor=$4 + + name=$OUTPUT_DIR/$PACKAGE_NAME-$archvar-$flavor.config echo -n "Building $name ... " touch config-merging config-merged @@ -95,33 +95,55 @@ function merge_configs() echo "done" } +function build_flavor() +{ + flavor=$1 + control_file="priority".$flavor + while read line + do + if [ $(echo "$line" | grep -c "^#") -ne 0 ]; then + continue + elif [ $(echo "$line" | grep -c "^$") -ne 0 ]; then + continue + elif [ $(echo "$line" | grep -c "^EMPTY") -ne 0 ]; then + empty=$(echo "$line" | cut -f2 -d"=") + for a in $empty + do + echo "# EMPTY" > $OUTPUT_DIR/$PACKAGE_NAME-$a-$flavor.config + + done + elif [ $(echo "$line" | grep -c "^ORDER") -ne 0 ]; then + order=$(echo "$line" | cut -f2 -d"=") + for o in $order + do + glist=$(find $o -type d) + for d in $glist + do + combine_config_layer $d + done + done + else + arch=$(echo "$line" | cut -f1 -d"=") + configs=$(echo "$line" | cut -f2 -d"=") + + if [ -n "$SUBARCH" ]; then + case $arch in + $SUBARCH*) + ;; + *) + continue + esac + fi + + merge_configs $arch $configs "$order" $flavor + fi + done < $control_file +} + while read line do - if [ $(echo "$line" | grep -c "^#") -ne 0 ]; then - continue - elif [ $(echo "$line" | grep -c "^$") -ne 0 ]; then - continue - elif [ $(echo "$line" | grep -c "^ORDER") -ne 0 ]; then - order=$(echo "$line" | cut -f2 -d"=") - for o in $order - do - glist=$(find $o -type d) - for d in $glist - do - combine_config_layer $d - done - done - else - arch=$(echo "$line" | cut -f1 -d"=") - configs=$(echo "$line" | cut -f2 -d"=") - - if [ -n "$SUBARCH" -a "$SUBARCH" != "$arch" ]; then - continue - fi - - merge_configs $arch $configs "$order" - fi -done < $control_file + build_flavor $line +done < flavors # A passed in kernel version implies copy to final location # otherwise defer to another script diff --git a/configs/fedora/debug/CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE b/configs/fedora/debug/CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE deleted file mode 100644 index 48732e524..000000000 --- a/configs/fedora/debug/CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE +++ /dev/null @@ -1 +0,0 @@ -CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=4096 diff --git a/configs/fedora/debug/CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE b/configs/fedora/debug/CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE new file mode 100644 index 000000000..fbfa0f399 --- /dev/null +++ b/configs/fedora/debug/CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE @@ -0,0 +1 @@ +CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE=16000 diff --git a/configs/fedora/debug/x86/x86_64/CONFIG_NR_CPUS b/configs/fedora/debug/x86/x86_64/CONFIG_NR_CPUS deleted file mode 100644 index 441191641..000000000 --- a/configs/fedora/debug/x86/x86_64/CONFIG_NR_CPUS +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NR_CPUS=8192 diff --git a/configs/fedora/debug/x86/x86_64/README b/configs/fedora/debug/x86/x86_64/README new file mode 100644 index 000000000..fa1c296db --- /dev/null +++ b/configs/fedora/debug/x86/x86_64/README @@ -0,0 +1,2 @@ +Place config options in this directory that you want applied to x86_64 +debug kernel variant. diff --git a/configs/fedora/generic/CONFIG_ADIN_PHY b/configs/fedora/generic/CONFIG_ADIN_PHY new file mode 100644 index 000000000..7fc6478a5 --- /dev/null +++ b/configs/fedora/generic/CONFIG_ADIN_PHY @@ -0,0 +1 @@ +CONFIG_ADIN_PHY=m diff --git a/configs/fedora/generic/CONFIG_ADIS16460 b/configs/fedora/generic/CONFIG_ADIS16460 new file mode 100644 index 000000000..e3f206072 --- /dev/null +++ b/configs/fedora/generic/CONFIG_ADIS16460 @@ -0,0 +1 @@ +# CONFIG_ADIS16460 is not set diff --git a/configs/fedora/generic/CONFIG_AMD_XGBE b/configs/fedora/generic/CONFIG_AMD_XGBE deleted file mode 100644 index bc3c626e4..000000000 --- a/configs/fedora/generic/CONFIG_AMD_XGBE +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_AMD_XGBE is not set diff --git a/configs/fedora/generic/CONFIG_ARCH_IOP13XX b/configs/fedora/generic/CONFIG_ARCH_IOP13XX deleted file mode 100644 index afcc30683..000000000 --- a/configs/fedora/generic/CONFIG_ARCH_IOP13XX +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_ARCH_IOP13XX is not set diff --git a/configs/fedora/generic/CONFIG_ARCH_IOP33X b/configs/fedora/generic/CONFIG_ARCH_IOP33X deleted file mode 100644 index 810b89131..000000000 --- a/configs/fedora/generic/CONFIG_ARCH_IOP33X +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_ARCH_IOP33X is not set diff --git a/configs/fedora/generic/CONFIG_ARCH_KS8695 b/configs/fedora/generic/CONFIG_ARCH_KS8695 deleted file mode 100644 index 065baadb5..000000000 --- a/configs/fedora/generic/CONFIG_ARCH_KS8695 +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_ARCH_KS8695 is not set diff --git a/configs/fedora/generic/CONFIG_ARCH_LPC32XX b/configs/fedora/generic/CONFIG_ARCH_LPC32XX deleted file mode 100644 index 309e5f041..000000000 --- a/configs/fedora/generic/CONFIG_ARCH_LPC32XX +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_ARCH_LPC32XX is not set diff --git a/configs/fedora/generic/CONFIG_ARCH_W90X900 b/configs/fedora/generic/CONFIG_ARCH_W90X900 deleted file mode 100644 index cf8f40c7e..000000000 --- a/configs/fedora/generic/CONFIG_ARCH_W90X900 +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_ARCH_W90X900 is not set diff --git a/configs/fedora/generic/CONFIG_ATH9K_PCI_NO_EEPROM b/configs/fedora/generic/CONFIG_ATH9K_PCI_NO_EEPROM new file mode 100644 index 000000000..941b59840 --- /dev/null +++ b/configs/fedora/generic/CONFIG_ATH9K_PCI_NO_EEPROM @@ -0,0 +1 @@ +CONFIG_ATH9K_PCI_NO_EEPROM=m diff --git a/configs/fedora/generic/CONFIG_BLK_CGROUP_IOCOST b/configs/fedora/generic/CONFIG_BLK_CGROUP_IOCOST new file mode 100644 index 000000000..b5de16173 --- /dev/null +++ b/configs/fedora/generic/CONFIG_BLK_CGROUP_IOCOST @@ -0,0 +1 @@ +CONFIG_BLK_CGROUP_IOCOST=y diff --git a/configs/fedora/generic/CONFIG_CAN_F81601 b/configs/fedora/generic/CONFIG_CAN_F81601 new file mode 100644 index 000000000..b24d08ba4 --- /dev/null +++ b/configs/fedora/generic/CONFIG_CAN_F81601 @@ -0,0 +1 @@ +# CONFIG_CAN_F81601 is not set diff --git a/configs/fedora/generic/CONFIG_CAN_J1939 b/configs/fedora/generic/CONFIG_CAN_J1939 new file mode 100644 index 000000000..388031677 --- /dev/null +++ b/configs/fedora/generic/CONFIG_CAN_J1939 @@ -0,0 +1 @@ +# CONFIG_CAN_J1939 is not set diff --git a/configs/fedora/generic/CONFIG_CAN_KVASER_PCIEFD b/configs/fedora/generic/CONFIG_CAN_KVASER_PCIEFD new file mode 100644 index 000000000..d5191aa13 --- /dev/null +++ b/configs/fedora/generic/CONFIG_CAN_KVASER_PCIEFD @@ -0,0 +1 @@ +# CONFIG_CAN_KVASER_PCIEFD is not set diff --git a/configs/fedora/generic/CONFIG_CAN_M_CAN_PLATFORM b/configs/fedora/generic/CONFIG_CAN_M_CAN_PLATFORM new file mode 100644 index 000000000..fe2b43c10 --- /dev/null +++ b/configs/fedora/generic/CONFIG_CAN_M_CAN_PLATFORM @@ -0,0 +1 @@ +# CONFIG_CAN_M_CAN_PLATFORM is not set diff --git a/configs/fedora/generic/CONFIG_CAN_M_CAN_TCAN4X5X b/configs/fedora/generic/CONFIG_CAN_M_CAN_TCAN4X5X new file mode 100644 index 000000000..90e108828 --- /dev/null +++ b/configs/fedora/generic/CONFIG_CAN_M_CAN_TCAN4X5X @@ -0,0 +1 @@ +# CONFIG_CAN_M_CAN_TCAN4X5X is not set diff --git a/configs/fedora/generic/CONFIG_CPU_IDLE_GOV_HALTPOLL b/configs/fedora/generic/CONFIG_CPU_IDLE_GOV_HALTPOLL new file mode 100644 index 000000000..0d4e80f4d --- /dev/null +++ b/configs/fedora/generic/CONFIG_CPU_IDLE_GOV_HALTPOLL @@ -0,0 +1 @@ +# CONFIG_CPU_IDLE_GOV_HALTPOLL is not set diff --git a/configs/fedora/generic/CONFIG_CRASH b/configs/fedora/generic/CONFIG_CRASH deleted file mode 100644 index 98a38fe93..000000000 --- a/configs/fedora/generic/CONFIG_CRASH +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CRASH=m diff --git a/configs/fedora/generic/CONFIG_CROS_EC b/configs/fedora/generic/CONFIG_CROS_EC new file mode 100644 index 000000000..bd6dd449b --- /dev/null +++ b/configs/fedora/generic/CONFIG_CROS_EC @@ -0,0 +1 @@ +# CONFIG_CROS_EC is not set diff --git a/configs/fedora/generic/CONFIG_CRYPTO_AEGIS128L b/configs/fedora/generic/CONFIG_CRYPTO_AEGIS128L deleted file mode 100644 index 332f8d41c..000000000 --- a/configs/fedora/generic/CONFIG_CRYPTO_AEGIS128L +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CRYPTO_AEGIS128L=m diff --git a/configs/fedora/generic/CONFIG_CRYPTO_AEGIS256 b/configs/fedora/generic/CONFIG_CRYPTO_AEGIS256 deleted file mode 100644 index 505f92cb2..000000000 --- a/configs/fedora/generic/CONFIG_CRYPTO_AEGIS256 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CRYPTO_AEGIS256=m diff --git a/configs/fedora/generic/CONFIG_CRYPTO_DEV_CCP_DEBUGFS b/configs/fedora/generic/CONFIG_CRYPTO_DEV_CCP_DEBUGFS new file mode 100644 index 000000000..fe46585da --- /dev/null +++ b/configs/fedora/generic/CONFIG_CRYPTO_DEV_CCP_DEBUGFS @@ -0,0 +1 @@ +# CONFIG_CRYPTO_DEV_CCP_DEBUGFS is not set diff --git a/configs/fedora/generic/CONFIG_CRYPTO_DEV_SAFEXCEL b/configs/fedora/generic/CONFIG_CRYPTO_DEV_SAFEXCEL new file mode 100644 index 000000000..6bd1d5baa --- /dev/null +++ b/configs/fedora/generic/CONFIG_CRYPTO_DEV_SAFEXCEL @@ -0,0 +1 @@ +# CONFIG_CRYPTO_DEV_SAFEXCEL is not set diff --git a/configs/fedora/generic/CONFIG_CRYPTO_ESSIV b/configs/fedora/generic/CONFIG_CRYPTO_ESSIV new file mode 100644 index 000000000..9c914d446 --- /dev/null +++ b/configs/fedora/generic/CONFIG_CRYPTO_ESSIV @@ -0,0 +1 @@ +CONFIG_CRYPTO_ESSIV=m diff --git a/configs/fedora/generic/CONFIG_CRYPTO_MORUS1280 b/configs/fedora/generic/CONFIG_CRYPTO_MORUS1280 deleted file mode 100644 index 631ee59ba..000000000 --- a/configs/fedora/generic/CONFIG_CRYPTO_MORUS1280 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CRYPTO_MORUS1280=m diff --git a/configs/fedora/generic/CONFIG_CRYPTO_MORUS640 b/configs/fedora/generic/CONFIG_CRYPTO_MORUS640 deleted file mode 100644 index 774f20fc6..000000000 --- a/configs/fedora/generic/CONFIG_CRYPTO_MORUS640 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CRYPTO_MORUS640=m diff --git a/configs/fedora/generic/CONFIG_CRYPTO_SHA512 b/configs/fedora/generic/CONFIG_CRYPTO_SHA512 index 29ce3726b..5c25197e5 100644 --- a/configs/fedora/generic/CONFIG_CRYPTO_SHA512 +++ b/configs/fedora/generic/CONFIG_CRYPTO_SHA512 @@ -1 +1 @@ -CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA512=y diff --git a/configs/fedora/generic/CONFIG_DEBUG_INFO_BTF b/configs/fedora/generic/CONFIG_DEBUG_INFO_BTF index 3b5ac748f..39227b451 100644 --- a/configs/fedora/generic/CONFIG_DEBUG_INFO_BTF +++ b/configs/fedora/generic/CONFIG_DEBUG_INFO_BTF @@ -1 +1 @@ -# CONFIG_DEBUG_INFO_BTF is not set +CONFIG_DEBUG_INFO_BTF=y diff --git a/configs/fedora/generic/CONFIG_DEBUG_INFO_VTA b/configs/fedora/generic/CONFIG_DEBUG_INFO_VTA deleted file mode 100644 index 593de8069..000000000 --- a/configs/fedora/generic/CONFIG_DEBUG_INFO_VTA +++ /dev/null @@ -1 +0,0 @@ -CONFIG_DEBUG_INFO_VTA=y diff --git a/configs/fedora/generic/CONFIG_DMABUF_SELFTESTS b/configs/fedora/generic/CONFIG_DMABUF_SELFTESTS new file mode 100644 index 000000000..6943ce41c --- /dev/null +++ b/configs/fedora/generic/CONFIG_DMABUF_SELFTESTS @@ -0,0 +1 @@ +# CONFIG_DMABUF_SELFTESTS is not set diff --git a/configs/fedora/generic/CONFIG_DM_CLONE b/configs/fedora/generic/CONFIG_DM_CLONE new file mode 100644 index 000000000..03f992664 --- /dev/null +++ b/configs/fedora/generic/CONFIG_DM_CLONE @@ -0,0 +1 @@ +# CONFIG_DM_CLONE is not set diff --git a/configs/fedora/generic/CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG b/configs/fedora/generic/CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG new file mode 100644 index 000000000..4d2da6ce4 --- /dev/null +++ b/configs/fedora/generic/CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG @@ -0,0 +1 @@ +# CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG is not set diff --git a/configs/fedora/generic/CONFIG_DRM_GM12U320 b/configs/fedora/generic/CONFIG_DRM_GM12U320 new file mode 100644 index 000000000..f8f5101cc --- /dev/null +++ b/configs/fedora/generic/CONFIG_DRM_GM12U320 @@ -0,0 +1 @@ +CONFIG_DRM_GM12U320=m diff --git a/configs/fedora/generic/CONFIG_DRM_PANEL_LG_LB035Q02 b/configs/fedora/generic/CONFIG_DRM_PANEL_LG_LB035Q02 new file mode 100644 index 000000000..fe60a1992 --- /dev/null +++ b/configs/fedora/generic/CONFIG_DRM_PANEL_LG_LB035Q02 @@ -0,0 +1 @@ +# CONFIG_DRM_PANEL_LG_LB035Q02 is not set diff --git a/configs/fedora/generic/CONFIG_DRM_PANEL_NEC_NL8048HL11 b/configs/fedora/generic/CONFIG_DRM_PANEL_NEC_NL8048HL11 new file mode 100644 index 000000000..339ff848f --- /dev/null +++ b/configs/fedora/generic/CONFIG_DRM_PANEL_NEC_NL8048HL11 @@ -0,0 +1 @@ +# CONFIG_DRM_PANEL_NEC_NL8048HL11 is not set diff --git a/configs/fedora/generic/CONFIG_DRM_PANEL_NOVATEK_NT39016 b/configs/fedora/generic/CONFIG_DRM_PANEL_NOVATEK_NT39016 new file mode 100644 index 000000000..edce22723 --- /dev/null +++ b/configs/fedora/generic/CONFIG_DRM_PANEL_NOVATEK_NT39016 @@ -0,0 +1 @@ +# CONFIG_DRM_PANEL_NOVATEK_NT39016 is not set diff --git a/configs/fedora/generic/CONFIG_DRM_PANEL_RAYDIUM_RM67191 b/configs/fedora/generic/CONFIG_DRM_PANEL_RAYDIUM_RM67191 new file mode 100644 index 000000000..085f3b0bb --- /dev/null +++ b/configs/fedora/generic/CONFIG_DRM_PANEL_RAYDIUM_RM67191 @@ -0,0 +1 @@ +# CONFIG_DRM_PANEL_RAYDIUM_RM67191 is not set diff --git a/configs/fedora/generic/CONFIG_DRM_PANEL_SHARP_LS037V7DW01 b/configs/fedora/generic/CONFIG_DRM_PANEL_SHARP_LS037V7DW01 new file mode 100644 index 000000000..26cceaa22 --- /dev/null +++ b/configs/fedora/generic/CONFIG_DRM_PANEL_SHARP_LS037V7DW01 @@ -0,0 +1 @@ +# CONFIG_DRM_PANEL_SHARP_LS037V7DW01 is not set diff --git a/configs/fedora/generic/CONFIG_DRM_PANEL_SONY_ACX565AKM b/configs/fedora/generic/CONFIG_DRM_PANEL_SONY_ACX565AKM new file mode 100644 index 000000000..de1d34f6b --- /dev/null +++ b/configs/fedora/generic/CONFIG_DRM_PANEL_SONY_ACX565AKM @@ -0,0 +1 @@ +# CONFIG_DRM_PANEL_SONY_ACX565AKM is not set diff --git a/configs/fedora/generic/CONFIG_DRM_PANEL_TPO_TD028TTEC1 b/configs/fedora/generic/CONFIG_DRM_PANEL_TPO_TD028TTEC1 new file mode 100644 index 000000000..8c0af5fb4 --- /dev/null +++ b/configs/fedora/generic/CONFIG_DRM_PANEL_TPO_TD028TTEC1 @@ -0,0 +1 @@ +# CONFIG_DRM_PANEL_TPO_TD028TTEC1 is not set diff --git a/configs/fedora/generic/CONFIG_DRM_PANEL_TPO_TD043MTEA1 b/configs/fedora/generic/CONFIG_DRM_PANEL_TPO_TD043MTEA1 new file mode 100644 index 000000000..4494ef96f --- /dev/null +++ b/configs/fedora/generic/CONFIG_DRM_PANEL_TPO_TD043MTEA1 @@ -0,0 +1 @@ +# CONFIG_DRM_PANEL_TPO_TD043MTEA1 is not set diff --git a/configs/fedora/generic/CONFIG_DRM_TDFX b/configs/fedora/generic/CONFIG_DRM_TDFX index 698169953..36f8ba1f9 100644 --- a/configs/fedora/generic/CONFIG_DRM_TDFX +++ b/configs/fedora/generic/CONFIG_DRM_TDFX @@ -1 +1 @@ -# CONFIG_DRM_TDFX=n is not set +# CONFIG_DRM_TDFX is not set diff --git a/configs/fedora/generic/CONFIG_DRM_TINYDRM b/configs/fedora/generic/CONFIG_DRM_TINYDRM deleted file mode 100644 index be104b06c..000000000 --- a/configs/fedora/generic/CONFIG_DRM_TINYDRM +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_DRM_TINYDRM is not set diff --git a/configs/fedora/generic/CONFIG_EFI_RCI2_TABLE b/configs/fedora/generic/CONFIG_EFI_RCI2_TABLE new file mode 100644 index 000000000..9d1af7ab4 --- /dev/null +++ b/configs/fedora/generic/CONFIG_EFI_RCI2_TABLE @@ -0,0 +1 @@ +# CONFIG_EFI_RCI2_TABLE is not set diff --git a/configs/fedora/generic/CONFIG_EFI_TEST b/configs/fedora/generic/CONFIG_EFI_TEST index 455eb3061..09ff10ce7 100644 --- a/configs/fedora/generic/CONFIG_EFI_TEST +++ b/configs/fedora/generic/CONFIG_EFI_TEST @@ -1 +1 @@ -# CONFIG_EFI_TEST is not set +CONFIG_EFI_TEST=m diff --git a/configs/fedora/generic/CONFIG_EXFAT_FS b/configs/fedora/generic/CONFIG_EXFAT_FS new file mode 100644 index 000000000..2113d8106 --- /dev/null +++ b/configs/fedora/generic/CONFIG_EXFAT_FS @@ -0,0 +1 @@ +# CONFIG_EXFAT_FS is not set diff --git a/configs/fedora/generic/CONFIG_FSL_ENETC_MDIO b/configs/fedora/generic/CONFIG_FSL_ENETC_MDIO new file mode 100644 index 000000000..9ae6245d1 --- /dev/null +++ b/configs/fedora/generic/CONFIG_FSL_ENETC_MDIO @@ -0,0 +1 @@ +# CONFIG_FSL_ENETC_MDIO is not set diff --git a/configs/fedora/generic/CONFIG_FS_VERITY b/configs/fedora/generic/CONFIG_FS_VERITY new file mode 100644 index 000000000..962866cac --- /dev/null +++ b/configs/fedora/generic/CONFIG_FS_VERITY @@ -0,0 +1 @@ +CONFIG_FS_VERITY=y diff --git a/configs/fedora/generic/CONFIG_FS_VERITY_BUILTIN_SIGNATURES b/configs/fedora/generic/CONFIG_FS_VERITY_BUILTIN_SIGNATURES new file mode 100644 index 000000000..a9cb95904 --- /dev/null +++ b/configs/fedora/generic/CONFIG_FS_VERITY_BUILTIN_SIGNATURES @@ -0,0 +1 @@ +# CONFIG_FS_VERITY_BUILTIN_SIGNATURES is not set diff --git a/configs/fedora/generic/CONFIG_FS_VERITY_DEBUG b/configs/fedora/generic/CONFIG_FS_VERITY_DEBUG new file mode 100644 index 000000000..5d654c77b --- /dev/null +++ b/configs/fedora/generic/CONFIG_FS_VERITY_DEBUG @@ -0,0 +1 @@ +# CONFIG_FS_VERITY_DEBUG is not set diff --git a/configs/fedora/generic/CONFIG_HEADERS_INSTALL b/configs/fedora/generic/CONFIG_HEADERS_INSTALL index 5b3057511..3400dd672 100644 --- a/configs/fedora/generic/CONFIG_HEADERS_INSTALL +++ b/configs/fedora/generic/CONFIG_HEADERS_INSTALL @@ -1 +1 @@ -# CONFIG_HEADERS_INSTALL is not set +CONFIG_HEADERS_INSTALL=y diff --git a/configs/fedora/generic/CONFIG_HEADER_TEST b/configs/fedora/generic/CONFIG_HEADER_TEST index 2d55c1445..bcdd8b485 100644 --- a/configs/fedora/generic/CONFIG_HEADER_TEST +++ b/configs/fedora/generic/CONFIG_HEADER_TEST @@ -1 +1 @@ -# CONFIG_HEADER_TEST is not set +CONFIG_HEADER_TEST=y diff --git a/configs/fedora/generic/CONFIG_HID_CREATIVE_SB0540 b/configs/fedora/generic/CONFIG_HID_CREATIVE_SB0540 new file mode 100644 index 000000000..ce52dd6a4 --- /dev/null +++ b/configs/fedora/generic/CONFIG_HID_CREATIVE_SB0540 @@ -0,0 +1 @@ +# CONFIG_HID_CREATIVE_SB0540 is not set diff --git a/configs/fedora/generic/CONFIG_I2C_BCM2048 b/configs/fedora/generic/CONFIG_I2C_BCM2048 deleted file mode 100644 index 65ce228bc..000000000 --- a/configs/fedora/generic/CONFIG_I2C_BCM2048 +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_I2C_BCM2048 is not set diff --git a/configs/fedora/generic/CONFIG_IMA_APPRAISE_MODSIG b/configs/fedora/generic/CONFIG_IMA_APPRAISE_MODSIG new file mode 100644 index 000000000..e2c2e3e15 --- /dev/null +++ b/configs/fedora/generic/CONFIG_IMA_APPRAISE_MODSIG @@ -0,0 +1 @@ +CONFIG_IMA_APPRAISE_MODSIG=y diff --git a/configs/fedora/generic/CONFIG_IMA_DEFAULT_HASH_SHA512 b/configs/fedora/generic/CONFIG_IMA_DEFAULT_HASH_SHA512 new file mode 100644 index 000000000..63c785685 --- /dev/null +++ b/configs/fedora/generic/CONFIG_IMA_DEFAULT_HASH_SHA512 @@ -0,0 +1 @@ +# CONFIG_IMA_DEFAULT_HASH_SHA512 is not set diff --git a/configs/fedora/generic/CONFIG_INPUT_PWM_BEEPER b/configs/fedora/generic/CONFIG_INPUT_PWM_BEEPER index 9ac1c7b31..59fdb225d 100644 --- a/configs/fedora/generic/CONFIG_INPUT_PWM_BEEPER +++ b/configs/fedora/generic/CONFIG_INPUT_PWM_BEEPER @@ -1 +1 @@ -# CONFIG_INPUT_PWM_BEEPER is not set +CONFIG_INPUT_PWM_BEEPER=m diff --git a/configs/fedora/generic/CONFIG_IONIC b/configs/fedora/generic/CONFIG_IONIC new file mode 100644 index 000000000..389ea4bb6 --- /dev/null +++ b/configs/fedora/generic/CONFIG_IONIC @@ -0,0 +1 @@ +CONFIG_IONIC=m diff --git a/configs/fedora/generic/CONFIG_JOYSTICK_FSIA6B b/configs/fedora/generic/CONFIG_JOYSTICK_FSIA6B new file mode 100644 index 000000000..76957fd33 --- /dev/null +++ b/configs/fedora/generic/CONFIG_JOYSTICK_FSIA6B @@ -0,0 +1 @@ +# CONFIG_JOYSTICK_FSIA6B is not set diff --git a/configs/fedora/generic/CONFIG_KERNEL_HEADER_TEST b/configs/fedora/generic/CONFIG_KERNEL_HEADER_TEST new file mode 100644 index 000000000..040d0b830 --- /dev/null +++ b/configs/fedora/generic/CONFIG_KERNEL_HEADER_TEST @@ -0,0 +1 @@ +CONFIG_KERNEL_HEADER_TEST=y diff --git a/configs/fedora/generic/CONFIG_LIVEPATCH b/configs/fedora/generic/CONFIG_LIVEPATCH index 6f147cf26..1b05d0d1a 100644 --- a/configs/fedora/generic/CONFIG_LIVEPATCH +++ b/configs/fedora/generic/CONFIG_LIVEPATCH @@ -1 +1 @@ -# CONFIG_LIVEPATCH is not set +CONFIG_LIVEPATCH=y diff --git a/configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL b/configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL deleted file mode 100644 index c22c35ff2..000000000 --- a/configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_LOCK_DOWN_KERNEL is not set diff --git a/configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY b/configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY new file mode 100644 index 000000000..97079e8b0 --- /dev/null +++ b/configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY @@ -0,0 +1 @@ +# CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY is not set diff --git a/configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY b/configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY new file mode 100644 index 000000000..895927de3 --- /dev/null +++ b/configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY @@ -0,0 +1 @@ +# CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY is not set diff --git a/configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE b/configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE new file mode 100644 index 000000000..9c975c314 --- /dev/null +++ b/configs/fedora/generic/CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE @@ -0,0 +1 @@ +CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE=y diff --git a/configs/fedora/generic/CONFIG_MAX5432 b/configs/fedora/generic/CONFIG_MAX5432 new file mode 100644 index 000000000..b6ea28de1 --- /dev/null +++ b/configs/fedora/generic/CONFIG_MAX5432 @@ -0,0 +1 @@ +# CONFIG_MAX5432 is not set diff --git a/configs/fedora/generic/CONFIG_MLX5_SW_STEERING b/configs/fedora/generic/CONFIG_MLX5_SW_STEERING new file mode 100644 index 000000000..28a9bc46a --- /dev/null +++ b/configs/fedora/generic/CONFIG_MLX5_SW_STEERING @@ -0,0 +1 @@ +CONFIG_MLX5_SW_STEERING=y diff --git a/configs/fedora/generic/CONFIG_MLX5_TLS b/configs/fedora/generic/CONFIG_MLX5_TLS new file mode 100644 index 000000000..ca3633796 --- /dev/null +++ b/configs/fedora/generic/CONFIG_MLX5_TLS @@ -0,0 +1 @@ +# CONFIG_MLX5_TLS is not set diff --git a/configs/fedora/generic/CONFIG_MMC_SDHCI_OF_ASPEED b/configs/fedora/generic/CONFIG_MMC_SDHCI_OF_ASPEED new file mode 100644 index 000000000..1c72970c1 --- /dev/null +++ b/configs/fedora/generic/CONFIG_MMC_SDHCI_OF_ASPEED @@ -0,0 +1 @@ +# CONFIG_MMC_SDHCI_OF_ASPEED is not set diff --git a/configs/fedora/generic/CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS b/configs/fedora/generic/CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS new file mode 100644 index 000000000..35c9fe219 --- /dev/null +++ b/configs/fedora/generic/CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS @@ -0,0 +1 @@ +# CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set diff --git a/configs/fedora/generic/CONFIG_MOXTET b/configs/fedora/generic/CONFIG_MOXTET new file mode 100644 index 000000000..d141565b6 --- /dev/null +++ b/configs/fedora/generic/CONFIG_MOXTET @@ -0,0 +1 @@ +# CONFIG_MOXTET is not set diff --git a/configs/fedora/generic/CONFIG_MTD_NAND_MXIC b/configs/fedora/generic/CONFIG_MTD_NAND_MXIC new file mode 100644 index 000000000..6a2310167 --- /dev/null +++ b/configs/fedora/generic/CONFIG_MTD_NAND_MXIC @@ -0,0 +1 @@ +# CONFIG_MTD_NAND_MXIC is not set diff --git a/configs/fedora/generic/CONFIG_NETDEVSIM b/configs/fedora/generic/CONFIG_NETDEVSIM index f7666c533..96004592a 100644 --- a/configs/fedora/generic/CONFIG_NETDEVSIM +++ b/configs/fedora/generic/CONFIG_NETDEVSIM @@ -1 +1 @@ -# CONFIG_NETDEVSIM is not set +CONFIG_NETDEVSIM=m diff --git a/configs/fedora/generic/CONFIG_NET_DSA_MICROCHIP_KSZ8795 b/configs/fedora/generic/CONFIG_NET_DSA_MICROCHIP_KSZ8795 new file mode 100644 index 000000000..37fb020d6 --- /dev/null +++ b/configs/fedora/generic/CONFIG_NET_DSA_MICROCHIP_KSZ8795 @@ -0,0 +1 @@ +# CONFIG_NET_DSA_MICROCHIP_KSZ8795 is not set diff --git a/configs/fedora/generic/CONFIG_NET_DSA_MICROCHIP_KSZ9477_I2C b/configs/fedora/generic/CONFIG_NET_DSA_MICROCHIP_KSZ9477_I2C new file mode 100644 index 000000000..e12e72f0a --- /dev/null +++ b/configs/fedora/generic/CONFIG_NET_DSA_MICROCHIP_KSZ9477_I2C @@ -0,0 +1 @@ +# CONFIG_NET_DSA_MICROCHIP_KSZ9477_I2C is not set diff --git a/configs/fedora/generic/CONFIG_NET_TC_SKB_EXT b/configs/fedora/generic/CONFIG_NET_TC_SKB_EXT new file mode 100644 index 000000000..3290f992f --- /dev/null +++ b/configs/fedora/generic/CONFIG_NET_TC_SKB_EXT @@ -0,0 +1 @@ +CONFIG_NET_TC_SKB_EXT=y diff --git a/configs/fedora/generic/CONFIG_NET_VENDOR_PENSANDO b/configs/fedora/generic/CONFIG_NET_VENDOR_PENSANDO new file mode 100644 index 000000000..aba7e5839 --- /dev/null +++ b/configs/fedora/generic/CONFIG_NET_VENDOR_PENSANDO @@ -0,0 +1 @@ +CONFIG_NET_VENDOR_PENSANDO=y diff --git a/configs/fedora/generic/CONFIG_NFT_SOCKET b/configs/fedora/generic/CONFIG_NFT_SOCKET index d28a66d0a..84aa8fd92 100644 --- a/configs/fedora/generic/CONFIG_NFT_SOCKET +++ b/configs/fedora/generic/CONFIG_NFT_SOCKET @@ -1 +1 @@ -# CONFIG_NFT_SOCKET is not set +CONFIG_NFT_SOCKET=m diff --git a/configs/fedora/generic/CONFIG_NFT_TPROXY b/configs/fedora/generic/CONFIG_NFT_TPROXY index e8288ff55..d43e8c5f4 100644 --- a/configs/fedora/generic/CONFIG_NFT_TPROXY +++ b/configs/fedora/generic/CONFIG_NFT_TPROXY @@ -1 +1 @@ -# CONFIG_NFT_TPROXY is not set +CONFIG_NFT_TPROXY=m diff --git a/configs/fedora/generic/CONFIG_NFT_TUNNEL b/configs/fedora/generic/CONFIG_NFT_TUNNEL index a6c2fa49d..30f2b484f 100644 --- a/configs/fedora/generic/CONFIG_NFT_TUNNEL +++ b/configs/fedora/generic/CONFIG_NFT_TUNNEL @@ -1 +1 @@ -# CONFIG_NFT_TUNNEL is not set +CONFIG_NFT_TUNNEL=m diff --git a/configs/fedora/generic/CONFIG_NOA1305 b/configs/fedora/generic/CONFIG_NOA1305 new file mode 100644 index 000000000..2d1dd8731 --- /dev/null +++ b/configs/fedora/generic/CONFIG_NOA1305 @@ -0,0 +1 @@ +# CONFIG_NOA1305 is not set diff --git a/configs/fedora/generic/CONFIG_OPTIMIZE_INLINING b/configs/fedora/generic/CONFIG_OPTIMIZE_INLINING index b7e716809..6991e6d3f 100644 --- a/configs/fedora/generic/CONFIG_OPTIMIZE_INLINING +++ b/configs/fedora/generic/CONFIG_OPTIMIZE_INLINING @@ -1 +1 @@ -# CONFIG_OPTIMIZE_INLINING is not set +CONFIG_OPTIMIZE_INLINING=y diff --git a/configs/fedora/generic/CONFIG_PINCTRL_SC7180 b/configs/fedora/generic/CONFIG_PINCTRL_SC7180 new file mode 100644 index 000000000..797cd04fb --- /dev/null +++ b/configs/fedora/generic/CONFIG_PINCTRL_SC7180 @@ -0,0 +1 @@ +# CONFIG_PINCTRL_SC7180 is not set diff --git a/configs/fedora/generic/CONFIG_PREEMPT_LL b/configs/fedora/generic/CONFIG_PREEMPT_LL deleted file mode 100644 index 513294a39..000000000 --- a/configs/fedora/generic/CONFIG_PREEMPT_LL +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_PREEMPT_LL is not set diff --git a/configs/fedora/generic/CONFIG_RANDOM_TRUST_BOOTLOADER b/configs/fedora/generic/CONFIG_RANDOM_TRUST_BOOTLOADER new file mode 100644 index 000000000..5597038dd --- /dev/null +++ b/configs/fedora/generic/CONFIG_RANDOM_TRUST_BOOTLOADER @@ -0,0 +1 @@ +# CONFIG_RANDOM_TRUST_BOOTLOADER is not set diff --git a/configs/fedora/generic/CONFIG_RDMA_SIW b/configs/fedora/generic/CONFIG_RDMA_SIW index 67d1735af..3bc1ec48a 100644 --- a/configs/fedora/generic/CONFIG_RDMA_SIW +++ b/configs/fedora/generic/CONFIG_RDMA_SIW @@ -1 +1 @@ -# CONFIG_RDMA_SIW is not set +CONFIG_RDMA_SIW=m diff --git a/configs/fedora/generic/CONFIG_READ_ONLY_THP_FOR_FS b/configs/fedora/generic/CONFIG_READ_ONLY_THP_FOR_FS new file mode 100644 index 000000000..5aceef7ad --- /dev/null +++ b/configs/fedora/generic/CONFIG_READ_ONLY_THP_FOR_FS @@ -0,0 +1 @@ +# CONFIG_READ_ONLY_THP_FOR_FS is not set diff --git a/configs/fedora/generic/CONFIG_REGULATOR_SY8824X b/configs/fedora/generic/CONFIG_REGULATOR_SY8824X new file mode 100644 index 000000000..42053ce4c --- /dev/null +++ b/configs/fedora/generic/CONFIG_REGULATOR_SY8824X @@ -0,0 +1 @@ +# CONFIG_REGULATOR_SY8824X is not set diff --git a/configs/fedora/generic/CONFIG_REMOTEPROC b/configs/fedora/generic/CONFIG_REMOTEPROC index 5a1f9df99..a5c237d2f 100644 --- a/configs/fedora/generic/CONFIG_REMOTEPROC +++ b/configs/fedora/generic/CONFIG_REMOTEPROC @@ -1 +1 @@ -CONFIG_REMOTEPROC=m +CONFIG_REMOTEPROC=y diff --git a/configs/fedora/generic/CONFIG_SECURITY_LOCKDOWN_LSM b/configs/fedora/generic/CONFIG_SECURITY_LOCKDOWN_LSM new file mode 100644 index 000000000..4a55be3bb --- /dev/null +++ b/configs/fedora/generic/CONFIG_SECURITY_LOCKDOWN_LSM @@ -0,0 +1 @@ +CONFIG_SECURITY_LOCKDOWN_LSM=y diff --git a/configs/fedora/generic/CONFIG_SECURITY_LOCKDOWN_LSM_EARLY b/configs/fedora/generic/CONFIG_SECURITY_LOCKDOWN_LSM_EARLY new file mode 100644 index 000000000..edb6d0007 --- /dev/null +++ b/configs/fedora/generic/CONFIG_SECURITY_LOCKDOWN_LSM_EARLY @@ -0,0 +1 @@ +CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y diff --git a/configs/fedora/generic/CONFIG_SENSORS_ADS1015 b/configs/fedora/generic/CONFIG_SENSORS_ADS1015 deleted file mode 100644 index 928b4f25f..000000000 --- a/configs/fedora/generic/CONFIG_SENSORS_ADS1015 +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_SENSORS_ADS1015 is not set diff --git a/configs/fedora/generic/CONFIG_SENSORS_AS370 b/configs/fedora/generic/CONFIG_SENSORS_AS370 new file mode 100644 index 000000000..f76a8def3 --- /dev/null +++ b/configs/fedora/generic/CONFIG_SENSORS_AS370 @@ -0,0 +1 @@ +# CONFIG_SENSORS_AS370 is not set diff --git a/configs/fedora/generic/CONFIG_SENSORS_INSPUR_IPSPS b/configs/fedora/generic/CONFIG_SENSORS_INSPUR_IPSPS new file mode 100644 index 000000000..ac589f45a --- /dev/null +++ b/configs/fedora/generic/CONFIG_SENSORS_INSPUR_IPSPS @@ -0,0 +1 @@ +# CONFIG_SENSORS_INSPUR_IPSPS is not set diff --git a/configs/fedora/generic/CONFIG_SERIAL_8250_MOXA b/configs/fedora/generic/CONFIG_SERIAL_8250_MOXA deleted file mode 100644 index 5fe7e1175..000000000 --- a/configs/fedora/generic/CONFIG_SERIAL_8250_MOXA +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SERIAL_8250_MOXA=m diff --git a/configs/fedora/generic/CONFIG_SERIAL_FSL_LINFLEXUART b/configs/fedora/generic/CONFIG_SERIAL_FSL_LINFLEXUART new file mode 100644 index 000000000..68d716e9d --- /dev/null +++ b/configs/fedora/generic/CONFIG_SERIAL_FSL_LINFLEXUART @@ -0,0 +1 @@ +# CONFIG_SERIAL_FSL_LINFLEXUART is not set diff --git a/configs/fedora/generic/CONFIG_SGI_IOC4 b/configs/fedora/generic/CONFIG_SGI_IOC4 deleted file mode 100644 index 0d104aafd..000000000 --- a/configs/fedora/generic/CONFIG_SGI_IOC4 +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_SGI_IOC4 is not set diff --git a/configs/fedora/generic/CONFIG_SND_HDA_INTEL b/configs/fedora/generic/CONFIG_SND_HDA_INTEL index dfe74ea98..6f057ecfe 100644 --- a/configs/fedora/generic/CONFIG_SND_HDA_INTEL +++ b/configs/fedora/generic/CONFIG_SND_HDA_INTEL @@ -1 +1 @@ -CONFIG_SND_HDA_INTEL=m +# CONFIG_SND_HDA_INTEL is not set diff --git a/configs/fedora/generic/CONFIG_SND_HDA_INTEL_DETECT_DMIC b/configs/fedora/generic/CONFIG_SND_HDA_INTEL_DETECT_DMIC new file mode 100644 index 000000000..501f523b0 --- /dev/null +++ b/configs/fedora/generic/CONFIG_SND_HDA_INTEL_DETECT_DMIC @@ -0,0 +1 @@ +# CONFIG_SND_HDA_INTEL_DETECT_DMIC is not set diff --git a/configs/fedora/generic/CONFIG_SND_SOC_SOF_OF b/configs/fedora/generic/CONFIG_SND_SOC_SOF_OF new file mode 100644 index 000000000..54729e3fa --- /dev/null +++ b/configs/fedora/generic/CONFIG_SND_SOC_SOF_OF @@ -0,0 +1 @@ +# CONFIG_SND_SOC_SOF_OF is not set diff --git a/configs/fedora/generic/CONFIG_SND_SOC_UDA1334 b/configs/fedora/generic/CONFIG_SND_SOC_UDA1334 new file mode 100644 index 000000000..ab138d8d8 --- /dev/null +++ b/configs/fedora/generic/CONFIG_SND_SOC_UDA1334 @@ -0,0 +1 @@ +# CONFIG_SND_SOC_UDA1334 is not set diff --git a/configs/fedora/generic/CONFIG_SOUNDWIRE_BUS b/configs/fedora/generic/CONFIG_SOUNDWIRE_BUS deleted file mode 100644 index dd3714b7c..000000000 --- a/configs/fedora/generic/CONFIG_SOUNDWIRE_BUS +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SOUNDWIRE_BUS=m diff --git a/configs/fedora/generic/CONFIG_TEST_LIVEPATCH b/configs/fedora/generic/CONFIG_TEST_LIVEPATCH new file mode 100644 index 000000000..38a780283 --- /dev/null +++ b/configs/fedora/generic/CONFIG_TEST_LIVEPATCH @@ -0,0 +1 @@ +# CONFIG_TEST_LIVEPATCH is not set diff --git a/configs/fedora/generic/CONFIG_TINYDRM_HX8357D b/configs/fedora/generic/CONFIG_TINYDRM_HX8357D new file mode 100644 index 000000000..b6034f2f3 --- /dev/null +++ b/configs/fedora/generic/CONFIG_TINYDRM_HX8357D @@ -0,0 +1 @@ +# CONFIG_TINYDRM_HX8357D is not set diff --git a/configs/fedora/generic/CONFIG_TINYDRM_ILI9225 b/configs/fedora/generic/CONFIG_TINYDRM_ILI9225 new file mode 100644 index 000000000..1371c3f6e --- /dev/null +++ b/configs/fedora/generic/CONFIG_TINYDRM_ILI9225 @@ -0,0 +1 @@ +# CONFIG_TINYDRM_ILI9225 is not set diff --git a/configs/fedora/generic/CONFIG_TINYDRM_ILI9341 b/configs/fedora/generic/CONFIG_TINYDRM_ILI9341 new file mode 100644 index 000000000..d0fdddaeb --- /dev/null +++ b/configs/fedora/generic/CONFIG_TINYDRM_ILI9341 @@ -0,0 +1 @@ +# CONFIG_TINYDRM_ILI9341 is not set diff --git a/configs/fedora/generic/CONFIG_TINYDRM_MI0283QT b/configs/fedora/generic/CONFIG_TINYDRM_MI0283QT new file mode 100644 index 000000000..fb0b5f045 --- /dev/null +++ b/configs/fedora/generic/CONFIG_TINYDRM_MI0283QT @@ -0,0 +1 @@ +# CONFIG_TINYDRM_MI0283QT is not set diff --git a/configs/fedora/generic/CONFIG_TINYDRM_REPAPER b/configs/fedora/generic/CONFIG_TINYDRM_REPAPER new file mode 100644 index 000000000..c4d2874fa --- /dev/null +++ b/configs/fedora/generic/CONFIG_TINYDRM_REPAPER @@ -0,0 +1 @@ +# CONFIG_TINYDRM_REPAPER is not set diff --git a/configs/fedora/generic/CONFIG_TINYDRM_ST7586 b/configs/fedora/generic/CONFIG_TINYDRM_ST7586 new file mode 100644 index 000000000..2b9e29f63 --- /dev/null +++ b/configs/fedora/generic/CONFIG_TINYDRM_ST7586 @@ -0,0 +1 @@ +# CONFIG_TINYDRM_ST7586 is not set diff --git a/configs/fedora/generic/CONFIG_TINYDRM_ST7735R b/configs/fedora/generic/CONFIG_TINYDRM_ST7735R new file mode 100644 index 000000000..365910ba1 --- /dev/null +++ b/configs/fedora/generic/CONFIG_TINYDRM_ST7735R @@ -0,0 +1 @@ +# CONFIG_TINYDRM_ST7735R is not set diff --git a/configs/fedora/generic/CONFIG_TLS_DEVICE b/configs/fedora/generic/CONFIG_TLS_DEVICE index 1d436b4a8..7a19aef6a 100644 --- a/configs/fedora/generic/CONFIG_TLS_DEVICE +++ b/configs/fedora/generic/CONFIG_TLS_DEVICE @@ -1 +1 @@ -# CONFIG_TLS_DEVICE is not set +CONFIG_TLS_DEVICE=y diff --git a/configs/fedora/generic/CONFIG_UAPI_HEADER_TEST b/configs/fedora/generic/CONFIG_UAPI_HEADER_TEST new file mode 100644 index 000000000..b42b04505 --- /dev/null +++ b/configs/fedora/generic/CONFIG_UAPI_HEADER_TEST @@ -0,0 +1 @@ +CONFIG_UAPI_HEADER_TEST=y diff --git a/configs/fedora/generic/CONFIG_USB_CDNS3 b/configs/fedora/generic/CONFIG_USB_CDNS3 new file mode 100644 index 000000000..7f19f1a47 --- /dev/null +++ b/configs/fedora/generic/CONFIG_USB_CDNS3 @@ -0,0 +1 @@ +# CONFIG_USB_CDNS3 is not set diff --git a/configs/fedora/generic/CONFIG_USB_CONN_GPIO b/configs/fedora/generic/CONFIG_USB_CONN_GPIO new file mode 100644 index 000000000..e91343881 --- /dev/null +++ b/configs/fedora/generic/CONFIG_USB_CONN_GPIO @@ -0,0 +1 @@ +# CONFIG_USB_CONN_GPIO is not set diff --git a/configs/fedora/generic/CONFIG_USB_OHCI_HCD_SSB b/configs/fedora/generic/CONFIG_USB_OHCI_HCD_SSB new file mode 100644 index 000000000..eb3e84ce6 --- /dev/null +++ b/configs/fedora/generic/CONFIG_USB_OHCI_HCD_SSB @@ -0,0 +1 @@ +# CONFIG_USB_OHCI_HCD_SSB is not set diff --git a/configs/fedora/generic/CONFIG_USB_RIO500 b/configs/fedora/generic/CONFIG_USB_RIO500 deleted file mode 100644 index 961c7e67f..000000000 --- a/configs/fedora/generic/CONFIG_USB_RIO500 +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_USB_RIO500 is not set diff --git a/configs/fedora/generic/CONFIG_VIRTIO_FS b/configs/fedora/generic/CONFIG_VIRTIO_FS new file mode 100644 index 000000000..9fe646616 --- /dev/null +++ b/configs/fedora/generic/CONFIG_VIRTIO_FS @@ -0,0 +1 @@ +CONFIG_VIRTIO_FS=m diff --git a/configs/fedora/generic/CONFIG_W1_MASTER_SGI b/configs/fedora/generic/CONFIG_W1_MASTER_SGI new file mode 100644 index 000000000..8360af649 --- /dev/null +++ b/configs/fedora/generic/CONFIG_W1_MASTER_SGI @@ -0,0 +1 @@ +# CONFIG_W1_MASTER_SGI is not set diff --git a/configs/fedora/generic/CONFIG_W1_SLAVE_DS250X b/configs/fedora/generic/CONFIG_W1_SLAVE_DS250X new file mode 100644 index 000000000..fbab0ea85 --- /dev/null +++ b/configs/fedora/generic/CONFIG_W1_SLAVE_DS250X @@ -0,0 +1 @@ +# CONFIG_W1_SLAVE_DS250X is not set diff --git a/configs/fedora/generic/arm/CONFIG_APDS9960 b/configs/fedora/generic/arm/CONFIG_APDS9960 new file mode 100644 index 000000000..d8df5d41a --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_APDS9960 @@ -0,0 +1 @@ +CONFIG_APDS9960=m diff --git a/configs/fedora/generic/arm/CONFIG_ARCH_ASPEED b/configs/fedora/generic/arm/CONFIG_ARCH_ASPEED new file mode 100644 index 000000000..067532b38 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_ARCH_ASPEED @@ -0,0 +1 @@ +# CONFIG_ARCH_ASPEED is not set diff --git a/configs/fedora/generic/arm/CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM b/configs/fedora/generic/arm/CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM new file mode 100644 index 000000000..23c1c90c7 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM @@ -0,0 +1 @@ +CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM=m diff --git a/configs/fedora/generic/arm/CONFIG_ARM_PSCI_CPUIDLE b/configs/fedora/generic/arm/CONFIG_ARM_PSCI_CPUIDLE new file mode 100644 index 000000000..29843b961 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_ARM_PSCI_CPUIDLE @@ -0,0 +1 @@ +CONFIG_ARM_PSCI_CPUIDLE=y diff --git a/configs/fedora/generic/arm/CONFIG_ARM_PSCI_FW b/configs/fedora/generic/arm/CONFIG_ARM_PSCI_FW new file mode 100644 index 000000000..8f3a93575 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_ARM_PSCI_FW @@ -0,0 +1 @@ +CONFIG_ARM_PSCI_FW=y diff --git a/configs/fedora/generic/arm/CONFIG_ARM_QCOM_CPUFREQ_KRYO b/configs/fedora/generic/arm/CONFIG_ARM_QCOM_CPUFREQ_KRYO deleted file mode 100644 index 3b9e5e47f..000000000 --- a/configs/fedora/generic/arm/CONFIG_ARM_QCOM_CPUFREQ_KRYO +++ /dev/null @@ -1 +0,0 @@ -CONFIG_ARM_QCOM_CPUFREQ_KRYO=m diff --git a/configs/fedora/generic/arm/CONFIG_BATTERY_GAUGE_LTC2941 b/configs/fedora/generic/arm/CONFIG_BATTERY_GAUGE_LTC2941 new file mode 100644 index 000000000..232f4909b --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_BATTERY_GAUGE_LTC2941 @@ -0,0 +1 @@ +CONFIG_BATTERY_GAUGE_LTC2941=m diff --git a/configs/fedora/generic/arm/CONFIG_BATTERY_MAX17040 b/configs/fedora/generic/arm/CONFIG_BATTERY_MAX17040 new file mode 100644 index 000000000..e9e3fab08 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_BATTERY_MAX17040 @@ -0,0 +1 @@ +CONFIG_BATTERY_MAX17040=m diff --git a/configs/fedora/generic/arm/CONFIG_CAN_MCP251X b/configs/fedora/generic/arm/CONFIG_CAN_MCP251X new file mode 100644 index 000000000..861e26b17 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_CAN_MCP251X @@ -0,0 +1 @@ +CONFIG_CAN_MCP251X=m diff --git a/configs/fedora/generic/arm/CONFIG_CROS_EC b/configs/fedora/generic/arm/CONFIG_CROS_EC new file mode 100644 index 000000000..1ad522e6a --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_CROS_EC @@ -0,0 +1 @@ +CONFIG_CROS_EC=m diff --git a/configs/fedora/generic/arm/CONFIG_CROS_EC_CHARDEV b/configs/fedora/generic/arm/CONFIG_CROS_EC_CHARDEV new file mode 100644 index 000000000..a3df83240 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_CROS_EC_CHARDEV @@ -0,0 +1 @@ +CONFIG_CROS_EC_CHARDEV=m diff --git a/configs/fedora/generic/arm/CONFIG_CRYPTO_AEGIS128_SIMD b/configs/fedora/generic/arm/CONFIG_CRYPTO_AEGIS128_SIMD new file mode 100644 index 000000000..0fa737a1d --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_CRYPTO_AEGIS128_SIMD @@ -0,0 +1 @@ +CONFIG_CRYPTO_AEGIS128_SIMD=y diff --git a/configs/fedora/generic/arm/CONFIG_DRM_TINYDRM b/configs/fedora/generic/arm/CONFIG_DRM_TINYDRM deleted file mode 100644 index 4e6e01bfe..000000000 --- a/configs/fedora/generic/arm/CONFIG_DRM_TINYDRM +++ /dev/null @@ -1 +0,0 @@ -CONFIG_DRM_TINYDRM=m diff --git a/configs/fedora/generic/arm/CONFIG_GPIO_MOXTET b/configs/fedora/generic/arm/CONFIG_GPIO_MOXTET new file mode 100644 index 000000000..14a747e37 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_GPIO_MOXTET @@ -0,0 +1 @@ +CONFIG_GPIO_MOXTET=m diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_GPIO_TPS6586X b/configs/fedora/generic/arm/CONFIG_GPIO_TPS6586X similarity index 100% rename from configs/fedora/generic/arm/armv7/armv7/CONFIG_GPIO_TPS6586X rename to configs/fedora/generic/arm/CONFIG_GPIO_TPS6586X diff --git a/configs/fedora/generic/arm/CONFIG_HDC100X b/configs/fedora/generic/arm/CONFIG_HDC100X new file mode 100644 index 000000000..01ce4e667 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_HDC100X @@ -0,0 +1 @@ +CONFIG_HDC100X=m diff --git a/configs/fedora/generic/arm/CONFIG_HTU21 b/configs/fedora/generic/arm/CONFIG_HTU21 new file mode 100644 index 000000000..9508d6609 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_HTU21 @@ -0,0 +1 @@ +CONFIG_HTU21=m diff --git a/configs/fedora/generic/arm/CONFIG_IMX7ULP_WDT b/configs/fedora/generic/arm/CONFIG_IMX7ULP_WDT new file mode 100644 index 000000000..fc7a20637 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_IMX7ULP_WDT @@ -0,0 +1 @@ +# CONFIG_IMX7ULP_WDT is not set diff --git a/configs/fedora/generic/arm/CONFIG_IMX_DSP b/configs/fedora/generic/arm/CONFIG_IMX_DSP new file mode 100644 index 000000000..e7d6b097b --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_IMX_DSP @@ -0,0 +1 @@ +CONFIG_IMX_DSP=y diff --git a/configs/fedora/generic/arm/CONFIG_INPUT_PWM_BEEPER b/configs/fedora/generic/arm/CONFIG_INPUT_PWM_BEEPER deleted file mode 100644 index 59fdb225d..000000000 --- a/configs/fedora/generic/arm/CONFIG_INPUT_PWM_BEEPER +++ /dev/null @@ -1 +0,0 @@ -CONFIG_INPUT_PWM_BEEPER=m diff --git a/configs/fedora/generic/arm/CONFIG_INTERCONNECT_QCOM_QCS404 b/configs/fedora/generic/arm/CONFIG_INTERCONNECT_QCOM_QCS404 new file mode 100644 index 000000000..5b700e166 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_INTERCONNECT_QCOM_QCS404 @@ -0,0 +1 @@ +# CONFIG_INTERCONNECT_QCOM_QCS404 is not set diff --git a/configs/fedora/generic/arm/CONFIG_LEDS_PCA963X b/configs/fedora/generic/arm/CONFIG_LEDS_PCA963X new file mode 100644 index 000000000..42b62ab96 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_LEDS_PCA963X @@ -0,0 +1 @@ +CONFIG_LEDS_PCA963X=m diff --git a/configs/fedora/generic/arm/CONFIG_MAG3110 b/configs/fedora/generic/arm/CONFIG_MAG3110 new file mode 100644 index 000000000..029f5c044 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_MAG3110 @@ -0,0 +1 @@ +CONFIG_MAG3110=m diff --git a/configs/fedora/generic/arm/CONFIG_MCP320X b/configs/fedora/generic/arm/CONFIG_MCP320X new file mode 100644 index 000000000..072c95cb0 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_MCP320X @@ -0,0 +1 @@ +CONFIG_MCP320X=m diff --git a/configs/fedora/generic/arm/CONFIG_MCP3422 b/configs/fedora/generic/arm/CONFIG_MCP3422 new file mode 100644 index 000000000..213f87aa8 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_MCP3422 @@ -0,0 +1 @@ +CONFIG_MCP3422=m diff --git a/configs/fedora/generic/arm/CONFIG_MESON_EE_PM_DOMAINS b/configs/fedora/generic/arm/CONFIG_MESON_EE_PM_DOMAINS new file mode 100644 index 000000000..29e8d77d7 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_MESON_EE_PM_DOMAINS @@ -0,0 +1 @@ +CONFIG_MESON_EE_PM_DOMAINS=y diff --git a/configs/fedora/generic/arm/CONFIG_MFD_CROS_EC b/configs/fedora/generic/arm/CONFIG_MFD_CROS_EC deleted file mode 100644 index 3600231f6..000000000 --- a/configs/fedora/generic/arm/CONFIG_MFD_CROS_EC +++ /dev/null @@ -1 +0,0 @@ -CONFIG_MFD_CROS_EC=m diff --git a/configs/fedora/generic/arm/CONFIG_MFD_CROS_EC_CHARDEV b/configs/fedora/generic/arm/CONFIG_MFD_CROS_EC_CHARDEV deleted file mode 100644 index fc68f1d89..000000000 --- a/configs/fedora/generic/arm/CONFIG_MFD_CROS_EC_CHARDEV +++ /dev/null @@ -1 +0,0 @@ -CONFIG_MFD_CROS_EC_CHARDEV=m diff --git a/configs/fedora/generic/arm/CONFIG_MFD_CROS_EC_DEV b/configs/fedora/generic/arm/CONFIG_MFD_CROS_EC_DEV new file mode 100644 index 000000000..a4fd1512e --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_MFD_CROS_EC_DEV @@ -0,0 +1 @@ +CONFIG_MFD_CROS_EC_DEV=m diff --git a/configs/fedora/generic/arm/CONFIG_MOXTET b/configs/fedora/generic/arm/CONFIG_MOXTET new file mode 100644 index 000000000..29810388f --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_MOXTET @@ -0,0 +1 @@ +CONFIG_MOXTET=m diff --git a/configs/fedora/generic/arm/CONFIG_PWM_PCA9685 b/configs/fedora/generic/arm/CONFIG_PWM_PCA9685 new file mode 100644 index 000000000..822677184 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_PWM_PCA9685 @@ -0,0 +1 @@ +CONFIG_PWM_PCA9685=m diff --git a/configs/fedora/generic/arm/CONFIG_QCOM_SOCINFO b/configs/fedora/generic/arm/CONFIG_QCOM_SOCINFO new file mode 100644 index 000000000..c98f36a71 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_QCOM_SOCINFO @@ -0,0 +1 @@ +CONFIG_QCOM_SOCINFO=m diff --git a/configs/fedora/generic/arm/CONFIG_RESET_SCMI b/configs/fedora/generic/arm/CONFIG_RESET_SCMI new file mode 100644 index 000000000..510ea209c --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_RESET_SCMI @@ -0,0 +1 @@ +CONFIG_RESET_SCMI=y diff --git a/configs/fedora/generic/arm/CONFIG_RTC_DRV_MESON_VRTC b/configs/fedora/generic/arm/CONFIG_RTC_DRV_MESON_VRTC new file mode 100644 index 000000000..4ae0ab82f --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_RTC_DRV_MESON_VRTC @@ -0,0 +1 @@ +CONFIG_RTC_DRV_MESON_VRTC=m diff --git a/configs/fedora/generic/arm/armv7/CONFIG_SENSORS_GPIO_FAN b/configs/fedora/generic/arm/CONFIG_SENSORS_GPIO_FAN similarity index 100% rename from configs/fedora/generic/arm/armv7/CONFIG_SENSORS_GPIO_FAN rename to configs/fedora/generic/arm/CONFIG_SENSORS_GPIO_FAN diff --git a/configs/fedora/generic/arm/armv7/CONFIG_SI7020 b/configs/fedora/generic/arm/CONFIG_SI7020 similarity index 100% rename from configs/fedora/generic/arm/armv7/CONFIG_SI7020 rename to configs/fedora/generic/arm/CONFIG_SI7020 diff --git a/configs/fedora/generic/arm/CONFIG_SM_GCC_8150 b/configs/fedora/generic/arm/CONFIG_SM_GCC_8150 new file mode 100644 index 000000000..70de2f2e1 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_SM_GCC_8150 @@ -0,0 +1 @@ +# CONFIG_SM_GCC_8150 is not set diff --git a/configs/fedora/generic/arm/CONFIG_SND_SOC_ADAU1977_I2C b/configs/fedora/generic/arm/CONFIG_SND_SOC_ADAU1977_I2C new file mode 100644 index 000000000..9665f5229 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_SND_SOC_ADAU1977_I2C @@ -0,0 +1 @@ +CONFIG_SND_SOC_ADAU1977_I2C=m diff --git a/configs/fedora/generic/arm/CONFIG_SND_SOC_CS4265 b/configs/fedora/generic/arm/CONFIG_SND_SOC_CS4265 new file mode 100644 index 000000000..3c8bc686b --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_SND_SOC_CS4265 @@ -0,0 +1 @@ +CONFIG_SND_SOC_CS4265=m diff --git a/configs/fedora/generic/arm/CONFIG_SND_SOC_CS4271_I2C b/configs/fedora/generic/arm/CONFIG_SND_SOC_CS4271_I2C new file mode 100644 index 000000000..3408b3502 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_SND_SOC_CS4271_I2C @@ -0,0 +1 @@ +CONFIG_SND_SOC_CS4271_I2C=m diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_CS42XX8_I2C b/configs/fedora/generic/arm/CONFIG_SND_SOC_CS42XX8_I2C similarity index 100% rename from configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_CS42XX8_I2C rename to configs/fedora/generic/arm/CONFIG_SND_SOC_CS42XX8_I2C diff --git a/configs/fedora/generic/arm/CONFIG_SND_SOC_DA7213 b/configs/fedora/generic/arm/CONFIG_SND_SOC_DA7213 new file mode 100644 index 000000000..e7f8eecca --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_SND_SOC_DA7213 @@ -0,0 +1 @@ +CONFIG_SND_SOC_DA7213=m diff --git a/configs/fedora/generic/arm/CONFIG_SND_SOC_ICS43432 b/configs/fedora/generic/arm/CONFIG_SND_SOC_ICS43432 new file mode 100644 index 000000000..be2f8fc33 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_SND_SOC_ICS43432 @@ -0,0 +1 @@ +CONFIG_SND_SOC_ICS43432=m diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_SND_SOC_MAX98357A b/configs/fedora/generic/arm/CONFIG_SND_SOC_MAX98357A similarity index 100% rename from configs/fedora/generic/arm/aarch64/CONFIG_SND_SOC_MAX98357A rename to configs/fedora/generic/arm/CONFIG_SND_SOC_MAX98357A diff --git a/configs/fedora/generic/arm/CONFIG_SND_SOC_PCM5102A b/configs/fedora/generic/arm/CONFIG_SND_SOC_PCM5102A new file mode 100644 index 000000000..b5aa6251d --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_SND_SOC_PCM5102A @@ -0,0 +1 @@ +CONFIG_SND_SOC_PCM5102A=m diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_SND_SOC_SGTL5000 b/configs/fedora/generic/arm/CONFIG_SND_SOC_SGTL5000 similarity index 100% rename from configs/fedora/generic/arm/aarch64/CONFIG_SND_SOC_SGTL5000 rename to configs/fedora/generic/arm/CONFIG_SND_SOC_SGTL5000 diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_TLV320AIC23 b/configs/fedora/generic/arm/CONFIG_SND_SOC_TLV320AIC23 similarity index 100% rename from configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_TLV320AIC23 rename to configs/fedora/generic/arm/CONFIG_SND_SOC_TLV320AIC23 diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_TLV320AIC23_I2C b/configs/fedora/generic/arm/CONFIG_SND_SOC_TLV320AIC23_I2C similarity index 100% rename from configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_TLV320AIC23_I2C rename to configs/fedora/generic/arm/CONFIG_SND_SOC_TLV320AIC23_I2C diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_TLV320AIC23_SPI b/configs/fedora/generic/arm/CONFIG_SND_SOC_TLV320AIC23_SPI similarity index 100% rename from configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_TLV320AIC23_SPI rename to configs/fedora/generic/arm/CONFIG_SND_SOC_TLV320AIC23_SPI diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_WM8731 b/configs/fedora/generic/arm/CONFIG_SND_SOC_WM8731 similarity index 100% rename from configs/fedora/generic/arm/armv7/armv7/CONFIG_SND_SOC_WM8731 rename to configs/fedora/generic/arm/CONFIG_SND_SOC_WM8731 diff --git a/configs/fedora/generic/arm/CONFIG_SND_SOC_WM8741 b/configs/fedora/generic/arm/CONFIG_SND_SOC_WM8741 new file mode 100644 index 000000000..58adc551f --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_SND_SOC_WM8741 @@ -0,0 +1 @@ +CONFIG_SND_SOC_WM8741=m diff --git a/configs/fedora/generic/arm/CONFIG_TCG_FTPM_TEE b/configs/fedora/generic/arm/CONFIG_TCG_FTPM_TEE new file mode 100644 index 000000000..f84ad6543 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_TCG_FTPM_TEE @@ -0,0 +1 @@ +CONFIG_TCG_FTPM_TEE=m diff --git a/configs/fedora/generic/arm/CONFIG_TINYDRM_MIPI_DBI b/configs/fedora/generic/arm/CONFIG_TINYDRM_MIPI_DBI deleted file mode 100644 index bb0235842..000000000 --- a/configs/fedora/generic/arm/CONFIG_TINYDRM_MIPI_DBI +++ /dev/null @@ -1 +0,0 @@ -CONFIG_TINYDRM_MIPI_DBI=m diff --git a/configs/fedora/generic/arm/armv7/CONFIG_TOUCHSCREEN_ADS7846 b/configs/fedora/generic/arm/CONFIG_TOUCHSCREEN_ADS7846 similarity index 100% rename from configs/fedora/generic/arm/armv7/CONFIG_TOUCHSCREEN_ADS7846 rename to configs/fedora/generic/arm/CONFIG_TOUCHSCREEN_ADS7846 diff --git a/configs/fedora/generic/arm/CONFIG_TOUCHSCREEN_EXC3000 b/configs/fedora/generic/arm/CONFIG_TOUCHSCREEN_EXC3000 new file mode 100644 index 000000000..9211c830e --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_TOUCHSCREEN_EXC3000 @@ -0,0 +1 @@ +CONFIG_TOUCHSCREEN_EXC3000=m diff --git a/configs/fedora/generic/arm/CONFIG_TOUCHSCREEN_GOODIX b/configs/fedora/generic/arm/CONFIG_TOUCHSCREEN_GOODIX new file mode 100644 index 000000000..ad45d6831 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_TOUCHSCREEN_GOODIX @@ -0,0 +1 @@ +CONFIG_TOUCHSCREEN_GOODIX=m diff --git a/configs/fedora/generic/arm/CONFIG_TSL4531 b/configs/fedora/generic/arm/CONFIG_TSL4531 new file mode 100644 index 000000000..82759bc16 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_TSL4531 @@ -0,0 +1 @@ +CONFIG_TSL4531=m diff --git a/configs/fedora/generic/arm/CONFIG_TURRIS_MOX_RWTM b/configs/fedora/generic/arm/CONFIG_TURRIS_MOX_RWTM new file mode 100644 index 000000000..5dcb7dbb9 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_TURRIS_MOX_RWTM @@ -0,0 +1 @@ +CONFIG_TURRIS_MOX_RWTM=m diff --git a/configs/fedora/generic/arm/CONFIG_USB_CONN_GPIO b/configs/fedora/generic/arm/CONFIG_USB_CONN_GPIO new file mode 100644 index 000000000..4113924f9 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_USB_CONN_GPIO @@ -0,0 +1 @@ +CONFIG_USB_CONN_GPIO=m diff --git a/configs/fedora/generic/arm/CONFIG_USB_OHCI_HCD b/configs/fedora/generic/arm/CONFIG_USB_OHCI_HCD new file mode 100644 index 000000000..b57227638 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_USB_OHCI_HCD @@ -0,0 +1 @@ +CONFIG_USB_OHCI_HCD=m diff --git a/configs/fedora/generic/arm/CONFIG_VEML6070 b/configs/fedora/generic/arm/CONFIG_VEML6070 new file mode 100644 index 000000000..b714b90a3 --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_VEML6070 @@ -0,0 +1 @@ +CONFIG_VEML6070=m diff --git a/configs/fedora/generic/arm/CONFIG_VIDEO_SUN4I_CSI b/configs/fedora/generic/arm/CONFIG_VIDEO_SUN4I_CSI new file mode 100644 index 000000000..890d5e0bc --- /dev/null +++ b/configs/fedora/generic/arm/CONFIG_VIDEO_SUN4I_CSI @@ -0,0 +1 @@ +CONFIG_VIDEO_SUN4I_CSI=m diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_ARM64_TAGGED_ADDR_ABI b/configs/fedora/generic/arm/aarch64/CONFIG_ARM64_TAGGED_ADDR_ABI new file mode 100644 index 000000000..478c311de --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_ARM64_TAGGED_ADDR_ABI @@ -0,0 +1 @@ +CONFIG_ARM64_TAGGED_ADDR_ABI=y diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_ARM64_VA_BITS_52 b/configs/fedora/generic/arm/aarch64/CONFIG_ARM64_VA_BITS_52 new file mode 100644 index 000000000..3e4b995e9 --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_ARM64_VA_BITS_52 @@ -0,0 +1 @@ +# CONFIG_ARM64_VA_BITS_52 is not set diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_ARM_QCOM_CPUFREQ_NVMEM b/configs/fedora/generic/arm/aarch64/CONFIG_ARM_QCOM_CPUFREQ_NVMEM new file mode 100644 index 000000000..b50af990b --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_ARM_QCOM_CPUFREQ_NVMEM @@ -0,0 +1 @@ +CONFIG_ARM_QCOM_CPUFREQ_NVMEM=m diff --git a/configs/fedora/generic/arm/CONFIG_CAVIUM_TX2_ERRATUM_219 b/configs/fedora/generic/arm/aarch64/CONFIG_CAVIUM_TX2_ERRATUM_219 similarity index 100% rename from configs/fedora/generic/arm/CONFIG_CAVIUM_TX2_ERRATUM_219 rename to configs/fedora/generic/arm/aarch64/CONFIG_CAVIUM_TX2_ERRATUM_219 diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_CLK_IMX8MN b/configs/fedora/generic/arm/aarch64/CONFIG_CLK_IMX8MN new file mode 100644 index 000000000..dd001886b --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_CLK_IMX8MN @@ -0,0 +1 @@ +CONFIG_CLK_IMX8MN=y diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_CRYPTO_DEV_HISI_ZIP b/configs/fedora/generic/arm/aarch64/CONFIG_CRYPTO_DEV_HISI_ZIP new file mode 100644 index 000000000..54dadfbdd --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_CRYPTO_DEV_HISI_ZIP @@ -0,0 +1 @@ +# CONFIG_CRYPTO_DEV_HISI_ZIP is not set diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_EDAC_BLUEFIELD b/configs/fedora/generic/arm/aarch64/CONFIG_EDAC_BLUEFIELD new file mode 100644 index 000000000..8cecdf961 --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_EDAC_BLUEFIELD @@ -0,0 +1 @@ +CONFIG_EDAC_BLUEFIELD=m diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_HISI_KIRIN_DW_DSI b/configs/fedora/generic/arm/aarch64/CONFIG_HISI_KIRIN_DW_DSI deleted file mode 100644 index cef60968e..000000000 --- a/configs/fedora/generic/arm/aarch64/CONFIG_HISI_KIRIN_DW_DSI +++ /dev/null @@ -1 +0,0 @@ -CONFIG_HISI_KIRIN_DW_DSI=m diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_KEXEC_SIG b/configs/fedora/generic/arm/aarch64/CONFIG_KEXEC_SIG new file mode 100644 index 000000000..67b688658 --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_KEXEC_SIG @@ -0,0 +1 @@ +CONFIG_KEXEC_SIG=y diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_NR_CPUS b/configs/fedora/generic/arm/aarch64/CONFIG_NR_CPUS index 0c4b1d904..4190afcbb 100644 --- a/configs/fedora/generic/arm/aarch64/CONFIG_NR_CPUS +++ b/configs/fedora/generic/arm/aarch64/CONFIG_NR_CPUS @@ -1 +1 @@ -CONFIG_NR_CPUS=256 +CONFIG_NR_CPUS=4096 diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_PCIE_AL b/configs/fedora/generic/arm/aarch64/CONFIG_PCIE_AL new file mode 100644 index 000000000..4cfae7f6a --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_PCIE_AL @@ -0,0 +1 @@ +# CONFIG_PCIE_AL is not set diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_PCIE_TEGRA194 b/configs/fedora/generic/arm/aarch64/CONFIG_PCIE_TEGRA194 new file mode 100644 index 000000000..5484caeef --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_PCIE_TEGRA194 @@ -0,0 +1 @@ +CONFIG_PCIE_TEGRA194=m diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_PHY_TEGRA194_P2U b/configs/fedora/generic/arm/aarch64/CONFIG_PHY_TEGRA194_P2U new file mode 100644 index 000000000..23e44783c --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_PHY_TEGRA194_P2U @@ -0,0 +1 @@ +CONFIG_PHY_TEGRA194_P2U=m diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_QCOM_SOCINFO b/configs/fedora/generic/arm/aarch64/CONFIG_QCOM_SOCINFO new file mode 100644 index 000000000..8e56160a2 --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_QCOM_SOCINFO @@ -0,0 +1 @@ +# CONFIG_QCOM_SOCINFO is not set diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_RTC_DRV_FSL_FTM_ALARM b/configs/fedora/generic/arm/aarch64/CONFIG_RTC_DRV_FSL_FTM_ALARM new file mode 100644 index 000000000..390851818 --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_RTC_DRV_FSL_FTM_ALARM @@ -0,0 +1 @@ +CONFIG_RTC_DRV_FSL_FTM_ALARM=m diff --git a/configs/fedora/generic/arm/aarch64/CONFIG_SM_GCC_8150 b/configs/fedora/generic/arm/aarch64/CONFIG_SM_GCC_8150 new file mode 100644 index 000000000..3e341c392 --- /dev/null +++ b/configs/fedora/generic/arm/aarch64/CONFIG_SM_GCC_8150 @@ -0,0 +1 @@ +CONFIG_SM_GCC_8150=y diff --git a/configs/fedora/generic/arm/armv7/CONFIG_ARCH_MULTI_V5 b/configs/fedora/generic/arm/armv7/CONFIG_ARCH_MULTI_V5 new file mode 100644 index 000000000..642406b79 --- /dev/null +++ b/configs/fedora/generic/arm/armv7/CONFIG_ARCH_MULTI_V5 @@ -0,0 +1 @@ +# CONFIG_ARCH_MULTI_V5 is not set diff --git a/configs/fedora/generic/arm/armv7/CONFIG_EDAC_ARMADA_XP b/configs/fedora/generic/arm/armv7/CONFIG_EDAC_ARMADA_XP new file mode 100644 index 000000000..301caab79 --- /dev/null +++ b/configs/fedora/generic/arm/armv7/CONFIG_EDAC_ARMADA_XP @@ -0,0 +1 @@ +CONFIG_EDAC_ARMADA_XP=y diff --git a/configs/fedora/generic/arm/armv7/CONFIG_MTD_M25P80 b/configs/fedora/generic/arm/armv7/CONFIG_MTD_M25P80 deleted file mode 100644 index 9e4ab3f0b..000000000 --- a/configs/fedora/generic/arm/armv7/CONFIG_MTD_M25P80 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_MTD_M25P80=m diff --git a/configs/fedora/generic/arm/armv7/CONFIG_SND_SOC_SGTL5000 b/configs/fedora/generic/arm/armv7/CONFIG_SND_SOC_SGTL5000 deleted file mode 100644 index ea71dece1..000000000 --- a/configs/fedora/generic/arm/armv7/CONFIG_SND_SOC_SGTL5000 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_SGTL5000=m diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_ARM_TEGRA20_DEVFREQ b/configs/fedora/generic/arm/armv7/armv7/CONFIG_ARM_TEGRA20_DEVFREQ new file mode 100644 index 000000000..c3c35e684 --- /dev/null +++ b/configs/fedora/generic/arm/armv7/armv7/CONFIG_ARM_TEGRA20_DEVFREQ @@ -0,0 +1 @@ +CONFIG_ARM_TEGRA20_DEVFREQ=m diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_LGPHILIPS_LB035Q02 b/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_LGPHILIPS_LB035Q02 deleted file mode 100644 index 59d16a459..000000000 --- a/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_LGPHILIPS_LB035Q02 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_DRM_OMAP_PANEL_LGPHILIPS_LB035Q02=m diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_NEC_NL8048HL11 b/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_NEC_NL8048HL11 deleted file mode 100644 index 8751af145..000000000 --- a/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_NEC_NL8048HL11 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_DRM_OMAP_PANEL_NEC_NL8048HL11=m diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_SHARP_LS037V7DW01 b/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_SHARP_LS037V7DW01 deleted file mode 100644 index fe01d0a37..000000000 --- a/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_SHARP_LS037V7DW01 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_DRM_OMAP_PANEL_SHARP_LS037V7DW01=m diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_SONY_ACX565AKM b/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_SONY_ACX565AKM deleted file mode 100644 index d4629e2b7..000000000 --- a/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_SONY_ACX565AKM +++ /dev/null @@ -1 +0,0 @@ -CONFIG_DRM_OMAP_PANEL_SONY_ACX565AKM=m diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_TPO_TD028TTEC1 b/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_TPO_TD028TTEC1 deleted file mode 100644 index de91d35b4..000000000 --- a/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_TPO_TD028TTEC1 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_DRM_OMAP_PANEL_TPO_TD028TTEC1=m diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_TPO_TD043MTEA1 b/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_TPO_TD043MTEA1 deleted file mode 100644 index 9a503f8e7..000000000 --- a/configs/fedora/generic/arm/armv7/armv7/CONFIG_DRM_OMAP_PANEL_TPO_TD043MTEA1 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_DRM_OMAP_PANEL_TPO_TD043MTEA1=m diff --git a/configs/fedora/generic/arm/armv7/armv7/CONFIG_QCOM_COMMAND_DB b/configs/fedora/generic/arm/armv7/armv7/CONFIG_QCOM_COMMAND_DB new file mode 100644 index 000000000..0a34c3a7e --- /dev/null +++ b/configs/fedora/generic/arm/armv7/armv7/CONFIG_QCOM_COMMAND_DB @@ -0,0 +1 @@ +CONFIG_QCOM_COMMAND_DB=y diff --git a/configs/fedora/generic/powerpc/CONFIG_EFI_TEST b/configs/fedora/generic/powerpc/CONFIG_EFI_TEST new file mode 100644 index 000000000..455eb3061 --- /dev/null +++ b/configs/fedora/generic/powerpc/CONFIG_EFI_TEST @@ -0,0 +1 @@ +# CONFIG_EFI_TEST is not set diff --git a/configs/fedora/generic/powerpc/CONFIG_HMM_MIRROR b/configs/fedora/generic/powerpc/CONFIG_HMM_MIRROR index 0d7d51185..11dfee6c1 100644 --- a/configs/fedora/generic/powerpc/CONFIG_HMM_MIRROR +++ b/configs/fedora/generic/powerpc/CONFIG_HMM_MIRROR @@ -1 +1 @@ -# CONFIG_HMM_MIRROR is not set +CONFIG_HMM_MIRROR=y diff --git a/configs/fedora/generic/powerpc/CONFIG_INPUT_PWM_BEEPER b/configs/fedora/generic/powerpc/CONFIG_INPUT_PWM_BEEPER deleted file mode 100644 index 59fdb225d..000000000 --- a/configs/fedora/generic/powerpc/CONFIG_INPUT_PWM_BEEPER +++ /dev/null @@ -1 +0,0 @@ -CONFIG_INPUT_PWM_BEEPER=m diff --git a/configs/fedora/generic/powerpc/CONFIG_NR_CPUS b/configs/fedora/generic/powerpc/CONFIG_NR_CPUS index 27d187f4d..b13ed41c9 100644 --- a/configs/fedora/generic/powerpc/CONFIG_NR_CPUS +++ b/configs/fedora/generic/powerpc/CONFIG_NR_CPUS @@ -1 +1 @@ -CONFIG_NR_CPUS=1024 +CONFIG_NR_CPUS=2048 diff --git a/configs/fedora/generic/powerpc/CONFIG_OPAL_CORE b/configs/fedora/generic/powerpc/CONFIG_OPAL_CORE new file mode 100644 index 000000000..48e23bed6 --- /dev/null +++ b/configs/fedora/generic/powerpc/CONFIG_OPAL_CORE @@ -0,0 +1 @@ +# CONFIG_OPAL_CORE is not set diff --git a/configs/fedora/generic/powerpc/CONFIG_PPC_SVM b/configs/fedora/generic/powerpc/CONFIG_PPC_SVM new file mode 100644 index 000000000..b62f122bf --- /dev/null +++ b/configs/fedora/generic/powerpc/CONFIG_PPC_SVM @@ -0,0 +1 @@ +CONFIG_PPC_SVM=y diff --git a/configs/fedora/generic/powerpc/CONFIG_SND_HDA_INTEL b/configs/fedora/generic/powerpc/CONFIG_SND_HDA_INTEL new file mode 100644 index 000000000..dfe74ea98 --- /dev/null +++ b/configs/fedora/generic/powerpc/CONFIG_SND_HDA_INTEL @@ -0,0 +1 @@ +CONFIG_SND_HDA_INTEL=m diff --git a/configs/fedora/generic/powerpc/CONFIG_SND_HDA_INTEL_DETECT_DMIC b/configs/fedora/generic/powerpc/CONFIG_SND_HDA_INTEL_DETECT_DMIC new file mode 100644 index 000000000..501f523b0 --- /dev/null +++ b/configs/fedora/generic/powerpc/CONFIG_SND_HDA_INTEL_DETECT_DMIC @@ -0,0 +1 @@ +# CONFIG_SND_HDA_INTEL_DETECT_DMIC is not set diff --git a/configs/fedora/generic/s390x/CONFIG_CRYPTO_SHA3_256_S390 b/configs/fedora/generic/s390x/CONFIG_CRYPTO_SHA3_256_S390 new file mode 100644 index 000000000..2c2725640 --- /dev/null +++ b/configs/fedora/generic/s390x/CONFIG_CRYPTO_SHA3_256_S390 @@ -0,0 +1 @@ +CONFIG_CRYPTO_SHA3_256_S390=m diff --git a/configs/fedora/generic/s390x/CONFIG_CRYPTO_SHA3_512_S390 b/configs/fedora/generic/s390x/CONFIG_CRYPTO_SHA3_512_S390 new file mode 100644 index 000000000..0c00ba82a --- /dev/null +++ b/configs/fedora/generic/s390x/CONFIG_CRYPTO_SHA3_512_S390 @@ -0,0 +1 @@ +CONFIG_CRYPTO_SHA3_512_S390=m diff --git a/configs/fedora/generic/s390x/CONFIG_EFI_TEST b/configs/fedora/generic/s390x/CONFIG_EFI_TEST new file mode 100644 index 000000000..455eb3061 --- /dev/null +++ b/configs/fedora/generic/s390x/CONFIG_EFI_TEST @@ -0,0 +1 @@ +# CONFIG_EFI_TEST is not set diff --git a/configs/fedora/generic/s390x/CONFIG_INPUT_PWM_BEEPER b/configs/fedora/generic/s390x/CONFIG_INPUT_PWM_BEEPER new file mode 100644 index 000000000..9ac1c7b31 --- /dev/null +++ b/configs/fedora/generic/s390x/CONFIG_INPUT_PWM_BEEPER @@ -0,0 +1 @@ +# CONFIG_INPUT_PWM_BEEPER is not set diff --git a/configs/fedora/generic/s390x/CONFIG_KEXEC_SIG b/configs/fedora/generic/s390x/CONFIG_KEXEC_SIG new file mode 100644 index 000000000..67b688658 --- /dev/null +++ b/configs/fedora/generic/s390x/CONFIG_KEXEC_SIG @@ -0,0 +1 @@ +CONFIG_KEXEC_SIG=y diff --git a/configs/fedora/generic/s390x/CONFIG_KEXEC_VERIFY_SIG b/configs/fedora/generic/s390x/CONFIG_KEXEC_VERIFY_SIG deleted file mode 100644 index 5d9b84372..000000000 --- a/configs/fedora/generic/s390x/CONFIG_KEXEC_VERIFY_SIG +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_KEXEC_VERIFY_SIG is not set diff --git a/configs/fedora/generic/s390x/CONFIG_MARCH_Z15 b/configs/fedora/generic/s390x/CONFIG_MARCH_Z15 new file mode 100644 index 000000000..6865b8850 --- /dev/null +++ b/configs/fedora/generic/s390x/CONFIG_MARCH_Z15 @@ -0,0 +1 @@ +# CONFIG_MARCH_Z15 is not set diff --git a/configs/fedora/generic/s390x/CONFIG_NR_CPUS b/configs/fedora/generic/s390x/CONFIG_NR_CPUS index fa1ab7e94..9ce2b2de6 100644 --- a/configs/fedora/generic/s390x/CONFIG_NR_CPUS +++ b/configs/fedora/generic/s390x/CONFIG_NR_CPUS @@ -1 +1 @@ -CONFIG_NR_CPUS=64 +CONFIG_NR_CPUS=512 diff --git a/configs/fedora/generic/s390x/CONFIG_TUNE_Z15 b/configs/fedora/generic/s390x/CONFIG_TUNE_Z15 new file mode 100644 index 000000000..edbf220a0 --- /dev/null +++ b/configs/fedora/generic/s390x/CONFIG_TUNE_Z15 @@ -0,0 +1 @@ +# CONFIG_TUNE_Z15 is not set diff --git a/configs/fedora/generic/x86/CONFIG_CPU_IDLE_GOV_HALTPOLL b/configs/fedora/generic/x86/CONFIG_CPU_IDLE_GOV_HALTPOLL new file mode 100644 index 000000000..4e01ab97c --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_CPU_IDLE_GOV_HALTPOLL @@ -0,0 +1 @@ +CONFIG_CPU_IDLE_GOV_HALTPOLL=y diff --git a/configs/fedora/generic/x86/CONFIG_CROS_EC b/configs/fedora/generic/x86/CONFIG_CROS_EC new file mode 100644 index 000000000..bd6dd449b --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_CROS_EC @@ -0,0 +1 @@ +# CONFIG_CROS_EC is not set diff --git a/configs/fedora/generic/x86/CONFIG_CROS_EC_I2C b/configs/fedora/generic/x86/CONFIG_CROS_EC_I2C deleted file mode 100644 index 67550eb9c..000000000 --- a/configs/fedora/generic/x86/CONFIG_CROS_EC_I2C +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CROS_EC_I2C=m diff --git a/configs/fedora/generic/x86/CONFIG_CROS_EC_PROTO b/configs/fedora/generic/x86/CONFIG_CROS_EC_PROTO deleted file mode 100644 index 96a1e9bcb..000000000 --- a/configs/fedora/generic/x86/CONFIG_CROS_EC_PROTO +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CROS_EC_PROTO=y diff --git a/configs/fedora/generic/x86/CONFIG_CROS_EC_SPI b/configs/fedora/generic/x86/CONFIG_CROS_EC_SPI deleted file mode 100644 index 54b52bed4..000000000 --- a/configs/fedora/generic/x86/CONFIG_CROS_EC_SPI +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CROS_EC_SPI=m diff --git a/configs/fedora/generic/x86/CONFIG_DRM_AMD_DC_DCN2_1 b/configs/fedora/generic/x86/CONFIG_DRM_AMD_DC_DCN2_1 new file mode 100644 index 000000000..9aa94df3c --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_DRM_AMD_DC_DCN2_1 @@ -0,0 +1 @@ +CONFIG_DRM_AMD_DC_DCN2_1=y diff --git a/configs/fedora/generic/x86/CONFIG_EFI_RCI2_TABLE b/configs/fedora/generic/x86/CONFIG_EFI_RCI2_TABLE new file mode 100644 index 000000000..083461929 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_EFI_RCI2_TABLE @@ -0,0 +1 @@ +CONFIG_EFI_RCI2_TABLE=y diff --git a/configs/fedora/generic/x86/CONFIG_HALTPOLL_CPUIDLE b/configs/fedora/generic/x86/CONFIG_HALTPOLL_CPUIDLE new file mode 100644 index 000000000..2a48c8bdc --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_HALTPOLL_CPUIDLE @@ -0,0 +1 @@ +CONFIG_HALTPOLL_CPUIDLE=y diff --git a/configs/fedora/generic/CONFIG_KS0108 b/configs/fedora/generic/x86/CONFIG_KS0108 similarity index 100% rename from configs/fedora/generic/CONFIG_KS0108 rename to configs/fedora/generic/x86/CONFIG_KS0108 diff --git a/configs/fedora/generic/CONFIG_KS0108_DELAY b/configs/fedora/generic/x86/CONFIG_KS0108_DELAY similarity index 100% rename from configs/fedora/generic/CONFIG_KS0108_DELAY rename to configs/fedora/generic/x86/CONFIG_KS0108_DELAY diff --git a/configs/fedora/generic/CONFIG_KS0108_PORT b/configs/fedora/generic/x86/CONFIG_KS0108_PORT similarity index 100% rename from configs/fedora/generic/CONFIG_KS0108_PORT rename to configs/fedora/generic/x86/CONFIG_KS0108_PORT diff --git a/configs/fedora/generic/x86/CONFIG_LOCK_DOWN_KERNEL b/configs/fedora/generic/x86/CONFIG_LOCK_DOWN_KERNEL deleted file mode 100644 index e99bff22d..000000000 --- a/configs/fedora/generic/x86/CONFIG_LOCK_DOWN_KERNEL +++ /dev/null @@ -1 +0,0 @@ -CONFIG_LOCK_DOWN_KERNEL=y diff --git a/configs/fedora/generic/x86/CONFIG_LOCK_DOWN_KERNEL_FORCE b/configs/fedora/generic/x86/CONFIG_LOCK_DOWN_KERNEL_FORCE deleted file mode 100644 index b6a333ecd..000000000 --- a/configs/fedora/generic/x86/CONFIG_LOCK_DOWN_KERNEL_FORCE +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_LOCK_DOWN_KERNEL_FORCE is not set diff --git a/configs/fedora/generic/x86/CONFIG_MAXSMP b/configs/fedora/generic/x86/CONFIG_MAXSMP index d0d71de53..8d0fa581d 100644 --- a/configs/fedora/generic/x86/CONFIG_MAXSMP +++ b/configs/fedora/generic/x86/CONFIG_MAXSMP @@ -1 +1 @@ -# CONFIG_MAXSMP is not set +CONFIG_MAXSMP=y diff --git a/configs/fedora/generic/x86/CONFIG_PARAVIRT_SPINLOCKS b/configs/fedora/generic/x86/CONFIG_PARAVIRT_SPINLOCKS index 857e9465e..14b4c8d8d 100644 --- a/configs/fedora/generic/x86/CONFIG_PARAVIRT_SPINLOCKS +++ b/configs/fedora/generic/x86/CONFIG_PARAVIRT_SPINLOCKS @@ -1 +1 @@ -# CONFIG_PARAVIRT_SPINLOCKS is not set +CONFIG_PARAVIRT_SPINLOCKS=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_HDA_INTEL b/configs/fedora/generic/x86/CONFIG_SND_HDA_INTEL new file mode 100644 index 000000000..dfe74ea98 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_HDA_INTEL @@ -0,0 +1 @@ +CONFIG_SND_HDA_INTEL=m diff --git a/configs/fedora/generic/x86/CONFIG_SND_HDA_INTEL_DETECT_DMIC b/configs/fedora/generic/x86/CONFIG_SND_HDA_INTEL_DETECT_DMIC new file mode 100644 index 000000000..501f523b0 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_HDA_INTEL_DETECT_DMIC @@ -0,0 +1 @@ +# CONFIG_SND_HDA_INTEL_DETECT_DMIC is not set diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH new file mode 100644 index 000000000..9d675be4d --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH @@ -0,0 +1 @@ +CONFIG_SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH=m diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_GLK_DA7219_MAX98357A_MACH b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_GLK_DA7219_MAX98357A_MACH new file mode 100644 index 000000000..324a48c5f --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_GLK_DA7219_MAX98357A_MACH @@ -0,0 +1 @@ +CONFIG_SND_SOC_INTEL_GLK_DA7219_MAX98357A_MACH=m diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC index e109ab25a..eb1b21982 100644 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC @@ -1 +1 @@ -CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=y +# CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC is not set diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC~ b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC~ new file mode 100644 index 000000000..4181a1dd2 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC~ @@ -0,0 +1 @@ +CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=n diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH new file mode 100644 index 000000000..c13580570 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH @@ -0,0 +1,2 @@ +CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH=m + diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH~ b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH~ new file mode 100644 index 000000000..bad67ba0e --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH~ @@ -0,0 +1 @@ +# CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH is not set diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH new file mode 100644 index 000000000..c11d5fcea --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH @@ -0,0 +1 @@ +CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH=m diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES new file mode 100644 index 000000000..1e007232f --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES @@ -0,0 +1 @@ +CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT new file mode 100644 index 000000000..fa0eee213 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_APOLLOLAKE_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT new file mode 100644 index 000000000..893908b7d --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_CANNONLAKE_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT new file mode 100644 index 000000000..711e96855 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_COFFEELAKE_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT new file mode 100644 index 000000000..f2d98813b --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_COMETLAKE_H_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT new file mode 100644 index 000000000..eca28b0b2 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_COMETLAKE_LP_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_ELKHARTLAKE_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_ELKHARTLAKE_SUPPORT new file mode 100644 index 000000000..efe93bc3e --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_ELKHARTLAKE_SUPPORT @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_ELKHARTLAKE_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT new file mode 100644 index 000000000..9b6b0ebe3 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_GEMINILAKE_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1 b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1 new file mode 100644 index 000000000..3d5403951 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1 @@ -0,0 +1 @@ +# CONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1 is not set diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1~ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1~ new file mode 100644 index 000000000..df1d44aef --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1~ @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1=n diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC new file mode 100644 index 000000000..32dfcb2bc --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_COMMON_HDMI_CODEC b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_COMMON_HDMI_CODEC new file mode 100644 index 000000000..432d9eb42 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_COMMON_HDMI_CODEC @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_HDA_COMMON_HDMI_CODEC=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_LINK b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_LINK new file mode 100644 index 000000000..3d4aa71ce --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_HDA_LINK @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_HDA_LINK=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT new file mode 100644 index 000000000..acd67f035 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_ICELAKE_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL index a8070bb58..93748db03 100644 --- a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL @@ -1 +1 @@ -# CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL is not set +CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_JASPERLAKE_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_JASPERLAKE_SUPPORT new file mode 100644 index 000000000..d25aaa73d --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_JASPERLAKE_SUPPORT @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_JASPERLAKE_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT new file mode 100644 index 000000000..aa1c7a699 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_MERRIFIELD_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_TIGERLAKE_SUPPORT b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_TIGERLAKE_SUPPORT new file mode 100644 index 000000000..616056ec4 --- /dev/null +++ b/configs/fedora/generic/x86/CONFIG_SND_SOC_SOF_TIGERLAKE_SUPPORT @@ -0,0 +1 @@ +CONFIG_SND_SOC_SOF_TIGERLAKE_SUPPORT=y diff --git a/configs/fedora/generic/x86/CONFIG_VIDEO_CROS_EC_CEC b/configs/fedora/generic/x86/CONFIG_VIDEO_CROS_EC_CEC deleted file mode 100644 index 180ec3f10..000000000 --- a/configs/fedora/generic/x86/CONFIG_VIDEO_CROS_EC_CEC +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VIDEO_CROS_EC_CEC=m diff --git a/configs/fedora/generic/x86/i686/CONFIG_CRYPTO_AES_586 b/configs/fedora/generic/x86/i686/CONFIG_CRYPTO_AES_586 deleted file mode 100644 index 4702bf09c..000000000 --- a/configs/fedora/generic/x86/i686/CONFIG_CRYPTO_AES_586 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CRYPTO_AES_586=y diff --git a/configs/fedora/generic/x86/i686/CONFIG_INPUT_PWM_BEEPER b/configs/fedora/generic/x86/i686/CONFIG_INPUT_PWM_BEEPER deleted file mode 100644 index 59fdb225d..000000000 --- a/configs/fedora/generic/x86/i686/CONFIG_INPUT_PWM_BEEPER +++ /dev/null @@ -1 +0,0 @@ -CONFIG_INPUT_PWM_BEEPER=m diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_CROS_EC_CHARDEV b/configs/fedora/generic/x86/x86_64/CONFIG_CROS_EC_CHARDEV new file mode 100644 index 000000000..a3df83240 --- /dev/null +++ b/configs/fedora/generic/x86/x86_64/CONFIG_CROS_EC_CHARDEV @@ -0,0 +1 @@ +CONFIG_CROS_EC_CHARDEV=m diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_AEGIS128L_AESNI_SSE2 b/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_AEGIS128L_AESNI_SSE2 deleted file mode 100644 index 21a9942c6..000000000 --- a/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_AEGIS128L_AESNI_SSE2 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CRYPTO_AEGIS128L_AESNI_SSE2=m diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_AEGIS256_AESNI_SSE2 b/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_AEGIS256_AESNI_SSE2 deleted file mode 100644 index 847524120..000000000 --- a/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_AEGIS256_AESNI_SSE2 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CRYPTO_AEGIS256_AESNI_SSE2=m diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_AES_X86_64 b/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_AES_X86_64 deleted file mode 100644 index 7c09d010b..000000000 --- a/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_AES_X86_64 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CRYPTO_AES_X86_64=y diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_MORUS1280_AVX2 b/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_MORUS1280_AVX2 deleted file mode 100644 index 8ae1a8885..000000000 --- a/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_MORUS1280_AVX2 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CRYPTO_MORUS1280_AVX2=m diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_MORUS1280_SSE2 b/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_MORUS1280_SSE2 deleted file mode 100644 index 786389934..000000000 --- a/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_MORUS1280_SSE2 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CRYPTO_MORUS1280_SSE2=m diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_MORUS640_SSE2 b/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_MORUS640_SSE2 deleted file mode 100644 index 07d98b3fd..000000000 --- a/configs/fedora/generic/x86/x86_64/CONFIG_CRYPTO_MORUS640_SSE2 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CRYPTO_MORUS640_SSE2=m diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_MFD_CROS_EC b/configs/fedora/generic/x86/x86_64/CONFIG_MFD_CROS_EC deleted file mode 100644 index 3600231f6..000000000 --- a/configs/fedora/generic/x86/x86_64/CONFIG_MFD_CROS_EC +++ /dev/null @@ -1 +0,0 @@ -CONFIG_MFD_CROS_EC=m diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_MFD_CROS_EC_CHARDEV b/configs/fedora/generic/x86/x86_64/CONFIG_MFD_CROS_EC_CHARDEV deleted file mode 100644 index fc68f1d89..000000000 --- a/configs/fedora/generic/x86/x86_64/CONFIG_MFD_CROS_EC_CHARDEV +++ /dev/null @@ -1 +0,0 @@ -CONFIG_MFD_CROS_EC_CHARDEV=m diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_MFD_CROS_EC_DEV b/configs/fedora/generic/x86/x86_64/CONFIG_MFD_CROS_EC_DEV new file mode 100644 index 000000000..a4fd1512e --- /dev/null +++ b/configs/fedora/generic/x86/x86_64/CONFIG_MFD_CROS_EC_DEV @@ -0,0 +1 @@ +CONFIG_MFD_CROS_EC_DEV=m diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_NR_CPUS b/configs/fedora/generic/x86/x86_64/CONFIG_NR_CPUS index 27d187f4d..441191641 100644 --- a/configs/fedora/generic/x86/x86_64/CONFIG_NR_CPUS +++ b/configs/fedora/generic/x86/x86_64/CONFIG_NR_CPUS @@ -1 +1 @@ -CONFIG_NR_CPUS=1024 +CONFIG_NR_CPUS=8192 diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_OPTIMIZE_INLINING b/configs/fedora/generic/x86/x86_64/CONFIG_OPTIMIZE_INLINING deleted file mode 100644 index 6991e6d3f..000000000 --- a/configs/fedora/generic/x86/x86_64/CONFIG_OPTIMIZE_INLINING +++ /dev/null @@ -1 +0,0 @@ -CONFIG_OPTIMIZE_INLINING=y diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_SGI_IOC4 b/configs/fedora/generic/x86/x86_64/CONFIG_SGI_IOC4 deleted file mode 100644 index 89b268e91..000000000 --- a/configs/fedora/generic/x86/x86_64/CONFIG_SGI_IOC4 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SGI_IOC4=m diff --git a/configs/fedora/generic/x86/x86_64/CONFIG_X86_5LEVEL b/configs/fedora/generic/x86/x86_64/CONFIG_X86_5LEVEL index db301f396..ee4d305c7 100644 --- a/configs/fedora/generic/x86/x86_64/CONFIG_X86_5LEVEL +++ b/configs/fedora/generic/x86/x86_64/CONFIG_X86_5LEVEL @@ -1 +1 @@ -# CONFIG_X86_5LEVEL is not set +CONFIG_X86_5LEVEL=y diff --git a/configs/flavors b/configs/flavors new file mode 100644 index 000000000..35a143bac --- /dev/null +++ b/configs/flavors @@ -0,0 +1 @@ +fedora diff --git a/configs/config_generation b/configs/priority.fedora similarity index 100% rename from configs/config_generation rename to configs/priority.fedora diff --git a/configs/process_configs.sh b/configs/process_configs.sh index 846fe2e70..b464d95ce 100755 --- a/configs/process_configs.sh +++ b/configs/process_configs.sh @@ -2,7 +2,20 @@ # # This script takes the merged config files and processes them through oldconfig # and listnewconfig +# +usage() +{ + # alphabetical order please + echo "process_configs.sh [ options ] package_name kernel_version" + echo " -a: report all errors, equivalent to [-c -n -w -i]" + echo " -c: error on mismatched config options" + echo " -i: continue on error" + echo " -n: error on unset config options" + echo " -t: test run, do not overwrite original config" + echo " -w: error on misconfigured config options" + exit 1 +} die() { @@ -14,16 +27,16 @@ die() switch_to_toplevel() { path="$(pwd)" - while test "$path" != "/" + while test -n "$path" do test -e $path/MAINTAINERS && \ - test -d $path/drivers && \ - break + test -d $path/drivers && \ + break path="$(dirname $path)" done - test "$path" != "/" || die "Can't find toplevel" + test -n "$path" || die "Can't find toplevel" echo "$path" } @@ -48,7 +61,7 @@ checkoptions() configs[a[1]]=a[2]; } else { if (configs[a[1]] != "" && configs[a[1]] != a[2]) - print "Found "a[1]"="configs[a[1]]" after generation, had " a[1]"="a[2]" in Source tree"; + print "Found "a[1]"="a[2]" after generation, had " a[1]"="configs[a[1]]" in Source tree"; } } ' $1 $2 > .mismatches @@ -57,14 +70,15 @@ checkoptions() then echo "Error: Mismatches found in configuration files" cat .mismatches - exit 1 + RETURNCODE=1 + [ "$CONTINUEONERROR" ] || exit 1 fi } function process_configs() { # assume we are in $source_tree/configs, need to get to top level - pushd $(switch_to_toplevel) + pushd $(switch_to_toplevel) &>/dev/null for cfg in $SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}${SUBARCH}*.config do @@ -73,49 +87,97 @@ function process_configs() cfgorig="${cfg}.orig" cat $cfg > $cfgorig + if [ "$arch" = "EMPTY" ] + then + # This arch is intentionally left blank + continue + fi echo -n "Processing $cfg ... " - # an empty grep is good but leaves a return value, so use # 'true' to bypass - make ARCH=$arch KCONFIG_CONFIG=$cfg listnewconfig | grep -E 'CONFIG_' > .newoptions || true + make ARCH=$arch KCONFIG_CONFIG=$cfgorig listnewconfig >& .listnewconfig + grep -E 'CONFIG_' .listnewconfig > .newoptions if test -n "$NEWOPTIONS" && test -s .newoptions then echo "Found unset config items, please set them to an appropriate value" cat .newoptions rm .newoptions - exit 1 + RETURNCODE=1 + [ "$CONTINUEONERROR" ] || exit 1 fi rm .newoptions - make ARCH=$arch KCONFIG_CONFIG=$cfg olddefconfig > /dev/null || exit 1 + grep -E 'config.*warning' .listnewconfig > .warnings + if test -n "$CHECKWARNINGS" && test -s .warnings + then + echo "Found misconfigured config items, please set them to an appropriate value" + cat .warnings + rm .warnings + RETURNCODE=1 + [ "$CONTINUEONERROR" ] || exit 1 + fi + rm .warnings + + rm .listnewconfig + + make ARCH=$arch KCONFIG_CONFIG=$cfgorig olddefconfig > /dev/null || exit 1 echo "# $arch" > ${cfgtmp} - cat "${cfg}" >> ${cfgtmp} + cat "${cfgorig}" >> ${cfgtmp} if test -n "$CHECKOPTIONS" then - checkoptions $cfgtmp $cfgorig + checkoptions $cfg $cfgtmp + fi + # if test run, don't overwrite original + if test -n "$TESTRUN" + then + rm ${cfgtmp} + else + mv ${cfgtmp} ${cfg} fi - mv ${cfgtmp} ${cfg} rm ${cfgorig} echo "done" done - rm "$SCRIPT_DIR"/*.config.old + rm "$SCRIPT_DIR"/*.config*.old popd > /dev/null echo "Processed config files are in $SCRIPT_DIR" } -NEWOPTIONS="" CHECKOPTIONS="" +CONTINUEONERROR="" +NEWOPTIONS="" +TESTRUN="" +CHECKWARNINGS="" + +RETURNCODE=0 while [[ $# -gt 0 ]] do key="$1" case $key in - -n) + -a) + CHECKOPTIONS="x" + CONTINUEONERROR="x" NEWOPTIONS="x" + CHECKWARNINGS="x" ;; -c) CHECKOPTIONS="x" ;; + -h) + usage + ;; + -i) + CONTINUEONERROR="x" + ;; + -n) + NEWOPTIONS="x" + ;; + -t) + TESTRUN="x" + ;; + -w) + CHECKWARNINGS="x" + ;; *) break;; esac @@ -133,3 +195,4 @@ SCRIPT_DIR="$(dirname $SCRIPT)" cd $SCRIPT_DIR process_configs +exit $RETURNCODE diff --git a/cpupower.config b/cpupower.config new file mode 100644 index 000000000..e69de29bb diff --git a/cpupower.service b/cpupower.service new file mode 100644 index 000000000..e69de29bb diff --git a/crash-driver.patch b/crash-driver.patch deleted file mode 100644 index 164dc90f5..000000000 --- a/crash-driver.patch +++ /dev/null @@ -1,722 +0,0 @@ -From 973e23bf27b0b2e5021321357fc570cccea3104c Mon Sep 17 00:00:00 2001 -From: Dave Anderson -Date: Tue, 26 Nov 2013 12:42:46 -0500 -Subject: [PATCH] crash-driver - -Bugzilla: N/A -Upstream-status: Fedora mustard ---- - arch/arm/include/asm/crash-driver.h | 6 ++ - arch/arm64/include/asm/crash-driver.h | 6 ++ - arch/ia64/include/asm/crash-driver.h | 90 ++++++++++++++++++++++ - arch/ia64/kernel/ia64_ksyms.c | 3 + - arch/powerpc/include/asm/crash-driver.h | 6 ++ - arch/s390/include/asm/crash-driver.h | 60 +++++++++++++++ - arch/s390/mm/maccess.c | 2 + - arch/x86/include/asm/crash-driver.h | 6 ++ - drivers/char/Kconfig | 3 + - drivers/char/Makefile | 2 + - drivers/char/crash.c | 128 ++++++++++++++++++++++++++++++++ - include/asm-generic/crash-driver.h | 72 ++++++++++++++++++ - 12 files changed, 384 insertions(+) - create mode 100644 arch/arm/include/asm/crash-driver.h - create mode 100644 arch/arm64/include/asm/crash-driver.h - create mode 100644 arch/ia64/include/asm/crash-driver.h - create mode 100644 arch/powerpc/include/asm/crash-driver.h - create mode 100644 arch/s390/include/asm/crash-driver.h - create mode 100644 arch/x86/include/asm/crash-driver.h - create mode 100644 drivers/char/crash.c - create mode 100644 include/asm-generic/crash-driver.h - -diff --git a/arch/arm/include/asm/crash-driver.h b/arch/arm/include/asm/crash-driver.h -new file mode 100644 -index 0000000..06e7ae9 ---- /dev/null -+++ b/arch/arm/include/asm/crash-driver.h -@@ -0,0 +1,6 @@ -+#ifndef _ARM_CRASH_H -+#define _ARM_CRASH_H -+ -+#include -+ -+#endif /* _ARM_CRASH_H */ -diff --git a/arch/arm64/include/asm/crash-driver.h b/arch/arm64/include/asm/crash-driver.h -new file mode 100644 -index 0000000..43b26da ---- /dev/null -+++ b/arch/arm64/include/asm/crash-driver.h -@@ -0,0 +1,6 @@ -+#ifndef _ARM64_CRASH_H -+#define _ARM64_CRASH_H -+ -+#include -+ -+#endif /* _ARM64_CRASH_H */ -diff --git a/arch/ia64/include/asm/crash-driver.h b/arch/ia64/include/asm/crash-driver.h -new file mode 100644 -index 0000000..404bcb9 ---- /dev/null -+++ b/arch/ia64/include/asm/crash-driver.h -@@ -0,0 +1,90 @@ -+#ifndef _ASM_IA64_CRASH_H -+#define _ASM_IA64_CRASH_H -+ -+/* -+ * linux/include/asm-ia64/crash-driver.h -+ * -+ * Copyright (c) 2004 Red Hat, Inc. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifdef __KERNEL__ -+ -+#include -+#include -+#include -+ -+static inline void * -+map_virtual(u64 offset, struct page **pp) -+{ -+ struct page *page; -+ unsigned long pfn; -+ u32 type; -+ -+ if (REGION_NUMBER(offset) == 5) { -+ char byte; -+ -+ if (__get_user(byte, (char *)offset) == 0) -+ return (void *)offset; -+ else -+ return NULL; -+ } -+ -+ switch (type = efi_mem_type(offset)) -+ { -+ case EFI_LOADER_CODE: -+ case EFI_LOADER_DATA: -+ case EFI_BOOT_SERVICES_CODE: -+ case EFI_BOOT_SERVICES_DATA: -+ case EFI_CONVENTIONAL_MEMORY: -+ break; -+ -+ default: -+ printk(KERN_INFO -+ "crash memory driver: invalid memory type for %lx: %d\n", -+ offset, type); -+ return NULL; -+ } -+ -+ pfn = offset >> PAGE_SHIFT; -+ -+ if (!pfn_valid(pfn)) { -+ printk(KERN_INFO -+ "crash memory driver: invalid pfn: %lx )\n", pfn); -+ return NULL; -+ } -+ -+ page = pfn_to_page(pfn); -+ -+ if (!page->virtual) { -+ printk(KERN_INFO -+ "crash memory driver: offset: %lx page: %lx page->virtual: NULL\n", -+ offset, (unsigned long)page); -+ return NULL; -+ } -+ -+ return (page->virtual + (offset & (PAGE_SIZE-1))); -+} -+ -+static inline void unmap_virtual(struct page *page) -+{ -+ return; -+} -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _ASM_IA64_CRASH_H */ -diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c -index d111248..b14b4c6 100644 ---- a/arch/ia64/kernel/ia64_ksyms.c -+++ b/arch/ia64/kernel/ia64_ksyms.c -@@ -9,3 +9,6 @@ - EXPORT_SYMBOL(min_low_pfn); /* defined by bootmem.c, but not exported by generic code */ - EXPORT_SYMBOL(max_low_pfn); /* defined by bootmem.c, but not exported by generic code */ - #endif -+ -+#include -+EXPORT_SYMBOL_GPL(efi_mem_type); -diff --git a/arch/powerpc/include/asm/crash-driver.h b/arch/powerpc/include/asm/crash-driver.h -new file mode 100644 -index 0000000..50092d9 ---- /dev/null -+++ b/arch/powerpc/include/asm/crash-driver.h -@@ -0,0 +1,6 @@ -+#ifndef _PPC64_CRASH_H -+#define _PPC64_CRASH_H -+ -+#include -+ -+#endif /* _PPC64_CRASH_H */ -diff --git a/arch/s390/include/asm/crash-driver.h b/arch/s390/include/asm/crash-driver.h -new file mode 100644 -index 0000000..552be5e ---- /dev/null -+++ b/arch/s390/include/asm/crash-driver.h -@@ -0,0 +1,60 @@ -+#ifndef _S390_CRASH_H -+#define _S390_CRASH_H -+ -+#ifdef __KERNEL__ -+ -+#include -+#include -+ -+/* -+ * For swapped prefix pages get bounce buffer using xlate_dev_mem_ptr() -+ */ -+static inline void *map_virtual(u64 offset, struct page **pp) -+{ -+ struct page *page; -+ unsigned long pfn; -+ void *vaddr; -+ -+ vaddr = xlate_dev_mem_ptr(offset); -+ pfn = ((unsigned long) vaddr) >> PAGE_SHIFT; -+ if ((unsigned long) vaddr != offset) -+ page = pfn_to_page(pfn); -+ else -+ page = NULL; -+ -+ if (!page_is_ram(pfn)) { -+ printk(KERN_INFO -+ "crash memory driver: !page_is_ram(pfn: %lx)\n", pfn); -+ return NULL; -+ } -+ -+ if (!pfn_valid(pfn)) { -+ printk(KERN_INFO -+ "crash memory driver: invalid pfn: %lx )\n", pfn); -+ return NULL; -+ } -+ -+ *pp = page; -+ return vaddr; -+} -+ -+/* -+ * Free bounce buffer if necessary -+ */ -+static inline void unmap_virtual(struct page *page) -+{ -+ void *vaddr; -+ -+ if (page) { -+ /* -+ * Because for bounce buffers vaddr will never be 0 -+ * unxlate_dev_mem_ptr() will always free the bounce buffer. -+ */ -+ vaddr = (void *)(page_to_pfn(page) << PAGE_SHIFT); -+ unxlate_dev_mem_ptr(0, vaddr); -+ } -+} -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _S390_CRASH_H */ -diff --git a/arch/s390/mm/maccess.c b/arch/s390/mm/maccess.c -index 792f9c6..3197995 100644 ---- a/arch/s390/mm/maccess.c -+++ b/arch/s390/mm/maccess.c -@@ -201,6 +201,7 @@ void *xlate_dev_mem_ptr(phys_addr_t addr) - put_online_cpus(); - return bounce; - } -+EXPORT_SYMBOL_GPL(xlate_dev_mem_ptr); - - /* - * Free converted buffer for /dev/mem access (if necessary) -@@ -210,3 +211,4 @@ void unxlate_dev_mem_ptr(phys_addr_t addr, void *buf) - if ((void *) addr != buf) - free_page((unsigned long) buf); - } -+EXPORT_SYMBOL_GPL(unxlate_dev_mem_ptr); -diff --git a/arch/x86/include/asm/crash-driver.h b/arch/x86/include/asm/crash-driver.h -new file mode 100644 -index 0000000..fd4736e ---- /dev/null -+++ b/arch/x86/include/asm/crash-driver.h -@@ -0,0 +1,6 @@ -+#ifndef _X86_CRASH_H -+#define _X86_CRASH_H -+ -+#include -+ -+#endif /* _X86_CRASH_H */ -diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig -index dcc0973..99b99d5 100644 ---- a/drivers/char/Kconfig -+++ b/drivers/char/Kconfig -@@ -4,6 +4,9 @@ - - menu "Character devices" - -+config CRASH -+ tristate "Crash Utility memory driver" -+ - source "drivers/tty/Kconfig" - - config DEVMEM -diff --git a/drivers/char/Makefile b/drivers/char/Makefile -index 6e6c244..29cc9c8 100644 ---- a/drivers/char/Makefile -+++ b/drivers/char/Makefile -@@ -58,3 +58,5 @@ js-rtc-y = rtc.o - obj-$(CONFIG_XILLYBUS) += xillybus/ - obj-$(CONFIG_POWERNV_OP_PANEL) += powernv-op-panel.o - obj-$(CONFIG_ADI) += adi.o -+ -+obj-$(CONFIG_CRASH) += crash.o -diff --git a/drivers/char/crash.c b/drivers/char/crash.c -new file mode 100644 -index 0000000..085378a ---- /dev/null -+++ b/drivers/char/crash.c -@@ -0,0 +1,128 @@ -+/* -+ * linux/drivers/char/crash.c -+ * -+ * Copyright (C) 2004 Dave Anderson -+ * Copyright (C) 2004 Red Hat, Inc. -+ */ -+ -+/****************************************************************************** -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ *****************************************************************************/ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define CRASH_VERSION "1.0" -+ -+/* -+ * These are the file operation functions that allow crash utility -+ * access to physical memory. -+ */ -+ -+static loff_t -+crash_llseek(struct file * file, loff_t offset, int orig) -+{ -+ switch (orig) { -+ case 0: -+ file->f_pos = offset; -+ return file->f_pos; -+ case 1: -+ file->f_pos += offset; -+ return file->f_pos; -+ default: -+ return -EINVAL; -+ } -+} -+ -+/* -+ * Determine the page address for an address offset value, -+ * get a virtual address for it, and copy it out. -+ * Accesses must fit within a page. -+ */ -+static ssize_t -+crash_read(struct file *file, char *buf, size_t count, loff_t *poff) -+{ -+ void *vaddr; -+ struct page *page; -+ u64 offset; -+ ssize_t read; -+ -+ offset = *poff; -+ if (offset >> PAGE_SHIFT != (offset+count-1) >> PAGE_SHIFT) -+ return -EINVAL; -+ -+ vaddr = map_virtual(offset, &page); -+ if (!vaddr) -+ return -EFAULT; -+ -+ if (copy_to_user(buf, vaddr, count)) { -+ unmap_virtual(page); -+ return -EFAULT; -+ } -+ unmap_virtual(page); -+ -+ read = count; -+ *poff += read; -+ return read; -+} -+ -+static struct file_operations crash_fops = { -+ .owner = THIS_MODULE, -+ .llseek = crash_llseek, -+ .read = crash_read, -+}; -+ -+static struct miscdevice crash_dev = { -+ MISC_DYNAMIC_MINOR, -+ "crash", -+ &crash_fops -+}; -+ -+static int __init -+crash_init(void) -+{ -+ int ret; -+ -+ ret = misc_register(&crash_dev); -+ if (ret) { -+ printk(KERN_ERR -+ "crash memory driver: cannot misc_register (MISC_DYNAMIC_MINOR)\n"); -+ goto out; -+ } -+ -+ ret = 0; -+ printk(KERN_INFO "crash memory driver: version %s\n", CRASH_VERSION); -+out: -+ return ret; -+} -+ -+static void __exit -+crash_cleanup_module(void) -+{ -+ misc_deregister(&crash_dev); -+} -+ -+module_init(crash_init); -+module_exit(crash_cleanup_module); -+ -+MODULE_LICENSE("GPL"); -diff --git a/include/asm-generic/crash-driver.h b/include/asm-generic/crash-driver.h -new file mode 100644 -index 0000000..25ab986 ---- /dev/null -+++ b/include/asm-generic/crash-driver.h -@@ -0,0 +1,72 @@ -+#ifndef __CRASH_H__ -+#define __CRASH_H__ -+ -+/* -+ * include/linux/crash-driver.h -+ * -+ * Copyright (c) 2013 Red Hat, Inc. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifdef __KERNEL__ -+ -+#include -+#include -+ -+static inline void * -+map_virtual(u64 offset, struct page **pp) -+{ -+ struct page *page; -+ unsigned long pfn; -+ void *vaddr; -+ -+ pfn = (unsigned long)(offset >> PAGE_SHIFT); -+ -+ if (!page_is_ram(pfn)) { -+ printk(KERN_INFO -+ "crash memory driver: !page_is_ram(pfn: %lx)\n", pfn); -+ return NULL; -+ } -+ -+ if (!pfn_valid(pfn)) { -+ printk(KERN_INFO -+ "crash memory driver: invalid pfn: %lx )\n", pfn); -+ return NULL; -+ } -+ -+ page = pfn_to_page(pfn); -+ -+ vaddr = kmap(page); -+ if (!vaddr) { -+ printk(KERN_INFO -+ "crash memory driver: pfn: %lx kmap(page: %lx) failed\n", -+ pfn, (unsigned long)page); -+ return NULL; -+ } -+ -+ *pp = page; -+ return (vaddr + (offset & (PAGE_SIZE-1))); -+} -+ -+static inline void unmap_virtual(struct page *page) -+{ -+ kunmap(page); -+} -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* __CRASH_H__ */ --- -2.7.4 - -From 23d8bd48303acda2d3a95a3e1a662784a4fa9fcd Mon Sep 17 00:00:00 2001 -From: Fedora Kernel Team -Date: Tue, 20 Sep 2016 19:39:46 +0200 -Subject: [PATCH] Update of crash driver to handle CONFIG_HARDENED_USERCOPY and - to restrict the supported architectures. - ---- - drivers/char/Kconfig | 1 + - drivers/char/crash.c | 33 ++++++++++++++++++++++++++++++--- - 2 files changed, 31 insertions(+), 3 deletions(-) - -diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig -index 99b99d5..be6a3ae 100644 ---- a/drivers/char/Kconfig -+++ b/drivers/char/Kconfig -@@ -6,6 +6,7 @@ menu "Character devices" - - config CRASH - tristate "Crash Utility memory driver" -+ depends on X86_32 || X86_64 || ARM || ARM64 || PPC64 || S390 - - source "drivers/tty/Kconfig" - -diff --git a/drivers/char/crash.c b/drivers/char/crash.c -index 085378a..0258bf8 100644 ---- a/drivers/char/crash.c -+++ b/drivers/char/crash.c -@@ -32,7 +32,7 @@ - #include - #include - --#define CRASH_VERSION "1.0" -+#define CRASH_VERSION "1.2" - - /* - * These are the file operation functions that allow crash utility -@@ -66,6 +66,7 @@ crash_read(struct file *file, char *buf, size_t count, loff_t *poff) - struct page *page; - u64 offset; - ssize_t read; -+ char *buffer = file->private_data; - - offset = *poff; - if (offset >> PAGE_SHIFT != (offset+count-1) >> PAGE_SHIFT) -@@ -74,8 +75,12 @@ crash_read(struct file *file, char *buf, size_t count, loff_t *poff) - vaddr = map_virtual(offset, &page); - if (!vaddr) - return -EFAULT; -- -- if (copy_to_user(buf, vaddr, count)) { -+ /* -+ * Use bounce buffer to bypass the CONFIG_HARDENED_USERCOPY -+ * kernel text restriction. -+ */ -+ memcpy(buffer, (char *)vaddr, count); -+ if (copy_to_user(buf, buffer, count)) { - unmap_virtual(page); - return -EFAULT; - } -@@ -86,10 +91,32 @@ crash_read(struct file *file, char *buf, size_t count, loff_t *poff) - return read; - } - -+static int -+crash_open(struct inode * inode, struct file * filp) -+{ -+ if (!capable(CAP_SYS_RAWIO)) -+ return -EPERM; -+ -+ filp->private_data = (void *)__get_free_page(GFP_KERNEL); -+ if (!filp->private_data) -+ return -ENOMEM; -+ -+ return 0; -+} -+ -+static int -+crash_release(struct inode *inode, struct file *filp) -+{ -+ free_pages((unsigned long)filp->private_data, 0); -+ return 0; -+} -+ - static struct file_operations crash_fops = { - .owner = THIS_MODULE, - .llseek = crash_llseek, - .read = crash_read, -+ .open = crash_open, -+ .release = crash_release, - }; - - static struct miscdevice crash_dev = { --- -2.7.4 - -From: Dave Anderson -Date: Fri, 18 Nov 2016 11:52:35 -0500 -Cc: onestero@redhat.com -Subject: [PATCH v2] Restore live system crash analysis for ARM64 - -This v2 version simplifies the copy out of the kimage_voffset value -to user-space per Oleg's suggestion. - -Upstream status: N/A - -Test: v2 version tested successfully with a modified crash utility - -The following Linux 4.6 commit breaks support for live system -crash analysis on ARM64: - - commit a7f8de168ace487fa7b88cb154e413cf40e87fc6 - Author: Ard Biesheuvel - arm64: allow kernel Image to be loaded anywhere in physical memory - -The patchset drastically modified the kernel's virtual memory layout, -where notably the static kernel text and data image was moved from the -unity mapped region into the vmalloc region. Prior to Linux 4.6, -the kernel's __virt_to_phys() function was this: - - #define __virt_to_phys(x) (((phys_addr_t)(x) - PAGE_OFFSET + PHYS_OFFSET)) - -When running on a live system, the crash utility could determine PAGE_OFFSET -by looking at the virtual addresses compiled into the vmlinux file, and -PHYS_OFFSET can be determined by looking at /proc/iomem. - -As of Linux 4.6, it is done differently: - - #define __virt_to_phys(x) ({ \ - phys_addr_t __x = (phys_addr_t)(x); \ - __x & BIT(VA_BITS - 1) ? (__x & ~PAGE_OFFSET) + PHYS_OFFSET : \ - (__x - kimage_voffset); }) - -The PAGE_OFFSET/PHYS_OFFSET section of the conditional expression is for -traditional unity-mapped virtual addresses, but kernel text and static -data requires the new "kimage_voffset" variable. Unfortunately, the -contents of the new "kimage_voffset" variable is not available or -calculatable from a user-space perspective, even with root privileges. - -At least the ARM64 developers made its contents available to modules -with an EXPORT_SYMBOL(kimage_voffset) declaration. Accordingly, with -a modification to the /dev/crash driver to return its contents, the -crash utility can run on a live system. - -The patch allows for architecture-specific DEV_CRASH_ARCH_DATA ioctls -to be created, where this is the first instance of one. - - ---- - arch/arm64/include/asm/crash-driver.h | 16 ++++++++++++++++ - drivers/char/crash.c | 13 ++++++++++++- - 2 files changed, 28 insertions(+), 1 deletion(-) - -diff --git a/arch/arm64/include/asm/crash-driver.h b/arch/arm64/include/asm/crash-driver.h -index 43b26da..fe68e7c 100644 ---- a/arch/arm64/include/asm/crash-driver.h -+++ b/arch/arm64/include/asm/crash-driver.h -@@ -3,4 +3,20 @@ - - #include - -+#define DEV_CRASH_ARCH_DATA _IOR('c', 1, long) -+ -+static long -+crash_arch_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -+{ -+ extern u64 kimage_voffset; -+ -+ switch (cmd) -+ { -+ case DEV_CRASH_ARCH_DATA: -+ return put_user(kimage_voffset, (unsigned long __user *)arg); -+ default: -+ return -EINVAL; -+ } -+} -+ - #endif /* _ARM64_CRASH_H */ -diff --git a/drivers/char/crash.c b/drivers/char/crash.c -index 0258bf8..dfb767c 100644 ---- a/drivers/char/crash.c -+++ b/drivers/char/crash.c -@@ -32,7 +32,7 @@ - #include - #include - --#define CRASH_VERSION "1.2" -+#define CRASH_VERSION "1.3" - - /* - * These are the file operation functions that allow crash utility -@@ -111,10 +111,21 @@ crash_release(struct inode *inode, struct file *filp) - return 0; - } - -+static long -+crash_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -+{ -+#ifdef DEV_CRASH_ARCH_DATA -+ return crash_arch_ioctl(file, cmd, arg); -+#else -+ return -EINVAL; -+#endif -+} -+ - static struct file_operations crash_fops = { - .owner = THIS_MODULE, - .llseek = crash_llseek, - .read = crash_read, -+ .unlocked_ioctl = crash_ioctl, - .open = crash_open, - .release = crash_release, - }; --- -1.8.3.1 - diff --git a/die-floppy-die.patch b/die-floppy-die.patch deleted file mode 100644 index caaa2dde5..000000000 --- a/die-floppy-die.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Kyle McMartin -Date: Tue, 30 Mar 2010 00:04:29 -0400 -Subject: [PATCH] die-floppy-die - -Kill the floppy.ko pnp modalias. We were surviving just fine without -autoloading floppy drivers, tyvm. - -Please feel free to register all complaints in the wastepaper bin. - -Bugzilla: N/A -Upstream-status: Fedora mustard ---- - drivers/block/floppy.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c -index a08cda955285..e320e1e679cf 100644 ---- a/drivers/block/floppy.c -+++ b/drivers/block/floppy.c -@@ -4633,8 +4633,7 @@ static const struct pnp_device_id floppy_pnpids[] = { - {"PNP0700", 0}, - {} - }; -- --MODULE_DEVICE_TABLE(pnp, floppy_pnpids); -+/* MODULE_DEVICE_TABLE(pnp, floppy_pnpids); */ - - #else - diff --git a/drm-i915-hush-check-crtc-state.patch b/drm-i915-hush-check-crtc-state.patch deleted file mode 100644 index 6e2481838..000000000 --- a/drm-i915-hush-check-crtc-state.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 8f8f3ee1e3ae35df618761475293dc5d8285b6e0 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Mon, 10 Jul 2017 08:11:48 -0700 -Subject: [PATCH] drm/i915: hush check crtc state - -This is _by far_ the most common backtrace for i915 on retrace.fp.o, and -it's mostly useless noise. There's not enough context when it's generated -to know if something actually went wrong. Downgrade the message to -KMS debugging so we can still get it if we want it. - -Bugzilla: 1027037 1028785 -Upstream-status: http://lists.freedesktop.org/archives/intel-gfx/2013-November/035948.html ---- - drivers/gpu/drm/i915/display/intel_display.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c -index 8592a7d422de..e915cf6b0ba6 100644 ---- a/drivers/gpu/drm/i915/display/intel_display.c -+++ b/drivers/gpu/drm/i915/display/intel_display.c -@@ -12982,7 +12982,7 @@ verify_crtc_state(struct drm_crtc *crtc, - - sw_config = to_intel_crtc_state(new_crtc_state); - if (!intel_pipe_config_compare(sw_config, pipe_config, false)) { -- I915_STATE_WARN(1, "pipe state doesn't match!\n"); -+ DRM_DEBUG_KMS(1, "pipe state doesn't match!\n"); - intel_dump_pipe_config(pipe_config, NULL, "[hw state]"); - intel_dump_pipe_config(sw_config, NULL, "[sw state]"); - } --- -2.21.0 - diff --git a/dwc3-fix.patch b/dwc3-fix.patch deleted file mode 100644 index d741b9e2e..000000000 --- a/dwc3-fix.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 4749e0e61241cc121de572520a39dab365b9ea1d Mon Sep 17 00:00:00 2001 -From: Thinh Nguyen -Date: Thu, 8 Aug 2019 16:39:42 -0700 -Subject: usb: dwc3: Update soft-reset wait polling rate - -Starting from DWC_usb31 version 1.90a and later, the DCTL.CSFRST bit -will not be cleared until after all the internal clocks are synchronized -during soft-reset. This may take a little more than 50ms. Set the -polling rate at 20ms instead. - -Signed-off-by: Thinh Nguyen -Signed-off-by: Felipe Balbi ---- - drivers/usb/dwc3/core.c | 23 ++++++++++++++++++----- - drivers/usb/dwc3/core.h | 2 ++ - 2 files changed, 20 insertions(+), 5 deletions(-) - -diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c -index 98bce85c29d0..252c397860ef 100644 ---- a/drivers/usb/dwc3/core.c -+++ b/drivers/usb/dwc3/core.c -@@ -252,12 +252,25 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc) - reg |= DWC3_DCTL_CSFTRST; - dwc3_writel(dwc->regs, DWC3_DCTL, reg); - -+ /* -+ * For DWC_usb31 controller 1.90a and later, the DCTL.CSFRST bit -+ * is cleared only after all the clocks are synchronized. This can -+ * take a little more than 50ms. Set the polling rate at 20ms -+ * for 10 times instead. -+ */ -+ if (dwc3_is_usb31(dwc) && dwc->revision >= DWC3_USB31_REVISION_190A) -+ retries = 10; -+ - do { - reg = dwc3_readl(dwc->regs, DWC3_DCTL); - if (!(reg & DWC3_DCTL_CSFTRST)) - goto done; - -- udelay(1); -+ if (dwc3_is_usb31(dwc) && -+ dwc->revision >= DWC3_USB31_REVISION_190A) -+ msleep(20); -+ else -+ udelay(1); - } while (--retries); - - phy_exit(dwc->usb3_generic_phy); -@@ -267,11 +280,11 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc) - - done: - /* -- * For DWC_usb31 controller, once DWC3_DCTL_CSFTRST bit is cleared, -- * we must wait at least 50ms before accessing the PHY domain -- * (synchronization delay). DWC_usb31 programming guide section 1.3.2. -+ * For DWC_usb31 controller 1.80a and prior, once DCTL.CSFRST bit -+ * is cleared, we must wait at least 50ms before accessing the PHY -+ * domain (synchronization delay). - */ -- if (dwc3_is_usb31(dwc)) -+ if (dwc3_is_usb31(dwc) && dwc->revision <= DWC3_USB31_REVISION_180A) - msleep(50); - - return 0; -diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h -index 3dd783b889cb..1c8b349379af 100644 ---- a/drivers/usb/dwc3/core.h -+++ b/drivers/usb/dwc3/core.h -@@ -1137,6 +1137,8 @@ struct dwc3 { - #define DWC3_USB31_REVISION_120A (0x3132302a | DWC3_REVISION_IS_DWC31) - #define DWC3_USB31_REVISION_160A (0x3136302a | DWC3_REVISION_IS_DWC31) - #define DWC3_USB31_REVISION_170A (0x3137302a | DWC3_REVISION_IS_DWC31) -+#define DWC3_USB31_REVISION_180A (0x3138302a | DWC3_REVISION_IS_DWC31) -+#define DWC3_USB31_REVISION_190A (0x3139302a | DWC3_REVISION_IS_DWC31) - - u32 version_type; - --- -cgit 1.2-0.3.lf.el7 - diff --git a/efi-lockdown.patch b/efi-lockdown.patch deleted file mode 100644 index 75d4b7ed7..000000000 --- a/efi-lockdown.patch +++ /dev/null @@ -1,2173 +0,0 @@ -From 4f426f922e12f0ffaed373536f68531e18d68495 Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Mon, 18 Feb 2019 12:44:57 +0000 -Subject: [PATCH 01/29] Add the ability to lock down access to the running - kernel image - -Provide a single call to allow kernel code to determine whether the system -should be locked down, thereby disallowing various accesses that might -allow the running kernel image to be changed including the loading of -modules that aren't validly signed with a key we recognise, fiddling with -MSR registers and disallowing hibernation. - -Signed-off-by: David Howells -Acked-by: James Morris -Signed-off-by: Matthew Garrett ---- - include/linux/kernel.h | 17 ++++++++++++ - include/linux/security.h | 9 +++++- - security/Kconfig | 15 ++++++++++ - security/Makefile | 3 ++ - security/lock_down.c | 60 ++++++++++++++++++++++++++++++++++++++++ - 5 files changed, 103 insertions(+), 1 deletion(-) - create mode 100644 security/lock_down.c - -diff --git a/include/linux/kernel.h b/include/linux/kernel.h -index 0c9bc231107f..f71008b0a641 100644 ---- a/include/linux/kernel.h -+++ b/include/linux/kernel.h -@@ -312,6 +312,23 @@ static inline void refcount_error_report(struct pt_regs *regs, const char *err) - { } - #endif - -+#ifdef CONFIG_LOCK_DOWN_KERNEL -+extern bool __kernel_is_locked_down(const char *what, bool first); -+#else -+static inline bool __kernel_is_locked_down(const char *what, bool first) -+{ -+ return false; -+} -+#endif -+ -+#define kernel_is_locked_down(what) \ -+ ({ \ -+ static bool message_given; \ -+ bool locked_down = __kernel_is_locked_down(what, !message_given); \ -+ message_given = true; \ -+ locked_down; \ -+ }) -+ - /* Internal, do not use. */ - int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res); - int __must_check _kstrtol(const char *s, unsigned int base, long *res); -diff --git a/include/linux/security.h b/include/linux/security.h -index 5f7441abbf42..fd7579c879a6 100644 ---- a/include/linux/security.h -+++ b/include/linux/security.h -@@ -1829,5 +1829,12 @@ static inline void security_bpf_prog_free(struct bpf_prog_aux *aux) - #endif /* CONFIG_SECURITY */ - #endif /* CONFIG_BPF_SYSCALL */ - --#endif /* ! __LINUX_SECURITY_H */ -+#ifdef CONFIG_LOCK_DOWN_KERNEL -+extern void __init init_lockdown(void); -+#else -+static inline void __init init_lockdown(void) -+{ -+} -+#endif - -+#endif /* ! __LINUX_SECURITY_H */ -diff --git a/security/Kconfig b/security/Kconfig -index 06a30851511a..720cf9dee2b4 100644 ---- a/security/Kconfig -+++ b/security/Kconfig -@@ -230,6 +230,21 @@ config STATIC_USERMODEHELPER_PATH - If you wish for all usermode helper programs to be disabled, - specify an empty string here (i.e. ""). - -+config LOCK_DOWN_KERNEL -+ bool "Allow the kernel to be 'locked down'" -+ help -+ Allow the kernel to be locked down. If lockdown support is enabled -+ and activated, the kernel will impose additional restrictions -+ intended to prevent uid 0 from being able to modify the running -+ kernel. This may break userland applications that rely on low-level -+ access to hardware. -+ -+config LOCK_DOWN_KERNEL_FORCE -+ bool "Enable kernel lockdown mode automatically" -+ depends on LOCK_DOWN_KERNEL -+ help -+ Enable the kernel lock down functionality automatically at boot. -+ - source "security/selinux/Kconfig" - source "security/smack/Kconfig" - source "security/tomoyo/Kconfig" -diff --git a/security/Makefile b/security/Makefile -index c598b904938f..5ff090149c88 100644 ---- a/security/Makefile -+++ b/security/Makefile -@@ -32,3 +32,6 @@ obj-$(CONFIG_CGROUP_DEVICE) += device_cgroup.o - # Object integrity file lists - subdir-$(CONFIG_INTEGRITY) += integrity - obj-$(CONFIG_INTEGRITY) += integrity/ -+ -+# Allow the kernel to be locked down -+obj-$(CONFIG_LOCK_DOWN_KERNEL) += lock_down.o -diff --git a/security/lock_down.c b/security/lock_down.c -new file mode 100644 -index 000000000000..18d8776a4d02 ---- /dev/null -+++ b/security/lock_down.c -@@ -0,0 +1,60 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* Lock down the kernel -+ * -+ * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#include -+#include -+ -+static __ro_after_init bool kernel_locked_down; -+ -+/* -+ * Put the kernel into lock-down mode. -+ */ -+static void __init lock_kernel_down(const char *where) -+{ -+ if (!kernel_locked_down) { -+ kernel_locked_down = true; -+ pr_notice("Kernel is locked down from %s; see man kernel_lockdown.7\n", -+ where); -+ } -+} -+ -+static int __init lockdown_param(char *ignored) -+{ -+ lock_kernel_down("command line"); -+ return 0; -+} -+ -+early_param("lockdown", lockdown_param); -+ -+/* -+ * Lock the kernel down from very early in the arch setup. This must happen -+ * prior to things like ACPI being initialised. -+ */ -+void __init init_lockdown(void) -+{ -+#ifdef CONFIG_LOCK_DOWN_FORCE -+ lock_kernel_down("Kernel configuration"); -+#endif -+} -+ -+/** -+ * kernel_is_locked_down - Find out if the kernel is locked down -+ * @what: Tag to use in notice generated if lockdown is in effect -+ */ -+bool __kernel_is_locked_down(const char *what, bool first) -+{ -+ if (what && first && kernel_locked_down) -+ pr_notice("Lockdown: %s is restricted; see man kernel_lockdown.7\n", -+ what); -+ return kernel_locked_down; -+} -+EXPORT_SYMBOL(__kernel_is_locked_down); --- -2.21.0 - - -From 7b3d34ce99e1db6152f3f350f7512ed67712d2bb Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Mon, 18 Feb 2019 12:44:58 +0000 -Subject: [PATCH 02/29] Enforce module signatures if the kernel is locked down - -If the kernel is locked down, require that all modules have valid -signatures that we can verify. - -I have adjusted the errors generated: - - (1) If there's no signature (ENODATA) or we can't check it (ENOPKG, - ENOKEY), then: - - (a) If signatures are enforced then EKEYREJECTED is returned. - - (b) If there's no signature or we can't check it, but the kernel is - locked down then EPERM is returned (this is then consistent with - other lockdown cases). - - (2) If the signature is unparseable (EBADMSG, EINVAL), the signature fails - the check (EKEYREJECTED) or a system error occurs (eg. ENOMEM), we - return the error we got. - -Note that the X.509 code doesn't check for key expiry as the RTC might not -be valid or might not have been transferred to the kernel's clock yet. - - [Modified by Matthew Garrett to remove the IMA integration. This will - be replaced with integration with the IMA architecture policy - patchset.] - -Signed-off-by: David Howells -Reviewed-by: Jiri Bohac -Signed-off-by: Matthew Garrett -Cc: Jessica Yu ---- - kernel/module.c | 39 ++++++++++++++++++++++++++++++++------- - 1 file changed, 32 insertions(+), 7 deletions(-) - -diff --git a/kernel/module.c b/kernel/module.c -index a2cee14a83f3..c771a183b741 100644 ---- a/kernel/module.c -+++ b/kernel/module.c -@@ -2753,8 +2753,9 @@ static inline void kmemleak_load_module(const struct module *mod, - #ifdef CONFIG_MODULE_SIG - static int module_sig_check(struct load_info *info, int flags) - { -- int err = -ENOKEY; -+ int err = -ENODATA; - const unsigned long markerlen = sizeof(MODULE_SIG_STRING) - 1; -+ const char *reason; - const void *mod = info->hdr; - - /* -@@ -2769,16 +2770,40 @@ static int module_sig_check(struct load_info *info, int flags) - err = mod_verify_sig(mod, info); - } - -- if (!err) { -+ switch (err) { -+ case 0: - info->sig_ok = true; - return 0; -- } - -- /* Not having a signature is only an error if we're strict. */ -- if (err == -ENOKEY && !is_module_sig_enforced()) -- err = 0; -+ /* We don't permit modules to be loaded into trusted kernels -+ * without a valid signature on them, but if we're not -+ * enforcing, certain errors are non-fatal. -+ */ -+ case -ENODATA: -+ reason = "Loading of unsigned module"; -+ goto decide; -+ case -ENOPKG: -+ reason = "Loading of module with unsupported crypto"; -+ goto decide; -+ case -ENOKEY: -+ reason = "Loading of module with unavailable key"; -+ decide: -+ if (is_module_sig_enforced()) { -+ pr_notice("%s is rejected\n", reason); -+ return -EKEYREJECTED; -+ } - -- return err; -+ if (kernel_is_locked_down(reason)) -+ return -EPERM; -+ return 0; -+ -+ /* All other errors are fatal, including nomem, unparseable -+ * signatures and signature check failures - even if signatures -+ * aren't required. -+ */ -+ default: -+ return err; -+ } - } - #else /* !CONFIG_MODULE_SIG */ - static int module_sig_check(struct load_info *info, int flags) --- -2.21.0 - - -From e6cee3fcc560211fbc3d1efaf048ad4b987a4b73 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Mon, 18 Feb 2019 12:44:58 +0000 -Subject: [PATCH 03/29] Restrict /dev/{mem,kmem,port} when the kernel is locked - down - -Allowing users to read and write to core kernel memory makes it possible -for the kernel to be subverted, avoiding module loading restrictions, and -also to steal cryptographic information. - -Disallow /dev/mem and /dev/kmem from being opened this when the kernel has -been locked down to prevent this. - -Also disallow /dev/port from being opened to prevent raw ioport access and -thus DMA from being used to accomplish the same thing. - -Signed-off-by: Matthew Garrett -Signed-off-by: David Howells -Signed-off-by: Matthew Garrett -Cc: x86@kernel.org ---- - drivers/char/mem.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/char/mem.c b/drivers/char/mem.c -index b08dc50f9f26..0a2f2e75d5f4 100644 ---- a/drivers/char/mem.c -+++ b/drivers/char/mem.c -@@ -786,6 +786,8 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig) - - static int open_port(struct inode *inode, struct file *filp) - { -+ if (kernel_is_locked_down("/dev/mem,kmem,port")) -+ return -EPERM; - return capable(CAP_SYS_RAWIO) ? 0 : -EPERM; - } - --- -2.21.0 - - -From 1fe9d9809a7bedff1c0a043f5bcaf128d479fe24 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Mon, 18 Feb 2019 12:44:58 +0000 -Subject: [PATCH 04/29] kexec_load: Disable at runtime if the kernel is locked - down - -The kexec_load() syscall permits the loading and execution of arbitrary -code in ring 0, which is something that lock-down is meant to prevent. It -makes sense to disable kexec_load() in this situation. - -This does not affect kexec_file_load() syscall which can check for a -signature on the image to be booted. - -Signed-off-by: Matthew Garrett -Signed-off-by: David Howells -Acked-by: Dave Young -cc: kexec@lists.infradead.org -Signed-off-by: Matthew Garrett ---- - kernel/kexec.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/kernel/kexec.c b/kernel/kexec.c -index 1b018f1a6e0d..fc87f152c229 100644 ---- a/kernel/kexec.c -+++ b/kernel/kexec.c -@@ -205,6 +205,13 @@ static inline int kexec_load_check(unsigned long nr_segments, - if (result < 0) - return result; - -+ /* -+ * kexec can be used to circumvent module loading restrictions, so -+ * prevent loading in that case -+ */ -+ if (kernel_is_locked_down("kexec of unsigned images")) -+ return -EPERM; -+ - /* - * Verify we have a legal set of flags - * This leaves us room for future extensions. --- -2.21.0 - - -From b1dbde991ca218ddc1b25e293e94e72907b2b2dc Mon Sep 17 00:00:00 2001 -From: Dave Young -Date: Mon, 18 Feb 2019 12:44:58 +0000 -Subject: [PATCH 05/29] Copy secure_boot flag in boot params across kexec - reboot - -Kexec reboot in case secure boot being enabled does not keep the secure -boot mode in new kernel, so later one can load unsigned kernel via legacy -kexec_load. In this state, the system is missing the protections provided -by secure boot. - -Adding a patch to fix this by retain the secure_boot flag in original -kernel. - -secure_boot flag in boot_params is set in EFI stub, but kexec bypasses the -stub. Fixing this issue by copying secure_boot flag across kexec reboot. - -Signed-off-by: Dave Young -Signed-off-by: David Howells -cc: kexec@lists.infradead.org -Signed-off-by: Matthew Garrett ---- - arch/x86/kernel/kexec-bzimage64.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c -index 5ebcd02cbca7..d2f4e706a428 100644 ---- a/arch/x86/kernel/kexec-bzimage64.c -+++ b/arch/x86/kernel/kexec-bzimage64.c -@@ -180,6 +180,7 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr, - if (efi_enabled(EFI_OLD_MEMMAP)) - return 0; - -+ params->secure_boot = boot_params.secure_boot; - ei->efi_loader_signature = current_ei->efi_loader_signature; - ei->efi_systab = current_ei->efi_systab; - ei->efi_systab_hi = current_ei->efi_systab_hi; --- -2.21.0 - - -From 054c9d4879b81dcf7c49c5815c30db59ad9356ea Mon Sep 17 00:00:00 2001 -From: Jiri Bohac -Date: Mon, 18 Feb 2019 12:44:58 +0000 -Subject: [PATCH 06/29] kexec_file: split KEXEC_VERIFY_SIG into KEXEC_SIG and - KEXEC_SIG_FORCE - -This is a preparatory patch for kexec_file_load() lockdown. A locked down -kernel needs to prevent unsigned kernel images from being loaded with -kexec_file_load(). Currently, the only way to force the signature -verification is compiling with KEXEC_VERIFY_SIG. This prevents loading -usigned images even when the kernel is not locked down at runtime. - -This patch splits KEXEC_VERIFY_SIG into KEXEC_SIG and KEXEC_SIG_FORCE. -Analogous to the MODULE_SIG and MODULE_SIG_FORCE for modules, KEXEC_SIG -turns on the signature verification but allows unsigned images to be -loaded. KEXEC_SIG_FORCE disallows images without a valid signature. - -[Modified by David Howells such that: - - (1) verify_pefile_signature() differentiates between no-signature and - sig-didn't-match in its returned errors. - - (2) kexec fails with EKEYREJECTED and logs an appropriate message if - signature checking is enforced and an signature is not found, uses - unsupported crypto or has no matching key. - - (3) kexec fails with EKEYREJECTED if there is a signature for which we - have a key, but signature doesn't match - even if in non-forcing mode. - - (4) kexec fails with EBADMSG or some other error if there is a signature - which cannot be parsed - even if in non-forcing mode. - - (5) kexec fails with ELIBBAD if the PE file cannot be parsed to extract - the signature - even if in non-forcing mode. - -] - -Signed-off-by: Jiri Bohac -Signed-off-by: David Howells -Reviewed-by: Jiri Bohac -cc: kexec@lists.infradead.org -Signed-off-by: Matthew Garrett ---- - arch/x86/Kconfig | 20 ++++++++--- - crypto/asymmetric_keys/verify_pefile.c | 4 ++- - include/linux/kexec.h | 4 +-- - kernel/kexec_file.c | 48 ++++++++++++++++++++++---- - 4 files changed, 61 insertions(+), 15 deletions(-) - -diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 879741336771..df9592ce8503 100644 ---- a/arch/x86/Kconfig -+++ b/arch/x86/Kconfig -@@ -2026,20 +2026,30 @@ config KEXEC_FILE - config ARCH_HAS_KEXEC_PURGATORY - def_bool KEXEC_FILE - --config KEXEC_VERIFY_SIG -+config KEXEC_SIG - bool "Verify kernel signature during kexec_file_load() syscall" - depends on KEXEC_FILE - ---help--- -- This option makes kernel signature verification mandatory for -- the kexec_file_load() syscall. - -- In addition to that option, you need to enable signature -+ This option makes the kexec_file_load() syscall check for a valid -+ signature of the kernel image. The image can still be loaded without -+ a valid signature unless you also enable KEXEC_SIG_FORCE, though if -+ there's a signature that we can check, then it must be valid. -+ -+ In addition to this option, you need to enable signature - verification for the corresponding kernel image type being - loaded in order for this to work. - -+config KEXEC_SIG_FORCE -+ bool "Require a valid signature in kexec_file_load() syscall" -+ depends on KEXEC_SIG -+ ---help--- -+ This option makes kernel signature verification mandatory for -+ the kexec_file_load() syscall. -+ - config KEXEC_BZIMAGE_VERIFY_SIG - bool "Enable bzImage signature verification support" -- depends on KEXEC_VERIFY_SIG -+ depends on KEXEC_SIG - depends on SIGNED_PE_FILE_VERIFICATION - select SYSTEM_TRUSTED_KEYRING - ---help--- -diff --git a/crypto/asymmetric_keys/verify_pefile.c b/crypto/asymmetric_keys/verify_pefile.c -index 3b303fe2f061..cc9dbcecaaca 100644 ---- a/crypto/asymmetric_keys/verify_pefile.c -+++ b/crypto/asymmetric_keys/verify_pefile.c -@@ -96,7 +96,7 @@ static int pefile_parse_binary(const void *pebuf, unsigned int pelen, - - if (!ddir->certs.virtual_address || !ddir->certs.size) { - pr_debug("Unsigned PE binary\n"); -- return -EKEYREJECTED; -+ return -ENODATA; - } - - chkaddr(ctx->header_size, ddir->certs.virtual_address, -@@ -403,6 +403,8 @@ static int pefile_digest_pe(const void *pebuf, unsigned int pelen, - * (*) 0 if at least one signature chain intersects with the keys in the trust - * keyring, or: - * -+ * (*) -ENODATA if there is no signature present. -+ * - * (*) -ENOPKG if a suitable crypto module couldn't be found for a check on a - * chain. - * -diff --git a/include/linux/kexec.h b/include/linux/kexec.h -index b9b1bc5f9669..58b27c7bdc2b 100644 ---- a/include/linux/kexec.h -+++ b/include/linux/kexec.h -@@ -125,7 +125,7 @@ typedef void *(kexec_load_t)(struct kimage *image, char *kernel_buf, - unsigned long cmdline_len); - typedef int (kexec_cleanup_t)(void *loader_data); - --#ifdef CONFIG_KEXEC_VERIFY_SIG -+#ifdef CONFIG_KEXEC_SIG - typedef int (kexec_verify_sig_t)(const char *kernel_buf, - unsigned long kernel_len); - #endif -@@ -134,7 +134,7 @@ struct kexec_file_ops { - kexec_probe_t *probe; - kexec_load_t *load; - kexec_cleanup_t *cleanup; --#ifdef CONFIG_KEXEC_VERIFY_SIG -+#ifdef CONFIG_KEXEC_SIG - kexec_verify_sig_t *verify_sig; - #endif - }; -diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c -index b8cc032d5620..5036bde1e5b3 100644 ---- a/kernel/kexec_file.c -+++ b/kernel/kexec_file.c -@@ -88,7 +88,7 @@ int __weak arch_kimage_file_post_load_cleanup(struct kimage *image) - return kexec_image_post_load_cleanup_default(image); - } - --#ifdef CONFIG_KEXEC_VERIFY_SIG -+#ifdef CONFIG_KEXEC_SIG - static int kexec_image_verify_sig_default(struct kimage *image, void *buf, - unsigned long buf_len) - { -@@ -186,7 +186,8 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd, - const char __user *cmdline_ptr, - unsigned long cmdline_len, unsigned flags) - { -- int ret = 0; -+ const char *reason; -+ int ret; - void *ldata; - loff_t size; - -@@ -202,15 +203,48 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd, - if (ret) - goto out; - --#ifdef CONFIG_KEXEC_VERIFY_SIG -+#ifdef CONFIG_KEXEC_SIG - ret = arch_kexec_kernel_verify_sig(image, image->kernel_buf, - image->kernel_buf_len); -- if (ret) { -- pr_debug("kernel signature verification failed.\n"); -+#else -+ ret = -ENODATA; -+#endif -+ -+ switch (ret) { -+ case 0: -+ break; -+ -+ /* Certain verification errors are non-fatal if we're not -+ * checking errors, provided we aren't mandating that there -+ * must be a valid signature. -+ */ -+ case -ENODATA: -+ reason = "kexec of unsigned image"; -+ goto decide; -+ case -ENOPKG: -+ reason = "kexec of image with unsupported crypto"; -+ goto decide; -+ case -ENOKEY: -+ reason = "kexec of image with unavailable key"; -+ decide: -+ if (IS_ENABLED(CONFIG_KEXEC_SIG_FORCE)) { -+ pr_notice("%s rejected\n", reason); -+ ret = -EKEYREJECTED; -+ goto out; -+ } -+ -+ ret = 0; -+ break; -+ -+ /* All other errors are fatal, including nomem, unparseable -+ * signatures and signature check failures - even if signatures -+ * aren't required. -+ */ -+ default: -+ pr_notice("kernel signature verification failed (%d).\n", ret); - goto out; - } -- pr_debug("kernel signature verification successful.\n"); --#endif -+ - /* It is possible that there no initramfs is being loaded */ - if (!(flags & KEXEC_FILE_NO_INITRAMFS)) { - ret = kernel_read_file_from_fd(initrd_fd, &image->initrd_buf, --- -2.21.0 - - -From d0ca8a6c26bfd6c8de7ed1d83326aae9b4bdfbf4 Mon Sep 17 00:00:00 2001 -From: Jiri Bohac -Date: Mon, 18 Feb 2019 12:44:58 +0000 -Subject: [PATCH 07/29] kexec_file: Restrict at runtime if the kernel is locked - down - -When KEXEC_SIG is not enabled, kernel should not load images through -kexec_file systemcall if the kernel is locked down. - -[Modified by David Howells to fit with modifications to the previous patch - and to return -EPERM if the kernel is locked down for consistency with - other lockdowns. Modified by Matthew Garrett to remove the IMA - integration, which will be replaced by integrating with the IMA - architecture policy patches.] - -Signed-off-by: Jiri Bohac -Signed-off-by: David Howells -Reviewed-by: Jiri Bohac -cc: kexec@lists.infradead.org -Signed-off-by: Matthew Garrett ---- - kernel/kexec_file.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c -index 5036bde1e5b3..0668c29d2eaf 100644 ---- a/kernel/kexec_file.c -+++ b/kernel/kexec_file.c -@@ -234,6 +234,12 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd, - } - - ret = 0; -+ -+ if (kernel_is_locked_down(reason)) { -+ ret = -EPERM; -+ goto out; -+ } -+ - break; - - /* All other errors are fatal, including nomem, unparseable --- -2.21.0 - - -From 3754ff197e10abd8ef88875e069741025ea0dd84 Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Mon, 18 Feb 2019 12:44:59 +0000 -Subject: [PATCH 08/29] hibernate: Disable when the kernel is locked down - -There is currently no way to verify the resume image when returning -from hibernate. This might compromise the signed modules trust model, -so until we can work with signed hibernate images we disable it when the -kernel is locked down. - -Signed-off-by: Josh Boyer -Signed-off-by: David Howells -Cc: rjw@rjwysocki.net -Cc: pavel@ucw.cz -cc: linux-pm@vger.kernel.org -Signed-off-by: Matthew Garrett ---- - kernel/power/hibernate.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c -index cd7434e6000d..0f30de4a712a 100644 ---- a/kernel/power/hibernate.c -+++ b/kernel/power/hibernate.c -@@ -68,7 +68,7 @@ static const struct platform_hibernation_ops *hibernation_ops; - - bool hibernation_available(void) - { -- return (nohibernate == 0); -+ return nohibernate == 0 && !kernel_is_locked_down("Hibernation"); - } - - /** --- -2.21.0 - - -From a144fd3bcc7fcbf55b608c89b8cf64abec72130c Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Mon, 18 Feb 2019 12:44:59 +0000 -Subject: [PATCH 09/29] uswsusp: Disable when the kernel is locked down - -uswsusp allows a user process to dump and then restore kernel state, which -makes it possible to modify the running kernel. Disable this if the kernel -is locked down. - -Signed-off-by: Matthew Garrett -Signed-off-by: David Howells -Reviewed-by: James Morris -cc: linux-pm@vger.kernel.org -Cc: pavel@ucw.cz -Cc: rjw@rjwysocki.net -Signed-off-by: Matthew Garrett ---- - kernel/power/user.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/kernel/power/user.c b/kernel/power/user.c -index 77438954cc2b..0caff429eb55 100644 ---- a/kernel/power/user.c -+++ b/kernel/power/user.c -@@ -49,6 +49,9 @@ static int snapshot_open(struct inode *inode, struct file *filp) - if (!hibernation_available()) - return -EPERM; - -+ if (kernel_is_locked_down("/dev/snapshot")) -+ return -EPERM; -+ - lock_system_sleep(); - - if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { --- -2.21.0 - - -From 069af594117ee566597173886950d3577c523983 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Mon, 18 Feb 2019 12:44:59 +0000 -Subject: [PATCH 10/29] PCI: Lock down BAR access when the kernel is locked - down - -Any hardware that can potentially generate DMA has to be locked down in -order to avoid it being possible for an attacker to modify kernel code, -allowing them to circumvent disabled module loading or module signing. -Default to paranoid - in future we can potentially relax this for -sufficiently IOMMU-isolated devices. - -Signed-off-by: Matthew Garrett -Signed-off-by: David Howells -Acked-by: Bjorn Helgaas -cc: linux-pci@vger.kernel.org -Signed-off-by: Matthew Garrett ---- - drivers/pci/pci-sysfs.c | 9 +++++++++ - drivers/pci/proc.c | 9 ++++++++- - drivers/pci/syscall.c | 3 ++- - 3 files changed, 19 insertions(+), 2 deletions(-) - -diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c -index 965c72104150..f8cef3e348a3 100644 ---- a/drivers/pci/pci-sysfs.c -+++ b/drivers/pci/pci-sysfs.c -@@ -907,6 +907,9 @@ static ssize_t pci_write_config(struct file *filp, struct kobject *kobj, - loff_t init_off = off; - u8 *data = (u8 *) buf; - -+ if (kernel_is_locked_down("Direct PCI access")) -+ return -EPERM; -+ - if (off > dev->cfg_size) - return 0; - if (off + count > dev->cfg_size) { -@@ -1168,6 +1171,9 @@ static int pci_mmap_resource(struct kobject *kobj, struct bin_attribute *attr, - enum pci_mmap_state mmap_type; - struct resource *res = &pdev->resource[bar]; - -+ if (kernel_is_locked_down("Direct PCI access")) -+ return -EPERM; -+ - if (res->flags & IORESOURCE_MEM && iomem_is_exclusive(res->start)) - return -EINVAL; - -@@ -1243,6 +1249,9 @@ static ssize_t pci_write_resource_io(struct file *filp, struct kobject *kobj, - struct bin_attribute *attr, char *buf, - loff_t off, size_t count) - { -+ if (kernel_is_locked_down("Direct PCI access")) -+ return -EPERM; -+ - return pci_resource_io(filp, kobj, attr, buf, off, count, true); - } - -diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c -index fe7fe678965b..23c9b5979f5d 100644 ---- a/drivers/pci/proc.c -+++ b/drivers/pci/proc.c -@@ -117,6 +117,9 @@ static ssize_t proc_bus_pci_write(struct file *file, const char __user *buf, - int size = dev->cfg_size; - int cnt; - -+ if (kernel_is_locked_down("Direct PCI access")) -+ return -EPERM; -+ - if (pos >= size) - return 0; - if (nbytes >= size) -@@ -196,6 +199,9 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, - #endif /* HAVE_PCI_MMAP */ - int ret = 0; - -+ if (kernel_is_locked_down("Direct PCI access")) -+ return -EPERM; -+ - switch (cmd) { - case PCIIOC_CONTROLLER: - ret = pci_domain_nr(dev->bus); -@@ -238,7 +244,8 @@ static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) - struct pci_filp_private *fpriv = file->private_data; - int i, ret, write_combine = 0, res_bit = IORESOURCE_MEM; - -- if (!capable(CAP_SYS_RAWIO)) -+ if (!capable(CAP_SYS_RAWIO) || -+ kernel_is_locked_down("Direct PCI access")) - return -EPERM; - - if (fpriv->mmap_state == pci_mmap_io) { -diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c -index d96626c614f5..b8a08d3166a1 100644 ---- a/drivers/pci/syscall.c -+++ b/drivers/pci/syscall.c -@@ -90,7 +90,8 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, - u32 dword; - int err = 0; - -- if (!capable(CAP_SYS_ADMIN)) -+ if (!capable(CAP_SYS_ADMIN) || -+ kernel_is_locked_down("Direct PCI access")) - return -EPERM; - - dev = pci_get_domain_bus_and_slot(0, bus, dfn); --- -2.21.0 - - -From 97f7b0338b58afd67817ca886de78ce9bba67f29 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Mon, 18 Feb 2019 12:44:59 +0000 -Subject: [PATCH 11/29] x86: Lock down IO port access when the kernel is locked - down - -IO port access would permit users to gain access to PCI configuration -registers, which in turn (on a lot of hardware) give access to MMIO -register space. This would potentially permit root to trigger arbitrary -DMA, so lock it down by default. - -This also implicitly locks down the KDADDIO, KDDELIO, KDENABIO and -KDDISABIO console ioctls. - -Signed-off-by: Matthew Garrett -Signed-off-by: David Howells -Reviewed-by: Thomas Gleixner -cc: x86@kernel.org -Signed-off-by: Matthew Garrett ---- - arch/x86/kernel/ioport.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c -index 0fe1c8782208..abc702a6ae9c 100644 ---- a/arch/x86/kernel/ioport.c -+++ b/arch/x86/kernel/ioport.c -@@ -31,7 +31,8 @@ long ksys_ioperm(unsigned long from, unsigned long num, int turn_on) - - if ((from + num <= from) || (from + num > IO_BITMAP_BITS)) - return -EINVAL; -- if (turn_on && !capable(CAP_SYS_RAWIO)) -+ if (turn_on && (!capable(CAP_SYS_RAWIO) || -+ kernel_is_locked_down("ioperm"))) - return -EPERM; - - /* -@@ -126,7 +127,8 @@ SYSCALL_DEFINE1(iopl, unsigned int, level) - return -EINVAL; - /* Trying to gain more privileges? */ - if (level > old) { -- if (!capable(CAP_SYS_RAWIO)) -+ if (!capable(CAP_SYS_RAWIO) || -+ kernel_is_locked_down("iopl")) - return -EPERM; - } - regs->flags = (regs->flags & ~X86_EFLAGS_IOPL) | --- -2.21.0 - - -From 65029f8df39eb1d0a48cbcb6686b21e844ff9b3c Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Mon, 18 Feb 2019 12:44:59 +0000 -Subject: [PATCH 12/29] x86/msr: Restrict MSR access when the kernel is locked - down - -Writing to MSRs should not be allowed if the kernel is locked down, since -it could lead to execution of arbitrary code in kernel mode. Based on a -patch by Kees Cook. - -MSR accesses are logged for the purposes of building up a whitelist as per -Alan Cox's suggestion. - -Signed-off-by: Matthew Garrett -Signed-off-by: David Howells -Acked-by: Kees Cook -Reviewed-by: Thomas Gleixner -cc: x86@kernel.org -Signed-off-by: Matthew Garrett ---- - arch/x86/kernel/msr.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c -index 3db2252b958d..5eed6530c223 100644 ---- a/arch/x86/kernel/msr.c -+++ b/arch/x86/kernel/msr.c -@@ -79,6 +79,11 @@ static ssize_t msr_write(struct file *file, const char __user *buf, - int err = 0; - ssize_t bytes = 0; - -+ if (kernel_is_locked_down("Direct MSR access")) { -+ pr_info("Direct access to MSR %x\n", reg); -+ return -EPERM; -+ } -+ - if (count % 8) - return -EINVAL; /* Invalid chunk size */ - -@@ -130,6 +135,11 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg) - err = -EFAULT; - break; - } -+ if (kernel_is_locked_down("Direct MSR access")) { -+ pr_info("Direct access to MSR %x\n", regs[1]); /* Display %ecx */ -+ err = -EPERM; -+ break; -+ } - err = wrmsr_safe_regs_on_cpu(cpu, regs); - if (err) - break; --- -2.21.0 - - -From 0a0ad07ecc667dae61d7a1073559830184022be7 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Mon, 18 Feb 2019 12:44:59 +0000 -Subject: [PATCH 13/29] ACPI: Limit access to custom_method when the kernel is - locked down - -custom_method effectively allows arbitrary access to system memory, making -it possible for an attacker to circumvent restrictions on module loading. -Disable it if the kernel is locked down. - -Signed-off-by: Matthew Garrett -Signed-off-by: David Howells -cc: linux-acpi@vger.kernel.org -Signed-off-by: Matthew Garrett ---- - drivers/acpi/custom_method.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/acpi/custom_method.c b/drivers/acpi/custom_method.c -index b2ef4c2ec955..33b821be0600 100644 ---- a/drivers/acpi/custom_method.c -+++ b/drivers/acpi/custom_method.c -@@ -30,6 +30,9 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, - struct acpi_table_header table; - acpi_status status; - -+ if (kernel_is_locked_down("ACPI custom methods")) -+ return -EPERM; -+ - if (!(*ppos)) { - /* parse the table header to get the table length */ - if (count <= sizeof(struct acpi_table_header)) --- -2.21.0 - - -From ad843f3ba6d525cc47eb2c866de74a324d3a960c Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Mon, 18 Feb 2019 12:44:59 +0000 -Subject: [PATCH 14/29] acpi: Ignore acpi_rsdp kernel param when the kernel has - been locked down - -This option allows userspace to pass the RSDP address to the kernel, which -makes it possible for a user to modify the workings of hardware . Reject -the option when the kernel is locked down. - -Signed-off-by: Josh Boyer -Signed-off-by: David Howells -cc: Dave Young -cc: linux-acpi@vger.kernel.org -Signed-off-by: Matthew Garrett ---- - drivers/acpi/osl.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c -index 9c0edf2fc0dd..0c5c7b51fb72 100644 ---- a/drivers/acpi/osl.c -+++ b/drivers/acpi/osl.c -@@ -180,7 +180,7 @@ acpi_physical_address __init acpi_os_get_root_pointer(void) - acpi_physical_address pa; - - #ifdef CONFIG_KEXEC -- if (acpi_rsdp) -+ if (acpi_rsdp && !kernel_is_locked_down("ACPI RSDP specification")) - return acpi_rsdp; - #endif - pa = acpi_arch_get_root_pointer(); --- -2.21.0 - - -From 146618cd3ae3556184f3ca94ca82809f4e7090b9 Mon Sep 17 00:00:00 2001 -From: Linn Crosetto -Date: Mon, 18 Feb 2019 12:45:00 +0000 -Subject: [PATCH 15/29] acpi: Disable ACPI table override if the kernel is - locked down - -From the kernel documentation (initrd_table_override.txt): - - If the ACPI_INITRD_TABLE_OVERRIDE compile option is true, it is possible - to override nearly any ACPI table provided by the BIOS with an - instrumented, modified one. - -When securelevel is set, the kernel should disallow any unauthenticated -changes to kernel space. ACPI tables contain code invoked by the kernel, -so do not allow ACPI tables to be overridden if the kernel is locked down. - -Signed-off-by: Linn Crosetto -Signed-off-by: David Howells -cc: linux-acpi@vger.kernel.org -Signed-off-by: Matthew Garrett ---- - drivers/acpi/tables.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c -index b32327759380..6fd5c8328427 100644 ---- a/drivers/acpi/tables.c -+++ b/drivers/acpi/tables.c -@@ -578,6 +578,11 @@ void __init acpi_table_upgrade(void) - if (table_nr == 0) - return; - -+ if (kernel_is_locked_down("ACPI table override")) { -+ pr_notice("kernel is locked down, ignoring table override\n"); -+ return; -+ } -+ - acpi_tables_addr = - memblock_find_in_range(0, ACPI_TABLE_UPGRADE_MAX_PHYS, - all_tables_size, PAGE_SIZE); --- -2.21.0 - - -From e183b69655b6069c7007ad911252dd681fb0083f Mon Sep 17 00:00:00 2001 -From: Linn Crosetto -Date: Mon, 18 Feb 2019 12:45:00 +0000 -Subject: [PATCH 16/29] acpi: Disable APEI error injection if the kernel is - locked down - -ACPI provides an error injection mechanism, EINJ, for debugging and testing -the ACPI Platform Error Interface (APEI) and other RAS features. If -supported by the firmware, ACPI specification 5.0 and later provide for a -way to specify a physical memory address to which to inject the error. - -Injecting errors through EINJ can produce errors which to the platform are -indistinguishable from real hardware errors. This can have undesirable -side-effects, such as causing the platform to mark hardware as needing -replacement. - -While it does not provide a method to load unauthenticated privileged code, -the effect of these errors may persist across reboots and affect trust in -the underlying hardware, so disable error injection through EINJ if -the kernel is locked down. - -Signed-off-by: Linn Crosetto -Signed-off-by: David Howells -cc: linux-acpi@vger.kernel.org -Signed-off-by: Matthew Garrett ---- - drivers/acpi/apei/einj.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c -index e430cf4caec2..dde995f871d6 100644 ---- a/drivers/acpi/apei/einj.c -+++ b/drivers/acpi/apei/einj.c -@@ -510,6 +510,9 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, - int rc; - u64 base_addr, size; - -+ if (kernel_is_locked_down("ACPI error injection")) -+ return -EPERM; -+ - /* If user manually set "flags", make sure it is legal */ - if (flags && (flags & - ~(SETWA_FLAGS_APICID|SETWA_FLAGS_MEM|SETWA_FLAGS_PCIE_SBDF))) --- -2.21.0 - - -From 2c469f9240f58dce6049eae000d70dcef8025cfa Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Mon, 18 Feb 2019 12:45:00 +0000 -Subject: [PATCH 17/29] Prohibit PCMCIA CIS storage when the kernel is locked - down - -Prohibit replacement of the PCMCIA Card Information Structure when the -kernel is locked down. - -Suggested-by: Dominik Brodowski -Signed-off-by: David Howells -cc: linux-pcmcia@lists.infradead.org -Signed-off-by: Matthew Garrett ---- - drivers/pcmcia/cistpl.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c -index abd029945cc8..77919fa3fb4a 100644 ---- a/drivers/pcmcia/cistpl.c -+++ b/drivers/pcmcia/cistpl.c -@@ -1575,6 +1575,9 @@ static ssize_t pccard_store_cis(struct file *filp, struct kobject *kobj, - struct pcmcia_socket *s; - int error; - -+ if (kernel_is_locked_down("Direct PCMCIA CIS storage")) -+ return -EPERM; -+ - s = to_socket(container_of(kobj, struct device, kobj)); - - if (off) --- -2.21.0 - - -From 5f1bdf370484979c291e37cd6905480a12083b18 Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Mon, 18 Feb 2019 12:45:00 +0000 -Subject: [PATCH 18/29] Lock down TIOCSSERIAL - -Lock down TIOCSSERIAL as that can be used to change the ioport and irq -settings on a serial port. This only appears to be an issue for the serial -drivers that use the core serial code. All other drivers seem to either -ignore attempts to change port/irq or give an error. - -Reported-by: Greg Kroah-Hartman -Signed-off-by: David Howells -cc: Jiri Slaby -Cc: linux-serial@vger.kernel.org -Signed-off-by: Matthew Garrett ---- - drivers/tty/serial/serial_core.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c -index 4223cb496764..4f3cd7bc1713 100644 ---- a/drivers/tty/serial/serial_core.c -+++ b/drivers/tty/serial/serial_core.c -@@ -846,6 +846,12 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port, - new_flags = (__force upf_t)new_info->flags; - old_custom_divisor = uport->custom_divisor; - -+ if ((change_port || change_irq) && -+ kernel_is_locked_down("Using TIOCSSERIAL to change device addresses, irqs and dma channels")) { -+ retval = -EPERM; -+ goto exit; -+ } -+ - if (!capable(CAP_SYS_ADMIN)) { - retval = -EPERM; - if (change_irq || change_port || --- -2.21.0 - - -From b07159ff6bc3345b49db17a82fa31013f398d4e5 Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Mon, 18 Feb 2019 12:45:01 +0000 -Subject: [PATCH 19/29] Lock down module params that specify hardware - parameters (eg. ioport) - -Provided an annotation for module parameters that specify hardware -parameters (such as io ports, iomem addresses, irqs, dma channels, fixed -dma buffers and other types). - -Suggested-by: Alan Cox -Signed-off-by: David Howells -Signed-off-by: Matthew Garrett ---- - kernel/params.c | 26 +++++++++++++++++++++----- - 1 file changed, 21 insertions(+), 5 deletions(-) - -diff --git a/kernel/params.c b/kernel/params.c -index cf448785d058..61a08a5da208 100644 ---- a/kernel/params.c -+++ b/kernel/params.c -@@ -96,13 +96,19 @@ bool parameq(const char *a, const char *b) - return parameqn(a, b, strlen(a)+1); - } - --static void param_check_unsafe(const struct kernel_param *kp) -+static bool param_check_unsafe(const struct kernel_param *kp, -+ const char *doing) - { - if (kp->flags & KERNEL_PARAM_FL_UNSAFE) { - pr_notice("Setting dangerous option %s - tainting kernel\n", - kp->name); - add_taint(TAINT_USER, LOCKDEP_STILL_OK); - } -+ -+ if (kp->flags & KERNEL_PARAM_FL_HWPARAM && -+ kernel_is_locked_down("Command line-specified device addresses, irqs and dma channels")) -+ return false; -+ return true; - } - - static int parse_one(char *param, -@@ -132,8 +138,10 @@ static int parse_one(char *param, - pr_debug("handling %s with %p\n", param, - params[i].ops->set); - kernel_param_lock(params[i].mod); -- param_check_unsafe(¶ms[i]); -- err = params[i].ops->set(val, ¶ms[i]); -+ if (param_check_unsafe(¶ms[i], doing)) -+ err = params[i].ops->set(val, ¶ms[i]); -+ else -+ err = -EPERM; - kernel_param_unlock(params[i].mod); - return err; - } -@@ -541,6 +549,12 @@ static ssize_t param_attr_show(struct module_attribute *mattr, - return count; - } - -+#ifdef CONFIG_MODULES -+#define mod_name(mod) (mod)->name -+#else -+#define mod_name(mod) "unknown" -+#endif -+ - /* sysfs always hands a nul-terminated string in buf. We rely on that. */ - static ssize_t param_attr_store(struct module_attribute *mattr, - struct module_kobject *mk, -@@ -553,8 +567,10 @@ static ssize_t param_attr_store(struct module_attribute *mattr, - return -EPERM; - - kernel_param_lock(mk->mod); -- param_check_unsafe(attribute->param); -- err = attribute->param->ops->set(buf, attribute->param); -+ if (param_check_unsafe(attribute->param, mod_name(mk->mod))) -+ err = attribute->param->ops->set(buf, attribute->param); -+ else -+ err = -EPERM; - kernel_param_unlock(mk->mod); - if (!err) - return len; --- -2.21.0 - - -From 3e7fdce10f144b2a947f020bd0eeeb536c77153e Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Mon, 18 Feb 2019 12:45:01 +0000 -Subject: [PATCH 20/29] x86/mmiotrace: Lock down the testmmiotrace module - -The testmmiotrace module shouldn't be permitted when the kernel is locked -down as it can be used to arbitrarily read and write MMIO space. - -Suggested-by: Thomas Gleixner -Signed-off-by: David Howells -cc: Steven Rostedt -cc: Ingo Molnar -cc: "H. Peter Anvin" -cc: x86@kernel.org -Signed-off-by: Matthew Garrett ---- - arch/x86/mm/testmmiotrace.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/arch/x86/mm/testmmiotrace.c b/arch/x86/mm/testmmiotrace.c -index 0881e1ff1e58..13f1da99ee5e 100644 ---- a/arch/x86/mm/testmmiotrace.c -+++ b/arch/x86/mm/testmmiotrace.c -@@ -116,6 +116,9 @@ static int __init init(void) - { - unsigned long size = (read_far) ? (8 << 20) : (16 << 10); - -+ if (kernel_is_locked_down("MMIO trace testing")) -+ return -EPERM; -+ - if (mmio_address == 0) { - pr_err("you have to use the module argument mmio_address.\n"); - pr_err("DO NOT LOAD THIS MODULE UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!\n"); --- -2.21.0 - - -From 1e81a8fd6ed139113011e3b7d70aa8b5c59a97cb Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Mon, 18 Feb 2019 12:45:02 +0000 -Subject: [PATCH 21/29] Lock down /proc/kcore - -Disallow access to /proc/kcore when the kernel is locked down to prevent -access to cryptographic data. - -Signed-off-by: David Howells -Reviewed-by: James Morris -Signed-off-by: Matthew Garrett ---- - fs/proc/kcore.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c -index f5834488b67d..0639228c4904 100644 ---- a/fs/proc/kcore.c -+++ b/fs/proc/kcore.c -@@ -545,6 +545,8 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) - - static int open_kcore(struct inode *inode, struct file *filp) - { -+ if (kernel_is_locked_down("/proc/kcore")) -+ return -EPERM; - if (!capable(CAP_SYS_RAWIO)) - return -EPERM; - --- -2.21.0 - - -From 03a1ba6091a421ae40a17dc67f61a96733c8f0d2 Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Mon, 18 Feb 2019 12:45:02 +0000 -Subject: [PATCH 22/29] Lock down kprobes - -Disallow the creation of kprobes when the kernel is locked down by -preventing their registration. This prevents kprobes from being used to -access kernel memory, either to make modifications or to steal crypto data. - -Reported-by: Alexei Starovoitov -Signed-off-by: David Howells -Signed-off-by: Matthew Garrett -Cc: Naveen N. Rao -Cc: Anil S Keshavamurthy -Cc: davem@davemloft.net -Cc: Masami Hiramatsu ---- - kernel/kprobes.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/kernel/kprobes.c b/kernel/kprobes.c -index 9f5433a52488..e54c7b70298a 100644 ---- a/kernel/kprobes.c -+++ b/kernel/kprobes.c -@@ -1556,6 +1556,9 @@ int register_kprobe(struct kprobe *p) - struct module *probed_mod; - kprobe_opcode_t *addr; - -+ if (kernel_is_locked_down("Use of kprobes")) -+ return -EPERM; -+ - /* Adjust probe address from symbol */ - addr = kprobe_addr(p); - if (IS_ERR(addr)) --- -2.21.0 - - -From d743cdf3a9508b9d9293acb3170b1d76f5556d1a Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Mon, 18 Feb 2019 12:45:02 +0000 -Subject: [PATCH 23/29] bpf: Restrict kernel image access functions when the - kernel is locked down - -There are some bpf functions can be used to read kernel memory: -bpf_probe_read, bpf_probe_write_user and bpf_trace_printk. These allow -private keys in kernel memory (e.g. the hibernation image signing key) to -be read by an eBPF program and kernel memory to be altered without -restriction. - -Completely prohibit the use of BPF when the kernel is locked down. - -Suggested-by: Alexei Starovoitov -Signed-off-by: David Howells -cc: netdev@vger.kernel.org -cc: Chun-Yi Lee -cc: Alexei Starovoitov -Cc: Daniel Borkmann -Signed-off-by: Matthew Garrett ---- - kernel/bpf/syscall.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c -index 5d141f16f6fa..cf9f0d069a2a 100644 ---- a/kernel/bpf/syscall.c -+++ b/kernel/bpf/syscall.c -@@ -2813,6 +2813,9 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, siz - if (sysctl_unprivileged_bpf_disabled && !capable(CAP_SYS_ADMIN)) - return -EPERM; - -+ if (kernel_is_locked_down("BPF")) -+ return -EPERM; -+ - err = bpf_check_uarg_tail_zero(uattr, sizeof(attr), size); - if (err) - return err; --- -2.21.0 - - -From 7ec8d8a7bc177bc54e627b04a6aa4520174965cd Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Mon, 18 Feb 2019 12:45:02 +0000 -Subject: [PATCH 24/29] Lock down perf - -Disallow the use of certain perf facilities that might allow userspace to -access kernel data. - -Signed-off-by: David Howells -Signed-off-by: Matthew Garrett -Cc: Peter Zijlstra -Cc: Ingo Molnar -Cc: Arnaldo Carvalho de Melo ---- - kernel/events/core.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/kernel/events/core.c b/kernel/events/core.c -index eea9d52b010c..08f51f91d959 100644 ---- a/kernel/events/core.c -+++ b/kernel/events/core.c -@@ -10824,6 +10824,11 @@ SYSCALL_DEFINE5(perf_event_open, - return -EINVAL; - } - -+ if ((attr.sample_type & PERF_SAMPLE_REGS_INTR) && -+ kernel_is_locked_down("PERF_SAMPLE_REGS_INTR")) -+ /* REGS_INTR can leak data, lockdown must prevent this */ -+ return -EPERM; -+ - /* Only privileged users can get physical addresses */ - if ((attr.sample_type & PERF_SAMPLE_PHYS_ADDR) && - perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN)) --- -2.21.0 - - -From 98fa6aca64b1723db15cb1791b734aebb105433e Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Mon, 18 Feb 2019 12:45:02 +0000 -Subject: [PATCH 25/29] debugfs: Restrict debugfs when the kernel is locked - down - -Disallow opening of debugfs files that might be used to muck around when -the kernel is locked down as various drivers give raw access to hardware -through debugfs. Given the effort of auditing all 2000 or so files and -manually fixing each one as necessary, I've chosen to apply a heuristic -instead. The following changes are made: - - (1) chmod and chown are disallowed on debugfs objects (though the root dir - can be modified by mount and remount, but I'm not worried about that). - - (2) When the kernel is locked down, only files with the following criteria - are permitted to be opened: - - - The file must have mode 00444 - - The file must not have ioctl methods - - The file must not have mmap - - (3) When the kernel is locked down, files may only be opened for reading. - -Normal device interaction should be done through configfs, sysfs or a -miscdev, not debugfs. - -Note that this makes it unnecessary to specifically lock down show_dsts(), -show_devs() and show_call() in the asus-wmi driver. - -I would actually prefer to lock down all files by default and have the -the files unlocked by the creator. This is tricky to manage correctly, -though, as there are 19 creation functions and ~1600 call sites (some of -them in loops scanning tables). - -Signed-off-by: David Howells -cc: Andy Shevchenko -cc: acpi4asus-user@lists.sourceforge.net -cc: platform-driver-x86@vger.kernel.org -cc: Matthew Garrett -cc: Thomas Gleixner -Cc: Greg Kroah-Hartman -Signed-off-by: Matthew Garrett ---- - fs/debugfs/file.c | 28 ++++++++++++++++++++++++++++ - fs/debugfs/inode.c | 30 ++++++++++++++++++++++++++++-- - 2 files changed, 56 insertions(+), 2 deletions(-) - -diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c -index 93e4ca6b2ad7..8eeff9068228 100644 ---- a/fs/debugfs/file.c -+++ b/fs/debugfs/file.c -@@ -136,6 +136,25 @@ void debugfs_file_put(struct dentry *dentry) - } - EXPORT_SYMBOL_GPL(debugfs_file_put); - -+/* -+ * Only permit access to world-readable files when the kernel is locked down. -+ * We also need to exclude any file that has ways to write or alter it as root -+ * can bypass the permissions check. -+ */ -+static bool debugfs_is_locked_down(struct inode *inode, -+ struct file *filp, -+ const struct file_operations *real_fops) -+{ -+ if ((inode->i_mode & 07777) == 0444 && -+ !(filp->f_mode & FMODE_WRITE) && -+ !real_fops->unlocked_ioctl && -+ !real_fops->compat_ioctl && -+ !real_fops->mmap) -+ return false; -+ -+ return kernel_is_locked_down("debugfs"); -+} -+ - static int open_proxy_open(struct inode *inode, struct file *filp) - { - struct dentry *dentry = F_DENTRY(filp); -@@ -147,6 +166,11 @@ static int open_proxy_open(struct inode *inode, struct file *filp) - return r == -EIO ? -ENOENT : r; - - real_fops = debugfs_real_fops(filp); -+ -+ r = -EPERM; -+ if (debugfs_is_locked_down(inode, filp, real_fops)) -+ goto out; -+ - real_fops = fops_get(real_fops); - if (!real_fops) { - /* Huh? Module did not clean up after itself at exit? */ -@@ -272,6 +296,10 @@ static int full_proxy_open(struct inode *inode, struct file *filp) - return r == -EIO ? -ENOENT : r; - - real_fops = debugfs_real_fops(filp); -+ r = -EPERM; -+ if (debugfs_is_locked_down(inode, filp, real_fops)) -+ goto out; -+ - real_fops = fops_get(real_fops); - if (!real_fops) { - /* Huh? Module did not cleanup after itself at exit? */ -diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c -index 042b688ed124..cc0486ca1a11 100644 ---- a/fs/debugfs/inode.c -+++ b/fs/debugfs/inode.c -@@ -35,6 +35,31 @@ static struct vfsmount *debugfs_mount; - static int debugfs_mount_count; - static bool debugfs_registered; - -+/* -+ * Don't allow access attributes to be changed whilst the kernel is locked down -+ * so that we can use the file mode as part of a heuristic to determine whether -+ * to lock down individual files. -+ */ -+static int debugfs_setattr(struct dentry *dentry, struct iattr *ia) -+{ -+ if ((ia->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID)) && -+ kernel_is_locked_down("debugfs")) -+ return -EPERM; -+ return simple_setattr(dentry, ia); -+} -+ -+static const struct inode_operations debugfs_file_inode_operations = { -+ .setattr = debugfs_setattr, -+}; -+static const struct inode_operations debugfs_dir_inode_operations = { -+ .lookup = simple_lookup, -+ .setattr = debugfs_setattr, -+}; -+static const struct inode_operations debugfs_symlink_inode_operations = { -+ .get_link = simple_get_link, -+ .setattr = debugfs_setattr, -+}; -+ - static struct inode *debugfs_get_inode(struct super_block *sb) - { - struct inode *inode = new_inode(sb); -@@ -369,6 +394,7 @@ static struct dentry *__debugfs_create_file(const char *name, umode_t mode, - inode->i_mode = mode; - inode->i_private = data; - -+ inode->i_op = &debugfs_file_inode_operations; - inode->i_fop = proxy_fops; - dentry->d_fsdata = (void *)((unsigned long)real_fops | - DEBUGFS_FSDATA_IS_REAL_FOPS_BIT); -@@ -532,7 +558,7 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent) - } - - inode->i_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO; -- inode->i_op = &simple_dir_inode_operations; -+ inode->i_op = &debugfs_dir_inode_operations; - inode->i_fop = &simple_dir_operations; - - /* directory inodes start off with i_nlink == 2 (for "." entry) */ -@@ -632,7 +658,7 @@ struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, - return failed_creating(dentry); - } - inode->i_mode = S_IFLNK | S_IRWXUGO; -- inode->i_op = &simple_symlink_inode_operations; -+ inode->i_op = &debugfs_symlink_inode_operations; - inode->i_link = link; - d_instantiate(dentry, inode); - return end_creating(dentry); --- -2.21.0 - - -From 39ffa9315f46123f0f1f66fb6fd0597211b43b1d Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Wed, 28 Feb 2018 14:43:03 +0000 -Subject: [PATCH 26/29] lockdown: Print current->comm in restriction messages - -Print the content of current->comm in messages generated by lockdown to -indicate a restriction that was hit. This makes it a bit easier to find -out what caused the message. - -The message now patterned something like: - - Lockdown: : is restricted; see man kernel_lockdown.7 - -Signed-off-by: David Howells -Signed-off-by: Matthew Garrett ---- - security/lock_down.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/security/lock_down.c b/security/lock_down.c -index 18d8776a4d02..ee00ca2677e7 100644 ---- a/security/lock_down.c -+++ b/security/lock_down.c -@@ -53,8 +53,8 @@ void __init init_lockdown(void) - bool __kernel_is_locked_down(const char *what, bool first) - { - if (what && first && kernel_locked_down) -- pr_notice("Lockdown: %s is restricted; see man kernel_lockdown.7\n", -- what); -+ pr_notice("Lockdown: %s: %s is restricted; see man kernel_lockdown.7\n", -+ current->comm, what); - return kernel_locked_down; - } - EXPORT_SYMBOL(__kernel_is_locked_down); --- -2.21.0 - - -From 0086dbfaa88118636bc5d77f25bd578034a84075 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Tue, 12 Mar 2019 12:50:30 -0700 -Subject: [PATCH 27/29] kexec: Allow kexec_file() with appropriate IMA policy - when locked down - -Systems in lockdown mode should block the kexec of untrusted kernels. -For x86 and ARM we can ensure that a kernel is trustworthy by validating -a PE signature, but this isn't possible on other architectures. On those -platforms we can use IMA digital signatures instead. Add a function to -determine whether IMA has or will verify signatures for a given event type, -and if so permit kexec_file() even if the kernel is otherwise locked down. -This is restricted to cases where CONFIG_INTEGRITY_TRUSTED_KEYRING is set -in order to prevent an attacker from loading additional keys at runtime. - -Signed-off-by: Matthew Garrett -Acked-by: Mimi Zohar -Cc: Dmitry Kasatkin -Cc: linux-integrity@vger.kernel.org ---- - include/linux/ima.h | 9 ++++++ - kernel/kexec_file.c | 7 +++- - security/integrity/ima/ima.h | 2 ++ - security/integrity/ima/ima_main.c | 2 +- - security/integrity/ima/ima_policy.c | 50 +++++++++++++++++++++++++++++ - 5 files changed, 68 insertions(+), 2 deletions(-) - -diff --git a/include/linux/ima.h b/include/linux/ima.h -index a20ad398d260..1c37f17f7203 100644 ---- a/include/linux/ima.h -+++ b/include/linux/ima.h -@@ -131,4 +131,13 @@ static inline int ima_inode_removexattr(struct dentry *dentry, - return 0; - } - #endif /* CONFIG_IMA_APPRAISE */ -+ -+#if defined(CONFIG_IMA_APPRAISE) && defined(CONFIG_INTEGRITY_TRUSTED_KEYRING) -+extern bool ima_appraise_signature(enum kernel_read_file_id func); -+#else -+static inline bool ima_appraise_signature(enum kernel_read_file_id func) -+{ -+ return false; -+} -+#endif /* CONFIG_IMA_APPRAISE && CONFIG_INTEGRITY_TRUSTED_KEYRING */ - #endif /* _LINUX_IMA_H */ -diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c -index 0668c29d2eaf..78728a0f16a7 100644 ---- a/kernel/kexec_file.c -+++ b/kernel/kexec_file.c -@@ -235,7 +235,12 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd, - - ret = 0; - -- if (kernel_is_locked_down(reason)) { -+ /* If IMA is guaranteed to appraise a signature on the kexec -+ * image, permit it even if the kernel is otherwise locked -+ * down. -+ */ -+ if (!ima_appraise_signature(READING_KEXEC_IMAGE) && -+ kernel_is_locked_down(reason)) { - ret = -EPERM; - goto out; - } -diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h -index 011b91c79351..64dcb11cf444 100644 ---- a/security/integrity/ima/ima.h -+++ b/security/integrity/ima/ima.h -@@ -113,6 +113,8 @@ struct ima_kexec_hdr { - u64 count; - }; - -+extern const int read_idmap[]; -+ - #ifdef CONFIG_HAVE_IMA_KEXEC - void ima_load_kexec_buffer(void); - #else -diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c -index 584019728660..b9f57503af2c 100644 ---- a/security/integrity/ima/ima_main.c -+++ b/security/integrity/ima/ima_main.c -@@ -502,7 +502,7 @@ int ima_read_file(struct file *file, enum kernel_read_file_id read_id) - return 0; - } - --static const int read_idmap[READING_MAX_ID] = { -+const int read_idmap[READING_MAX_ID] = { - [READING_FIRMWARE] = FIRMWARE_CHECK, - [READING_FIRMWARE_PREALLOC_BUFFER] = FIRMWARE_CHECK, - [READING_MODULE] = MODULE_CHECK, -diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c -index 6df7f641ff66..827f1e33fe86 100644 ---- a/security/integrity/ima/ima_policy.c -+++ b/security/integrity/ima/ima_policy.c -@@ -1456,3 +1456,53 @@ int ima_policy_show(struct seq_file *m, void *v) - return 0; - } - #endif /* CONFIG_IMA_READ_POLICY */ -+ -+#if defined(CONFIG_IMA_APPRAISE) && defined(CONFIG_INTEGRITY_TRUSTED_KEYRING) -+/* -+ * ima_appraise_signature: whether IMA will appraise a given function using -+ * an IMA digital signature. This is restricted to cases where the kernel -+ * has a set of built-in trusted keys in order to avoid an attacker simply -+ * loading additional keys. -+ */ -+bool ima_appraise_signature(enum kernel_read_file_id id) -+{ -+ struct ima_rule_entry *entry; -+ bool found = false; -+ enum ima_hooks func; -+ -+ if (id >= READING_MAX_ID) -+ return false; -+ -+ func = read_idmap[id] ?: FILE_CHECK; -+ -+ rcu_read_lock(); -+ list_for_each_entry_rcu(entry, ima_rules, list) { -+ if (entry->action != APPRAISE) -+ continue; -+ -+ /* -+ * A generic entry will match, but otherwise require that it -+ * match the func we're looking for -+ */ -+ if (entry->func && entry->func != func) -+ continue; -+ -+ /* -+ * We require this to be a digital signature, not a raw IMA -+ * hash. -+ */ -+ if (entry->flags & IMA_DIGSIG_REQUIRED) -+ found = true; -+ -+ /* -+ * We've found a rule that matches, so break now even if it -+ * didn't require a digital signature - a later rule that does -+ * won't override it, so would be a false positive. -+ */ -+ break; -+ } -+ -+ rcu_read_unlock(); -+ return found; -+} -+#endif /* CONFIG_IMA_APPRAISE && CONFIG_INTEGRITY_TRUSTED_KEYRING */ --- -2.21.0 - - -From 4a84d19a10c31a363aa7d1f325bd212012263a98 Mon Sep 17 00:00:00 2001 -From: Kyle McMartin -Date: Mon, 9 Apr 2018 09:52:45 +0100 -Subject: [PATCH 28/29] Add a SysRq option to lift kernel lockdown - -Make an option to provide a sysrq key that will lift the kernel lockdown, -thereby allowing the running kernel image to be accessed and modified. - -On x86 this is triggered with SysRq+x, but this key may not be available on -all arches, so it is set by setting LOCKDOWN_LIFT_KEY in asm/setup.h. -Since this macro must be defined in an arch to be able to use this facility -for that arch, the Kconfig option is restricted to arches that support it. - -Signed-off-by: Kyle McMartin -Signed-off-by: David Howells -cc: x86@kernel.org ---- - arch/x86/include/asm/setup.h | 2 ++ - drivers/input/misc/uinput.c | 1 + - drivers/tty/sysrq.c | 19 ++++++++++----- - include/linux/input.h | 5 ++++ - include/linux/sysrq.h | 8 +++++- - kernel/debug/kdb/kdb_main.c | 2 +- - security/Kconfig | 10 ++++++++ - security/lock_down.c | 47 ++++++++++++++++++++++++++++++++++++ - 8 files changed, 86 insertions(+), 8 deletions(-) - -diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h -index ed8ec011a9fd..8daf633a5347 100644 ---- a/arch/x86/include/asm/setup.h -+++ b/arch/x86/include/asm/setup.h -@@ -9,6 +9,8 @@ - #include - #include - -+#define LOCKDOWN_LIFT_KEY 'x' -+ - #ifdef __i386__ - - #include -diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c -index 84051f20b18a..583ab2bc1916 100644 ---- a/drivers/input/misc/uinput.c -+++ b/drivers/input/misc/uinput.c -@@ -353,6 +353,7 @@ static int uinput_create_device(struct uinput_device *udev) - dev->flush = uinput_dev_flush; - } - -+ dev->flags |= INPUTDEV_FLAGS_SYNTHETIC; - dev->event = uinput_dev_event; - - input_set_drvdata(udev->dev, udev); -diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c -index 573b2055173c..7cc95a8bdf8d 100644 ---- a/drivers/tty/sysrq.c -+++ b/drivers/tty/sysrq.c -@@ -480,6 +480,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = { - /* x: May be registered on mips for TLB dump */ - /* x: May be registered on ppc/powerpc for xmon */ - /* x: May be registered on sparc64 for global PMU dump */ -+ /* x: May be registered on x86_64 for disabling secure boot */ - NULL, /* x */ - /* y: May be registered on sparc64 for global register dump */ - NULL, /* y */ -@@ -523,7 +524,7 @@ static void __sysrq_put_key_op(int key, struct sysrq_key_op *op_p) - sysrq_key_table[i] = op_p; - } - --void __handle_sysrq(int key, bool check_mask) -+void __handle_sysrq(int key, unsigned int from) - { - struct sysrq_key_op *op_p; - int orig_log_level; -@@ -546,11 +547,15 @@ void __handle_sysrq(int key, bool check_mask) - - op_p = __sysrq_get_key_op(key); - if (op_p) { -- /* -- * Should we check for enabled operations (/proc/sysrq-trigger -- * should not) and is the invoked operation enabled? -- */ -- if (!check_mask || sysrq_on_mask(op_p->enable_mask)) { -+ /* Ban synthetic events from some sysrq functionality */ -+ if ((from == SYSRQ_FROM_PROC || from == SYSRQ_FROM_SYNTHETIC) && -+ op_p->enable_mask & SYSRQ_DISABLE_USERSPACE) { -+ printk("This sysrq operation is disabled from userspace.\n"); -+ } else if (from == SYSRQ_FROM_KERNEL || sysrq_on_mask(op_p->enable_mask)) { -+ /* -+ * Should we check for enabled operations (/proc/sysrq-trigger -+ * should not) and is the invoked operation enabled? -+ */ - pr_info("%s\n", op_p->action_msg); - console_loglevel = orig_log_level; - op_p->handler(key); -@@ -585,7 +590,7 @@ void __handle_sysrq(int key, bool check_mask) - void handle_sysrq(int key) - { - if (sysrq_on()) -- __handle_sysrq(key, true); -+ __handle_sysrq(key, SYSRQ_FROM_KERNEL); - } - EXPORT_SYMBOL(handle_sysrq); - -@@ -665,7 +670,7 @@ static void sysrq_do_reset(struct timer_list *t) - static void sysrq_handle_reset_request(struct sysrq_state *state) - { - if (state->reset_requested) -- __handle_sysrq(sysrq_xlate[KEY_B], false); -+ __handle_sysrq(sysrq_xlate[KEY_B], SYSRQ_FROM_KERNEL); - - if (sysrq_reset_downtime_ms) - mod_timer(&state->keyreset_timer, -@@ -818,8 +823,10 @@ static bool sysrq_handle_keypress(struct sysrq_state *sysrq, - - default: - if (sysrq->active && value && value != 2) { -+ int from = sysrq->handle.dev->flags & INPUTDEV_FLAGS_SYNTHETIC ? -+ SYSRQ_FROM_SYNTHETIC : 0; - sysrq->need_reinject = false; -- __handle_sysrq(sysrq_xlate[code], true); -+ __handle_sysrq(sysrq_xlate[code], from); - } - break; - } -@@ -1102,7 +1109,7 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf, - - if (get_user(c, buf)) - return -EFAULT; -- __handle_sysrq(c, false); -+ __handle_sysrq(c, SYSRQ_FROM_PROC); - } - - return count; -diff --git a/include/linux/input.h b/include/linux/input.h -index 510e78558c10..7e7065b2f58a 100644 ---- a/include/linux/input.h -+++ b/include/linux/input.h -@@ -39,6 +39,7 @@ struct input_value { - * @phys: physical path to the device in the system hierarchy - * @uniq: unique identification code for the device (if device has it) - * @id: id of the device (struct input_id) -+ * @flags: input device flags (SYNTHETIC, etc.) - * @propbit: bitmap of device properties and quirks - * @evbit: bitmap of types of events supported by the device (EV_KEY, - * EV_REL, etc.) -@@ -121,6 +122,8 @@ struct input_dev { - const char *uniq; - struct input_id id; - -+ unsigned int flags; -+ - unsigned long propbit[BITS_TO_LONGS(INPUT_PROP_CNT)]; - - unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; -@@ -187,6 +190,8 @@ struct input_dev { - }; - #define to_input_dev(d) container_of(d, struct input_dev, dev) - -+#define INPUTDEV_FLAGS_SYNTHETIC 0x000000001 -+ - /* - * Verify that we are in sync with input_device_id mod_devicetable.h #defines - */ -diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h -index 8c71874e8485..7de1f08b60a9 100644 ---- a/include/linux/sysrq.h -+++ b/include/linux/sysrq.h -@@ -29,6 +29,8 @@ - #define SYSRQ_ENABLE_BOOT 0x0080 - #define SYSRQ_ENABLE_RTNICE 0x0100 - -+#define SYSRQ_DISABLE_USERSPACE 0x00010000 -+ - struct sysrq_key_op { - void (*handler)(int); - char *help_msg; -@@ -43,8 +45,12 @@ struct sysrq_key_op { - * are available -- else NULL's). - */ - -+#define SYSRQ_FROM_KERNEL 0x0001 -+#define SYSRQ_FROM_PROC 0x0002 -+#define SYSRQ_FROM_SYNTHETIC 0x0004 -+ - void handle_sysrq(int key); --void __handle_sysrq(int key, bool check_mask); -+void __handle_sysrq(int key, unsigned int from); - int register_sysrq_key(int key, struct sysrq_key_op *op); - int unregister_sysrq_key(int key, struct sysrq_key_op *op); - struct sysrq_key_op *__sysrq_get_key_op(int key); -diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c -index 9ecfa37c7fbf..902b7785d7dc 100644 ---- a/kernel/debug/kdb/kdb_main.c -+++ b/kernel/debug/kdb/kdb_main.c -@@ -1981,7 +1981,7 @@ static int kdb_sr(int argc, const char **argv) - return KDB_ARGCOUNT; - - kdb_trap_printk++; -- __handle_sysrq(*argv[1], check_mask); -+ __handle_sysrq(*argv[1], check_mask ? SYSRQ_FROM_KERNEL : 0); - kdb_trap_printk--; - - return 0; -diff --git a/security/Kconfig b/security/Kconfig -index 720cf9dee2b4..fe08b674bfce 100644 ---- a/security/Kconfig -+++ b/security/Kconfig -@@ -245,6 +245,16 @@ config LOCK_DOWN_KERNEL_FORCE - help - Enable the kernel lock down functionality automatically at boot. - -+config ALLOW_LOCKDOWN_LIFT_BY_SYSRQ -+ bool "Allow the kernel lockdown to be lifted by SysRq" -+ depends on LOCK_DOWN_KERNEL -+ depends on !LOCK_DOWN_KERNEL_FORCE -+ depends on MAGIC_SYSRQ -+ depends on X86 -+ help -+ Allow the lockdown on a kernel to be lifted, by pressing a SysRq key -+ combination on a wired keyboard. On x86, this is SysRq+x. -+ - source "security/selinux/Kconfig" - source "security/smack/Kconfig" - source "security/tomoyo/Kconfig" -diff --git a/security/lock_down.c b/security/lock_down.c -index ee00ca2677e7..d68dff872ced 100644 ---- a/security/lock_down.c -+++ b/security/lock_down.c -@@ -12,8 +12,14 @@ - - #include - #include -+#include -+#include - -+#ifdef CONFIG_ALLOW_LOCKDOWN_LIFT_BY_SYSRQ -+static __read_mostly bool kernel_locked_down; -+#else - static __ro_after_init bool kernel_locked_down; -+#endif - - /* - * Put the kernel into lock-down mode. -@@ -58,3 +64,44 @@ bool __kernel_is_locked_down(const char *what, bool first) - return kernel_locked_down; - } - EXPORT_SYMBOL(__kernel_is_locked_down); -+ -+#ifdef CONFIG_ALLOW_LOCKDOWN_LIFT_BY_SYSRQ -+ -+/* -+ * Take the kernel out of lockdown mode. -+ */ -+static void lift_kernel_lockdown(void) -+{ -+ pr_notice("Lifting lockdown\n"); -+ kernel_locked_down = false; -+} -+ -+/* -+ * Allow lockdown to be lifted by pressing something like SysRq+x (and not by -+ * echoing the appropriate letter into the sysrq-trigger file). -+ */ -+static void sysrq_handle_lockdown_lift(int key) -+{ -+ if (kernel_locked_down) -+ lift_kernel_lockdown(); -+} -+ -+static struct sysrq_key_op lockdown_lift_sysrq_op = { -+ .handler = sysrq_handle_lockdown_lift, -+ .help_msg = "unSB(x)", -+ .action_msg = "Disabling Secure Boot restrictions", -+ .enable_mask = SYSRQ_DISABLE_USERSPACE, -+}; -+ -+static int __init lockdown_lift_sysrq(void) -+{ -+ if (kernel_locked_down) { -+ lockdown_lift_sysrq_op.help_msg[5] = LOCKDOWN_LIFT_KEY; -+ register_sysrq_key(LOCKDOWN_LIFT_KEY, &lockdown_lift_sysrq_op); -+ } -+ return 0; -+} -+ -+late_initcall(lockdown_lift_sysrq); -+ -+#endif /* CONFIG_ALLOW_LOCKDOWN_LIFT_BY_SYSRQ */ --- -2.21.0 - - -From c3e9fb754f7603ae10a750f685f0174c5ae51ffa Mon Sep 17 00:00:00 2001 -From: Vasily Gorbik -Date: Wed, 21 Nov 2018 13:05:10 +0100 -Subject: [PATCH 29/29] debugfs: avoid EPERM when no open file operation - defined - -With "debugfs: Restrict debugfs when the kernel is locked down" -return code "r" is unconditionally set to -EPERM, which stays like that -until function return if no "open" file operation defined, effectivelly -resulting in "Operation not permitted" for all such files despite kernel -lock down status or CONFIG_LOCK_DOWN_KERNEL being enabled. - -In particular this breaks 2 debugfs files on s390: -/sys/kernel/debug/s390_hypfs/diag_304 -/sys/kernel/debug/s390_hypfs/diag_204 - -To address that set EPERM return code only when debugfs_is_locked_down -returns true. - -Fixes: 3fc322605158 ("debugfs: Restrict debugfs when the kernel is locked down") -Signed-off-by: Vasily Gorbik ---- - fs/debugfs/file.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c -index 8eeff9068228..9c56e1aa1f29 100644 ---- a/fs/debugfs/file.c -+++ b/fs/debugfs/file.c -@@ -167,9 +167,10 @@ static int open_proxy_open(struct inode *inode, struct file *filp) - - real_fops = debugfs_real_fops(filp); - -- r = -EPERM; -- if (debugfs_is_locked_down(inode, filp, real_fops)) -+ if (debugfs_is_locked_down(inode, filp, real_fops)) { -+ r = -EPERM; - goto out; -+ } - - real_fops = fops_get(real_fops); - if (!real_fops) { -@@ -296,9 +297,10 @@ static int full_proxy_open(struct inode *inode, struct file *filp) - return r == -EIO ? -ENOENT : r; - - real_fops = debugfs_real_fops(filp); -- r = -EPERM; -- if (debugfs_is_locked_down(inode, filp, real_fops)) -+ if (debugfs_is_locked_down(inode, filp, real_fops)) { -+ r = -EPERM; - goto out; -+ } - - real_fops = fops_get(real_fops); - if (!real_fops) { --- -2.21.0 - diff --git a/efi-secureboot.patch b/efi-secureboot.patch index bb5b47b42..ee5382029 100644 --- a/efi-secureboot.patch +++ b/efi-secureboot.patch @@ -1,7 +1,109 @@ +From 478a0cff698409224330ea9e25eb332220b55dbb Mon Sep 17 00:00:00 2001 +From: Jeremy Cline +Date: Mon, 30 Sep 2019 21:22:47 +0000 +Subject: [PATCH 1/3] security: lockdown: expose a hook to lock the kernel down + +In order to automatically lock down kernels running on UEFI machines +booted in Secure Boot mode, expose the lock_kernel_down() hook. + +Signed-off-by: Jeremy Cline +--- + include/linux/lsm_hooks.h | 8 ++++++++ + include/linux/security.h | 5 +++++ + security/lockdown/lockdown.c | 1 + + security/security.c | 6 ++++++ + 4 files changed, 20 insertions(+) + +diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h +index a3763247547c..8d76d1f153ed 100644 +--- a/include/linux/lsm_hooks.h ++++ b/include/linux/lsm_hooks.h +@@ -1454,6 +1454,12 @@ + * code execution in kernel space should be permitted. + * + * @what: kernel feature being accessed ++ * ++ * @lock_kernel_down ++ * Put the kernel into lock-down mode. ++ * ++ * @where: Where the lock-down is originating from (e.g. command line option) ++ * @level: The lock-down level (can only increase) + */ + union security_list_options { + int (*binder_set_context_mgr)(struct task_struct *mgr); +@@ -1818,6 +1824,7 @@ union security_list_options { + void (*bpf_prog_free_security)(struct bpf_prog_aux *aux); + #endif /* CONFIG_BPF_SYSCALL */ + int (*locked_down)(enum lockdown_reason what); ++ int (*lock_kernel_down)(const char *where, enum lockdown_reason level); + }; + + struct security_hook_heads { +@@ -2060,6 +2067,7 @@ struct security_hook_heads { + struct hlist_head bpf_prog_free_security; + #endif /* CONFIG_BPF_SYSCALL */ + struct hlist_head locked_down; ++ struct hlist_head lock_kernel_down; + } __randomize_layout; + + /* +diff --git a/include/linux/security.h b/include/linux/security.h +index a8d59d612d27..467b9ccdf993 100644 +--- a/include/linux/security.h ++++ b/include/linux/security.h +@@ -442,6 +442,7 @@ int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen); + int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen); + int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen); + int security_locked_down(enum lockdown_reason what); ++int security_lock_kernel_down(const char *where, enum lockdown_reason level); + #else /* CONFIG_SECURITY */ + + static inline int call_blocking_lsm_notifier(enum lsm_event event, void *data) +@@ -1269,6 +1270,10 @@ static inline int security_locked_down(enum lockdown_reason what) + { + return 0; + } ++static inline int security_lock_kernel_down(const char *where, enum lockdown_reason level) ++{ ++ return 0; ++} + #endif /* CONFIG_SECURITY */ + + #ifdef CONFIG_SECURITY_NETWORK +diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c +index 8a10b43daf74..72a623075749 100644 +--- a/security/lockdown/lockdown.c ++++ b/security/lockdown/lockdown.c +@@ -97,6 +97,7 @@ static int lockdown_is_locked_down(enum lockdown_reason what) + + static struct security_hook_list lockdown_hooks[] __lsm_ro_after_init = { + LSM_HOOK_INIT(locked_down, lockdown_is_locked_down), ++ LSM_HOOK_INIT(lock_kernel_down, lock_kernel_down), + }; + + static int __init lockdown_lsm_init(void) +diff --git a/security/security.c b/security/security.c +index 1bc000f834e2..1506b95427cf 100644 +--- a/security/security.c ++++ b/security/security.c +@@ -2404,3 +2404,9 @@ int security_locked_down(enum lockdown_reason what) + return call_int_hook(locked_down, 0, what); + } + EXPORT_SYMBOL(security_locked_down); ++ ++int security_lock_kernel_down(const char *where, enum lockdown_reason level) ++{ ++ return call_int_hook(lock_kernel_down, 0, where, level); ++} ++EXPORT_SYMBOL(security_lock_kernel_down); +-- +2.21.0 + + From b5123d0553f4ed5e734f6457696cdd30228d1eee Mon Sep 17 00:00:00 2001 From: David Howells Date: Tue, 27 Feb 2018 10:04:55 +0000 -Subject: [PATCH 29/31] efi: Add an EFI_SECURE_BOOT flag to indicate secure +Subject: [PATCH 2/3] efi: Add an EFI_SECURE_BOOT flag to indicate secure boot mode UEFI machines can be booted in Secure Boot mode. Add an EFI_SECURE_BOOT @@ -15,6 +117,7 @@ Suggested-by: Ard Biesheuvel Signed-off-by: David Howells Reviewed-by: Ard Biesheuvel cc: linux-efi@vger.kernel.org +[Rebased for context; efi_is_table_address was moved to arch/x86] Signed-off-by: Jeremy Cline --- arch/x86/kernel/setup.c | 14 +----------- @@ -25,10 +128,10 @@ Signed-off-by: Jeremy Cline create mode 100644 drivers/firmware/efi/secureboot.c diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index b74e7bfed6ab..7da1712c89c9 100644 +index bbe35bf879f5..7e528b6af86b 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c -@@ -1158,19 +1158,7 @@ void __init setup_arch(char **cmdline_p) +@@ -1179,19 +1179,7 @@ void __init setup_arch(char **cmdline_p) /* Allocate bigger log buffer */ setup_log_buf(1); @@ -50,7 +153,7 @@ index b74e7bfed6ab..7da1712c89c9 100644 reserve_initrd(); diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile -index 5f9f5039de50..7a0a6378203e 100644 +index 4ac2de4dfa72..195b078a423c 100644 --- a/drivers/firmware/efi/Makefile +++ b/drivers/firmware/efi/Makefile @@ -24,6 +24,7 @@ obj-$(CONFIG_EFI_FAKE_MEMMAP) += fake_mem.o @@ -59,8 +162,8 @@ index 5f9f5039de50..7a0a6378203e 100644 obj-$(CONFIG_EFI_DEV_PATH_PARSER) += dev-path-parser.o +obj-$(CONFIG_EFI) += secureboot.o obj-$(CONFIG_APPLE_PROPERTIES) += apple-properties.o + obj-$(CONFIG_EFI_RCI2_TABLE) += rci2-table.o - arm-obj-$(CONFIG_EFI) := arm-init.o arm-runtime.o diff --git a/drivers/firmware/efi/secureboot.c b/drivers/firmware/efi/secureboot.c new file mode 100644 index 000000000000..9070055de0a1 @@ -106,10 +209,10 @@ index 000000000000..9070055de0a1 + } +} diff --git a/include/linux/efi.h b/include/linux/efi.h -index 100ce4a4aff6..62361b647a75 100644 +index 21d81021c1f4..758ec061d03b 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h -@@ -1155,6 +1155,14 @@ extern int __init efi_setup_pcdp_console(char *); +@@ -1204,6 +1204,14 @@ extern int __init efi_setup_pcdp_console(char *); #define EFI_DBG 8 /* Print additional debug info at runtime */ #define EFI_NX_PE_DATA 9 /* Can runtime data regions be mapped non-executable? */ #define EFI_MEM_ATTR 10 /* Did firmware publish an EFI_MEMORY_ATTRIBUTES table? */ @@ -124,16 +227,16 @@ index 100ce4a4aff6..62361b647a75 100644 #ifdef CONFIG_EFI /* -@@ -1198,6 +1206,8 @@ static inline bool efi_enabled(int feature) +@@ -1214,6 +1222,8 @@ static inline bool efi_enabled(int feature) + return test_bit(feature, &efi.flags) != 0; + } extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused); - - extern bool efi_is_table_address(unsigned long phys_addr); + +extern void __init efi_set_secure_boot(enum efi_secureboot_mode mode); #else static inline bool efi_enabled(int feature) { -@@ -1216,6 +1226,8 @@ static inline bool efi_is_table_address(unsigned long phys_addr) +@@ -1227,6 +1237,8 @@ efi_capsule_pending(int *reset_type) { return false; } @@ -142,9 +245,7 @@ index 100ce4a4aff6..62361b647a75 100644 #endif extern int efi_status_to_err(efi_status_t status); -@@ -1577,12 +1589,6 @@ efi_status_t efi_setup_gop(efi_system_table_t *sys_table_arg, - #endif - +@@ -1619,12 +1631,6 @@ static inline bool efi_runtime_disabled(void) { return true; } extern void efi_call_virt_check_flags(unsigned long flags, const char *call); extern unsigned long efi_call_virt_save_flags(void); @@ -158,121 +259,76 @@ index 100ce4a4aff6..62361b647a75 100644 #ifdef CONFIG_RESET_ATTACK_MITIGATION -- -2.19.1 +2.21.0 -From d78bf678059f83e22bec8ada1a448e22b9b90203 Mon Sep 17 00:00:00 2001 + +From 15368f76d4997912318d35c52bfeb9041d85098e Mon Sep 17 00:00:00 2001 From: David Howells -Date: Tue, 27 Feb 2018 10:04:55 +0000 -Subject: [PATCH 30/31] efi: Lock down the kernel if booted in secure boot mode +Date: Mon, 30 Sep 2019 21:28:16 +0000 +Subject: [PATCH 3/3] efi: Lock down the kernel if booted in secure boot mode -UEFI Secure Boot provides a mechanism for ensuring that the firmware will -only load signed bootloaders and kernels. Certain use cases may also -require that all kernel modules also be signed. Add a configuration option -that to lock down the kernel - which includes requiring validly signed -modules - if the kernel is secure-booted. +UEFI Secure Boot provides a mechanism for ensuring that the firmware +will only load signed bootloaders and kernels. Certain use cases may +also require that all kernel modules also be signed. Add a +configuration option that to lock down the kernel - which includes +requiring validly signed modules - if the kernel is secure-booted. Signed-off-by: David Howells -Acked-by: Ard Biesheuvel -cc: linux-efi@vger.kernel.org +Signed-off-by: Jeremy Cline --- - arch/x86/kernel/setup.c | 6 ++++-- - fs/debugfs/inode.c | 2 +- - security/Kconfig | 14 ++++++++++++++ - security/lock_down.c | 5 +++++ - 4 files changed, 20 insertions(+), 3 deletions(-) + arch/x86/kernel/setup.c | 8 ++++++++ + security/lockdown/Kconfig | 13 +++++++++++++ + 2 files changed, 21 insertions(+) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index adeee6329f55..27a54ec878bd 100644 +index 77ea96b794bd..a119e1bc9623 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c -@@ -65,6 +65,7 @@ - #include - #include - #include +@@ -73,6 +73,7 @@ + #include + #include + #include +#include - #include - #include -@@ -1005,6 +1006,10 @@ void __init setup_arch(char **cmdline_p) + #include + #include