From bc7e758e51a293f7d4ed557a156e2f12b5bedf21 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 19 Jun 2020 10:23:16 +0200 Subject: [PATCH] 4.4-stable patches added patches: carl9170-remove-p2p_go-support.patch e1000e-relax-condition-to-trigger-reset-for-me-workaround.patch media-go7007-fix-a-miss-of-snd_card_free.patch pci-program-mps-for-rciep-devices.patch --- .../carl9170-remove-p2p_go-support.patch | 80 +++++++++++++++++ ...n-to-trigger-reset-for-me-workaround.patch | 89 +++++++++++++++++++ ...a-go7007-fix-a-miss-of-snd_card_free.patch | 86 ++++++++++++++++++ .../pci-program-mps-for-rciep-devices.patch | 67 ++++++++++++++ queue-4.4/series | 4 + 5 files changed, 326 insertions(+) create mode 100644 queue-4.4/carl9170-remove-p2p_go-support.patch create mode 100644 queue-4.4/e1000e-relax-condition-to-trigger-reset-for-me-workaround.patch create mode 100644 queue-4.4/media-go7007-fix-a-miss-of-snd_card_free.patch create mode 100644 queue-4.4/pci-program-mps-for-rciep-devices.patch diff --git a/queue-4.4/carl9170-remove-p2p_go-support.patch b/queue-4.4/carl9170-remove-p2p_go-support.patch new file mode 100644 index 00000000000..ca799ea9496 --- /dev/null +++ b/queue-4.4/carl9170-remove-p2p_go-support.patch @@ -0,0 +1,80 @@ +From b14fba7ebd04082f7767a11daea7f12f3593de22 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Tue, 5 May 2020 10:42:09 +0300 +Subject: carl9170: remove P2P_GO support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Christian Lamparter + +commit b14fba7ebd04082f7767a11daea7f12f3593de22 upstream. + +This patch follows up on a bug-report by Frank Schäfer that +discovered P2P GO wasn't working with wpa_supplicant. +This patch removes part of the broken P2P GO support but +keeps the vif switchover code in place. + +Cc: +Link: +Reported-by: Frank Schäfer +Signed-off-by: Christian Lamparter +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20200425092811.9494-1-chunkeey@gmail.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/carl9170/fw.c | 4 +--- + drivers/net/wireless/ath/carl9170/main.c | 21 ++++----------------- + 2 files changed, 5 insertions(+), 20 deletions(-) + +--- a/drivers/net/wireless/ath/carl9170/fw.c ++++ b/drivers/net/wireless/ath/carl9170/fw.c +@@ -351,9 +351,7 @@ static int carl9170_fw(struct ar9170 *ar + ar->hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_ADHOC); + + if (SUPP(CARL9170FW_WLANTX_CAB)) { +- if_comb_types |= +- BIT(NL80211_IFTYPE_AP) | +- BIT(NL80211_IFTYPE_P2P_GO); ++ if_comb_types |= BIT(NL80211_IFTYPE_AP); + + #ifdef CONFIG_MAC80211_MESH + if_comb_types |= +--- a/drivers/net/wireless/ath/carl9170/main.c ++++ b/drivers/net/wireless/ath/carl9170/main.c +@@ -582,11 +582,10 @@ static int carl9170_init_interface(struc + ar->disable_offload |= ((vif->type != NL80211_IFTYPE_STATION) && + (vif->type != NL80211_IFTYPE_AP)); + +- /* While the driver supports HW offload in a single +- * P2P client configuration, it doesn't support HW +- * offload in the favourit, concurrent P2P GO+CLIENT +- * configuration. Hence, HW offload will always be +- * disabled for P2P. ++ /* The driver used to have P2P GO+CLIENT support, ++ * but since this was dropped and we don't know if ++ * there are any gremlins lurking in the shadows, ++ * so best we keep HW offload disabled for P2P. + */ + ar->disable_offload |= vif->p2p; + +@@ -639,18 +638,6 @@ static int carl9170_op_add_interface(str + if (vif->type == NL80211_IFTYPE_STATION) + break; + +- /* P2P GO [master] use-case +- * Because the P2P GO station is selected dynamically +- * by all participating peers of a WIFI Direct network, +- * the driver has be able to change the main interface +- * operating mode on the fly. +- */ +- if (main_vif->p2p && vif->p2p && +- vif->type == NL80211_IFTYPE_AP) { +- old_main = main_vif; +- break; +- } +- + err = -EBUSY; + rcu_read_unlock(); + diff --git a/queue-4.4/e1000e-relax-condition-to-trigger-reset-for-me-workaround.patch b/queue-4.4/e1000e-relax-condition-to-trigger-reset-for-me-workaround.patch new file mode 100644 index 00000000000..10b557cb375 --- /dev/null +++ b/queue-4.4/e1000e-relax-condition-to-trigger-reset-for-me-workaround.patch @@ -0,0 +1,89 @@ +From d601afcae2febc49665008e9a79e701248d56c50 Mon Sep 17 00:00:00 2001 +From: Punit Agrawal +Date: Fri, 15 May 2020 13:31:27 +0900 +Subject: e1000e: Relax condition to trigger reset for ME workaround + +From: Punit Agrawal + +commit d601afcae2febc49665008e9a79e701248d56c50 upstream. + +It's an error if the value of the RX/TX tail descriptor does not match +what was written. The error condition is true regardless the duration +of the interference from ME. But the driver only performs the reset if +E1000_ICH_FWSM_PCIM2PCI_COUNT (2000) iterations of 50us delay have +transpired. The extra condition can lead to inconsistency between the +state of hardware as expected by the driver. + +Fix this by dropping the check for number of delay iterations. + +While at it, also make __ew32_prepare() static as it's not used +anywhere else. + +CC: stable +Signed-off-by: Punit Agrawal +Reviewed-by: Alexander Duyck +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/intel/e1000e/e1000.h | 1 - + drivers/net/ethernet/intel/e1000e/netdev.c | 12 +++++------- + 2 files changed, 5 insertions(+), 8 deletions(-) + +--- a/drivers/net/ethernet/intel/e1000e/e1000.h ++++ b/drivers/net/ethernet/intel/e1000e/e1000.h +@@ -585,7 +585,6 @@ static inline u32 __er32(struct e1000_hw + + #define er32(reg) __er32(hw, E1000_##reg) + +-s32 __ew32_prepare(struct e1000_hw *hw); + void __ew32(struct e1000_hw *hw, unsigned long reg, u32 val); + + #define ew32(reg, val) __ew32(hw, E1000_##reg, (val)) +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -136,14 +136,12 @@ static const struct e1000_reg_info e1000 + * has bit 24 set while ME is accessing MAC CSR registers, wait if it is set + * and try again a number of times. + **/ +-s32 __ew32_prepare(struct e1000_hw *hw) ++static void __ew32_prepare(struct e1000_hw *hw) + { + s32 i = E1000_ICH_FWSM_PCIM2PCI_COUNT; + + while ((er32(FWSM) & E1000_ICH_FWSM_PCIM2PCI) && --i) + udelay(50); +- +- return i; + } + + void __ew32(struct e1000_hw *hw, unsigned long reg, u32 val) +@@ -624,11 +622,11 @@ static void e1000e_update_rdt_wa(struct + { + struct e1000_adapter *adapter = rx_ring->adapter; + struct e1000_hw *hw = &adapter->hw; +- s32 ret_val = __ew32_prepare(hw); + ++ __ew32_prepare(hw); + writel(i, rx_ring->tail); + +- if (unlikely(!ret_val && (i != readl(rx_ring->tail)))) { ++ if (unlikely(i != readl(rx_ring->tail))) { + u32 rctl = er32(RCTL); + + ew32(RCTL, rctl & ~E1000_RCTL_EN); +@@ -641,11 +639,11 @@ static void e1000e_update_tdt_wa(struct + { + struct e1000_adapter *adapter = tx_ring->adapter; + struct e1000_hw *hw = &adapter->hw; +- s32 ret_val = __ew32_prepare(hw); + ++ __ew32_prepare(hw); + writel(i, tx_ring->tail); + +- if (unlikely(!ret_val && (i != readl(tx_ring->tail)))) { ++ if (unlikely(i != readl(tx_ring->tail))) { + u32 tctl = er32(TCTL); + + ew32(TCTL, tctl & ~E1000_TCTL_EN); diff --git a/queue-4.4/media-go7007-fix-a-miss-of-snd_card_free.patch b/queue-4.4/media-go7007-fix-a-miss-of-snd_card_free.patch new file mode 100644 index 00000000000..9a9c98eb811 --- /dev/null +++ b/queue-4.4/media-go7007-fix-a-miss-of-snd_card_free.patch @@ -0,0 +1,86 @@ +From 9453264ef58638ce8976121ac44c07a3ef375983 Mon Sep 17 00:00:00 2001 +From: Chuhong Yuan +Date: Tue, 10 Dec 2019 04:15:48 +0100 +Subject: media: go7007: fix a miss of snd_card_free + +From: Chuhong Yuan + +commit 9453264ef58638ce8976121ac44c07a3ef375983 upstream. + +go7007_snd_init() misses a snd_card_free() in an error path. +Add the missed call to fix it. + +Signed-off-by: Chuhong Yuan +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +[Salvatore Bonaccorso: Adjust context for backport to versions which do +not contain c0decac19da3 ("media: use strscpy() instead of strlcpy()") +and ba78170ef153 ("media: go7007: Fix misuse of strscpy")] +Signed-off-by: Salvatore Bonaccorso +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/usb/go7007/snd-go7007.c | 35 ++++++++++++++++------------------ + 1 file changed, 17 insertions(+), 18 deletions(-) + +--- a/drivers/media/usb/go7007/snd-go7007.c ++++ b/drivers/media/usb/go7007/snd-go7007.c +@@ -243,22 +243,18 @@ int go7007_snd_init(struct go7007 *go) + gosnd->capturing = 0; + ret = snd_card_new(go->dev, index[dev], id[dev], THIS_MODULE, 0, + &gosnd->card); +- if (ret < 0) { +- kfree(gosnd); +- return ret; +- } ++ if (ret < 0) ++ goto free_snd; ++ + ret = snd_device_new(gosnd->card, SNDRV_DEV_LOWLEVEL, go, + &go7007_snd_device_ops); +- if (ret < 0) { +- kfree(gosnd); +- return ret; +- } ++ if (ret < 0) ++ goto free_card; ++ + ret = snd_pcm_new(gosnd->card, "go7007", 0, 0, 1, &gosnd->pcm); +- if (ret < 0) { +- snd_card_free(gosnd->card); +- kfree(gosnd); +- return ret; +- } ++ if (ret < 0) ++ goto free_card; ++ + strlcpy(gosnd->card->driver, "go7007", sizeof(gosnd->card->driver)); + strlcpy(gosnd->card->shortname, go->name, sizeof(gosnd->card->driver)); + strlcpy(gosnd->card->longname, gosnd->card->shortname, +@@ -269,11 +265,8 @@ int go7007_snd_init(struct go7007 *go) + &go7007_snd_capture_ops); + + ret = snd_card_register(gosnd->card); +- if (ret < 0) { +- snd_card_free(gosnd->card); +- kfree(gosnd); +- return ret; +- } ++ if (ret < 0) ++ goto free_card; + + gosnd->substream = NULL; + go->snd_context = gosnd; +@@ -281,6 +274,12 @@ int go7007_snd_init(struct go7007 *go) + ++dev; + + return 0; ++ ++free_card: ++ snd_card_free(gosnd->card); ++free_snd: ++ kfree(gosnd); ++ return ret; + } + EXPORT_SYMBOL(go7007_snd_init); + diff --git a/queue-4.4/pci-program-mps-for-rciep-devices.patch b/queue-4.4/pci-program-mps-for-rciep-devices.patch new file mode 100644 index 00000000000..5cce31093a9 --- /dev/null +++ b/queue-4.4/pci-program-mps-for-rciep-devices.patch @@ -0,0 +1,67 @@ +From aa0ce96d72dd2e1b0dfd0fb868f82876e7790878 Mon Sep 17 00:00:00 2001 +From: Ashok Raj +Date: Fri, 27 Mar 2020 14:16:15 -0700 +Subject: PCI: Program MPS for RCiEP devices + +From: Ashok Raj + +commit aa0ce96d72dd2e1b0dfd0fb868f82876e7790878 upstream. + +Root Complex Integrated Endpoints (RCiEPs) do not have an upstream bridge, +so pci_configure_mps() previously ignored them, which may result in reduced +performance. + +Instead, program the Max_Payload_Size of RCiEPs to the maximum supported +value (unless it is limited for the PCIE_BUS_PEER2PEER case). This also +affects the subsequent programming of Max_Read_Request_Size because Linux +programs MRRS based on the MPS value. + +Fixes: 9dae3a97297f ("PCI: Move MPS configuration check to pci_configure_device()") +Link: https://lore.kernel.org/r/1585343775-4019-1-git-send-email-ashok.raj@intel.com +Tested-by: Dave Jiang +Signed-off-by: Ashok Raj +Signed-off-by: Bjorn Helgaas +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/probe.c | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +--- a/drivers/pci/probe.c ++++ b/drivers/pci/probe.c +@@ -1335,13 +1335,33 @@ static void pci_configure_mps(struct pci + struct pci_dev *bridge = pci_upstream_bridge(dev); + int mps, p_mps, rc; + +- if (!pci_is_pcie(dev) || !bridge || !pci_is_pcie(bridge)) ++ if (!pci_is_pcie(dev)) + return; + + /* MPS and MRRS fields are of type 'RsvdP' for VFs, short-circuit out */ + if (dev->is_virtfn) + return; + ++ /* ++ * For Root Complex Integrated Endpoints, program the maximum ++ * supported value unless limited by the PCIE_BUS_PEER2PEER case. ++ */ ++ if (pci_pcie_type(dev) == PCI_EXP_TYPE_RC_END) { ++ if (pcie_bus_config == PCIE_BUS_PEER2PEER) ++ mps = 128; ++ else ++ mps = 128 << dev->pcie_mpss; ++ rc = pcie_set_mps(dev, mps); ++ if (rc) { ++ pci_warn(dev, "can't set Max Payload Size to %d; if necessary, use \"pci=pcie_bus_safe\" and report a bug\n", ++ mps); ++ } ++ return; ++ } ++ ++ if (!bridge || !pci_is_pcie(bridge)) ++ return; ++ + mps = pcie_get_mps(dev); + p_mps = pcie_get_mps(bridge); + diff --git a/queue-4.4/series b/queue-4.4/series index 3ee4acf69be..6c57d897f94 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -79,3 +79,7 @@ btrfs-fix-unreplayable-log-after-snapshot-delete-par.patch btrfs-send-emit-file-capabilities-after-chown.patch btrfs-fix-error-handling-when-submitting-direct-i-o-.patch ima-directly-assign-the-ima_default_policy-pointer-t.patch +pci-program-mps-for-rciep-devices.patch +e1000e-relax-condition-to-trigger-reset-for-me-workaround.patch +carl9170-remove-p2p_go-support.patch +media-go7007-fix-a-miss-of-snd_card_free.patch -- 2.47.3