Commit 1f0679f5 authored by Koen Vandeputte's avatar Koen Vandeputte
Browse files

kernel: bump 4.14 to 4.14.176



Refreshed all patches.

Remove upstreamed:
- 0001-net-thunderx-workaround-BGX-TX-Underflow-issue.patch
- 600-ipv6-addrconf-call-ipv6_mc_up-for-non-Ethernet-inter.patch

Fixes:
- CVE-2020-8647
- CVE-2020-8648 (potentially)
- CVE-2020-8649

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx
Signed-off-by: default avatarKoen Vandeputte <koen.vandeputte@ncentric.com>
parent 82c8170c
......@@ -251,7 +251,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Release Tx descriptors */
@@ -3061,7 +3020,6 @@ static int mvneta_setup_txqs(struct mvne
@@ -3060,7 +3019,6 @@ static int mvneta_setup_txqs(struct mvne
static void mvneta_start_dev(struct mvneta_port *pp)
{
int cpu;
......@@ -259,7 +259,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
mvneta_max_rx_size_set(pp, pp->pkt_size);
mvneta_txq_max_tx_size_set(pp, pp->pkt_size);
@@ -3089,16 +3047,15 @@ static void mvneta_start_dev(struct mvne
@@ -3088,16 +3046,15 @@ static void mvneta_start_dev(struct mvne
MVNETA_CAUSE_LINK_CHANGE |
MVNETA_CAUSE_PSC_SYNC_CHANGE);
......@@ -278,7 +278,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
if (!pp->neta_armada3700) {
for_each_online_cpu(cpu) {
@@ -3251,103 +3208,232 @@ static int mvneta_set_mac_addr(struct ne
@@ -3250,103 +3207,232 @@ static int mvneta_set_mac_addr(struct ne
return 0;
}
......@@ -585,7 +585,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Electing a CPU must be done in an atomic way: it should be done
@@ -3626,10 +3712,9 @@ static int mvneta_stop(struct net_device
@@ -3625,10 +3711,9 @@ static int mvneta_stop(struct net_device
static int mvneta_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
......@@ -598,7 +598,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Ethtool methods */
@@ -3640,44 +3725,25 @@ mvneta_ethtool_set_link_ksettings(struct
@@ -3639,44 +3724,25 @@ mvneta_ethtool_set_link_ksettings(struct
const struct ethtool_link_ksettings *cmd)
{
struct mvneta_port *pp = netdev_priv(ndev);
......@@ -657,7 +657,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Set interrupt coalescing for ethtools */
@@ -3769,6 +3835,22 @@ static int mvneta_ethtool_set_ringparam(
@@ -3768,6 +3834,22 @@ static int mvneta_ethtool_set_ringparam(
return 0;
}
......@@ -680,7 +680,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset,
u8 *data)
{
@@ -3785,26 +3867,35 @@ static void mvneta_ethtool_update_stats(
@@ -3784,26 +3866,35 @@ static void mvneta_ethtool_update_stats(
{
const struct mvneta_statistic *s;
void __iomem *base = pp->base;
......@@ -721,7 +721,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
}
@@ -3939,28 +4030,65 @@ static int mvneta_ethtool_get_rxfh(struc
@@ -3938,28 +4029,65 @@ static int mvneta_ethtool_get_rxfh(struc
static void mvneta_ethtool_get_wol(struct net_device *dev,
struct ethtool_wolinfo *wol)
{
......@@ -795,7 +795,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static u16 mvneta_select_queue(struct net_device *dev, struct sk_buff *skb,
void *accel_priv,
select_queue_fallback_t fallback)
@@ -3984,13 +4112,15 @@ static const struct net_device_ops mvnet
@@ -3983,13 +4111,15 @@ static const struct net_device_ops mvnet
};
static const struct ethtool_ops mvneta_eth_tool_ops = {
......@@ -812,7 +812,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
.get_strings = mvneta_ethtool_get_strings,
.get_ethtool_stats = mvneta_ethtool_get_stats,
.get_sset_count = mvneta_ethtool_get_sset_count,
@@ -3998,10 +4128,12 @@ static const struct ethtool_ops mvneta_e
@@ -3997,10 +4127,12 @@ static const struct ethtool_ops mvneta_e
.get_rxnfc = mvneta_ethtool_get_rxnfc,
.get_rxfh = mvneta_ethtool_get_rxfh,
.set_rxfh = mvneta_ethtool_set_rxfh,
......@@ -826,7 +826,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
};
/* Initialize hw */
@@ -4146,14 +4278,13 @@ static int mvneta_probe(struct platform_
@@ -4145,14 +4277,13 @@ static int mvneta_probe(struct platform_
{
struct resource *res;
struct device_node *dn = pdev->dev.of_node;
......@@ -842,7 +842,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
int tx_csum_limit;
int phy_mode;
int err;
@@ -4169,31 +4300,11 @@ static int mvneta_probe(struct platform_
@@ -4168,31 +4299,11 @@ static int mvneta_probe(struct platform_
goto err_free_netdev;
}
......@@ -875,7 +875,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
dev->tx_queue_len = MVNETA_MAX_TXD;
@@ -4204,12 +4315,7 @@ static int mvneta_probe(struct platform_
@@ -4203,12 +4314,7 @@ static int mvneta_probe(struct platform_
pp = netdev_priv(dev);
spin_lock_init(&pp->lock);
......@@ -889,7 +889,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
pp->rxq_def = rxq_def;
@@ -4231,7 +4337,7 @@ static int mvneta_probe(struct platform_
@@ -4230,7 +4336,7 @@ static int mvneta_probe(struct platform_
pp->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pp->clk)) {
err = PTR_ERR(pp->clk);
......@@ -898,7 +898,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
clk_prepare_enable(pp->clk);
@@ -4357,6 +4463,14 @@ static int mvneta_probe(struct platform_
@@ -4356,6 +4462,14 @@ static int mvneta_probe(struct platform_
/* 9676 == 9700 - 20 and rounding to 8 */
dev->max_mtu = 9676;
......@@ -913,7 +913,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
err = register_netdev(dev);
if (err < 0) {
dev_err(&pdev->dev, "failed to register\n");
@@ -4368,14 +4482,6 @@ static int mvneta_probe(struct platform_
@@ -4367,14 +4481,6 @@ static int mvneta_probe(struct platform_
platform_set_drvdata(pdev, pp->dev);
......@@ -928,7 +928,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
return 0;
err_netdev:
@@ -4384,16 +4490,14 @@ err_netdev:
@@ -4383,16 +4489,14 @@ err_netdev:
mvneta_bm_pool_destroy(pp->bm_priv, pp->pool_short,
1 << pp->id);
}
......@@ -947,7 +947,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
err_free_irq:
irq_dispose_mapping(dev->irq);
err_free_netdev:
@@ -4405,7 +4509,6 @@ err_free_netdev:
@@ -4404,7 +4508,6 @@ err_free_netdev:
static int mvneta_remove(struct platform_device *pdev)
{
struct net_device *dev = platform_get_drvdata(pdev);
......@@ -955,7 +955,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
struct mvneta_port *pp = netdev_priv(dev);
unregister_netdev(dev);
@@ -4413,10 +4516,8 @@ static int mvneta_remove(struct platform
@@ -4412,10 +4515,8 @@ static int mvneta_remove(struct platform
clk_disable_unprepare(pp->clk);
free_percpu(pp->ports);
free_percpu(pp->stats);
......@@ -967,7 +967,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
free_netdev(dev);
if (pp->bm_priv) {
@@ -4468,9 +4569,6 @@ static int mvneta_resume(struct device *
@@ -4467,9 +4568,6 @@ static int mvneta_resume(struct device *
return err;
}
......
......@@ -18,7 +18,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
struct device_node *dn;
unsigned int tx_csum_limit;
struct phylink *phylink;
@@ -4315,6 +4316,7 @@ static int mvneta_probe(struct platform_
@@ -4314,6 +4315,7 @@ static int mvneta_probe(struct platform_
pp = netdev_priv(dev);
spin_lock_init(&pp->lock);
......
......@@ -24,7 +24,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
mvneta_link_change(pp);
}
@@ -3045,8 +3044,7 @@ static void mvneta_start_dev(struct mvne
@@ -3044,8 +3043,7 @@ static void mvneta_start_dev(struct mvne
mvreg_write(pp, MVNETA_INTR_MISC_MASK,
MVNETA_CAUSE_PHY_STATUS_CHANGE |
......@@ -34,7 +34,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
phylink_start(pp->phylink);
netif_tx_start_all_queues(pp->dev);
@@ -3542,8 +3540,7 @@ static int mvneta_cpu_online(unsigned in
@@ -3541,8 +3539,7 @@ static int mvneta_cpu_online(unsigned in
on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
mvreg_write(pp, MVNETA_INTR_MISC_MASK,
MVNETA_CAUSE_PHY_STATUS_CHANGE |
......@@ -44,7 +44,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
netif_tx_start_all_queues(pp->dev);
spin_unlock(&pp->lock);
return 0;
@@ -3584,8 +3581,7 @@ static int mvneta_cpu_dead(unsigned int
@@ -3583,8 +3580,7 @@ static int mvneta_cpu_dead(unsigned int
on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
mvreg_write(pp, MVNETA_INTR_MISC_MASK,
MVNETA_CAUSE_PHY_STATUS_CHANGE |
......
......@@ -10,7 +10,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4045,6 +4045,22 @@ static int mvneta_ethtool_set_wol(struct
@@ -4044,6 +4044,22 @@ static int mvneta_ethtool_set_wol(struct
return ret;
}
......@@ -33,7 +33,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static int mvneta_ethtool_get_eee(struct net_device *dev,
struct ethtool_eee *eee)
{
@@ -4129,6 +4145,8 @@ static const struct ethtool_ops mvneta_e
@@ -4128,6 +4144,8 @@ static const struct ethtool_ops mvneta_e
.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
.get_wol = mvneta_ethtool_get_wol,
.set_wol = mvneta_ethtool_set_wol,
......
......@@ -15,7 +15,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4045,22 +4045,6 @@ static int mvneta_ethtool_set_wol(struct
@@ -4044,22 +4044,6 @@ static int mvneta_ethtool_set_wol(struct
return ret;
}
......@@ -38,7 +38,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
static int mvneta_ethtool_get_eee(struct net_device *dev,
struct ethtool_eee *eee)
{
@@ -4145,8 +4129,6 @@ static const struct ethtool_ops mvneta_e
@@ -4144,8 +4128,6 @@ static const struct ethtool_ops mvneta_e
.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
.get_wol = mvneta_ethtool_get_wol,
.set_wol = mvneta_ethtool_set_wol,
......
......@@ -27,7 +27,7 @@ Signed-off-by: Tim Harvey <tharvey@gateworks.com>
};
static struct bgx *bgx_vnic[MAX_BGX_THUNDER];
@@ -841,12 +842,12 @@ static void bgx_poll_for_link(struct wor
@@ -850,12 +851,12 @@ static void bgx_poll_for_link(struct wor
queue_delayed_work(lmac->check_link, &lmac->dwork, HZ * 2);
}
......@@ -42,7 +42,7 @@ Signed-off-by: Tim Harvey <tharvey@gateworks.com>
return PHY_INTERFACE_MODE_SGMII;
}
@@ -912,7 +913,8 @@ static int bgx_lmac_enable(struct bgx *b
@@ -921,7 +922,8 @@ static int bgx_lmac_enable(struct bgx *b
if (phy_connect_direct(&lmac->netdev, lmac->phydev,
bgx_lmac_handler,
......@@ -52,7 +52,7 @@ Signed-off-by: Tim Harvey <tharvey@gateworks.com>
return -ENODEV;
phy_start(lmac->phydev);
@@ -1287,6 +1289,8 @@ static int bgx_init_of_phy(struct bgx *b
@@ -1296,6 +1298,8 @@ static int bgx_init_of_phy(struct bgx *b
bgx->lmac[lmac].lmacid = lmac;
phy_np = of_parse_phandle(node, "phy-handle", 0);
......@@ -61,7 +61,7 @@ Signed-off-by: Tim Harvey <tharvey@gateworks.com>
/* If there is no phy or defective firmware presents
* this cortina phy, for which there is no driver
* support, ignore it.
@@ -1390,7 +1394,6 @@ static int bgx_probe(struct pci_dev *pde
@@ -1441,7 +1445,6 @@ static int bgx_probe(struct pci_dev *pde
bgx->max_lmac = 1;
bgx->bgx_id = MAX_BGX_PER_CN81XX - 1;
bgx_vnic[bgx->bgx_id] = bgx;
......@@ -69,7 +69,7 @@ Signed-off-by: Tim Harvey <tharvey@gateworks.com>
}
/* On 81xx all are DLMs and on 83xx there are 3 BGX QLMs and one
@@ -1407,6 +1410,8 @@ static int bgx_probe(struct pci_dev *pde
@@ -1458,6 +1461,8 @@ static int bgx_probe(struct pci_dev *pde
if (err)
goto err_enable;
......@@ -77,10 +77,10 @@ Signed-off-by: Tim Harvey <tharvey@gateworks.com>
+ xcv_init_hw(bgx->phy_mode);
bgx_init_hw(bgx);
/* Enable all LMACs */
bgx_register_intr(pdev);
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
@@ -226,7 +226,7 @@ void bgx_lmac_internal_loopback(int node
@@ -235,7 +235,7 @@ void bgx_lmac_internal_loopback(int node
void bgx_lmac_get_pfc(int node, int bgx_idx, int lmacid, void *pause);
void bgx_lmac_set_pfc(int node, int bgx_idx, int lmacid, void *pause);
......
From b1e7791e688620c9bb8476ac2d0bc99abeb7f825 Mon Sep 17 00:00:00 2001
From: Tim Harvey <tharvey@gateworks.com>
Date: Fri, 29 Dec 2017 16:48:04 -0800
Subject: [PATCH] net: thunderx: workaround BGX TX Underflow issue
While it is not yet understood why a TX underflow can easily occur
for SGMII interfaces resulting in a TX wedge. It has been found that
disabling/re-enabling the LMAC resolves the issue.
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 54 +++++++++++++++++++++++
drivers/net/ethernet/cavium/thunder/thunder_bgx.h | 9 ++++
2 files changed, 63 insertions(+)
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
@@ -1344,6 +1344,54 @@ static int bgx_init_phy(struct bgx *bgx)
return bgx_init_of_phy(bgx);
}
+static irqreturn_t bgx_intr_handler(int irq, void *data)
+{
+ struct bgx *bgx = (struct bgx *)data;
+ struct device *dev = &bgx->pdev->dev;
+ u64 status, val;
+ int lmac;
+
+ for (lmac = 0; lmac < bgx->lmac_count; lmac++) {
+ status = bgx_reg_read(bgx, lmac, BGX_GMP_GMI_TXX_INT);
+ if (status & GMI_TXX_INT_UNDFLW) {
+ dev_err(dev, "BGX%d lmac%d UNDFLW\n", bgx->bgx_id,
+ lmac);
+ val = bgx_reg_read(bgx, lmac, BGX_CMRX_CFG);
+ val &= ~CMR_EN;
+ bgx_reg_write(bgx, lmac, BGX_CMRX_CFG, val);
+ val |= CMR_EN;
+ bgx_reg_write(bgx, lmac, BGX_CMRX_CFG, val);
+ }
+ /* clear interrupts */
+ bgx_reg_write(bgx, lmac, BGX_GMP_GMI_TXX_INT, status);
+ }
+
+ return IRQ_HANDLED;
+}
+
+static int bgx_register_intr(struct pci_dev *pdev)
+{
+ struct bgx *bgx = pci_get_drvdata(pdev);
+ struct device *dev = &pdev->dev;
+ int num_vec, ret;
+ char irq_name[32];
+
+ /* Enable MSI-X */
+ num_vec = pci_msix_vec_count(pdev);
+ ret = pci_alloc_irq_vectors(pdev, num_vec, num_vec, PCI_IRQ_MSIX);
+ if (ret < 0) {
+ dev_err(dev, "Req for #%d msix vectors failed\n", num_vec);
+ return 1;
+ }
+ sprintf(irq_name, "BGX%d", bgx->bgx_id);
+ ret = request_irq(pci_irq_vector(pdev, GMPX_GMI_TX_INT),
+ bgx_intr_handler, 0, irq_name, bgx);
+ if (ret)
+ return 1;
+
+ return 0;
+}
+
static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
int err;
@@ -1414,6 +1462,8 @@ static int bgx_probe(struct pci_dev *pde
xcv_init_hw(bgx->phy_mode);
bgx_init_hw(bgx);
+ bgx_register_intr(pdev);
+
/* Enable all LMACs */
for (lmac = 0; lmac < bgx->lmac_count; lmac++) {
err = bgx_lmac_enable(bgx, lmac);
@@ -1424,6 +1474,10 @@ static int bgx_probe(struct pci_dev *pde
bgx_lmac_disable(bgx, --lmac);
goto err_enable;
}
+
+ /* enable TX FIFO Underflow interrupt */
+ bgx_reg_modify(bgx, lmac, BGX_GMP_GMI_TXX_INT_ENA_W1S,
+ GMI_TXX_INT_UNDFLW);
}
return 0;
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
@@ -179,6 +179,15 @@
#define BGX_GMP_GMI_TXX_BURST 0x38228
#define BGX_GMP_GMI_TXX_MIN_PKT 0x38240
#define BGX_GMP_GMI_TXX_SGMII_CTL 0x38300
+#define BGX_GMP_GMI_TXX_INT 0x38500
+#define BGX_GMP_GMI_TXX_INT_W1S 0x38508
+#define BGX_GMP_GMI_TXX_INT_ENA_W1C 0x38510
+#define BGX_GMP_GMI_TXX_INT_ENA_W1S 0x38518
+#define GMI_TXX_INT_PTP_LOST BIT_ULL(4)
+#define GMI_TXX_INT_LATE_COL BIT_ULL(3)
+#define GMI_TXX_INT_XSDEF BIT_ULL(2)
+#define GMI_TXX_INT_XSCOL BIT_ULL(1)
+#define GMI_TXX_INT_UNDFLW BIT_ULL(0)
#define BGX_MSIX_VEC_0_29_ADDR 0x400000 /* +(0..29) << 4 */
#define BGX_MSIX_VEC_0_29_CTL 0x400008
......@@ -49,8 +49,8 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
break;
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -412,6 +412,7 @@ struct phy_device {
bool suspended;
@@ -414,6 +414,7 @@ struct phy_device {
bool suspended_by_mdio_bus;
bool sysfs_links;
bool loopback_enabled;
+ bool no_auto_carrier_off;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment