From: Sasha Levin Date: Sun, 26 Sep 2021 22:59:06 +0000 (-0400) Subject: Fixes for 5.4 X-Git-Tag: v5.4.150~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c748d25b9b2ab2807600920687deb145e930be01;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.4 Signed-off-by: Sasha Levin --- diff --git a/queue-5.4/afs-fix-incorrect-triggering-of-sillyrename-on-3rd-p.patch b/queue-5.4/afs-fix-incorrect-triggering-of-sillyrename-on-3rd-p.patch new file mode 100644 index 00000000000..eb64a02dd89 --- /dev/null +++ b/queue-5.4/afs-fix-incorrect-triggering-of-sillyrename-on-3rd-p.patch @@ -0,0 +1,168 @@ +From d20bc91bbd3cb9c49e5f16699fe65e5624f105b7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 1 Sep 2021 18:11:33 +0100 +Subject: afs: Fix incorrect triggering of sillyrename on 3rd-party + invalidation + +From: David Howells + +[ Upstream commit 63d49d843ef5fffeea069e0ffdfbd2bf40ba01c6 ] + +The AFS filesystem is currently triggering the silly-rename cleanup from +afs_d_revalidate() when it sees that a dentry has been changed by a third +party[1]. It should not be doing this as the cleanup includes deleting the +silly-rename target file on iput. + +Fix this by removing the places in the d_revalidate handling that validate +anything other than the directory and the dirent. It probably should not +be looking to validate the target inode of the dentry also. + +This includes removing the point in afs_d_revalidate() where the inode that +a dentry used to point to was marked as being deleted (AFS_VNODE_DELETED). +We don't know it got deleted. It could have been renamed or it could have +hard links remaining. + +This was reproduced by cloning a git repo onto an afs volume on one +machine, switching to another machine and doing "git status", then +switching back to the first and doing "git status". The second status +would show weird output due to ".git/index" getting deleted by the above +mentioned mechanism. + +A simpler way to do it is to do: + + machine 1: touch a + machine 2: touch b; mv -f b a + machine 1: stat a + +on an afs volume. The bug shows up as the stat failing with ENOENT and the +file server log showing that machine 1 deleted "a". + +Fixes: 79ddbfa500b3 ("afs: Implement sillyrename for unlink and rename") +Reported-by: Markus Suvanto +Signed-off-by: David Howells +Tested-by: Markus Suvanto +cc: linux-afs@lists.infradead.org +Link: https://bugzilla.kernel.org/show_bug.cgi?id=214217#c4 [1] +Link: https://lore.kernel.org/r/163111668100.283156.3851669884664475428.stgit@warthog.procyon.org.uk/ +Signed-off-by: Sasha Levin +--- + fs/afs/dir.c | 46 +++++++--------------------------------------- + 1 file changed, 7 insertions(+), 39 deletions(-) + +diff --git a/fs/afs/dir.c b/fs/afs/dir.c +index e7494cd49ce7..8c39533d122a 100644 +--- a/fs/afs/dir.c ++++ b/fs/afs/dir.c +@@ -977,9 +977,9 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry, + */ + static int afs_d_revalidate_rcu(struct dentry *dentry) + { +- struct afs_vnode *dvnode, *vnode; ++ struct afs_vnode *dvnode; + struct dentry *parent; +- struct inode *dir, *inode; ++ struct inode *dir; + long dir_version, de_version; + + _enter("%p", dentry); +@@ -1009,18 +1009,6 @@ static int afs_d_revalidate_rcu(struct dentry *dentry) + return -ECHILD; + } + +- /* Check to see if the vnode referred to by the dentry still +- * has a callback. +- */ +- if (d_really_is_positive(dentry)) { +- inode = d_inode_rcu(dentry); +- if (inode) { +- vnode = AFS_FS_I(inode); +- if (!afs_check_validity(vnode)) +- return -ECHILD; +- } +- } +- + return 1; /* Still valid */ + } + +@@ -1056,17 +1044,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags) + if (IS_ERR(key)) + key = NULL; + +- if (d_really_is_positive(dentry)) { +- inode = d_inode(dentry); +- if (inode) { +- vnode = AFS_FS_I(inode); +- afs_validate(vnode, key); +- if (test_bit(AFS_VNODE_DELETED, &vnode->flags)) +- goto out_bad; +- } +- } +- +- /* lock down the parent dentry so we can peer at it */ ++ /* Hold the parent dentry so we can peer at it */ + parent = dget_parent(dentry); + dir = AFS_FS_I(d_inode(parent)); + +@@ -1075,7 +1053,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags) + + if (test_bit(AFS_VNODE_DELETED, &dir->flags)) { + _debug("%pd: parent dir deleted", dentry); +- goto out_bad_parent; ++ goto not_found; + } + + /* We only need to invalidate a dentry if the server's copy changed +@@ -1101,12 +1079,12 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags) + case 0: + /* the filename maps to something */ + if (d_really_is_negative(dentry)) +- goto out_bad_parent; ++ goto not_found; + inode = d_inode(dentry); + if (is_bad_inode(inode)) { + printk("kAFS: afs_d_revalidate: %pd2 has bad inode\n", + dentry); +- goto out_bad_parent; ++ goto not_found; + } + + vnode = AFS_FS_I(inode); +@@ -1128,9 +1106,6 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags) + dentry, fid.unique, + vnode->fid.unique, + vnode->vfs_inode.i_generation); +- write_seqlock(&vnode->cb_lock); +- set_bit(AFS_VNODE_DELETED, &vnode->flags); +- write_sequnlock(&vnode->cb_lock); + goto not_found; + } + goto out_valid; +@@ -1145,7 +1120,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags) + default: + _debug("failed to iterate dir %pd: %d", + parent, ret); +- goto out_bad_parent; ++ goto not_found; + } + + out_valid: +@@ -1156,16 +1131,9 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags) + _leave(" = 1 [valid]"); + return 1; + +- /* the dirent, if it exists, now points to a different vnode */ + not_found: +- spin_lock(&dentry->d_lock); +- dentry->d_flags |= DCACHE_NFSFS_RENAMED; +- spin_unlock(&dentry->d_lock); +- +-out_bad_parent: + _debug("dropping dentry %pd2", dentry); + dput(parent); +-out_bad: + key_put(key); + + _leave(" = 0 [bad]"); +-- +2.33.0 + diff --git a/queue-5.4/bnxt_en-fix-tx-timeout-when-tx-ring-size-is-set-to-t.patch b/queue-5.4/bnxt_en-fix-tx-timeout-when-tx-ring-size-is-set-to-t.patch new file mode 100644 index 00000000000..0a6ffc16ba9 --- /dev/null +++ b/queue-5.4/bnxt_en-fix-tx-timeout-when-tx-ring-size-is-set-to-t.patch @@ -0,0 +1,105 @@ +From 6841b83d97009d759cec1d413d5e6152a6643336 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Sep 2021 02:51:52 -0400 +Subject: bnxt_en: Fix TX timeout when TX ring size is set to the smallest + +From: Michael Chan + +[ Upstream commit 5bed8b0704c9ecccc8f4a2c377d7c8e21090a82e ] + +The smallest TX ring size we support must fit a TX SKB with MAX_SKB_FRAGS ++ 1. Because the first TX BD for a packet is always a long TX BD, we +need an extra TX BD to fit this packet. Define BNXT_MIN_TX_DESC_CNT with +this value to make this more clear. The current code uses a minimum +that is off by 1. Fix it using this constant. + +The tx_wake_thresh to determine when to wake up the TX queue is half the +ring size but we must have at least BNXT_MIN_TX_DESC_CNT for the next +packet which may have maximum fragments. So the comparison of the +available TX BDs with tx_wake_thresh should be >= instead of > in the +current code. Otherwise, at the smallest ring size, we will never wake +up the TX queue and will cause TX timeout. + +Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") +Reviewed-by: Pavan Chebbi +Signed-off-by: Michael Chan +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 ++++---- + drivers/net/ethernet/broadcom/bnxt/bnxt.h | 5 +++++ + drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 2 +- + 3 files changed, 10 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +index e67f07faca78..7f590a9e3af7 100644 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -372,7 +372,7 @@ static bool bnxt_txr_netif_try_stop_queue(struct bnxt *bp, + * netif_tx_queue_stopped(). + */ + smp_mb(); +- if (bnxt_tx_avail(bp, txr) > bp->tx_wake_thresh) { ++ if (bnxt_tx_avail(bp, txr) >= bp->tx_wake_thresh) { + netif_tx_wake_queue(txq); + return false; + } +@@ -701,7 +701,7 @@ static void bnxt_tx_int(struct bnxt *bp, struct bnxt_napi *bnapi, int nr_pkts) + smp_mb(); + + if (unlikely(netif_tx_queue_stopped(txq)) && +- bnxt_tx_avail(bp, txr) > bp->tx_wake_thresh && ++ bnxt_tx_avail(bp, txr) >= bp->tx_wake_thresh && + READ_ONCE(txr->dev_state) != BNXT_DEV_STATE_CLOSING) + netif_tx_wake_queue(txq); + } +@@ -2206,7 +2206,7 @@ static int __bnxt_poll_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, + if (TX_CMP_TYPE(txcmp) == CMP_TYPE_TX_L2_CMP) { + tx_pkts++; + /* return full budget so NAPI will complete. */ +- if (unlikely(tx_pkts > bp->tx_wake_thresh)) { ++ if (unlikely(tx_pkts >= bp->tx_wake_thresh)) { + rx_pkts = budget; + raw_cons = NEXT_RAW_CMP(raw_cons); + if (budget) +@@ -3329,7 +3329,7 @@ static int bnxt_init_tx_rings(struct bnxt *bp) + u16 i; + + bp->tx_wake_thresh = max_t(int, bp->tx_ring_size / 2, +- MAX_SKB_FRAGS + 1); ++ BNXT_MIN_TX_DESC_CNT); + + for (i = 0; i < bp->tx_nr_rings; i++) { + struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h +index 510ff01bdad8..8ba369c0100b 100644 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h +@@ -601,6 +601,11 @@ struct nqe_cn { + #define BNXT_MAX_RX_JUM_DESC_CNT (RX_DESC_CNT * MAX_RX_AGG_PAGES - 1) + #define BNXT_MAX_TX_DESC_CNT (TX_DESC_CNT * MAX_TX_PAGES - 1) + ++/* Minimum TX BDs for a TX packet with MAX_SKB_FRAGS + 1. We need one extra ++ * BD because the first TX BD is always a long BD. ++ */ ++#define BNXT_MIN_TX_DESC_CNT (MAX_SKB_FRAGS + 2) ++ + #define RX_RING(x) (((x) & ~(RX_DESC_CNT - 1)) >> (BNXT_PAGE_SHIFT - 4)) + #define RX_IDX(x) ((x) & (RX_DESC_CNT - 1)) + +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +index 211852378224..97aff84fd1d1 100644 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +@@ -744,7 +744,7 @@ static int bnxt_set_ringparam(struct net_device *dev, + + if ((ering->rx_pending > BNXT_MAX_RX_DESC_CNT) || + (ering->tx_pending > BNXT_MAX_TX_DESC_CNT) || +- (ering->tx_pending <= MAX_SKB_FRAGS)) ++ (ering->tx_pending < BNXT_MIN_TX_DESC_CNT)) + return -EINVAL; + + if (netif_running(dev)) +-- +2.33.0 + diff --git a/queue-5.4/enetc-fix-illegal-access-when-reading-affinity_hint.patch b/queue-5.4/enetc-fix-illegal-access-when-reading-affinity_hint.patch new file mode 100644 index 00000000000..d5c02c4f845 --- /dev/null +++ b/queue-5.4/enetc-fix-illegal-access-when-reading-affinity_hint.patch @@ -0,0 +1,54 @@ +From e0bc1ec9e376400a721dd74afd2382d08e69886d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 17 Sep 2021 13:22:05 +0300 +Subject: enetc: Fix illegal access when reading affinity_hint + +From: Claudiu Manoil + +[ Upstream commit 7237a494decfa17d0b9d0076e6cee3235719de90 ] + +irq_set_affinity_hit() stores a reference to the cpumask_t +parameter in the irq descriptor, and that reference can be +accessed later from irq_affinity_hint_proc_show(). Since +the cpu_mask parameter passed to irq_set_affinity_hit() has +only temporary storage (it's on the stack memory), later +accesses to it are illegal. Thus reads from the corresponding +procfs affinity_hint file can result in paging request oops. + +The issue is fixed by the get_cpu_mask() helper, which provides +a permanent storage for the cpumask_t parameter. + +Fixes: d4fd0404c1c9 ("enetc: Introduce basic PF and VF ENETC ethernet drivers") +Signed-off-by: Claudiu Manoil +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/freescale/enetc/enetc.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c +index b77eaf31bd4e..cee77326e7e8 100644 +--- a/drivers/net/ethernet/freescale/enetc/enetc.c ++++ b/drivers/net/ethernet/freescale/enetc/enetc.c +@@ -1222,7 +1222,6 @@ static void enetc_clear_bdrs(struct enetc_ndev_priv *priv) + static int enetc_setup_irqs(struct enetc_ndev_priv *priv) + { + struct pci_dev *pdev = priv->si->pdev; +- cpumask_t cpu_mask; + int i, j, err; + + for (i = 0; i < priv->bdr_int_num; i++) { +@@ -1249,9 +1248,7 @@ static int enetc_setup_irqs(struct enetc_ndev_priv *priv) + + enetc_wr(hw, ENETC_SIMSITRV(idx), entry); + } +- cpumask_clear(&cpu_mask); +- cpumask_set_cpu(i % num_online_cpus(), &cpu_mask); +- irq_set_affinity_hint(irq, &cpu_mask); ++ irq_set_affinity_hint(irq, get_cpu_mask(i % num_online_cpus())); + } + + return 0; +-- +2.33.0 + diff --git a/queue-5.4/gpio-uniphier-fix-void-functions-to-remove-return-va.patch b/queue-5.4/gpio-uniphier-fix-void-functions-to-remove-return-va.patch new file mode 100644 index 00000000000..b58dd44c715 --- /dev/null +++ b/queue-5.4/gpio-uniphier-fix-void-functions-to-remove-return-va.patch @@ -0,0 +1,45 @@ +From 44eb7758baef6c224c58dc5b6c438defaea2a83c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 16 Sep 2021 20:19:35 +0900 +Subject: gpio: uniphier: Fix void functions to remove return value + +From: Kunihiko Hayashi + +[ Upstream commit 2dd824cca3407bc9a2bd11b00f6e117b66fcfcf1 ] + +The return type of irq_chip.irq_mask() and irq_chip.irq_unmask() should +be void. + +Fixes: dbe776c2ca54 ("gpio: uniphier: add UniPhier GPIO controller driver") +Signed-off-by: Kunihiko Hayashi +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + drivers/gpio/gpio-uniphier.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c +index 93cdcc41e9fb..0f1cf50b4dce 100644 +--- a/drivers/gpio/gpio-uniphier.c ++++ b/drivers/gpio/gpio-uniphier.c +@@ -188,7 +188,7 @@ static void uniphier_gpio_irq_mask(struct irq_data *data) + + uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, 0); + +- return irq_chip_mask_parent(data); ++ irq_chip_mask_parent(data); + } + + static void uniphier_gpio_irq_unmask(struct irq_data *data) +@@ -198,7 +198,7 @@ static void uniphier_gpio_irq_unmask(struct irq_data *data) + + uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, mask); + +- return irq_chip_unmask_parent(data); ++ irq_chip_unmask_parent(data); + } + + static int uniphier_gpio_irq_set_type(struct irq_data *data, unsigned int type) +-- +2.33.0 + diff --git a/queue-5.4/net-mlx4_en-don-t-allow-arfs-for-encapsulated-packet.patch b/queue-5.4/net-mlx4_en-don-t-allow-arfs-for-encapsulated-packet.patch new file mode 100644 index 00000000000..5da28a7c006 --- /dev/null +++ b/queue-5.4/net-mlx4_en-don-t-allow-arfs-for-encapsulated-packet.patch @@ -0,0 +1,38 @@ +From 1be0c5e5b084dcdcfbf0e8c93506f1953bc31d85 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Sep 2021 09:51:45 +0300 +Subject: net/mlx4_en: Don't allow aRFS for encapsulated packets + +From: Aya Levin + +[ Upstream commit fdbccea419dc782079ce5881d2705cc9e3881480 ] + +Driver doesn't support aRFS for encapsulated packets, return early error +in such a case. + +Fixes: 1eb8c695bda9 ("net/mlx4_en: Add accelerated RFS support") +Signed-off-by: Aya Levin +Signed-off-by: Tariq Toukan +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +index d7d20b7fae39..250177b5bcac 100644 +--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c ++++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +@@ -371,6 +371,9 @@ mlx4_en_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb, + int nhoff = skb_network_offset(skb); + int ret = 0; + ++ if (skb->encapsulation) ++ return -EPROTONOSUPPORT; ++ + if (skb->protocol != htons(ETH_P_IP)) + return -EPROTONOSUPPORT; + +-- +2.33.0 + diff --git a/queue-5.4/net-mlx4_en-resolve-bad-operstate-value.patch b/queue-5.4/net-mlx4_en-resolve-bad-operstate-value.patch new file mode 100644 index 00000000000..23ae8dc5935 --- /dev/null +++ b/queue-5.4/net-mlx4_en-resolve-bad-operstate-value.patch @@ -0,0 +1,127 @@ +From 86479b316b5100ab5dc7c591bd4a2cf753ffd5ec Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 19 Sep 2021 14:55:45 +0300 +Subject: net/mlx4_en: Resolve bad operstate value + +From: Lama Kayal + +[ Upstream commit 72a3c58d18fd780eecd80178bb2132ce741a0a74 ] + +Any link state change that's done prior to net device registration +isn't reflected on the state, thus the operational state is left +obsolete, with 'UNKNOWN' status. + +To resolve the issue, query link state from FW upon open operations +to ensure operational state is updated. + +Fixes: c27a02cd94d6 ("mlx4_en: Add driver for Mellanox ConnectX 10GbE NIC") +Signed-off-by: Lama Kayal +Signed-off-by: Tariq Toukan +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + .../net/ethernet/mellanox/mlx4/en_netdev.c | 47 ++++++++++++------- + drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 1 - + 2 files changed, 29 insertions(+), 19 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +index cd165e52ed33..d7d20b7fae39 100644 +--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c ++++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +@@ -1268,7 +1268,6 @@ static void mlx4_en_do_set_rx_mode(struct work_struct *work) + if (!netif_carrier_ok(dev)) { + if (!mlx4_en_QUERY_PORT(mdev, priv->port)) { + if (priv->port_state.link_state) { +- priv->last_link_state = MLX4_DEV_EVENT_PORT_UP; + netif_carrier_on(dev); + en_dbg(LINK, priv, "Link Up\n"); + } +@@ -1562,26 +1561,36 @@ static void mlx4_en_service_task(struct work_struct *work) + mutex_unlock(&mdev->state_lock); + } + +-static void mlx4_en_linkstate(struct work_struct *work) ++static void mlx4_en_linkstate(struct mlx4_en_priv *priv) ++{ ++ struct mlx4_en_port_state *port_state = &priv->port_state; ++ struct mlx4_en_dev *mdev = priv->mdev; ++ struct net_device *dev = priv->dev; ++ bool up; ++ ++ if (mlx4_en_QUERY_PORT(mdev, priv->port)) ++ port_state->link_state = MLX4_PORT_STATE_DEV_EVENT_PORT_DOWN; ++ ++ up = port_state->link_state == MLX4_PORT_STATE_DEV_EVENT_PORT_UP; ++ if (up == netif_carrier_ok(dev)) ++ netif_carrier_event(dev); ++ if (!up) { ++ en_info(priv, "Link Down\n"); ++ netif_carrier_off(dev); ++ } else { ++ en_info(priv, "Link Up\n"); ++ netif_carrier_on(dev); ++ } ++} ++ ++static void mlx4_en_linkstate_work(struct work_struct *work) + { + struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, + linkstate_task); + struct mlx4_en_dev *mdev = priv->mdev; +- int linkstate = priv->link_state; + + mutex_lock(&mdev->state_lock); +- /* If observable port state changed set carrier state and +- * report to system log */ +- if (priv->last_link_state != linkstate) { +- if (linkstate == MLX4_DEV_EVENT_PORT_DOWN) { +- en_info(priv, "Link Down\n"); +- netif_carrier_off(priv->dev); +- } else { +- en_info(priv, "Link Up\n"); +- netif_carrier_on(priv->dev); +- } +- } +- priv->last_link_state = linkstate; ++ mlx4_en_linkstate(priv); + mutex_unlock(&mdev->state_lock); + } + +@@ -2085,9 +2094,11 @@ static int mlx4_en_open(struct net_device *dev) + mlx4_en_clear_stats(dev); + + err = mlx4_en_start_port(dev); +- if (err) ++ if (err) { + en_err(priv, "Failed starting port:%d\n", priv->port); +- ++ goto out; ++ } ++ mlx4_en_linkstate(priv); + out: + mutex_unlock(&mdev->state_lock); + return err; +@@ -3271,7 +3282,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, + spin_lock_init(&priv->stats_lock); + INIT_WORK(&priv->rx_mode_task, mlx4_en_do_set_rx_mode); + INIT_WORK(&priv->restart_task, mlx4_en_restart); +- INIT_WORK(&priv->linkstate_task, mlx4_en_linkstate); ++ INIT_WORK(&priv->linkstate_task, mlx4_en_linkstate_work); + INIT_DELAYED_WORK(&priv->stats_task, mlx4_en_do_get_stats); + INIT_DELAYED_WORK(&priv->service_task, mlx4_en_service_task); + INIT_WORK(&priv->vxlan_add_task, mlx4_en_add_vxlan_offloads); +diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +index 17a5bd4c68b2..c72a9201c7ea 100644 +--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h ++++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +@@ -571,7 +571,6 @@ struct mlx4_en_priv { + + struct mlx4_hwq_resources res; + int link_state; +- int last_link_state; + bool port_up; + int port; + int registered; +-- +2.33.0 + diff --git a/queue-5.4/net-smc-add-missing-error-check-in-smc_clc_prfx_set.patch b/queue-5.4/net-smc-add-missing-error-check-in-smc_clc_prfx_set.patch new file mode 100644 index 00000000000..f7bc32151d8 --- /dev/null +++ b/queue-5.4/net-smc-add-missing-error-check-in-smc_clc_prfx_set.patch @@ -0,0 +1,45 @@ +From 54fd9f7bdc40d29966648a3edfcc0d62b6c06167 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Sep 2021 21:18:14 +0200 +Subject: net/smc: add missing error check in smc_clc_prfx_set() + +From: Karsten Graul + +[ Upstream commit 6c90731980655280ea07ce4b21eb97457bf86286 ] + +Coverity stumbled over a missing error check in smc_clc_prfx_set(): + +*** CID 1475954: Error handling issues (CHECKED_RETURN) +/net/smc/smc_clc.c: 233 in smc_clc_prfx_set() +>>> CID 1475954: Error handling issues (CHECKED_RETURN) +>>> Calling "kernel_getsockname" without checking return value (as is done elsewhere 8 out of 10 times). +233 kernel_getsockname(clcsock, (struct sockaddr *)&addrs); + +Add the return code check in smc_clc_prfx_set(). + +Fixes: c246d942eabc ("net/smc: restructure netinfo for CLC proposal msgs") +Reported-by: Julian Wiedmann +Signed-off-by: Karsten Graul +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/smc/smc_clc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/net/smc/smc_clc.c b/net/smc/smc_clc.c +index aee9ccfa99c2..ade1232699bb 100644 +--- a/net/smc/smc_clc.c ++++ b/net/smc/smc_clc.c +@@ -164,7 +164,8 @@ static int smc_clc_prfx_set(struct socket *clcsock, + goto out_rel; + } + /* get address to which the internal TCP socket is bound */ +- kernel_getsockname(clcsock, (struct sockaddr *)&addrs); ++ if (kernel_getsockname(clcsock, (struct sockaddr *)&addrs) < 0) ++ goto out_rel; + /* analyze IP specific data of net_device belonging to TCP socket */ + addr6 = (struct sockaddr_in6 *)&addrs; + rcu_read_lock(); +-- +2.33.0 + diff --git a/queue-5.4/platform-x86-intel-punit_ipc-drop-wrong-use-of-acpi_.patch b/queue-5.4/platform-x86-intel-punit_ipc-drop-wrong-use-of-acpi_.patch new file mode 100644 index 00000000000..f5379daf68a --- /dev/null +++ b/queue-5.4/platform-x86-intel-punit_ipc-drop-wrong-use-of-acpi_.patch @@ -0,0 +1,50 @@ +From 443946c5169bfdcc3e33e00a38b2e4491a56e79c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Aug 2021 17:53:10 +0300 +Subject: platform/x86/intel: punit_ipc: Drop wrong use of ACPI_PTR() + +From: Andy Shevchenko + +[ Upstream commit 349bff48ae0f5f8aa2075d0bdc2091a30bd634f6 ] + +ACPI_PTR() is more harmful than helpful. For example, in this case +if CONFIG_ACPI=n, the ID table left unused which is not what we want. + +Instead of adding ifdeffery here and there, drop ACPI_PTR() +and unused acpi.h. + +Fixes: fdca4f16f57d ("platform:x86: add Intel P-Unit mailbox IPC driver") +Reported-by: kernel test robot +Signed-off-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20210827145310.76239-1-andriy.shevchenko@linux.intel.com +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/intel_punit_ipc.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/platform/x86/intel_punit_ipc.c b/drivers/platform/x86/intel_punit_ipc.c +index ccb44f2eb240..af3a28623e86 100644 +--- a/drivers/platform/x86/intel_punit_ipc.c ++++ b/drivers/platform/x86/intel_punit_ipc.c +@@ -8,7 +8,6 @@ + * which provide mailbox interface for power management usage. + */ + +-#include + #include + #include + #include +@@ -335,7 +334,7 @@ static struct platform_driver intel_punit_ipc_driver = { + .remove = intel_punit_ipc_remove, + .driver = { + .name = "intel_punit_ipc", +- .acpi_match_table = ACPI_PTR(punit_ipc_acpi_ids), ++ .acpi_match_table = punit_ipc_acpi_ids, + }, + }; + +-- +2.33.0 + diff --git a/queue-5.4/qed-rdma-don-t-wait-for-resources-under-hw-error-rec.patch b/queue-5.4/qed-rdma-don-t-wait-for-resources-under-hw-error-rec.patch new file mode 100644 index 00000000000..f6a5f86a373 --- /dev/null +++ b/queue-5.4/qed-rdma-don-t-wait-for-resources-under-hw-error-rec.patch @@ -0,0 +1,65 @@ +From 1a49189c8f8c9393d3086b2c9f15920c219c7110 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Sep 2021 13:53:26 +0300 +Subject: qed: rdma - don't wait for resources under hw error recovery flow + +From: Shai Malin + +[ Upstream commit 1ea7812326004afd2803cc968a4776ae5120a597 ] + +If the HW device is during recovery, the HW resources will never return, +hence we shouldn't wait for the CID (HW context ID) bitmaps to clear. +This fix speeds up the error recovery flow. + +Fixes: 64515dc899df ("qed: Add infrastructure for error detection and recovery") +Signed-off-by: Michal Kalderon +Signed-off-by: Ariel Elior +Signed-off-by: Shai Malin +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 8 ++++++++ + drivers/net/ethernet/qlogic/qed/qed_roce.c | 8 ++++++++ + 2 files changed, 16 insertions(+) + +diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c +index 9adbaccd0c5e..934740d60470 100644 +--- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c ++++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c +@@ -1307,6 +1307,14 @@ qed_iwarp_wait_cid_map_cleared(struct qed_hwfn *p_hwfn, struct qed_bmap *bmap) + prev_weight = weight; + + while (weight) { ++ /* If the HW device is during recovery, all resources are ++ * immediately reset without receiving a per-cid indication ++ * from HW. In this case we don't expect the cid_map to be ++ * cleared. ++ */ ++ if (p_hwfn->cdev->recov_in_prog) ++ return 0; ++ + msleep(QED_IWARP_MAX_CID_CLEAN_TIME); + + weight = bitmap_weight(bmap->bitmap, bmap->max_count); +diff --git a/drivers/net/ethernet/qlogic/qed/qed_roce.c b/drivers/net/ethernet/qlogic/qed/qed_roce.c +index 83817bb50e9f..6e6563b51d68 100644 +--- a/drivers/net/ethernet/qlogic/qed/qed_roce.c ++++ b/drivers/net/ethernet/qlogic/qed/qed_roce.c +@@ -107,6 +107,14 @@ void qed_roce_stop(struct qed_hwfn *p_hwfn) + * Beyond the added delay we clear the bitmap anyway. + */ + while (bitmap_weight(rcid_map->bitmap, rcid_map->max_count)) { ++ /* If the HW device is during recovery, all resources are ++ * immediately reset without receiving a per-cid indication ++ * from HW. In this case we don't expect the cid bitmap to be ++ * cleared. ++ */ ++ if (p_hwfn->cdev->recov_in_prog) ++ return; ++ + msleep(100); + if (wait_count++ > 20) { + DP_NOTICE(p_hwfn, "cid bitmap wait timed out\n"); +-- +2.33.0 + diff --git a/queue-5.4/series b/queue-5.4/series index f9f0293c8ff..928a6049ab7 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -22,3 +22,12 @@ btrfs-prevent-__btrfs_dump_space_info-to-underflow-its-free-space.patch xhci-set-hcd-flag-to-defer-primary-roothub-registration.patch serial-mvebu-uart-fix-driver-s-tx_empty-callback.patch net-hso-fix-muxed-tty-registration.patch +afs-fix-incorrect-triggering-of-sillyrename-on-3rd-p.patch +platform-x86-intel-punit_ipc-drop-wrong-use-of-acpi_.patch +enetc-fix-illegal-access-when-reading-affinity_hint.patch +net-mlx4_en-resolve-bad-operstate-value.patch +bnxt_en-fix-tx-timeout-when-tx-ring-size-is-set-to-t.patch +net-smc-add-missing-error-check-in-smc_clc_prfx_set.patch +gpio-uniphier-fix-void-functions-to-remove-return-va.patch +qed-rdma-don-t-wait-for-resources-under-hw-error-rec.patch +net-mlx4_en-don-t-allow-arfs-for-encapsulated-packet.patch