From: Greg Kroah-Hartman Date: Fri, 19 Jun 2020 08:24:31 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v4.4.228~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=99a68c11ead6c4f89d8a42502227911c40e18c23;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: carl9170-remove-p2p_go-support.patch e1000e-disable-tso-for-buffer-overrun-workaround.patch e1000e-relax-condition-to-trigger-reset-for-me-workaround.patch media-cedrus-program-output-format-during-each-run.patch media-go7007-fix-a-miss-of-snd_card_free.patch pci-program-mps-for-rciep-devices.patch --- diff --git a/queue-5.4/carl9170-remove-p2p_go-support.patch b/queue-5.4/carl9170-remove-p2p_go-support.patch new file mode 100644 index 00000000000..54d09816e2d --- /dev/null +++ b/queue-5.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 +@@ -338,9 +338,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-5.4/e1000e-disable-tso-for-buffer-overrun-workaround.patch b/queue-5.4/e1000e-disable-tso-for-buffer-overrun-workaround.patch new file mode 100644 index 00000000000..b11d2fc5876 --- /dev/null +++ b/queue-5.4/e1000e-disable-tso-for-buffer-overrun-workaround.patch @@ -0,0 +1,41 @@ +From f29801030ac67bf98b7a65d3aea67b30769d4f7c Mon Sep 17 00:00:00 2001 +From: Kai-Heng Feng +Date: Thu, 7 May 2020 22:21:07 +0800 +Subject: e1000e: Disable TSO for buffer overrun workaround + +From: Kai-Heng Feng + +commit f29801030ac67bf98b7a65d3aea67b30769d4f7c upstream. + +Commit b10effb92e27 ("e1000e: fix buffer overrun while the I219 is +processing DMA transactions") imposes roughly 30% performance penalty. + +The commit log states that "Disabling TSO eliminates performance loss +for TCP traffic without a noticeable impact on CPU performance", so +let's disable TSO by default to regain the loss. + +CC: stable +Fixes: b10effb92e27 ("e1000e: fix buffer overrun while the I219 is processing DMA transactions") +BugLink: https://bugs.launchpad.net/bugs/1802691 +Signed-off-by: Kai-Heng Feng +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -5289,6 +5289,10 @@ static void e1000_watchdog_task(struct w + /* oops */ + break; + } ++ if (hw->mac.type == e1000_pch_spt) { ++ netdev->features &= ~NETIF_F_TSO; ++ netdev->features &= ~NETIF_F_TSO6; ++ } + } + + /* enable transmits in the hardware, need to do this diff --git a/queue-5.4/e1000e-relax-condition-to-trigger-reset-for-me-workaround.patch b/queue-5.4/e1000e-relax-condition-to-trigger-reset-for-me-workaround.patch new file mode 100644 index 00000000000..e423eb295ce --- /dev/null +++ b/queue-5.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 +@@ -576,7 +576,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 +@@ -119,14 +119,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) +@@ -607,11 +605,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); +@@ -624,11 +622,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-5.4/media-cedrus-program-output-format-during-each-run.patch b/queue-5.4/media-cedrus-program-output-format-during-each-run.patch new file mode 100644 index 00000000000..7766081ad84 --- /dev/null +++ b/queue-5.4/media-cedrus-program-output-format-during-each-run.patch @@ -0,0 +1,70 @@ +From a8876c22eab9a871834f85de83e98bbf7e6e264d Mon Sep 17 00:00:00 2001 +From: Samuel Holland +Date: Sat, 9 May 2020 22:06:42 +0200 +Subject: media: cedrus: Program output format during each run + +From: Samuel Holland + +commit a8876c22eab9a871834f85de83e98bbf7e6e264d upstream. + +Previously, the output format was programmed as part of the ioctl() +handler. However, this has two problems: + + 1) If there are multiple active streams with different output + formats, the hardware will use whichever format was set last + for both streams. Similarly, an ioctl() done in an inactive + context will wrongly affect other active contexts. + 2) The registers are written while the device is not actively + streaming. To enable runtime PM tied to the streaming state, + all hardware access needs to be moved inside cedrus_device_run(). + +The call to cedrus_dst_format_set() is now placed just before the +codec-specific callback that programs the hardware. + +Cc: +Fixes: 50e761516f2b ("media: platform: Add Cedrus VPU decoder driver") +Suggested-by: Jernej Skrabec +Suggested-by: Paul Kocialkowski +Signed-off-by: Samuel Holland +Tested-by: Jernej Skrabec +Reviewed-by: Jernej Skrabec +Reviewed-by: Ezequiel Garcia +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/media/sunxi/cedrus/cedrus_dec.c | 2 ++ + drivers/staging/media/sunxi/cedrus/cedrus_video.c | 3 --- + 2 files changed, 2 insertions(+), 3 deletions(-) + +--- a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c ++++ b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c +@@ -65,6 +65,8 @@ void cedrus_device_run(void *priv) + + v4l2_m2m_buf_copy_metadata(run.src, run.dst, true); + ++ cedrus_dst_format_set(dev, &ctx->dst_fmt); ++ + dev->dec_ops[ctx->current_codec]->setup(ctx, &run); + + /* Complete request(s) controls if needed. */ +--- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c ++++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c +@@ -286,7 +286,6 @@ static int cedrus_s_fmt_vid_cap(struct f + struct v4l2_format *f) + { + struct cedrus_ctx *ctx = cedrus_file2ctx(file); +- struct cedrus_dev *dev = ctx->dev; + struct vb2_queue *vq; + int ret; + +@@ -300,8 +299,6 @@ static int cedrus_s_fmt_vid_cap(struct f + + ctx->dst_fmt = f->fmt.pix; + +- cedrus_dst_format_set(dev, &ctx->dst_fmt); +- + return 0; + } + diff --git a/queue-5.4/media-go7007-fix-a-miss-of-snd_card_free.patch b/queue-5.4/media-go7007-fix-a-miss-of-snd_card_free.patch new file mode 100644 index 00000000000..aac819ac086 --- /dev/null +++ b/queue-5.4/media-go7007-fix-a-miss-of-snd_card_free.patch @@ -0,0 +1,83 @@ +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 +Cc: 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 +@@ -236,22 +236,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; ++ + strscpy(gosnd->card->driver, "go7007", sizeof(gosnd->card->driver)); + strscpy(gosnd->card->shortname, go->name, sizeof(gosnd->card->shortname)); + strscpy(gosnd->card->longname, gosnd->card->shortname, +@@ -262,11 +258,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; +@@ -274,6 +267,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-5.4/pci-program-mps-for-rciep-devices.patch b/queue-5.4/pci-program-mps-for-rciep-devices.patch new file mode 100644 index 00000000000..0f92411e008 --- /dev/null +++ b/queue-5.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 +@@ -1889,13 +1889,33 @@ static void pci_configure_mps(struct pci + struct pci_dev *bridge = pci_upstream_bridge(dev); + int mps, mpss, 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-5.4/series b/queue-5.4/series index 01dd8afbbe7..b4eab8b268b 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -192,3 +192,9 @@ serial-8250_pci-move-pericom-ids-to-pci_ids.h.patch x86-amd_nb-add-amd-family-17h-model-60h-pci-ids.patch ima-remove-redundant-policy-rule-set-in-add_rules.patch ima-set-again-build_ima_appraise-variable.patch +pci-program-mps-for-rciep-devices.patch +e1000e-disable-tso-for-buffer-overrun-workaround.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 +media-cedrus-program-output-format-during-each-run.patch