kernel: bump 5.15 to 5.15.103 ()

Fixes sb commit: 138af4d ("kernel: refresh patch")
This commit is contained in:
lovehackintosh 2023-03-19 11:31:49 +08:00 committed by GitHub
parent a76ac2ef41
commit 89e25b5a13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
161 changed files with 797 additions and 2825 deletions
include
target/linux
airoha/patches-5.15
ath79/patches-5.15
bcm27xx/patches-5.15
generic
backport-5.15
702-v5.19-00-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch702-v5.19-02-net-ethernet-mtk_eth_soc-add-support-for-Wireless-Et.patch702-v5.19-07-net-ethernet-mtk_eth_soc-allocate-struct-mtk_ppe-sep.patch702-v5.19-08-net-ethernet-mtk_eth_soc-rework-hardware-flow-table-.patch702-v5.19-13-net-ethernet-mtk_eth_soc-use-standard-property-for-c.patch702-v5.19-17-net-ethernet-mtk_eth_soc-rely-on-GFP_KERNEL-for-dma_.patch702-v5.19-18-net-ethernet-mtk_eth_soc-move-tx-dma-desc-configurat.patch702-v5.19-19-net-ethernet-mtk_eth_soc-add-txd_size-to-mtk_soc_dat.patch702-v5.19-20-net-ethernet-mtk_eth_soc-rely-on-txd_size-in-mtk_tx_.patch702-v5.19-21-net-ethernet-mtk_eth_soc-rely-on-txd_size-in-mtk_des.patch702-v5.19-22-net-ethernet-mtk_eth_soc-rely-on-txd_size-in-txd_to_.patch702-v5.19-23-net-ethernet-mtk_eth_soc-add-rxd_size-to-mtk_soc_dat.patch702-v5.19-24-net-ethernet-mtk_eth_soc-rely-on-txd_size-field-in-m.patch702-v5.19-25-net-ethernet-mtk_eth_soc-rely-on-rxd_size-field-in-m.patch702-v5.19-26-net-ethernet-mtk_eth_soc-introduce-device-register-m.patch702-v5.19-27-net-ethernet-mtk_eth_soc-introduce-MTK_NETSYS_V2-sup.patch702-v5.19-28-net-ethernet-mtk_eth_soc-convert-ring-dma-pointer-to.patch702-v5.19-29-net-ethernet-mtk_eth_soc-convert-scratch_ring-pointe.patch702-v5.19-30-net-ethernet-mtk_eth_soc-introduce-support-for-mt798.patch702-v5.19-33-net-ethernet-mtk_eth_soc-enable-rx-cksum-offload-for.patch704-01-v5.17-net-mtk_eth_soc-populate-supported_interfaces-member.patch704-02-v5.17-net-mtk_eth_soc-remove-interface-checks-in-mtk_valid.patch704-03-v5.17-net-mtk_eth_soc-drop-use-of-phylink_helper_basex_spe.patch704-04-v5.17-net-mtk_eth_soc-use-phylink_generic_validate.patch704-05-v5.17-net-mtk_eth_soc-mark-as-a-legacy_pre_march2020-drive.patch704-06-v5.19-eth-mtk_eth_soc-remove-a-copy-of-the-NAPI_POLL_WEIGH.patch704-07-v5.19-mtk_eth_soc-remove-unused-mac-mode.patch704-08-v5.19-net-mtk_eth_soc-remove-unused-sgmii-flags.patch704-09-v5.19-net-mtk_eth_soc-add-mask-and-update-PCS-speed-defini.patch704-11-v5.19-net-mtk_eth_soc-correct-802.3z-duplex-setting.patch704-12-v5.19-net-mtk_eth_soc-stop-passing-phylink-state-to-sgmii-.patch704-13-v5.19-net-mtk_eth_soc-provide-mtk_sgmii_config.patch704-15-v5.19-net-mtk_eth_soc-move-MAC_MCR-setting-to-mac_finish.patch704-16-v5.19-net-mtk_eth_soc-move-restoration-of-SYSCFG0-to-mac_f.patch704-17-v5.19-net-mtk_eth_soc-convert-code-structure-to-suit-split.patch704-18-v5.19-net-mtk_eth_soc-partially-convert-to-phylink_pcs.patch705-01-v5.17-net-dsa-mt7530-iterate-using-dsa_switch_for_each_use.patch705-02-v5.19-net-dsa-mt7530-populate-supported_interfaces-and-mac.patch705-03-v5.19-net-dsa-mt7530-remove-interface-checks.patch705-04-v5.19-net-dsa-mt7530-drop-use-of-phylink_helper_basex_spee.patch705-05-v5.19-net-dsa-mt7530-only-indicate-linkmodes-that-can-be-s.patch705-06-v5.19-net-dsa-mt7530-switch-to-use-phylink_get_linkmodes.patch705-07-v5.19-net-dsa-mt7530-partially-convert-to-phylink_pcs.patch705-08-v5.19-net-dsa-mt7530-move-autoneg-handling-to-PCS-validati.patch705-09-v5.19-net-dsa-mt7530-mark-as-non-legacy.patch705-10-v5.19-net-dsa-mt753x-fix-pcs-conversion-regression.patch705-11-v6.0-net-dsa-mt7530-rework-mt7530_hw_vlan_-add-del.patch705-12-v6.0-net-dsa-mt7530-rework-mt753-01-_setup.patch705-13-v6.0-net-dsa-mt7530-get-cpu-port-via-dp-cpu_dp-instead-of.patch706-00-v6.0-net-ethernet-mtk_eth_soc-rely-on-page_pool-for-singl.patch706-01-v6.0-net-ethernet-mtk_eth_soc-add-basic-XDP-support.patch706-02-v6.0-net-ethernet-mtk_eth_soc-introduce-xdp-ethtool-count.patch706-03-v6.0-net-ethernet-mtk_eth_soc-add-xmit-XDP-support.patch706-04-v6.0-net-ethernet-mtk_eth_soc-add-support-for-page_pool_g.patch706-05-v6.0-net-ethernet-mtk_eth_soc-introduce-mtk_xdp_frame_map.patch706-06-v6.0-net-ethernet-mtk_eth_soc-introduce-xdp-multi-frag-su.patch710-v6.0-net-ethernet-mtk_eth_soc-fix-hw-hash-reporting-for-M.patch712-v6.0-net-ethernet-mtk_eth_soc-enable-XDP-support-just-for.patch713-v6.0-net-ethernet-mtk_eth_soc-move-gdma_to_ppe-and-ppe_ba.patch714-v6.0-net-ethernet-mtk_eth_soc-move-ppe-table-hash-offset-.patch715-v6.0-net-ethernet-mtk_eth_soc-add-the-capability-to-run-m.patch716-v6.0-net-ethernet-mtk_eth_soc-move-wdma_base-definitions-.patch717-v6.0-net-ethernet-mtk_eth_soc-add-foe_entry_size-to-mtk_e.patch721-v6.0-net-ethernet-mtk_eth_wed-add-wed-support-for-mt7986-.patch723-v6.0-net-ethernet-mtk_eth_soc-introduce-flow-offloading-s.patch724-v6.0-net-ethernet-mtk_eth_soc-enable-flow-offloading-supp.patch728-v6.1-01-net-ethernet-mtk_eth_soc-fix-possible-memory-leak-in.patch729-06-v6.1-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch729-08-v6.2-net-ethernet-mtk_eth_soc-fix-RSTCTRL_PPE-0-1-definit.patch729-18-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_reset-util.patch729-19-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch729-20-v6.3-net-ethernet-mtk_eth_soc-align-reset-procedure-to-ve.patch729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch729-22-v6.3-net-ethernet-mtk_wed-add-reset-reset_complete-callba.patch733-v6.2-02-net-mediatek-sgmii-ensure-the-SGMII-PHY-is-powered-d.patch733-v6.2-03-net-mediatek-sgmii-fix-duplex-configuration.patch775-v6.0-01-net-ethernet-stmicro-stmmac-move-queue-reset-to-dedi.patch775-v6.0-02-net-ethernet-stmicro-stmmac-first-disable-all-queues.patch775-v6.0-03-net-ethernet-stmicro-stmmac-move-dma-conf-to-dedicat.patch775-v6.0-04-net-ethernet-stmicro-stmmac-generate-stmmac-dma-conf.patch775-v6.0-05-net-ethernet-stmicro-stmmac-permit-MTU-change-with-i.patch782-v6.1-net-dsa-mt7530-add-support-for-in-band-link-status.patch
hack-5.15

View File

@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .102
LINUX_KERNEL_HASH-5.15.102 = 441cddfb970b97759eebdb9b142673662ce0770500e3ae8bcd4b90af369b01e6
LINUX_VERSION-5.15 = .103
LINUX_KERNEL_HASH-5.15.103 = 0876ba81631cca532f72a8d633f7031c3068669a0ecdd77d23b74e8dfc8dd705

View File

@ -1,6 +1,6 @@
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -308,6 +308,12 @@ config SPI_DLN2
@@ -307,6 +307,12 @@ config SPI_DLN2
This driver can also be built as a module. If so, the module
will be called spi-dln2.

View File

@ -10,7 +10,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -3149,6 +3149,7 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -3158,6 +3158,7 @@ int spi_nor_scan(struct spi_nor *nor, co
struct device *dev = nor->dev;
struct mtd_info *mtd = &nor->mtd;
struct device_node *np = spi_nor_get_flash_node(nor);
@ -18,7 +18,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
int ret;
int i;
@@ -3203,7 +3204,12 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -3212,7 +3213,12 @@ int spi_nor_scan(struct spi_nor *nor, co
if (ret)
return ret;

View File

@ -1,6 +1,6 @@
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -2175,6 +2175,14 @@ config RAVE_SP_CORE
@@ -2176,6 +2176,14 @@ config RAVE_SP_CORE
Select this to get support for the Supervisory Processor
device found on several devices in RAVE line of hardware.

View File

@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2716,6 +2716,11 @@ static int lan78xx_reset(struct lan78xx_
@@ -2691,6 +2691,11 @@ static int lan78xx_reset(struct lan78xx_
int ret;
u32 buf;
u8 sig;
@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
ret = lan78xx_read_reg(dev, HW_CFG, &buf);
if (ret < 0)
@@ -2797,6 +2802,10 @@ static int lan78xx_reset(struct lan78xx_
@@ -2772,6 +2777,10 @@ static int lan78xx_reset(struct lan78xx_
buf |= HW_CFG_MEF_;
@ -37,7 +37,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
ret = lan78xx_write_reg(dev, HW_CFG, buf);
if (ret < 0)
return ret;
@@ -2895,6 +2904,9 @@ static int lan78xx_reset(struct lan78xx_
@@ -2870,6 +2879,9 @@ static int lan78xx_reset(struct lan78xx_
buf |= MAC_CR_AUTO_DUPLEX_ | MAC_CR_AUTO_SPEED_;
}
}

View File

@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2960,6 +2960,22 @@ static int lan78xx_open(struct net_devic
@@ -2935,6 +2935,22 @@ static int lan78xx_open(struct net_devic
netif_dbg(dev, ifup, dev->net, "phy initialised successfully");

View File

@ -37,7 +37,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data)
{
u32 *buf;
@@ -3288,8 +3297,14 @@ static int lan78xx_bind(struct lan78xx_n
@@ -3263,8 +3272,14 @@ static int lan78xx_bind(struct lan78xx_n
if (DEFAULT_RX_CSUM_ENABLE)
dev->net->features |= NETIF_F_RXCSUM;

View File

@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2277,6 +2277,22 @@ static int lan78xx_phy_init(struct lan78
@@ -2252,6 +2252,22 @@ static int lan78xx_phy_init(struct lan78
mii_adv_to_linkmode_adv_t(fc, mii_adv);
linkmode_or(phydev->advertising, fc, phydev->advertising);
@ -39,7 +39,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
if (phydev->mdio.dev.of_node) {
u32 reg;
int len;
@@ -2969,22 +2985,6 @@ static int lan78xx_open(struct net_devic
@@ -2944,22 +2960,6 @@ static int lan78xx_open(struct net_devic
netif_dbg(dev, ifup, dev->net, "phy initialised successfully");

View File

@ -28,7 +28,7 @@ See: https://github.com/raspberrypi/linux/issues/2447
static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data)
{
u32 *buf;
@@ -4148,7 +4153,13 @@ static int lan78xx_probe(struct usb_inte
@@ -4123,7 +4128,13 @@ static int lan78xx_probe(struct usb_inte
netdev->max_mtu = MAX_SINGLE_PACKET_SIZE;
netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER);

View File

@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2282,7 +2282,7 @@ static int lan78xx_phy_init(struct lan78
@@ -2257,7 +2257,7 @@ static int lan78xx_phy_init(struct lan78
mii_adv_to_linkmode_adv_t(fc, mii_adv);
linkmode_or(phydev->advertising, fc, phydev->advertising);

View File

@ -12,7 +12,7 @@ in both dwc_otg and in ipv6 processing.
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -3527,7 +3527,7 @@ static int rx_submit(struct lan78xx_net
@@ -3502,7 +3502,7 @@ static int rx_submit(struct lan78xx_net
size_t size = dev->rx_urb_size;
int ret = 0;

View File

@ -21,7 +21,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -230,12 +230,12 @@ static int lan87xx_read_status(struct ph
@@ -220,12 +220,12 @@ static int lan87xx_read_status(struct ph
if (rc < 0)
return rc;

View File

@ -18,7 +18,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -220,6 +220,8 @@ static int lan87xx_read_status(struct ph
@@ -210,6 +210,8 @@ static int lan87xx_read_status(struct ph
int err = genphy_read_status(phydev);
if (!phydev->link && priv->energy_enable && phydev->irq == PHY_POLL) {
@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
/* Disable EDPD to wake up PHY */
int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
if (rc < 0)
@@ -235,7 +237,7 @@ static int lan87xx_read_status(struct ph
@@ -225,7 +227,7 @@ static int lan87xx_read_status(struct ph
*/
read_poll_timeout(phy_read, rc,
rc & MII_LAN83C185_ENERGYON || rc < 0,
@ -36,7 +36,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
MII_LAN83C185_CTRL_STATUS);
if (rc < 0)
return rc;
@@ -245,10 +247,16 @@ static int lan87xx_read_status(struct ph
@@ -235,10 +237,16 @@ static int lan87xx_read_status(struct ph
if (rc < 0)
return rc;

View File

@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <linux/mfd/syscon.h>
#include <linux/regmap.h>
#include <linux/clk.h>
@@ -839,7 +840,7 @@ static int mtk_init_fq_dma(struct mtk_et
@@ -840,7 +841,7 @@ static int mtk_init_fq_dma(struct mtk_et
dma_addr_t dma_addr;
int i;
@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
cnt * sizeof(struct mtk_tx_dma),
&eth->phy_scratch_ring,
GFP_ATOMIC);
@@ -851,10 +852,10 @@ static int mtk_init_fq_dma(struct mtk_et
@@ -852,10 +853,10 @@ static int mtk_init_fq_dma(struct mtk_et
if (unlikely(!eth->scratch_head))
return -ENOMEM;
@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return -ENOMEM;
phy_ring_tail = eth->phy_scratch_ring +
@@ -908,26 +909,26 @@ static void mtk_tx_unmap(struct mtk_eth
@@ -909,26 +910,26 @@ static void mtk_tx_unmap(struct mtk_eth
{
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) {
@ -73,7 +73,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
dma_unmap_addr(tx_buf, dma_addr1),
dma_unmap_len(tx_buf, dma_len1),
DMA_TO_DEVICE);
@@ -1005,9 +1006,9 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1006,9 +1007,9 @@ static int mtk_tx_map(struct sk_buff *sk
if (skb_vlan_tag_present(skb))
txd4 |= TX_DMA_INS_VLAN | skb_vlan_tag_get(skb);
@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return -ENOMEM;
WRITE_ONCE(itxd->txd1, mapped_addr);
@@ -1046,10 +1047,10 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1047,10 +1048,10 @@ static int mtk_tx_map(struct sk_buff *sk
frag_map_size = min(frag_size, MTK_TX_DMA_BUF_LEN);
@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
goto err_dma;
if (i == nr_frags - 1 &&
@@ -1330,18 +1331,18 @@ static int mtk_poll_rx(struct napi_struc
@@ -1331,18 +1332,18 @@ static int mtk_poll_rx(struct napi_struc
netdev->stats.rx_dropped++;
goto release_desc;
}
@ -120,7 +120,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ring->buf_size, DMA_FROM_DEVICE);
/* receive data */
@@ -1614,7 +1615,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1615,7 +1616,7 @@ static int mtk_tx_alloc(struct mtk_eth *
if (!ring->buf)
goto no_tx_mem;
@ -129,7 +129,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
&ring->phys, GFP_ATOMIC);
if (!ring->dma)
goto no_tx_mem;
@@ -1632,7 +1633,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1633,7 +1634,7 @@ static int mtk_tx_alloc(struct mtk_eth *
* descriptors in ring->dma_pdma.
*/
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
@ -138,7 +138,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
&ring->phys_pdma,
GFP_ATOMIC);
if (!ring->dma_pdma)
@@ -1691,7 +1692,7 @@ static void mtk_tx_clean(struct mtk_eth
@@ -1692,7 +1693,7 @@ static void mtk_tx_clean(struct mtk_eth
}
if (ring->dma) {
@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
MTK_DMA_SIZE * sizeof(*ring->dma),
ring->dma,
ring->phys);
@@ -1699,7 +1700,7 @@ static void mtk_tx_clean(struct mtk_eth
@@ -1700,7 +1701,7 @@ static void mtk_tx_clean(struct mtk_eth
}
if (ring->dma_pdma) {
@ -156,7 +156,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
MTK_DMA_SIZE * sizeof(*ring->dma_pdma),
ring->dma_pdma,
ring->phys_pdma);
@@ -1747,18 +1748,18 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1748,18 +1749,18 @@ static int mtk_rx_alloc(struct mtk_eth *
return -ENOMEM;
}
@ -178,7 +178,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return -ENOMEM;
ring->dma[i].rxd1 = (unsigned int)dma_addr;
@@ -1794,7 +1795,7 @@ static void mtk_rx_clean(struct mtk_eth
@@ -1795,7 +1796,7 @@ static void mtk_rx_clean(struct mtk_eth
continue;
if (!ring->dma[i].rxd1)
continue;
@ -187,7 +187,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ring->dma[i].rxd1,
ring->buf_size,
DMA_FROM_DEVICE);
@@ -1805,7 +1806,7 @@ static void mtk_rx_clean(struct mtk_eth
@@ -1806,7 +1807,7 @@ static void mtk_rx_clean(struct mtk_eth
}
if (ring->dma) {
@ -196,7 +196,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ring->dma_size * sizeof(*ring->dma),
ring->dma,
ring->phys);
@@ -2161,7 +2162,7 @@ static void mtk_dma_free(struct mtk_eth
@@ -2162,7 +2163,7 @@ static void mtk_dma_free(struct mtk_eth
if (eth->netdev[i])
netdev_reset_queue(eth->netdev[i]);
if (eth->scratch_ring) {
@ -205,7 +205,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
MTK_DMA_SIZE * sizeof(struct mtk_tx_dma),
eth->scratch_ring,
eth->phy_scratch_ring);
@@ -2513,6 +2514,8 @@ static void mtk_dim_tx(struct work_struc
@@ -2514,6 +2515,8 @@ static void mtk_dim_tx(struct work_struc
static int mtk_hw_init(struct mtk_eth *eth)
{
@ -214,7 +214,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
int i, val, ret;
if (test_and_set_bit(MTK_HW_INIT, &eth->state))
@@ -2525,6 +2528,10 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -2526,6 +2529,10 @@ static int mtk_hw_init(struct mtk_eth *e
if (ret)
goto err_disable_pm;
@ -225,7 +225,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
ret = device_reset(eth->dev);
if (ret) {
@@ -3078,6 +3085,35 @@ free_netdev:
@@ -3079,6 +3086,35 @@ free_netdev:
return err;
}
@ -261,7 +261,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int mtk_probe(struct platform_device *pdev)
{
struct device_node *mac_np;
@@ -3091,6 +3127,7 @@ static int mtk_probe(struct platform_dev
@@ -3092,6 +3128,7 @@ static int mtk_probe(struct platform_dev
eth->soc = of_device_get_match_data(&pdev->dev);
eth->dev = &pdev->dev;
@ -269,7 +269,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
eth->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(eth->base))
return PTR_ERR(eth->base);
@@ -3139,6 +3176,16 @@ static int mtk_probe(struct platform_dev
@@ -3140,6 +3177,16 @@ static int mtk_probe(struct platform_dev
}
}
@ -288,7 +288,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
GFP_KERNEL);
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -462,6 +462,12 @@
@@ -463,6 +463,12 @@
#define RSTCTRL_FE BIT(6)
#define RSTCTRL_PPE BIT(31)
@ -301,7 +301,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* SGMII subsystem config registers */
/* Register to auto-negotiation restart */
#define SGMSYS_PCS_CONTROL_1 0x0
@@ -879,6 +885,7 @@ struct mtk_sgmii {
@@ -880,6 +886,7 @@ struct mtk_sgmii {
/* struct mtk_eth - This is the main datasructure for holding the state
* of the driver
* @dev: The device pointer
@ -309,7 +309,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
* @base: The mapped register i/o base
* @page_lock: Make sure that register operations are atomic
* @tx_irq__lock: Make sure that IRQ register operations are atomic
@@ -922,6 +929,7 @@ struct mtk_sgmii {
@@ -923,6 +930,7 @@ struct mtk_sgmii {
struct mtk_eth {
struct device *dev;
@ -317,7 +317,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
void __iomem *base;
spinlock_t page_lock;
spinlock_t tx_irq_lock;
@@ -1020,6 +1028,7 @@ int mtk_gmac_rgmii_path_setup(struct mtk
@@ -1021,6 +1029,7 @@ int mtk_gmac_rgmii_path_setup(struct mtk
int mtk_eth_offload_init(struct mtk_eth *eth);
int mtk_eth_setup_tc(struct net_device *dev, enum tc_setup_type type,
void *type_data);

View File

@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int mtk_msg_level = -1;
module_param_named(msg_level, mtk_msg_level, int, 0);
@@ -3208,6 +3209,22 @@ static int mtk_probe(struct platform_dev
@@ -3209,6 +3210,22 @@ static int mtk_probe(struct platform_dev
}
}

View File

@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -2334,7 +2334,7 @@ static int mtk_open(struct net_device *d
@@ -2335,7 +2335,7 @@ static int mtk_open(struct net_device *d
return err;
}
@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
gdm_config = MTK_GDMA_TO_PPE;
mtk_gdm_config(eth, gdm_config);
@@ -2408,7 +2408,7 @@ static int mtk_stop(struct net_device *d
@@ -2409,7 +2409,7 @@ static int mtk_stop(struct net_device *d
mtk_dma_free(eth);
if (eth->soc->offload_version)
@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return 0;
}
@@ -3300,10 +3300,11 @@ static int mtk_probe(struct platform_dev
@@ -3301,10 +3301,11 @@ static int mtk_probe(struct platform_dev
}
if (eth->soc->offload_version) {
@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (err)
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -982,7 +982,7 @@ struct mtk_eth {
@@ -983,7 +983,7 @@ struct mtk_eth {
u32 rx_dma_l4_valid;
int ip_align;

View File

@ -33,7 +33,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <net/dsa.h>
#include "mtk_eth_soc.h"
@@ -1292,7 +1293,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1293,7 +1294,7 @@ static int mtk_poll_rx(struct napi_struc
struct net_device *netdev;
unsigned int pktlen;
dma_addr_t dma_addr;
@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
int mac;
ring = mtk_get_rx_ring(eth);
@@ -1371,6 +1372,11 @@ static int mtk_poll_rx(struct napi_struc
@@ -1372,6 +1373,11 @@ static int mtk_poll_rx(struct napi_struc
skb_set_hash(skb, hash, PKT_HASH_TYPE_L4);
}
@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX &&
(trxd.rxd2 & RX_DMA_VTAG))
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
@@ -3300,7 +3306,7 @@ static int mtk_probe(struct platform_dev
@@ -3301,7 +3307,7 @@ static int mtk_probe(struct platform_dev
}
if (eth->soc->offload_version) {

View File

@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mediatek,hifsys = <&hifsys>;
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3187,7 +3187,7 @@ static int mtk_probe(struct platform_dev
@@ -3188,7 +3188,7 @@ static int mtk_probe(struct platform_dev
struct regmap *cci;
cci = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,

View File

@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -845,7 +845,7 @@ static int mtk_init_fq_dma(struct mtk_et
@@ -846,7 +846,7 @@ static int mtk_init_fq_dma(struct mtk_et
eth->scratch_ring = dma_alloc_coherent(eth->dma_dev,
cnt * sizeof(struct mtk_tx_dma),
&eth->phy_scratch_ring,
@ -22,7 +22,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (unlikely(!eth->scratch_ring))
return -ENOMEM;
@@ -1623,7 +1623,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1624,7 +1624,7 @@ static int mtk_tx_alloc(struct mtk_eth *
goto no_tx_mem;
ring->dma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz,
@ -31,7 +31,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!ring->dma)
goto no_tx_mem;
@@ -1641,8 +1641,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1642,8 +1642,7 @@ static int mtk_tx_alloc(struct mtk_eth *
*/
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
ring->dma_pdma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz,
@ -41,7 +41,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!ring->dma_pdma)
goto no_tx_mem;
@@ -1757,7 +1756,7 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1758,7 +1757,7 @@ static int mtk_rx_alloc(struct mtk_eth *
ring->dma = dma_alloc_coherent(eth->dma_dev,
rx_dma_size * sizeof(*ring->dma),

View File

@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -971,18 +971,51 @@ static void setup_tx_buf(struct mtk_eth
@@ -972,18 +972,51 @@ static void setup_tx_buf(struct mtk_eth
}
}
@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int k = 0;
itxd = ring->next_free;
@@ -990,49 +1023,32 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -991,49 +1024,32 @@ static int mtk_tx_map(struct sk_buff *sk
if (itxd == ring->last_free)
return -ENOMEM;
@ -126,7 +126,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
bool new_desc = true;
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA) ||
@@ -1047,23 +1063,17 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1048,23 +1064,17 @@ static int mtk_tx_map(struct sk_buff *sk
new_desc = false;
}
@ -159,7 +159,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
tx_buf = mtk_desc_to_tx_buf(ring, txd);
if (new_desc)
@@ -1073,20 +1083,17 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1074,20 +1084,17 @@ static int mtk_tx_map(struct sk_buff *sk
tx_buf->flags |= (!mac->id) ? MTK_TX_FLAGS_FPORT0 :
MTK_TX_FLAGS_FPORT1;
@ -186,7 +186,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
txd_pdma->txd2 |= TX_DMA_LS0;
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -842,6 +842,17 @@ enum mkt_eth_capabilities {
@@ -843,6 +843,17 @@ enum mkt_eth_capabilities {
MTK_MUX_U3_GMAC2_TO_QPHY | \
MTK_MUX_GMAC12_TO_GEPHY_SGMII | MTK_QDMA)

View File

@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -837,20 +837,20 @@ static void *mtk_max_lro_buf_alloc(gfp_t
@@ -838,20 +838,20 @@ static void *mtk_max_lro_buf_alloc(gfp_t
/* the qdma core needs scratch memory to be setup */
static int mtk_init_fq_dma(struct mtk_eth *eth)
{
@ -38,7 +38,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (unlikely(!eth->scratch_head))
return -ENOMEM;
@@ -860,16 +860,19 @@ static int mtk_init_fq_dma(struct mtk_et
@@ -861,16 +861,19 @@ static int mtk_init_fq_dma(struct mtk_et
if (unlikely(dma_mapping_error(eth->dma_dev, dma_addr)))
return -ENOMEM;
@ -65,7 +65,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
mtk_w32(eth, eth->phy_scratch_ring, MTK_QDMA_FQ_HEAD);
@@ -2169,6 +2172,7 @@ static int mtk_dma_init(struct mtk_eth *
@@ -2170,6 +2173,7 @@ static int mtk_dma_init(struct mtk_eth *
static void mtk_dma_free(struct mtk_eth *eth)
{
@ -73,7 +73,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int i;
for (i = 0; i < MTK_MAC_COUNT; i++)
@@ -2176,9 +2180,8 @@ static void mtk_dma_free(struct mtk_eth
@@ -2177,9 +2181,8 @@ static void mtk_dma_free(struct mtk_eth
netdev_reset_queue(eth->netdev[i]);
if (eth->scratch_ring) {
dma_free_coherent(eth->dma_dev,
@ -85,7 +85,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
eth->scratch_ring = NULL;
eth->phy_scratch_ring = 0;
}
@@ -3390,6 +3393,9 @@ static const struct mtk_soc_data mt2701_
@@ -3391,6 +3394,9 @@ static const struct mtk_soc_data mt2701_
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
@ -95,7 +95,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct mtk_soc_data mt7621_data = {
@@ -3398,6 +3404,9 @@ static const struct mtk_soc_data mt7621_
@@ -3399,6 +3405,9 @@ static const struct mtk_soc_data mt7621_
.required_clks = MT7621_CLKS_BITMAP,
.required_pctl = false,
.offload_version = 2,
@ -105,7 +105,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct mtk_soc_data mt7622_data = {
@@ -3407,6 +3416,9 @@ static const struct mtk_soc_data mt7622_
@@ -3408,6 +3417,9 @@ static const struct mtk_soc_data mt7622_
.required_clks = MT7622_CLKS_BITMAP,
.required_pctl = false,
.offload_version = 2,
@ -115,7 +115,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct mtk_soc_data mt7623_data = {
@@ -3415,6 +3427,9 @@ static const struct mtk_soc_data mt7623_
@@ -3416,6 +3428,9 @@ static const struct mtk_soc_data mt7623_
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
.offload_version = 2,
@ -125,7 +125,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct mtk_soc_data mt7629_data = {
@@ -3423,6 +3438,9 @@ static const struct mtk_soc_data mt7629_
@@ -3424,6 +3439,9 @@ static const struct mtk_soc_data mt7629_
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7629_CLKS_BITMAP,
.required_pctl = false,
@ -135,7 +135,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct mtk_soc_data rt5350_data = {
@@ -3430,6 +3448,9 @@ static const struct mtk_soc_data rt5350_
@@ -3431,6 +3449,9 @@ static const struct mtk_soc_data rt5350_
.hw_features = MTK_HW_FEATURES_MT7628,
.required_clks = MT7628_CLKS_BITMAP,
.required_pctl = false,
@ -147,7 +147,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
const struct of_device_id of_mtk_match[] = {
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -863,6 +863,7 @@ struct mtk_tx_dma_desc_info {
@@ -864,6 +864,7 @@ struct mtk_tx_dma_desc_info {
* the target SoC
* @required_pctl A bool value to show whether the SoC requires
* the extra setup for those pins used by GMAC.
@ -155,7 +155,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
*/
struct mtk_soc_data {
u32 ana_rgc3;
@@ -871,6 +872,9 @@ struct mtk_soc_data {
@@ -872,6 +873,9 @@ struct mtk_soc_data {
bool required_pctl;
u8 offload_version;
netdev_features_t hw_features;

View File

@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1624,8 +1624,10 @@ static int mtk_napi_rx(struct napi_struc
@@ -1625,8 +1625,10 @@ static int mtk_napi_rx(struct napi_struc
static int mtk_tx_alloc(struct mtk_eth *eth)
{
@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->buf = kcalloc(MTK_DMA_SIZE, sizeof(*ring->buf),
GFP_KERNEL);
@@ -1641,8 +1643,10 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1642,8 +1644,10 @@ static int mtk_tx_alloc(struct mtk_eth *
int next = (i + 1) % MTK_DMA_SIZE;
u32 next_ptr = ring->phys + next * sz;
@ -37,7 +37,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
/* On MT7688 (PDMA only) this driver uses the ring->dma structs
@@ -1664,7 +1668,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1665,7 +1669,7 @@ static int mtk_tx_alloc(struct mtk_eth *
ring->dma_size = MTK_DMA_SIZE;
atomic_set(&ring->free_count, MTK_DMA_SIZE - 2);
ring->next_free = &ring->dma[0];
@ -46,7 +46,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->last_free_ptr = (u32)(ring->phys + ((MTK_DMA_SIZE - 1) * sz));
ring->thresh = MAX_SKB_FRAGS;
@@ -1697,6 +1701,7 @@ no_tx_mem:
@@ -1698,6 +1702,7 @@ no_tx_mem:
static void mtk_tx_clean(struct mtk_eth *eth)
{
@ -54,7 +54,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_tx_ring *ring = &eth->tx_ring;
int i;
@@ -1709,17 +1714,15 @@ static void mtk_tx_clean(struct mtk_eth
@@ -1710,17 +1715,15 @@ static void mtk_tx_clean(struct mtk_eth
if (ring->dma) {
dma_free_coherent(eth->dma_dev,

View File

@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -890,10 +890,11 @@ static inline void *mtk_qdma_phys_to_vir
@@ -891,10 +891,11 @@ static inline void *mtk_qdma_phys_to_vir
return ret + (desc - ring->phys);
}
@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return &ring->buf[idx];
}
@@ -1015,6 +1016,7 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1016,6 +1017,7 @@ static int mtk_tx_map(struct sk_buff *sk
};
struct mtk_mac *mac = netdev_priv(dev);
struct mtk_eth *eth = mac->hw;
@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_tx_dma *itxd, *txd;
struct mtk_tx_dma *itxd_pdma, *txd_pdma;
struct mtk_tx_buf *itx_buf, *tx_buf;
@@ -1026,7 +1028,7 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1027,7 +1029,7 @@ static int mtk_tx_map(struct sk_buff *sk
if (itxd == ring->last_free)
return -ENOMEM;
@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
memset(itx_buf, 0, sizeof(*itx_buf));
txd_info.addr = dma_map_single(eth->dma_dev, skb->data, txd_info.size,
@@ -1054,7 +1056,7 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1055,7 +1057,7 @@ static int mtk_tx_map(struct sk_buff *sk
while (frag_size) {
bool new_desc = true;
@ -53,7 +53,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
(i & 0x1)) {
txd = mtk_qdma_phys_to_virt(ring, txd->txd2);
txd_pdma = qdma_to_pdma(ring, txd);
@@ -1078,7 +1080,8 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1079,7 +1081,8 @@ static int mtk_tx_map(struct sk_buff *sk
mtk_tx_set_dma_desc(dev, txd, &txd_info);
@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (new_desc)
memset(tx_buf, 0, sizeof(*tx_buf));
tx_buf->skb = (struct sk_buff *)MTK_DMA_DUMMY_DESC;
@@ -1097,7 +1100,7 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1098,7 +1101,7 @@ static int mtk_tx_map(struct sk_buff *sk
/* store skb to cleanup */
itx_buf->skb = skb;
@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (k & 0x1)
txd_pdma->txd2 |= TX_DMA_LS0;
else
@@ -1115,7 +1118,7 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1116,7 +1119,7 @@ static int mtk_tx_map(struct sk_buff *sk
*/
wmb();
@ -81,7 +81,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (netif_xmit_stopped(netdev_get_tx_queue(dev, 0)) ||
!netdev_xmit_more())
mtk_w32(eth, txd->txd2, MTK_QTX_CTX_PTR);
@@ -1129,13 +1132,13 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1130,13 +1133,13 @@ static int mtk_tx_map(struct sk_buff *sk
err_dma:
do {
@ -97,7 +97,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
itxd_pdma->txd2 = TX_DMA_DESP2_DEF;
itxd = mtk_qdma_phys_to_virt(ring, itxd->txd2);
@@ -1449,7 +1452,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
@@ -1450,7 +1453,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
if ((desc->txd3 & TX_DMA_OWNER_CPU) == 0)
break;

View File

@ -11,7 +11,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -905,9 +905,10 @@ static struct mtk_tx_dma *qdma_to_pdma(s
@@ -906,9 +906,10 @@ static struct mtk_tx_dma *qdma_to_pdma(s
return ring->dma_pdma - ring->dma + dma;
}
@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static void mtk_tx_unmap(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
@@ -1123,8 +1124,10 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1124,8 +1125,10 @@ static int mtk_tx_map(struct sk_buff *sk
!netdev_xmit_more())
mtk_w32(eth, txd->txd2, MTK_QTX_CTX_PTR);
} else {

View File

@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1775,7 +1775,7 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1776,7 +1776,7 @@ static int mtk_rx_alloc(struct mtk_eth *
}
ring->dma = dma_alloc_coherent(eth->dma_dev,
@ -22,7 +22,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
&ring->phys, GFP_KERNEL);
if (!ring->dma)
return -ENOMEM;
@@ -1833,9 +1833,8 @@ static void mtk_rx_clean(struct mtk_eth
@@ -1834,9 +1834,8 @@ static void mtk_rx_clean(struct mtk_eth
if (ring->dma) {
dma_free_coherent(eth->dma_dev,
@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->dma = NULL;
}
}
@@ -3405,6 +3404,7 @@ static const struct mtk_soc_data mt2701_
@@ -3406,6 +3405,7 @@ static const struct mtk_soc_data mt2701_
.required_pctl = true,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3416,6 +3416,7 @@ static const struct mtk_soc_data mt7621_
@@ -3417,6 +3417,7 @@ static const struct mtk_soc_data mt7621_
.offload_version = 2,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
@ -50,7 +50,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3428,6 +3429,7 @@ static const struct mtk_soc_data mt7622_
@@ -3429,6 +3430,7 @@ static const struct mtk_soc_data mt7622_
.offload_version = 2,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
@ -58,7 +58,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3439,6 +3441,7 @@ static const struct mtk_soc_data mt7623_
@@ -3440,6 +3442,7 @@ static const struct mtk_soc_data mt7623_
.offload_version = 2,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
@ -66,7 +66,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3450,6 +3453,7 @@ static const struct mtk_soc_data mt7629_
@@ -3451,6 +3454,7 @@ static const struct mtk_soc_data mt7629_
.required_pctl = false,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
@ -74,7 +74,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3460,6 +3464,7 @@ static const struct mtk_soc_data rt5350_
@@ -3461,6 +3465,7 @@ static const struct mtk_soc_data rt5350_
.required_pctl = false,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
@ -84,7 +84,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -864,6 +864,7 @@ struct mtk_tx_dma_desc_info {
@@ -865,6 +865,7 @@ struct mtk_tx_dma_desc_info {
* @required_pctl A bool value to show whether the SoC requires
* the extra setup for those pins used by GMAC.
* @txd_size Tx DMA descriptor size.
@ -92,7 +92,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
*/
struct mtk_soc_data {
u32 ana_rgc3;
@@ -874,6 +875,7 @@ struct mtk_soc_data {
@@ -875,6 +876,7 @@ struct mtk_soc_data {
netdev_features_t hw_features;
struct {
u32 txd_size;

View File

@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1264,9 +1264,12 @@ static struct mtk_rx_ring *mtk_get_rx_ri
@@ -1265,9 +1265,12 @@ static struct mtk_rx_ring *mtk_get_rx_ri
return &eth->rx_ring[0];
for (i = 0; i < MTK_MAX_RX_RING_NUM; i++) {
@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->calc_idx_update = true;
return ring;
}
@@ -1317,7 +1320,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1318,7 +1321,7 @@ static int mtk_poll_rx(struct napi_struc
goto rx_done;
idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size);
@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
data = ring->data[idx];
if (!mtk_rx_get_desc(&trxd, rxd))
@@ -1509,7 +1512,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
@@ -1510,7 +1513,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
mtk_tx_unmap(eth, tx_buf, true);

View File

@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1784,18 +1784,25 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1785,18 +1785,25 @@ static int mtk_rx_alloc(struct mtk_eth *
return -ENOMEM;
for (i = 0; i < rx_dma_size; i++) {
@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
ring->dma_size = rx_dma_size;
ring->calc_idx_update = false;
@@ -1820,14 +1827,17 @@ static void mtk_rx_clean(struct mtk_eth
@@ -1821,14 +1828,17 @@ static void mtk_rx_clean(struct mtk_eth
if (ring->data && ring->dma) {
for (i = 0; i < ring->dma_size; i++) {

View File

@ -73,7 +73,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* strings used by ethtool */
static const struct mtk_ethtool_stats {
char str[ETH_GSTRING_LEN];
@@ -618,8 +671,8 @@ static inline void mtk_tx_irq_disable(st
@@ -619,8 +672,8 @@ static inline void mtk_tx_irq_disable(st
u32 val;
spin_lock_irqsave(&eth->tx_irq_lock, flags);
@ -84,7 +84,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock_irqrestore(&eth->tx_irq_lock, flags);
}
@@ -629,8 +682,8 @@ static inline void mtk_tx_irq_enable(str
@@ -630,8 +683,8 @@ static inline void mtk_tx_irq_enable(str
u32 val;
spin_lock_irqsave(&eth->tx_irq_lock, flags);
@ -95,7 +95,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock_irqrestore(&eth->tx_irq_lock, flags);
}
@@ -640,8 +693,8 @@ static inline void mtk_rx_irq_disable(st
@@ -641,8 +694,8 @@ static inline void mtk_rx_irq_disable(st
u32 val;
spin_lock_irqsave(&eth->rx_irq_lock, flags);
@ -106,7 +106,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock_irqrestore(&eth->rx_irq_lock, flags);
}
@@ -651,8 +704,8 @@ static inline void mtk_rx_irq_enable(str
@@ -652,8 +705,8 @@ static inline void mtk_rx_irq_enable(str
u32 val;
spin_lock_irqsave(&eth->rx_irq_lock, flags);
@ -117,7 +117,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock_irqrestore(&eth->rx_irq_lock, flags);
}
@@ -703,39 +756,39 @@ void mtk_stats_update_mac(struct mtk_mac
@@ -704,39 +757,39 @@ void mtk_stats_update_mac(struct mtk_mac
hw_stats->rx_checksum_errors +=
mtk_r32(mac->hw, MT7628_SDM_CS_ERR);
} else {
@ -172,7 +172,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
u64_stats_update_end(&hw_stats->syncp);
@@ -875,10 +928,10 @@ static int mtk_init_fq_dma(struct mtk_et
@@ -876,10 +929,10 @@ static int mtk_init_fq_dma(struct mtk_et
txd->txd4 = 0;
}
@ -187,7 +187,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0;
}
@@ -1122,7 +1175,7 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1123,7 +1176,7 @@ static int mtk_tx_map(struct sk_buff *sk
if (MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
if (netif_xmit_stopped(netdev_get_tx_queue(dev, 0)) ||
!netdev_xmit_more())
@ -196,7 +196,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} else {
int next_idx;
@@ -1439,6 +1492,7 @@ rx_done:
@@ -1440,6 +1493,7 @@ rx_done:
static int mtk_poll_tx_qdma(struct mtk_eth *eth, int budget,
unsigned int *done, unsigned int *bytes)
{
@ -204,7 +204,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_tx_ring *ring = &eth->tx_ring;
struct mtk_tx_dma *desc;
struct sk_buff *skb;
@@ -1446,7 +1500,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
@@ -1447,7 +1501,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
u32 cpu, dma;
cpu = ring->last_free_ptr;
@ -213,7 +213,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
desc = mtk_qdma_phys_to_virt(ring, cpu);
@@ -1481,7 +1535,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
@@ -1482,7 +1536,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
}
ring->last_free_ptr = cpu;
@ -222,7 +222,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return budget;
}
@@ -1574,24 +1628,25 @@ static void mtk_handle_status_irq(struct
@@ -1575,24 +1629,25 @@ static void mtk_handle_status_irq(struct
static int mtk_napi_tx(struct napi_struct *napi, int budget)
{
struct mtk_eth *eth = container_of(napi, struct mtk_eth, tx_napi);
@ -252,7 +252,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return budget;
if (napi_complete_done(napi, tx_done))
@@ -1603,6 +1658,7 @@ static int mtk_napi_tx(struct napi_struc
@@ -1604,6 +1659,7 @@ static int mtk_napi_tx(struct napi_struc
static int mtk_napi_rx(struct napi_struct *napi, int budget)
{
struct mtk_eth *eth = container_of(napi, struct mtk_eth, rx_napi);
@ -260,7 +260,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int rx_done_total = 0;
mtk_handle_status_irq(eth);
@@ -1610,21 +1666,21 @@ static int mtk_napi_rx(struct napi_struc
@@ -1611,21 +1667,21 @@ static int mtk_napi_rx(struct napi_struc
do {
int rx_done;
@ -286,7 +286,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (napi_complete_done(napi, rx_done_total))
mtk_rx_irq_enable(eth, MTK_RX_DONE_INT);
@@ -1687,20 +1743,20 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1688,20 +1744,20 @@ static int mtk_tx_alloc(struct mtk_eth *
*/
wmb();
@ -314,7 +314,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
return 0;
@@ -1739,6 +1795,7 @@ static void mtk_tx_clean(struct mtk_eth
@@ -1740,6 +1796,7 @@ static void mtk_tx_clean(struct mtk_eth
static int mtk_rx_alloc(struct mtk_eth *eth, int ring_no, int rx_flag)
{
@ -322,7 +322,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_rx_ring *ring;
int rx_data_len, rx_dma_size;
int i;
@@ -1807,16 +1864,18 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1808,16 +1865,18 @@ static int mtk_rx_alloc(struct mtk_eth *
ring->dma_size = rx_dma_size;
ring->calc_idx_update = false;
ring->calc_idx = rx_dma_size - 1;
@ -345,7 +345,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0;
}
@@ -2125,9 +2184,9 @@ static int mtk_dma_busy_wait(struct mtk_
@@ -2126,9 +2185,9 @@ static int mtk_dma_busy_wait(struct mtk_
u32 val;
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
@ -357,7 +357,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ret = readx_poll_timeout_atomic(__raw_readl, eth->base + reg, val,
!(val & (MTK_RX_DMA_BUSY | MTK_TX_DMA_BUSY)),
@@ -2185,8 +2244,8 @@ static int mtk_dma_init(struct mtk_eth *
@@ -2186,8 +2245,8 @@ static int mtk_dma_init(struct mtk_eth *
* automatically
*/
mtk_w32(eth, FC_THRES_DROP_MODE | FC_THRES_DROP_EN |
@ -368,7 +368,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
return 0;
@@ -2260,13 +2319,14 @@ static irqreturn_t mtk_handle_irq_tx(int
@@ -2261,13 +2320,14 @@ static irqreturn_t mtk_handle_irq_tx(int
static irqreturn_t mtk_handle_irq(int irq, void *_eth)
{
struct mtk_eth *eth = _eth;
@ -387,7 +387,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_handle_irq_tx(irq, _eth);
}
@@ -2290,6 +2350,7 @@ static void mtk_poll_controller(struct n
@@ -2291,6 +2351,7 @@ static void mtk_poll_controller(struct n
static int mtk_start_dma(struct mtk_eth *eth)
{
u32 rx_2b_offset = (NET_IP_ALIGN == 2) ? MTK_RX_2B_OFFSET : 0;
@ -395,7 +395,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int err;
err = mtk_dma_init(eth);
@@ -2304,16 +2365,15 @@ static int mtk_start_dma(struct mtk_eth
@@ -2305,16 +2366,15 @@ static int mtk_start_dma(struct mtk_eth
MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO |
MTK_RX_DMA_EN | MTK_RX_2B_OFFSET |
MTK_RX_BT_32DWORDS,
@ -415,7 +415,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
return 0;
@@ -2439,8 +2499,8 @@ static int mtk_stop(struct net_device *d
@@ -2440,8 +2500,8 @@ static int mtk_stop(struct net_device *d
cancel_work_sync(&eth->tx_dim.work);
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
@ -426,7 +426,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_dma_free(eth);
@@ -2494,6 +2554,7 @@ static void mtk_dim_rx(struct work_struc
@@ -2495,6 +2555,7 @@ static void mtk_dim_rx(struct work_struc
{
struct dim *dim = container_of(work, struct dim, work);
struct mtk_eth *eth = container_of(dim, struct mtk_eth, rx_dim);
@ -434,7 +434,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct dim_cq_moder cur_profile;
u32 val, cur;
@@ -2501,7 +2562,7 @@ static void mtk_dim_rx(struct work_struc
@@ -2502,7 +2563,7 @@ static void mtk_dim_rx(struct work_struc
dim->profile_ix);
spin_lock_bh(&eth->dim_lock);
@ -443,7 +443,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
val &= MTK_PDMA_DELAY_TX_MASK;
val |= MTK_PDMA_DELAY_RX_EN;
@@ -2511,9 +2572,9 @@ static void mtk_dim_rx(struct work_struc
@@ -2512,9 +2573,9 @@ static void mtk_dim_rx(struct work_struc
cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK);
val |= cur << MTK_PDMA_DELAY_RX_PINT_SHIFT;
@ -455,7 +455,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock_bh(&eth->dim_lock);
@@ -2524,6 +2585,7 @@ static void mtk_dim_tx(struct work_struc
@@ -2525,6 +2586,7 @@ static void mtk_dim_tx(struct work_struc
{
struct dim *dim = container_of(work, struct dim, work);
struct mtk_eth *eth = container_of(dim, struct mtk_eth, tx_dim);
@ -463,7 +463,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct dim_cq_moder cur_profile;
u32 val, cur;
@@ -2531,7 +2593,7 @@ static void mtk_dim_tx(struct work_struc
@@ -2532,7 +2594,7 @@ static void mtk_dim_tx(struct work_struc
dim->profile_ix);
spin_lock_bh(&eth->dim_lock);
@ -472,7 +472,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
val &= MTK_PDMA_DELAY_RX_MASK;
val |= MTK_PDMA_DELAY_TX_EN;
@@ -2541,9 +2603,9 @@ static void mtk_dim_tx(struct work_struc
@@ -2542,9 +2604,9 @@ static void mtk_dim_tx(struct work_struc
cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK);
val |= cur << MTK_PDMA_DELAY_TX_PINT_SHIFT;
@ -484,7 +484,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock_bh(&eth->dim_lock);
@@ -2554,6 +2616,7 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -2555,6 +2617,7 @@ static int mtk_hw_init(struct mtk_eth *e
{
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
ETHSYS_DMA_AG_MAP_PPE;
@ -492,7 +492,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int i, val, ret;
if (test_and_set_bit(MTK_HW_INIT, &eth->state))
@@ -2628,10 +2691,10 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -2629,10 +2692,10 @@ static int mtk_hw_init(struct mtk_eth *e
mtk_rx_irq_disable(eth, ~0);
/* FE int grouping */
@ -507,7 +507,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
return 0;
@@ -3170,14 +3233,6 @@ static int mtk_probe(struct platform_dev
@@ -3171,14 +3234,6 @@ static int mtk_probe(struct platform_dev
if (IS_ERR(eth->base))
return PTR_ERR(eth->base);
@ -522,7 +522,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
eth->rx_dma_l4_valid = RX_DMA_L4_VALID_PDMA;
eth->ip_align = NET_IP_ALIGN;
@@ -3411,6 +3466,7 @@ static int mtk_remove(struct platform_de
@@ -3412,6 +3467,7 @@ static int mtk_remove(struct platform_de
}
static const struct mtk_soc_data mt2701_data = {
@ -530,7 +530,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.caps = MT7623_CAPS | MTK_HWLRO,
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7623_CLKS_BITMAP,
@@ -3422,6 +3478,7 @@ static const struct mtk_soc_data mt2701_
@@ -3423,6 +3479,7 @@ static const struct mtk_soc_data mt2701_
};
static const struct mtk_soc_data mt7621_data = {
@ -538,7 +538,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.caps = MT7621_CAPS,
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7621_CLKS_BITMAP,
@@ -3434,6 +3491,7 @@ static const struct mtk_soc_data mt7621_
@@ -3435,6 +3492,7 @@ static const struct mtk_soc_data mt7621_
};
static const struct mtk_soc_data mt7622_data = {
@ -546,7 +546,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.ana_rgc3 = 0x2028,
.caps = MT7622_CAPS | MTK_HWLRO,
.hw_features = MTK_HW_FEATURES,
@@ -3447,6 +3505,7 @@ static const struct mtk_soc_data mt7622_
@@ -3448,6 +3506,7 @@ static const struct mtk_soc_data mt7622_
};
static const struct mtk_soc_data mt7623_data = {
@ -554,7 +554,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.caps = MT7623_CAPS | MTK_HWLRO,
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7623_CLKS_BITMAP,
@@ -3459,6 +3518,7 @@ static const struct mtk_soc_data mt7623_
@@ -3460,6 +3519,7 @@ static const struct mtk_soc_data mt7623_
};
static const struct mtk_soc_data mt7629_data = {
@ -562,7 +562,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.ana_rgc3 = 0x128,
.caps = MT7629_CAPS | MTK_HWLRO,
.hw_features = MTK_HW_FEATURES,
@@ -3471,6 +3531,7 @@ static const struct mtk_soc_data mt7629_
@@ -3472,6 +3532,7 @@ static const struct mtk_soc_data mt7629_
};
static const struct mtk_soc_data rt5350_data = {
@ -748,7 +748,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define MTK_STAT_OFFSET 0x40
#define MTK_WDMA0_BASE 0x2800
@@ -853,8 +762,46 @@ struct mtk_tx_dma_desc_info {
@@ -854,8 +763,46 @@ struct mtk_tx_dma_desc_info {
u8 last:1;
};
@ -795,7 +795,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
* @ana_rgc3: The offset for register ANA_RGC3 related to
* sgmiisys syscon
* @caps Flags shown the extra capability for the SoC
@@ -867,6 +814,7 @@ struct mtk_tx_dma_desc_info {
@@ -868,6 +815,7 @@ struct mtk_tx_dma_desc_info {
* @rxd_size Rx DMA descriptor size.
*/
struct mtk_soc_data {
@ -803,7 +803,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u32 ana_rgc3;
u32 caps;
u32 required_clks;
@@ -994,8 +942,6 @@ struct mtk_eth {
@@ -995,8 +943,6 @@ struct mtk_eth {
u32 tx_bytes;
struct dim tx_dim;

View File

@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -862,8 +862,8 @@ static inline int mtk_max_buf_size(int f
@@ -863,8 +863,8 @@ static inline int mtk_max_buf_size(int f
return buf_size;
}
@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
{
rxd->rxd2 = READ_ONCE(dma_rxd->rxd2);
if (!(rxd->rxd2 & RX_DMA_DONE))
@@ -872,6 +872,10 @@ static inline bool mtk_rx_get_desc(struc
@@ -873,6 +873,10 @@ static inline bool mtk_rx_get_desc(struc
rxd->rxd1 = READ_ONCE(dma_rxd->rxd1);
rxd->rxd3 = READ_ONCE(dma_rxd->rxd3);
rxd->rxd4 = READ_ONCE(dma_rxd->rxd4);
@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return true;
}
@@ -916,7 +920,7 @@ static int mtk_init_fq_dma(struct mtk_et
@@ -917,7 +921,7 @@ static int mtk_init_fq_dma(struct mtk_et
phy_ring_tail = eth->phy_scratch_ring + soc->txrx.txd_size * (cnt - 1);
for (i = 0; i < cnt; i++) {
@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
txd = (void *)eth->scratch_ring + i * soc->txrx.txd_size;
txd->txd1 = dma_addr + i * MTK_QDMA_PAGE_SIZE;
@@ -926,6 +930,12 @@ static int mtk_init_fq_dma(struct mtk_et
@@ -927,6 +931,12 @@ static int mtk_init_fq_dma(struct mtk_et
txd->txd3 = TX_DMA_PLEN0(MTK_QDMA_PAGE_SIZE);
txd->txd4 = 0;
@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
mtk_w32(eth, eth->phy_scratch_ring, soc->reg_map->qdma.fq_head);
@@ -1029,10 +1039,12 @@ static void setup_tx_buf(struct mtk_eth
@@ -1030,10 +1040,12 @@ static void setup_tx_buf(struct mtk_eth
}
}
@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u32 data;
WRITE_ONCE(desc->txd1, info->addr);
@@ -1056,6 +1068,59 @@ static void mtk_tx_set_dma_desc(struct n
@@ -1057,6 +1069,59 @@ static void mtk_tx_set_dma_desc(struct n
WRITE_ONCE(desc->txd4, data);
}
@ -132,7 +132,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev,
int tx_num, struct mtk_tx_ring *ring, bool gso)
{
@@ -1064,6 +1129,7 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1065,6 +1130,7 @@ static int mtk_tx_map(struct sk_buff *sk
.gso = gso,
.csum = skb->ip_summed == CHECKSUM_PARTIAL,
.vlan = skb_vlan_tag_present(skb),
@ -140,7 +140,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.vlan_tci = skb_vlan_tag_get(skb),
.first = true,
.last = !skb_is_nonlinear(skb),
@@ -1123,7 +1189,9 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1124,7 +1190,9 @@ static int mtk_tx_map(struct sk_buff *sk
}
memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
@ -151,7 +151,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
txd_info.last = i == skb_shinfo(skb)->nr_frags - 1 &&
!(frag_size - txd_info.size);
txd_info.addr = skb_frag_dma_map(eth->dma_dev, frag,
@@ -1204,17 +1272,16 @@ err_dma:
@@ -1205,17 +1273,16 @@ err_dma:
return -ENOMEM;
}
@ -172,7 +172,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
} else {
nfrags += skb_shinfo(skb)->nr_frags;
@@ -1266,7 +1333,7 @@ static netdev_tx_t mtk_start_xmit(struct
@@ -1267,7 +1334,7 @@ static netdev_tx_t mtk_start_xmit(struct
if (unlikely(test_bit(MTK_RESETTING, &eth->state)))
goto drop;
@ -181,7 +181,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
netif_stop_queue(dev);
netif_err(eth, tx_queued, dev,
@@ -1358,7 +1425,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1359,7 +1426,7 @@ static int mtk_poll_rx(struct napi_struc
int idx;
struct sk_buff *skb;
u8 *data, *new_data;
@ -190,7 +190,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int done = 0, bytes = 0;
while (done < budget) {
@@ -1366,7 +1433,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1367,7 +1434,7 @@ static int mtk_poll_rx(struct napi_struc
unsigned int pktlen;
dma_addr_t dma_addr;
u32 hash, reason;
@ -199,7 +199,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring = mtk_get_rx_ring(eth);
if (unlikely(!ring))
@@ -1376,16 +1443,15 @@ static int mtk_poll_rx(struct napi_struc
@@ -1377,16 +1444,15 @@ static int mtk_poll_rx(struct napi_struc
rxd = (void *)ring->dma + idx * eth->soc->txrx.rxd_size;
data = ring->data[idx];
@ -222,7 +222,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT ||
!eth->netdev[mac]))
@@ -1431,7 +1497,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1432,7 +1498,7 @@ static int mtk_poll_rx(struct napi_struc
pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
skb->dev = netdev;
skb_put(skb, pktlen);
@ -231,7 +231,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
skb_checksum_none_assert(skb);
@@ -1449,10 +1515,25 @@ static int mtk_poll_rx(struct napi_struc
@@ -1450,10 +1516,25 @@ static int mtk_poll_rx(struct napi_struc
mtk_ppe_check_skb(eth->ppe, skb,
trxd.rxd4 & MTK_RXD4_FOE_ENTRY);
@ -261,7 +261,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
skb_record_rx_queue(skb, 0);
napi_gro_receive(napi, skb);
@@ -1464,7 +1545,7 @@ release_desc:
@@ -1465,7 +1546,7 @@ release_desc:
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
rxd->rxd2 = RX_DMA_LSO;
else
@ -270,7 +270,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->calc_idx = idx;
@@ -1666,7 +1747,8 @@ static int mtk_napi_rx(struct napi_struc
@@ -1667,7 +1748,8 @@ static int mtk_napi_rx(struct napi_struc
do {
int rx_done;
@ -280,7 +280,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rx_done = mtk_poll_rx(napi, budget - rx_done_total, eth);
rx_done_total += rx_done;
@@ -1680,10 +1762,11 @@ static int mtk_napi_rx(struct napi_struc
@@ -1681,10 +1763,11 @@ static int mtk_napi_rx(struct napi_struc
if (rx_done_total == budget)
return budget;
@ -294,7 +294,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return rx_done_total;
}
@@ -1693,7 +1776,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1694,7 +1777,7 @@ static int mtk_tx_alloc(struct mtk_eth *
const struct mtk_soc_data *soc = eth->soc;
struct mtk_tx_ring *ring = &eth->tx_ring;
int i, sz = soc->txrx.txd_size;
@ -303,7 +303,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->buf = kcalloc(MTK_DMA_SIZE, sizeof(*ring->buf),
GFP_KERNEL);
@@ -1713,13 +1796,19 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1714,13 +1797,19 @@ static int mtk_tx_alloc(struct mtk_eth *
txd->txd2 = next_ptr;
txd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
txd->txd4 = 0;
@ -324,7 +324,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->dma_pdma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz,
&ring->phys_pdma, GFP_KERNEL);
if (!ring->dma_pdma)
@@ -1799,13 +1888,11 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1800,13 +1889,11 @@ static int mtk_rx_alloc(struct mtk_eth *
struct mtk_rx_ring *ring;
int rx_data_len, rx_dma_size;
int i;
@ -338,7 +338,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} else {
ring = &eth->rx_ring[ring_no];
}
@@ -1841,7 +1928,7 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1842,7 +1929,7 @@ static int mtk_rx_alloc(struct mtk_eth *
return -ENOMEM;
for (i = 0; i < rx_dma_size; i++) {
@ -347,7 +347,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dma_addr_t dma_addr = dma_map_single(eth->dma_dev,
ring->data[i] + NET_SKB_PAD + eth->ip_align,
@@ -1856,26 +1943,47 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1857,26 +1944,47 @@ static int mtk_rx_alloc(struct mtk_eth *
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
rxd->rxd2 = RX_DMA_LSO;
else
@ -403,7 +403,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0;
}
@@ -2297,7 +2405,7 @@ static irqreturn_t mtk_handle_irq_rx(int
@@ -2298,7 +2406,7 @@ static irqreturn_t mtk_handle_irq_rx(int
eth->rx_events++;
if (likely(napi_schedule_prep(&eth->rx_napi))) {
__napi_schedule(&eth->rx_napi);
@ -412,7 +412,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
return IRQ_HANDLED;
@@ -2321,8 +2429,10 @@ static irqreturn_t mtk_handle_irq(int ir
@@ -2322,8 +2430,10 @@ static irqreturn_t mtk_handle_irq(int ir
struct mtk_eth *eth = _eth;
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
@ -425,7 +425,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_handle_irq_rx(irq, _eth);
}
if (mtk_r32(eth, reg_map->tx_irq_mask) & MTK_TX_DONE_INT) {
@@ -2340,16 +2450,16 @@ static void mtk_poll_controller(struct n
@@ -2341,16 +2451,16 @@ static void mtk_poll_controller(struct n
struct mtk_eth *eth = mac->hw;
mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
@ -445,7 +445,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
int err;
@@ -2360,12 +2470,19 @@ static int mtk_start_dma(struct mtk_eth
@@ -2361,12 +2471,19 @@ static int mtk_start_dma(struct mtk_eth
}
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
@ -471,7 +471,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_w32(eth,
MTK_RX_DMA_EN | rx_2b_offset |
MTK_RX_BT_32DWORDS | MTK_MULTI_EN,
@@ -2439,7 +2556,7 @@ static int mtk_open(struct net_device *d
@@ -2440,7 +2557,7 @@ static int mtk_open(struct net_device *d
napi_enable(&eth->tx_napi);
napi_enable(&eth->rx_napi);
mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
@ -480,7 +480,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
refcount_set(&eth->dma_refcnt, 1);
}
else
@@ -2491,7 +2608,7 @@ static int mtk_stop(struct net_device *d
@@ -2492,7 +2609,7 @@ static int mtk_stop(struct net_device *d
mtk_gdm_config(eth, MTK_GDMA_DROP_ALL);
mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
@ -489,7 +489,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
napi_disable(&eth->tx_napi);
napi_disable(&eth->rx_napi);
@@ -2651,9 +2768,25 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -2652,9 +2769,25 @@ static int mtk_hw_init(struct mtk_eth *e
return 0;
}
@ -518,7 +518,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (eth->pctl) {
/* Set GE2 driving and slew rate */
@@ -2692,11 +2825,47 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -2693,11 +2826,47 @@ static int mtk_hw_init(struct mtk_eth *e
/* FE int grouping */
mtk_w32(eth, MTK_TX_DONE_INT, reg_map->pdma.int_grp);
@ -568,7 +568,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return 0;
err_disable_pm:
@@ -3233,12 +3402,8 @@ static int mtk_probe(struct platform_dev
@@ -3234,12 +3403,8 @@ static int mtk_probe(struct platform_dev
if (IS_ERR(eth->base))
return PTR_ERR(eth->base);
@ -582,7 +582,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_lock_init(&eth->page_lock);
spin_lock_init(&eth->tx_irq_lock);
@@ -3474,6 +3639,10 @@ static const struct mtk_soc_data mt2701_
@@ -3475,6 +3640,10 @@ static const struct mtk_soc_data mt2701_
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@ -593,7 +593,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3487,6 +3656,10 @@ static const struct mtk_soc_data mt7621_
@@ -3488,6 +3657,10 @@ static const struct mtk_soc_data mt7621_
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@ -604,7 +604,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3501,6 +3674,10 @@ static const struct mtk_soc_data mt7622_
@@ -3502,6 +3675,10 @@ static const struct mtk_soc_data mt7622_
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@ -615,7 +615,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3514,6 +3691,10 @@ static const struct mtk_soc_data mt7623_
@@ -3515,6 +3692,10 @@ static const struct mtk_soc_data mt7623_
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@ -626,7 +626,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3527,6 +3708,10 @@ static const struct mtk_soc_data mt7629_
@@ -3528,6 +3709,10 @@ static const struct mtk_soc_data mt7629_
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@ -637,7 +637,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
},
};
@@ -3539,6 +3724,10 @@ static const struct mtk_soc_data rt5350_
@@ -3540,6 +3725,10 @@ static const struct mtk_soc_data rt5350_
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@ -804,7 +804,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* PHY Indirect Access Control registers */
#define MTK_PHY_IAC 0x10004
#define PHY_IAC_ACCESS BIT(31)
@@ -370,6 +434,16 @@
@@ -371,6 +435,16 @@
#define ETHSYS_TRGMII_MT7621_DDR_PLL BIT(5)
/* ethernet reset control register */
@ -821,7 +821,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define ETHSYS_RSTCTRL 0x34
#define RSTCTRL_FE BIT(6)
#define RSTCTRL_PPE BIT(31)
@@ -453,6 +527,17 @@ struct mtk_rx_dma {
@@ -454,6 +528,17 @@ struct mtk_rx_dma {
unsigned int rxd4;
} __packed __aligned(4);
@ -839,7 +839,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_tx_dma {
unsigned int txd1;
unsigned int txd2;
@@ -460,6 +545,17 @@ struct mtk_tx_dma {
@@ -461,6 +546,17 @@ struct mtk_tx_dma {
unsigned int txd4;
} __packed __aligned(4);
@ -857,7 +857,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_eth;
struct mtk_mac;
@@ -646,7 +742,9 @@ enum mkt_eth_capabilities {
@@ -647,7 +743,9 @@ enum mkt_eth_capabilities {
MTK_SHARED_INT_BIT,
MTK_TRGMII_MT7621_CLK_BIT,
MTK_QDMA_BIT,
@ -867,7 +867,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* MUX BITS*/
MTK_ETH_MUX_GDM1_TO_GMAC1_ESW_BIT,
@@ -678,7 +776,9 @@ enum mkt_eth_capabilities {
@@ -679,7 +777,9 @@ enum mkt_eth_capabilities {
#define MTK_SHARED_INT BIT(MTK_SHARED_INT_BIT)
#define MTK_TRGMII_MT7621_CLK BIT(MTK_TRGMII_MT7621_CLK_BIT)
#define MTK_QDMA BIT(MTK_QDMA_BIT)
@ -877,7 +877,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define MTK_ETH_MUX_GDM1_TO_GMAC1_ESW \
BIT(MTK_ETH_MUX_GDM1_TO_GMAC1_ESW_BIT)
@@ -755,6 +855,7 @@ struct mtk_tx_dma_desc_info {
@@ -756,6 +856,7 @@ struct mtk_tx_dma_desc_info {
dma_addr_t addr;
u32 size;
u16 vlan_tci;
@ -885,7 +885,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u8 gso:1;
u8 csum:1;
u8 vlan:1;
@@ -812,6 +913,10 @@ struct mtk_reg_map {
@@ -813,6 +914,10 @@ struct mtk_reg_map {
* the extra setup for those pins used by GMAC.
* @txd_size Tx DMA descriptor size.
* @rxd_size Rx DMA descriptor size.
@ -896,7 +896,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
*/
struct mtk_soc_data {
const struct mtk_reg_map *reg_map;
@@ -824,6 +929,10 @@ struct mtk_soc_data {
@@ -825,6 +930,10 @@ struct mtk_soc_data {
struct {
u32 txd_size;
u32 rxd_size;
@ -907,7 +907,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} txrx;
};
@@ -942,7 +1051,6 @@ struct mtk_eth {
@@ -943,7 +1052,6 @@ struct mtk_eth {
u32 tx_bytes;
struct dim tx_dim;

View File

@ -10,7 +10,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -946,18 +946,15 @@ static int mtk_init_fq_dma(struct mtk_et
@@ -947,18 +947,15 @@ static int mtk_init_fq_dma(struct mtk_et
return 0;
}
@ -33,7 +33,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return &ring->buf[idx];
}
@@ -965,13 +962,12 @@ static struct mtk_tx_buf *mtk_desc_to_tx
@@ -966,13 +963,12 @@ static struct mtk_tx_buf *mtk_desc_to_tx
static struct mtk_tx_dma *qdma_to_pdma(struct mtk_tx_ring *ring,
struct mtk_tx_dma *dma)
{
@ -50,7 +50,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static void mtk_tx_unmap(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
@@ -1388,7 +1384,7 @@ static struct mtk_rx_ring *mtk_get_rx_ri
@@ -1389,7 +1385,7 @@ static struct mtk_rx_ring *mtk_get_rx_ri
ring = &eth->rx_ring[i];
idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size);
@ -59,7 +59,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (rxd->rxd2 & RX_DMA_DONE) {
ring->calc_idx_update = true;
return ring;
@@ -1440,7 +1436,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1441,7 +1437,7 @@ static int mtk_poll_rx(struct napi_struc
goto rx_done;
idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size);
@ -68,7 +68,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
data = ring->data[idx];
if (!mtk_rx_get_desc(eth, &trxd, rxd))
@@ -1647,7 +1643,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
@@ -1648,7 +1644,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
mtk_tx_unmap(eth, tx_buf, true);
@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->last_free = desc;
atomic_inc(&ring->free_count);
@@ -1792,7 +1788,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1793,7 +1789,7 @@ static int mtk_tx_alloc(struct mtk_eth *
int next = (i + 1) % MTK_DMA_SIZE;
u32 next_ptr = ring->phys + next * sz;
@ -86,7 +86,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
txd->txd2 = next_ptr;
txd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
txd->txd4 = 0;
@@ -1822,7 +1818,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1823,7 +1819,7 @@ static int mtk_tx_alloc(struct mtk_eth *
ring->dma_size = MTK_DMA_SIZE;
atomic_set(&ring->free_count, MTK_DMA_SIZE - 2);
@ -95,7 +95,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->last_free = (void *)txd;
ring->last_free_ptr = (u32)(ring->phys + ((MTK_DMA_SIZE - 1) * sz));
ring->thresh = MAX_SKB_FRAGS;
@@ -1937,7 +1933,7 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1938,7 +1934,7 @@ static int mtk_rx_alloc(struct mtk_eth *
if (unlikely(dma_mapping_error(eth->dma_dev, dma_addr)))
return -ENOMEM;
@ -104,7 +104,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rxd->rxd1 = (unsigned int)dma_addr;
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
@@ -1999,7 +1995,7 @@ static void mtk_rx_clean(struct mtk_eth
@@ -2000,7 +1996,7 @@ static void mtk_rx_clean(struct mtk_eth
if (!ring->data[i])
continue;
@ -115,7 +115,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -688,7 +688,7 @@ struct mtk_tx_buf {
@@ -689,7 +689,7 @@ struct mtk_tx_buf {
* are present
*/
struct mtk_tx_ring {
@ -124,7 +124,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_tx_buf *buf;
dma_addr_t phys;
struct mtk_tx_dma *next_free;
@@ -718,7 +718,7 @@ enum mtk_rx_flags {
@@ -719,7 +719,7 @@ enum mtk_rx_flags {
* @calc_idx: The current head of ring
*/
struct mtk_rx_ring {

View File

@ -11,7 +11,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -922,7 +922,7 @@ static int mtk_init_fq_dma(struct mtk_et
@@ -923,7 +923,7 @@ static int mtk_init_fq_dma(struct mtk_et
for (i = 0; i < cnt; i++) {
struct mtk_tx_dma_v2 *txd;
@ -22,7 +22,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
txd->txd2 = eth->phy_scratch_ring +
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -1028,7 +1028,7 @@ struct mtk_eth {
@@ -1029,7 +1029,7 @@ struct mtk_eth {
struct mtk_rx_ring rx_ring_qdma;
struct napi_struct tx_napi;
struct napi_struct rx_napi;

View File

@ -65,7 +65,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
void mtk_w32(struct mtk_eth *eth, u32 val, unsigned reg)
@@ -3711,6 +3748,21 @@ static const struct mtk_soc_data mt7629_
@@ -3712,6 +3749,21 @@ static const struct mtk_soc_data mt7629_
},
};
@ -87,7 +87,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static const struct mtk_soc_data rt5350_data = {
.reg_map = &mt7628_reg_map,
.caps = MT7628_CAPS,
@@ -3733,6 +3785,7 @@ const struct of_device_id of_mtk_match[]
@@ -3734,6 +3786,7 @@ const struct of_device_id of_mtk_match[]
{ .compatible = "mediatek,mt7622-eth", .data = &mt7622_data},
{ .compatible = "mediatek,mt7623-eth", .data = &mt7623_data},
{ .compatible = "mediatek,mt7629-eth", .data = &mt7629_data},
@ -97,7 +97,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -623,6 +623,10 @@ enum mtk_clks_map {
@@ -624,6 +624,10 @@ enum mtk_clks_map {
MTK_CLK_SGMII2_CDR_FB,
MTK_CLK_SGMII_CK,
MTK_CLK_ETH2PLL,
@ -108,7 +108,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
MTK_CLK_MAX
};
@@ -653,6 +657,16 @@ enum mtk_clks_map {
@@ -654,6 +658,16 @@ enum mtk_clks_map {
BIT(MTK_CLK_SGMII2_CDR_FB) | \
BIT(MTK_CLK_SGMII_CK) | \
BIT(MTK_CLK_ETH2PLL) | BIT(MTK_CLK_SGMIITOP))
@ -125,7 +125,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
enum mtk_dev_state {
MTK_HW_INIT,
@@ -851,6 +865,10 @@ enum mkt_eth_capabilities {
@@ -852,6 +866,10 @@ enum mkt_eth_capabilities {
MTK_MUX_U3_GMAC2_TO_QPHY | \
MTK_MUX_GMAC12_TO_GEPHY_SGMII | MTK_QDMA)

View File

@ -12,7 +12,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1462,8 +1462,8 @@ static int mtk_poll_rx(struct napi_struc
@@ -1463,8 +1463,8 @@ static int mtk_poll_rx(struct napi_struc
int done = 0, bytes = 0;
while (done < budget) {
@ -22,7 +22,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
dma_addr_t dma_addr;
u32 hash, reason;
int mac = 0;
@@ -1530,7 +1530,13 @@ static int mtk_poll_rx(struct napi_struc
@@ -1531,7 +1531,13 @@ static int mtk_poll_rx(struct napi_struc
pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
skb->dev = netdev;
skb_put(skb, pktlen);
@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
skb_checksum_none_assert(skb);
@@ -3758,6 +3764,7 @@ static const struct mtk_soc_data mt7986_
@@ -3759,6 +3765,7 @@ static const struct mtk_soc_data mt7986_
.txd_size = sizeof(struct mtk_tx_dma_v2),
.rxd_size = sizeof(struct mtk_rx_dma_v2),
.rx_irq_done_mask = MTK_RX_DONE_INT_V2,

View File

@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3354,6 +3354,26 @@ static int mtk_add_mac(struct mtk_eth *e
@@ -3355,6 +3355,26 @@ static int mtk_add_mac(struct mtk_eth *e
mac->phylink_config.dev = &eth->netdev[id]->dev;
mac->phylink_config.type = PHYLINK_NETDEV;

View File

@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -567,24 +567,8 @@ static void mtk_validate(struct phylink_
@@ -568,24 +568,8 @@ static void mtk_validate(struct phylink_
unsigned long *supported,
struct phylink_link_state *state)
{
@ -41,7 +41,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
phylink_set_port_modes(mask);
phylink_set(mask, Autoneg);
@@ -611,7 +595,6 @@ static void mtk_validate(struct phylink_
@@ -612,7 +596,6 @@ static void mtk_validate(struct phylink_
case PHY_INTERFACE_MODE_MII:
case PHY_INTERFACE_MODE_RMII:
case PHY_INTERFACE_MODE_REVMII:
@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default:
phylink_set(mask, 10baseT_Half);
phylink_set(mask, 10baseT_Full);
@@ -620,23 +603,6 @@ static void mtk_validate(struct phylink_
@@ -621,23 +604,6 @@ static void mtk_validate(struct phylink_
break;
}

View File

@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -577,8 +577,9 @@ static void mtk_validate(struct phylink_
@@ -578,8 +578,9 @@ static void mtk_validate(struct phylink_
phylink_set(mask, 1000baseT_Full);
break;
case PHY_INTERFACE_MODE_1000BASEX:
@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
phylink_set(mask, 2500baseX_Full);
break;
case PHY_INTERFACE_MODE_GMII:
@@ -608,11 +609,6 @@ static void mtk_validate(struct phylink_
@@ -609,11 +610,6 @@ static void mtk_validate(struct phylink_
linkmode_and(supported, supported, mask);
linkmode_and(state->advertising, state->advertising, mask);

View File

@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -563,56 +563,8 @@ static void mtk_mac_link_up(struct phyli
@@ -564,56 +564,8 @@ static void mtk_mac_link_up(struct phyli
mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
}
@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
.mac_pcs_get_state = mtk_mac_pcs_get_state,
.mac_an_restart = mtk_mac_an_restart,
.mac_config = mtk_mac_config,
@@ -3316,6 +3268,9 @@ static int mtk_add_mac(struct mtk_eth *e
@@ -3317,6 +3269,9 @@ static int mtk_add_mac(struct mtk_eth *e
mac->phylink_config.dev = &eth->netdev[id]->dev;
mac->phylink_config.type = PHYLINK_NETDEV;

View File

@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3268,6 +3268,10 @@ static int mtk_add_mac(struct mtk_eth *e
@@ -3269,6 +3269,10 @@ static int mtk_add_mac(struct mtk_eth *e
mac->phylink_config.dev = &eth->netdev[id]->dev;
mac->phylink_config.type = PHYLINK_NETDEV;

View File

@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3567,9 +3567,9 @@ static int mtk_probe(struct platform_dev
@@ -3568,9 +3568,9 @@ static int mtk_probe(struct platform_dev
*/
init_dummy_netdev(&eth->dummy_dev);
netif_napi_add(&eth->dummy_dev, &eth->tx_napi, mtk_napi_tx,

View File

@ -15,7 +15,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3263,7 +3263,6 @@ static int mtk_add_mac(struct mtk_eth *e
@@ -3264,7 +3264,6 @@ static int mtk_add_mac(struct mtk_eth *e
/* mac config is not set */
mac->interface = PHY_INTERFACE_MODE_NA;
@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
mac->phylink_config.dev = &eth->netdev[id]->dev;
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -1085,7 +1085,6 @@ struct mtk_eth {
@@ -1086,7 +1086,6 @@ struct mtk_eth {
struct mtk_mac {
int id;
phy_interface_t interface;

View File

@ -14,7 +14,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -956,23 +956,15 @@ struct mtk_soc_data {
@@ -957,23 +957,15 @@ struct mtk_soc_data {
/* currently no SoC has more than 2 macs */
#define MTK_MAX_DEVS 2

View File

@ -24,7 +24,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
#include "mtk_ppe.h"
#define MTK_QDMA_PAGE_SIZE 2048
@@ -473,9 +474,10 @@
@@ -474,9 +475,10 @@
#define SGMSYS_SGMII_MODE 0x20
#define SGMII_IF_MODE_BIT0 BIT(0)
#define SGMII_SPEED_DUPLEX_AN BIT(1)

View File

@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -532,8 +532,18 @@ static void mtk_mac_link_up(struct phyli
@@ -533,8 +533,18 @@ static void mtk_mac_link_up(struct phyli
{
struct mtk_mac *mac = container_of(config, struct mtk_mac,
phylink_config);
@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
mcr &= ~(MAC_MCR_SPEED_100 | MAC_MCR_SPEED_1000 |
MAC_MCR_FORCE_DPX | MAC_MCR_FORCE_TX_FC |
MAC_MCR_FORCE_RX_FC);
@@ -3267,9 +3277,7 @@ static int mtk_add_mac(struct mtk_eth *e
@@ -3268,9 +3278,7 @@ static int mtk_add_mac(struct mtk_eth *e
mac->phylink_config.dev = &eth->netdev[id]->dev;
mac->phylink_config.type = PHYLINK_NETDEV;
@ -51,7 +51,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
MAC_10 | MAC_100 | MAC_1000 | MAC_2500FD;
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -1103,6 +1103,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss,
@@ -1104,6 +1104,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss,
int mtk_sgmii_setup_mode_an(struct mtk_sgmii *ss, int id);
int mtk_sgmii_setup_mode_force(struct mtk_sgmii *ss, int id,
const struct phylink_link_state *state);

View File

@ -29,7 +29,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -1102,7 +1102,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss,
@@ -1103,7 +1103,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss,
u32 ana_rgc3);
int mtk_sgmii_setup_mode_an(struct mtk_sgmii *ss, int id);
int mtk_sgmii_setup_mode_force(struct mtk_sgmii *ss, int id,

View File

@ -32,7 +32,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -1100,9 +1100,8 @@ u32 mtk_r32(struct mtk_eth *eth, unsigne
@@ -1101,9 +1101,8 @@ u32 mtk_r32(struct mtk_eth *eth, unsigne
int mtk_sgmii_init(struct mtk_sgmii *ss, struct device_node *np,
u32 ana_rgc3);

View File

@ -25,27 +25,22 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* MT76x8 has no hardware settings between for the MAC */
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) &&
@@ -455,16 +455,6 @@ static void mtk_mac_config(struct phylin
@@ -455,6 +455,25 @@ static void mtk_mac_config(struct phylin
return;
}
- /* Setup gmac */
- mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
- mcr_new = mcr_cur;
- mcr_new |= MAC_MCR_IPG_CFG | MAC_MCR_FORCE_MODE |
- MAC_MCR_BACKOFF_EN | MAC_MCR_BACKPR_EN | MAC_MCR_FORCE_LINK;
-
- /* Only update control register when needed! */
- if (mcr_new != mcr_cur)
- mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
-
return;
err_phy:
@@ -477,6 +467,26 @@ init_err:
mac->id, phy_modes(state->interface), err);
}
+ return;
+
+err_phy:
+ dev_err(eth->dev, "%s: GMAC%d mode %s not supported!\n", __func__,
+ mac->id, phy_modes(state->interface));
+ return;
+
+init_err:
+ dev_err(eth->dev, "%s: GMAC%d mode %s err: %d!\n", __func__,
+ mac->id, phy_modes(state->interface), err);
+}
+
+static int mtk_mac_finish(struct phylink_config *config, unsigned int mode,
+ phy_interface_t interface)
+{
@ -53,23 +48,28 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+ phylink_config);
+ u32 mcr_cur, mcr_new;
+
+ /* Setup gmac */
+ mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
+ mcr_new = mcr_cur;
+ mcr_new |= MAC_MCR_IPG_CFG | MAC_MCR_FORCE_MODE |
+ MAC_MCR_BACKOFF_EN | MAC_MCR_BACKPR_EN | MAC_MCR_FORCE_LINK;
+
+ /* Only update control register when needed! */
+ if (mcr_new != mcr_cur)
+ mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
+
/* Setup gmac */
mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
mcr_new = mcr_cur;
@@ -466,16 +485,7 @@ static void mtk_mac_config(struct phylin
if (mcr_new != mcr_cur)
mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
- return;
-
-err_phy:
- dev_err(eth->dev, "%s: GMAC%d mode %s not supported!\n", __func__,
- mac->id, phy_modes(state->interface));
- return;
-
-init_err:
- dev_err(eth->dev, "%s: GMAC%d mode %s err: %d!\n", __func__,
- mac->id, phy_modes(state->interface), err);
+ return 0;
+}
+
}
static void mtk_mac_pcs_get_state(struct phylink_config *config,
struct phylink_link_state *state)
{
@@ -581,6 +591,7 @@ static const struct phylink_mac_ops mtk_
@@ -582,6 +592,7 @@ static const struct phylink_mac_ops mtk_
.mac_pcs_get_state = mtk_mac_pcs_get_state,
.mac_an_restart = mtk_mac_an_restart,
.mac_config = mtk_mac_config,

View File

@ -47,7 +47,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
mcr_new = mcr_cur;
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -1087,6 +1087,7 @@ struct mtk_mac {
@@ -1088,6 +1088,7 @@ struct mtk_mac {
struct mtk_hw_stats *hw_stats;
__be32 hwlro_ip[MTK_MAX_LRO_IP_CNT];
int hwlro_ip_cnt;

View File

@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -958,16 +958,23 @@ struct mtk_soc_data {
@@ -959,16 +959,23 @@ struct mtk_soc_data {
/* currently no SoC has more than 2 macs */
#define MTK_MAX_DEVS 2

View File

@ -69,7 +69,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Save the syscfg0 value for mac_finish */
mac->syscfg0 = val;
} else if (phylink_autoneg_inband(mode)) {
@@ -526,14 +536,6 @@ static void mtk_mac_pcs_get_state(struct
@@ -527,14 +537,6 @@ static void mtk_mac_pcs_get_state(struct
state->pause |= MLO_PAUSE_TX;
}
@ -84,7 +84,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static void mtk_mac_link_down(struct phylink_config *config, unsigned int mode,
phy_interface_t interface)
{
@@ -554,15 +556,6 @@ static void mtk_mac_link_up(struct phyli
@@ -555,15 +557,6 @@ static void mtk_mac_link_up(struct phyli
phylink_config);
u32 mcr;
@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
mcr &= ~(MAC_MCR_SPEED_100 | MAC_MCR_SPEED_1000 |
MAC_MCR_FORCE_DPX | MAC_MCR_FORCE_TX_FC |
@@ -595,8 +588,8 @@ static void mtk_mac_link_up(struct phyli
@@ -596,8 +589,8 @@ static void mtk_mac_link_up(struct phyli
static const struct phylink_mac_ops mtk_phylink_ops = {
.validate = phylink_generic_validate,
@ -112,7 +112,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
.mac_link_down = mtk_mac_link_down,
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -963,10 +963,12 @@ struct mtk_soc_data {
@@ -964,10 +964,12 @@ struct mtk_soc_data {
* @regmap: The register map pointing at the range used to setup
* SGMII modes
* @ana_rgc3: The offset refers to register ANA_RGC3 related to regmap
@ -125,7 +125,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
};
/* struct mtk_sgmii - This is the structure holding sgmii regmap and its
@@ -1106,12 +1108,9 @@ void mtk_stats_update_mac(struct mtk_mac
@@ -1107,12 +1109,9 @@ void mtk_stats_update_mac(struct mtk_mac
void mtk_w32(struct mtk_eth *eth, u32 val, unsigned reg);
u32 mtk_r32(struct mtk_eth *eth, unsigned reg);

View File

@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1191,27 +1191,31 @@ static int
@@ -1194,27 +1194,31 @@ static int
mt7530_port_bridge_join(struct dsa_switch *ds, int port,
struct net_device *bridge)
{
@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
/* Add the all other ports to this port matrix. */
@@ -1316,24 +1320,28 @@ static void
@@ -1319,24 +1323,28 @@ static void
mt7530_port_bridge_leave(struct dsa_switch *ds, int port,
struct net_device *bridge)
{

View File

@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2402,6 +2402,32 @@ mt7531_setup(struct dsa_switch *ds)
@@ -2407,6 +2407,32 @@ mt7531_setup(struct dsa_switch *ds)
return 0;
}
@ -56,7 +56,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static bool
mt7530_phy_mode_supported(struct dsa_switch *ds, int port,
const struct phylink_link_state *state)
@@ -2438,6 +2464,37 @@ static bool mt7531_is_rgmii_port(struct
@@ -2443,6 +2469,37 @@ static bool mt7531_is_rgmii_port(struct
return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII);
}
@ -94,7 +94,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static bool
mt7531_phy_mode_supported(struct dsa_switch *ds, int port,
const struct phylink_link_state *state)
@@ -2914,6 +2971,18 @@ mt7531_cpu_port_config(struct dsa_switch
@@ -2919,6 +2976,18 @@ mt7531_cpu_port_config(struct dsa_switch
return 0;
}
@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void
mt7530_mac_port_validate(struct dsa_switch *ds, int port,
unsigned long *supported)
@@ -3149,6 +3218,7 @@ static const struct dsa_switch_ops mt753
@@ -3154,6 +3223,7 @@ static const struct dsa_switch_ops mt753
.port_vlan_del = mt7530_port_vlan_del,
.port_mirror_add = mt753x_port_mirror_add,
.port_mirror_del = mt753x_port_mirror_del,
@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phylink_validate = mt753x_phylink_validate,
.phylink_mac_link_state = mt753x_phylink_mac_link_state,
.phylink_mac_config = mt753x_phylink_mac_config,
@@ -3166,6 +3236,7 @@ static const struct mt753x_info mt753x_t
@@ -3171,6 +3241,7 @@ static const struct mt753x_info mt753x_t
.phy_read = mt7530_phy_read,
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
@ -129,7 +129,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phy_mode_supported = mt7530_phy_mode_supported,
.mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state,
@@ -3177,6 +3248,7 @@ static const struct mt753x_info mt753x_t
@@ -3182,6 +3253,7 @@ static const struct mt753x_info mt753x_t
.phy_read = mt7530_phy_read,
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
@ -137,7 +137,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phy_mode_supported = mt7530_phy_mode_supported,
.mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state,
@@ -3189,6 +3261,7 @@ static const struct mt753x_info mt753x_t
@@ -3194,6 +3266,7 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7531_ind_phy_write,
.pad_setup = mt7531_pad_setup,
.cpu_port_config = mt7531_cpu_port_config,
@ -145,7 +145,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phy_mode_supported = mt7531_phy_mode_supported,
.mac_port_validate = mt7531_mac_port_validate,
.mac_port_get_state = mt7531_phylink_mac_link_state,
@@ -3251,6 +3324,7 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3256,6 +3329,7 @@ mt7530_probe(struct mdio_device *mdiodev
*/
if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write ||

View File

@ -21,7 +21,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2428,37 +2428,6 @@ static void mt7530_mac_port_get_caps(str
@@ -2433,37 +2433,6 @@ static void mt7530_mac_port_get_caps(str
}
}
@ -59,7 +59,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static bool mt7531_is_rgmii_port(struct mt7530_priv *priv, u32 port)
{
return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII);
@@ -2495,44 +2464,6 @@ static void mt7531_mac_port_get_caps(str
@@ -2500,44 +2469,6 @@ static void mt7531_mac_port_get_caps(str
}
}
@ -104,7 +104,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static int
mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
{
@@ -2787,9 +2718,6 @@ mt753x_phylink_mac_config(struct dsa_swi
@@ -2792,9 +2723,6 @@ mt753x_phylink_mac_config(struct dsa_swi
struct mt7530_priv *priv = ds->priv;
u32 mcr_cur, mcr_new;
@ -114,7 +114,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
switch (port) {
case 0 ... 4: /* Internal phy */
if (state->interface != PHY_INTERFACE_MODE_GMII)
@@ -3005,12 +2933,6 @@ mt753x_phylink_validate(struct dsa_switc
@@ -3010,12 +2938,6 @@ mt753x_phylink_validate(struct dsa_switc
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
struct mt7530_priv *priv = ds->priv;
@ -127,7 +127,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
phylink_set_port_modes(mask);
if (state->interface != PHY_INTERFACE_MODE_TRGMII &&
@@ -3237,7 +3159,6 @@ static const struct mt753x_info mt753x_t
@@ -3242,7 +3164,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps,
@ -135,7 +135,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config,
@@ -3249,7 +3170,6 @@ static const struct mt753x_info mt753x_t
@@ -3254,7 +3175,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps,
@ -143,7 +143,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config,
@@ -3262,7 +3182,6 @@ static const struct mt753x_info mt753x_t
@@ -3267,7 +3187,6 @@ static const struct mt753x_info mt753x_t
.pad_setup = mt7531_pad_setup,
.cpu_port_config = mt7531_cpu_port_config,
.mac_port_get_caps = mt7531_mac_port_get_caps,
@ -151,7 +151,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_validate = mt7531_mac_port_validate,
.mac_port_get_state = mt7531_phylink_mac_link_state,
.mac_port_config = mt7531_mac_config,
@@ -3325,7 +3244,6 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3330,7 +3249,6 @@ mt7530_probe(struct mdio_device *mdiodev
if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write ||
!priv->info->mac_port_get_caps ||

View File

@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2957,11 +2957,6 @@ mt753x_phylink_validate(struct dsa_switc
@@ -2962,11 +2962,6 @@ mt753x_phylink_validate(struct dsa_switc
linkmode_and(supported, supported, mask);
linkmode_and(state->advertising, state->advertising, mask);

View File

@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2535,12 +2535,13 @@ static int mt7531_rgmii_setup(struct mt7
@@ -2540,12 +2540,13 @@ static int mt7531_rgmii_setup(struct mt7
}
static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port,
@ -38,7 +38,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
phylink_set(supported, 2500baseX_Full);
phylink_set(supported, 2500baseT_Full);
}
@@ -2913,16 +2914,18 @@ static void mt753x_phylink_get_caps(stru
@@ -2918,16 +2919,18 @@ static void mt753x_phylink_get_caps(stru
static void
mt7530_mac_port_validate(struct dsa_switch *ds, int port,
@ -58,7 +58,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
static void
@@ -2945,12 +2948,13 @@ mt753x_phylink_validate(struct dsa_switc
@@ -2950,12 +2953,13 @@ mt753x_phylink_validate(struct dsa_switc
}
/* This switch only supports 1G full-duplex. */

View File

@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2534,19 +2534,6 @@ static int mt7531_rgmii_setup(struct mt7
@@ -2539,19 +2539,6 @@ static int mt7531_rgmii_setup(struct mt7
return 0;
}
@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void
mt7531_sgmii_link_up_force(struct dsa_switch *ds, int port,
unsigned int mode, phy_interface_t interface,
@@ -2913,51 +2900,21 @@ static void mt753x_phylink_get_caps(stru
@@ -2918,51 +2905,21 @@ static void mt753x_phylink_get_caps(stru
}
static void
@ -97,7 +97,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
linkmode_and(supported, supported, mask);
linkmode_and(state->advertising, state->advertising, mask);
@@ -3158,7 +3115,6 @@ static const struct mt753x_info mt753x_t
@@ -3163,7 +3120,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps,
@ -105,7 +105,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config,
},
@@ -3169,7 +3125,6 @@ static const struct mt753x_info mt753x_t
@@ -3174,7 +3130,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps,
@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config,
},
@@ -3181,7 +3136,6 @@ static const struct mt753x_info mt753x_t
@@ -3186,7 +3141,6 @@ static const struct mt753x_info mt753x_t
.pad_setup = mt7531_pad_setup,
.cpu_port_config = mt7531_cpu_port_config,
.mac_port_get_caps = mt7531_mac_port_get_caps,
@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_get_state = mt7531_phylink_mac_link_state,
.mac_port_config = mt7531_mac_config,
.mac_pcs_an_restart = mt7531_sgmii_restart_an,
@@ -3243,7 +3197,6 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3248,7 +3202,6 @@ mt7530_probe(struct mdio_device *mdiodev
if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write ||
!priv->info->mac_port_get_caps ||

View File

@ -33,7 +33,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* String, offset, and register size in bytes if different from 4 bytes */
static const struct mt7530_mib_desc mt7530_mib[] = {
MIB_DESC(1, 0x00, "TxDrop"),
@@ -2534,12 +2539,11 @@ static int mt7531_rgmii_setup(struct mt7
@@ -2539,12 +2544,11 @@ static int mt7531_rgmii_setup(struct mt7
return 0;
}
@ -50,7 +50,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
unsigned int val;
/* For adjusting speed and duplex of SGMII force mode. */
@@ -2565,6 +2569,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
@@ -2570,6 +2574,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
/* MT7531 SGMII 1G force mode can only work in full duplex mode,
* no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not.
@ -60,7 +60,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
*/
if ((speed == SPEED_10 || speed == SPEED_100) &&
duplex != DUPLEX_FULL)
@@ -2640,9 +2647,10 @@ static int mt7531_sgmii_setup_mode_an(st
@@ -2645,9 +2652,10 @@ static int mt7531_sgmii_setup_mode_an(st
return 0;
}
@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
u32 val;
/* Only restart AN when AN is enabled */
@@ -2699,6 +2707,24 @@ mt753x_mac_config(struct dsa_switch *ds,
@@ -2704,6 +2712,24 @@ mt753x_mac_config(struct dsa_switch *ds,
return priv->info->mac_port_config(ds, port, mode, state->interface);
}
@ -98,7 +98,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void
mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
const struct phylink_link_state *state)
@@ -2760,17 +2786,6 @@ unsupported:
@@ -2765,17 +2791,6 @@ unsupported:
mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
}
@ -116,7 +116,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port,
unsigned int mode,
phy_interface_t interface)
@@ -2780,16 +2795,13 @@ static void mt753x_phylink_mac_link_down
@@ -2785,16 +2800,13 @@ static void mt753x_phylink_mac_link_down
mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
}
@ -139,7 +139,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port,
@@ -2802,8 +2814,6 @@ static void mt753x_phylink_mac_link_up(s
@@ -2807,8 +2819,6 @@ static void mt753x_phylink_mac_link_up(s
struct mt7530_priv *priv = ds->priv;
u32 mcr;
@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK;
/* MT753x MAC works in 1G full duplex mode for all up-clocked
@@ -2881,6 +2891,8 @@ mt7531_cpu_port_config(struct dsa_switch
@@ -2886,6 +2896,8 @@ mt7531_cpu_port_config(struct dsa_switch
return ret;
mt7530_write(priv, MT7530_PMCR_P(port),
PMCR_CPU_PORT_SETTING(priv->id));
@ -157,7 +157,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL,
speed, DUPLEX_FULL, true, true);
@@ -2920,16 +2932,13 @@ mt753x_phylink_validate(struct dsa_switc
@@ -2925,16 +2937,13 @@ mt753x_phylink_validate(struct dsa_switc
linkmode_and(state->advertising, state->advertising, mask);
}
@ -178,7 +178,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
pmsr = mt7530_read(priv, MT7530_PMSR_P(port));
state->link = (pmsr & PMSR_LINK);
@@ -2956,8 +2965,6 @@ mt7530_phylink_mac_link_state(struct dsa
@@ -2961,8 +2970,6 @@ mt7530_phylink_mac_link_state(struct dsa
state->pause |= MLO_PAUSE_RX;
if (pmsr & PMSR_TX_FC)
state->pause |= MLO_PAUSE_TX;
@ -187,7 +187,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
static int
@@ -2999,32 +3006,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
@@ -3004,32 +3011,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
return 0;
}
@ -249,7 +249,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (ret)
return ret;
@@ -3037,6 +3061,13 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3042,6 +3066,13 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq)
mt7530_free_irq_common(priv);
@ -263,7 +263,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return ret;
}
@@ -3098,9 +3129,8 @@ static const struct dsa_switch_ops mt753
@@ -3103,9 +3134,8 @@ static const struct dsa_switch_ops mt753
.port_mirror_del = mt753x_port_mirror_del,
.phylink_get_caps = mt753x_phylink_get_caps,
.phylink_validate = mt753x_phylink_validate,
@ -274,7 +274,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phylink_mac_link_down = mt753x_phylink_mac_link_down,
.phylink_mac_link_up = mt753x_phylink_mac_link_up,
.get_mac_eee = mt753x_get_mac_eee,
@@ -3110,36 +3140,34 @@ static const struct dsa_switch_ops mt753
@@ -3115,36 +3145,34 @@ static const struct dsa_switch_ops mt753
static const struct mt753x_info mt753x_table[] = {
[ID_MT7621] = {
.id = ID_MT7621,
@ -314,7 +314,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
},
};
@@ -3197,7 +3225,7 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3202,7 +3230,7 @@ mt7530_probe(struct mdio_device *mdiodev
if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write ||
!priv->info->mac_port_get_caps ||

View File

@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2911,25 +2911,16 @@ static void mt753x_phylink_get_caps(stru
@@ -2916,25 +2916,16 @@ static void mt753x_phylink_get_caps(stru
priv->info->mac_port_get_caps(ds, port, config);
}
@ -55,7 +55,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
static void mt7530_pcs_get_state(struct phylink_pcs *pcs,
@@ -3031,12 +3022,14 @@ static void mt7530_pcs_an_restart(struct
@@ -3036,12 +3027,14 @@ static void mt7530_pcs_an_restart(struct
}
static const struct phylink_pcs_ops mt7530_pcs_ops = {
@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.pcs_get_state = mt7531_pcs_get_state,
.pcs_config = mt753x_pcs_config,
.pcs_an_restart = mt7531_pcs_an_restart,
@@ -3128,7 +3121,6 @@ static const struct dsa_switch_ops mt753
@@ -3133,7 +3126,6 @@ static const struct dsa_switch_ops mt753
.port_mirror_add = mt753x_port_mirror_add,
.port_mirror_del = mt753x_port_mirror_del,
.phylink_get_caps = mt753x_phylink_get_caps,

View File

@ -19,7 +19,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2908,6 +2908,12 @@ static void mt753x_phylink_get_caps(stru
@@ -2913,6 +2913,12 @@ static void mt753x_phylink_get_caps(stru
config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
MAC_10 | MAC_100 | MAC_1000FD;

View File

@ -81,7 +81,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3046,9 +3046,16 @@ static int
@@ -3051,9 +3051,16 @@ static int
mt753x_setup(struct dsa_switch *ds)
{
struct mt7530_priv *priv = ds->priv;
@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (ret)
return ret;
@@ -3060,13 +3067,6 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3065,13 +3072,6 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq)
mt7530_free_irq_common(priv);

View File

@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1537,11 +1537,11 @@ static void
@@ -1540,11 +1540,11 @@ static void
mt7530_hw_vlan_add(struct mt7530_priv *priv,
struct mt7530_hw_vlan_entry *entry)
{
@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Validate the entry with independent learning, create egress tag per
* VLAN and joining the port as one of the port members.
@@ -1552,22 +1552,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p
@@ -1555,22 +1555,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p
/* Decide whether adding tag or not for those outgoing packets from the
* port inside the VLAN.
@ -72,7 +72,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
static void
@@ -1586,11 +1584,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p
@@ -1589,11 +1587,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p
return;
}

View File

@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2102,11 +2102,12 @@ static int
@@ -2105,11 +2105,12 @@ static int
mt7530_setup(struct dsa_switch *ds)
{
struct mt7530_priv *priv = ds->priv;
@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
u32 id, val;
int ret, i;
@@ -2114,7 +2115,19 @@ mt7530_setup(struct dsa_switch *ds)
@@ -2117,7 +2118,19 @@ mt7530_setup(struct dsa_switch *ds)
* controller also is the container for two GMACs nodes representing
* as two netdev instances.
*/
@ -51,7 +51,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
ds->assisted_learning_on_cpu_port = true;
ds->mtu_enforcement_ingress = true;
@@ -2276,6 +2289,7 @@ mt7531_setup(struct dsa_switch *ds)
@@ -2281,6 +2294,7 @@ mt7531_setup(struct dsa_switch *ds)
{
struct mt7530_priv *priv = ds->priv;
struct mt7530_dummy_poll p;
@ -59,7 +59,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
u32 val, id;
int ret, i;
@@ -2350,8 +2364,11 @@ mt7531_setup(struct dsa_switch *ds)
@@ -2355,8 +2369,11 @@ mt7531_setup(struct dsa_switch *ds)
CORE_PLL_GROUP4, val);
/* BPDU to CPU port */

View File

@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1041,6 +1041,7 @@ static int
@@ -1044,6 +1044,7 @@ static int
mt7530_port_enable(struct dsa_switch *ds, int port,
struct phy_device *phy)
{
@ -29,7 +29,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mt7530_priv *priv = ds->priv;
mutex_lock(&priv->reg_mutex);
@@ -1049,7 +1050,11 @@ mt7530_port_enable(struct dsa_switch *ds
@@ -1052,7 +1053,11 @@ mt7530_port_enable(struct dsa_switch *ds
* restore the port matrix if the port is the member of a certain
* bridge.
*/
@ -42,7 +42,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
priv->ports[port].enable = true;
mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK,
priv->ports[port].pm);
@@ -1197,7 +1202,8 @@ mt7530_port_bridge_join(struct dsa_switc
@@ -1200,7 +1205,8 @@ mt7530_port_bridge_join(struct dsa_switc
struct net_device *bridge)
{
struct dsa_port *dp = dsa_to_port(ds, port), *other_dp;
@ -52,7 +52,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mt7530_priv *priv = ds->priv;
mutex_lock(&priv->reg_mutex);
@@ -1274,9 +1280,12 @@ mt7530_port_set_vlan_unaware(struct dsa_
@@ -1277,9 +1283,12 @@ mt7530_port_set_vlan_unaware(struct dsa_
* the CPU port get out of VLAN filtering mode.
*/
if (all_user_ports_removed) {
@ -67,7 +67,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
| PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
}
}
@@ -1326,6 +1335,7 @@ mt7530_port_bridge_leave(struct dsa_swit
@@ -1329,6 +1338,7 @@ mt7530_port_bridge_leave(struct dsa_swit
struct net_device *bridge)
{
struct dsa_port *dp = dsa_to_port(ds, port), *other_dp;
@ -75,7 +75,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mt7530_priv *priv = ds->priv;
mutex_lock(&priv->reg_mutex);
@@ -1354,8 +1364,8 @@ mt7530_port_bridge_leave(struct dsa_swit
@@ -1357,8 +1367,8 @@ mt7530_port_bridge_leave(struct dsa_swit
*/
if (priv->ports[port].enable)
mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK,
@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* When a port is removed from the bridge, the port would be set up
* back to the default as is at initial boot which is a VLAN-unaware
@@ -1518,6 +1528,9 @@ static int
@@ -1521,6 +1531,9 @@ static int
mt7530_port_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering,
struct netlink_ext_ack *extack)
{
@ -96,7 +96,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (vlan_filtering) {
/* The port is being kept as VLAN-unaware port when bridge is
* set up with vlan_filtering not being set, Otherwise, the
@@ -1525,7 +1538,7 @@ mt7530_port_vlan_filtering(struct dsa_sw
@@ -1528,7 +1541,7 @@ mt7530_port_vlan_filtering(struct dsa_sw
* for becoming a VLAN-aware port.
*/
mt7530_port_set_vlan_aware(ds, port);

View File

@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
MediaTek SoC family.
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1388,6 +1388,68 @@ static void mtk_update_rx_cpu_idx(struct
@@ -1389,6 +1389,68 @@ static void mtk_update_rx_cpu_idx(struct
}
}
@ -96,7 +96,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int mtk_poll_rx(struct napi_struct *napi, int budget,
struct mtk_eth *eth)
{
@@ -1401,9 +1463,9 @@ static int mtk_poll_rx(struct napi_struc
@@ -1402,9 +1464,9 @@ static int mtk_poll_rx(struct napi_struc
while (done < budget) {
unsigned int pktlen, *rxdcsum;
@ -107,7 +107,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int mac = 0;
ring = mtk_get_rx_ring(eth);
@@ -1434,36 +1496,54 @@ static int mtk_poll_rx(struct napi_struc
@@ -1435,36 +1497,54 @@ static int mtk_poll_rx(struct napi_struc
goto release_desc;
/* alloc new buffer */
@ -184,7 +184,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
skb->dev = netdev;
@@ -1517,7 +1597,6 @@ static int mtk_poll_rx(struct napi_struc
@@ -1518,7 +1598,6 @@ static int mtk_poll_rx(struct napi_struc
skip_rx:
ring->data[idx] = new_data;
rxd->rxd1 = (unsigned int)dma_addr;
@ -192,7 +192,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
release_desc:
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
rxd->rxd2 = RX_DMA_LSO;
@@ -1525,7 +1604,6 @@ release_desc:
@@ -1526,7 +1605,6 @@ release_desc:
rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size);
ring->calc_idx = idx;
@ -200,7 +200,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
done++;
}
@@ -1889,13 +1967,15 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1890,13 +1968,15 @@ static int mtk_rx_alloc(struct mtk_eth *
if (!ring->data)
return -ENOMEM;
@ -223,7 +223,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
ring->dma = dma_alloc_coherent(eth->dma_dev,
@@ -1906,16 +1986,33 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1907,16 +1987,33 @@ static int mtk_rx_alloc(struct mtk_eth *
for (i = 0; i < rx_dma_size; i++) {
struct mtk_rx_dma_v2 *rxd;
@ -264,7 +264,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
rxd->rxd2 = RX_DMA_LSO;
@@ -1931,6 +2028,7 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1932,6 +2029,7 @@ static int mtk_rx_alloc(struct mtk_eth *
rxd->rxd8 = 0;
}
}
@ -272,7 +272,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ring->dma_size = rx_dma_size;
ring->calc_idx_update = false;
ring->calc_idx = rx_dma_size - 1;
@@ -1982,7 +2080,7 @@ static void mtk_rx_clean(struct mtk_eth
@@ -1983,7 +2081,7 @@ static void mtk_rx_clean(struct mtk_eth
dma_unmap_single(eth->dma_dev, rxd->rxd1,
ring->buf_size, DMA_FROM_DEVICE);
@ -281,7 +281,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
kfree(ring->data);
ring->data = NULL;
@@ -1994,6 +2092,13 @@ static void mtk_rx_clean(struct mtk_eth
@@ -1995,6 +2093,13 @@ static void mtk_rx_clean(struct mtk_eth
ring->dma, ring->phys);
ring->dma = NULL;
}
@ -318,7 +318,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define MTK_QRX_OFFSET 0x10
#define MTK_MAX_RX_RING_NUM 4
@@ -742,6 +749,9 @@ struct mtk_rx_ring {
@@ -743,6 +750,9 @@ struct mtk_rx_ring {
bool calc_idx_update;
u16 calc_idx;
u32 crx_idx_reg;

View File

@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1388,6 +1388,11 @@ static void mtk_update_rx_cpu_idx(struct
@@ -1389,6 +1389,11 @@ static void mtk_update_rx_cpu_idx(struct
}
}
@ -30,7 +30,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static struct page_pool *mtk_create_page_pool(struct mtk_eth *eth,
struct xdp_rxq_info *xdp_q,
int id, int size)
@@ -1450,11 +1455,52 @@ static void mtk_rx_put_buff(struct mtk_r
@@ -1451,11 +1456,52 @@ static void mtk_rx_put_buff(struct mtk_r
skb_free_frag(data);
}
@ -83,7 +83,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int idx;
struct sk_buff *skb;
u8 *data, *new_data;
@@ -1463,9 +1509,9 @@ static int mtk_poll_rx(struct napi_struc
@@ -1464,9 +1510,9 @@ static int mtk_poll_rx(struct napi_struc
while (done < budget) {
unsigned int pktlen, *rxdcsum;
@ -94,7 +94,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int mac = 0;
ring = mtk_get_rx_ring(eth);
@@ -1495,8 +1541,14 @@ static int mtk_poll_rx(struct napi_struc
@@ -1496,8 +1542,14 @@ static int mtk_poll_rx(struct napi_struc
if (unlikely(test_bit(MTK_RESETTING, &eth->state)))
goto release_desc;
@ -109,7 +109,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
new_data = mtk_page_pool_get_buff(ring->page_pool,
&dma_addr,
GFP_ATOMIC);
@@ -1504,6 +1556,34 @@ static int mtk_poll_rx(struct napi_struc
@@ -1505,6 +1557,34 @@ static int mtk_poll_rx(struct napi_struc
netdev->stats.rx_dropped++;
goto release_desc;
}
@ -144,7 +144,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} else {
if (ring->frag_size <= PAGE_SIZE)
new_data = napi_alloc_frag(ring->frag_size);
@@ -1527,27 +1607,20 @@ static int mtk_poll_rx(struct napi_struc
@@ -1528,27 +1608,20 @@ static int mtk_poll_rx(struct napi_struc
dma_unmap_single(eth->dma_dev, trxd.rxd1,
ring->buf_size, DMA_FROM_DEVICE);
@ -181,7 +181,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
rxdcsum = &trxd.rxd3;
@@ -1559,7 +1632,6 @@ static int mtk_poll_rx(struct napi_struc
@@ -1560,7 +1633,6 @@ static int mtk_poll_rx(struct napi_struc
else
skb_checksum_none_assert(skb);
skb->protocol = eth_type_trans(skb, netdev);
@ -189,7 +189,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
hash = trxd.rxd4 & MTK_RXD4_FOE_ENTRY;
if (hash != MTK_RXD4_FOE_ENTRY) {
@@ -1622,6 +1694,9 @@ rx_done:
@@ -1623,6 +1695,9 @@ rx_done:
&dim_sample);
net_dim(&eth->rx_dim, dim_sample);
@ -199,7 +199,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return done;
}
@@ -1967,7 +2042,7 @@ static int mtk_rx_alloc(struct mtk_eth *
@@ -1968,7 +2043,7 @@ static int mtk_rx_alloc(struct mtk_eth *
if (!ring->data)
return -ENOMEM;
@ -208,7 +208,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct page_pool *pp;
pp = mtk_create_page_pool(eth, &ring->xdp_q, ring_no,
@@ -2709,6 +2784,48 @@ static int mtk_stop(struct net_device *d
@@ -2710,6 +2785,48 @@ static int mtk_stop(struct net_device *d
return 0;
}
@ -257,7 +257,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void ethsys_reset(struct mtk_eth *eth, u32 reset_bits)
{
regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL,
@@ -3004,6 +3121,12 @@ static int mtk_change_mtu(struct net_dev
@@ -3005,6 +3122,12 @@ static int mtk_change_mtu(struct net_dev
struct mtk_eth *eth = mac->hw;
u32 mcr_cur, mcr_new;
@ -270,7 +270,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
mcr_new = mcr_cur & ~MAC_MCR_MAX_RX_MASK;
@@ -3331,6 +3454,7 @@ static const struct net_device_ops mtk_n
@@ -3332,6 +3455,7 @@ static const struct net_device_ops mtk_n
.ndo_poll_controller = mtk_poll_controller,
#endif
.ndo_setup_tc = mtk_eth_setup_tc,
@ -280,7 +280,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -1085,6 +1085,8 @@ struct mtk_eth {
@@ -1086,6 +1086,8 @@ struct mtk_eth {
struct mtk_ppe *ppe;
struct rhashtable flow_table;

View File

@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const char * const mtk_clks_source_name[] = {
@@ -1458,6 +1469,9 @@ static void mtk_rx_put_buff(struct mtk_r
@@ -1459,6 +1470,9 @@ static void mtk_rx_put_buff(struct mtk_r
static u32 mtk_xdp_run(struct mtk_eth *eth, struct mtk_rx_ring *ring,
struct xdp_buff *xdp, struct net_device *dev)
{
@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct bpf_prog *prog;
u32 act = XDP_PASS;
@@ -1470,13 +1484,16 @@ static u32 mtk_xdp_run(struct mtk_eth *e
@@ -1471,13 +1485,16 @@ static u32 mtk_xdp_run(struct mtk_eth *e
act = bpf_prog_run_xdp(prog, xdp);
switch (act) {
case XDP_PASS:
@ -68,7 +68,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default:
bpf_warn_invalid_xdp_action(act);
fallthrough;
@@ -1489,6 +1506,11 @@ static u32 mtk_xdp_run(struct mtk_eth *e
@@ -1490,6 +1507,11 @@ static u32 mtk_xdp_run(struct mtk_eth *e
page_pool_put_full_page(ring->page_pool,
virt_to_head_page(xdp->data), true);
@ -82,7 +82,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -567,6 +567,16 @@ struct mtk_tx_dma_v2 {
@@ -568,6 +568,16 @@ struct mtk_tx_dma_v2 {
struct mtk_eth;
struct mtk_mac;
@ -99,7 +99,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* struct mtk_hw_stats - the structure that holds the traffic statistics.
* @stats_lock: make sure that stats operations are atomic
* @reg_offset: the status register offset of the SoC
@@ -590,6 +600,8 @@ struct mtk_hw_stats {
@@ -591,6 +601,8 @@ struct mtk_hw_stats {
u64 rx_checksum_errors;
u64 rx_flow_control_packets;

View File

@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -987,15 +987,26 @@ static void mtk_tx_unmap(struct mtk_eth
@@ -988,15 +988,26 @@ static void mtk_tx_unmap(struct mtk_eth
}
}
@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static void setup_tx_buf(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
@@ -1012,7 +1023,7 @@ static void setup_tx_buf(struct mtk_eth
@@ -1013,7 +1024,7 @@ static void setup_tx_buf(struct mtk_eth
dma_unmap_addr_set(tx_buf, dma_addr1, mapped_addr);
dma_unmap_len_set(tx_buf, dma_len1, size);
} else {
@ -58,7 +58,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
txd->txd1 = mapped_addr;
txd->txd2 = TX_DMA_PLEN0(size);
dma_unmap_addr_set(tx_buf, dma_addr0, mapped_addr);
@@ -1188,7 +1199,7 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1189,7 +1200,7 @@ static int mtk_tx_map(struct sk_buff *sk
soc->txrx.txd_size);
if (new_desc)
memset(tx_buf, 0, sizeof(*tx_buf));
@ -67,7 +67,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
tx_buf->flags |= MTK_TX_FLAGS_PAGE0;
tx_buf->flags |= (!mac->id) ? MTK_TX_FLAGS_FPORT0 :
MTK_TX_FLAGS_FPORT1;
@@ -1202,7 +1213,8 @@ static int mtk_tx_map(struct sk_buff *sk
@@ -1203,7 +1214,8 @@ static int mtk_tx_map(struct sk_buff *sk
}
/* store skb to cleanup */
@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
if (k & 0x1)
@@ -1414,13 +1426,14 @@ static struct page_pool *mtk_create_page
@@ -1415,13 +1427,14 @@ static struct page_pool *mtk_create_page
.pool_size = size,
.nid = NUMA_NO_NODE,
.dev = eth->dma_dev,
@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
pp = page_pool_create(&pp_params);
if (IS_ERR(pp))
return pp;
@@ -1466,6 +1479,122 @@ static void mtk_rx_put_buff(struct mtk_r
@@ -1467,6 +1480,122 @@ static void mtk_rx_put_buff(struct mtk_r
skb_free_frag(data);
}
@ -216,7 +216,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static u32 mtk_xdp_run(struct mtk_eth *eth, struct mtk_rx_ring *ring,
struct xdp_buff *xdp, struct net_device *dev)
{
@@ -1494,6 +1623,18 @@ static u32 mtk_xdp_run(struct mtk_eth *e
@@ -1495,6 +1624,18 @@ static u32 mtk_xdp_run(struct mtk_eth *e
count = &hw_stats->xdp_stats.rx_xdp_redirect;
goto update_stats;
@ -235,7 +235,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default:
bpf_warn_invalid_xdp_action(act);
fallthrough;
@@ -1727,9 +1868,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
@@ -1728,9 +1869,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
{
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
struct mtk_tx_ring *ring = &eth->tx_ring;
@ -246,7 +246,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u32 cpu, dma;
cpu = ring->last_free_ptr;
@@ -1750,15 +1890,21 @@ static int mtk_poll_tx_qdma(struct mtk_e
@@ -1751,15 +1891,21 @@ static int mtk_poll_tx_qdma(struct mtk_e
if (tx_buf->flags & MTK_TX_FLAGS_FPORT1)
mac = 1;
@ -271,7 +271,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_tx_unmap(eth, tx_buf, true);
ring->last_free = desc;
@@ -1777,9 +1923,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
@@ -1778,9 +1924,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
unsigned int *done, unsigned int *bytes)
{
struct mtk_tx_ring *ring = &eth->tx_ring;
@ -282,7 +282,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u32 cpu, dma;
cpu = ring->cpu_idx;
@@ -1787,14 +1932,18 @@ static int mtk_poll_tx_pdma(struct mtk_e
@@ -1788,14 +1933,18 @@ static int mtk_poll_tx_pdma(struct mtk_e
while ((cpu != dma) && budget) {
tx_buf = &ring->buf[cpu];
@ -304,7 +304,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
mtk_tx_unmap(eth, tx_buf, true);
@@ -3477,6 +3626,7 @@ static const struct net_device_ops mtk_n
@@ -3478,6 +3627,7 @@ static const struct net_device_ops mtk_n
#endif
.ndo_setup_tc = mtk_eth_setup_tc,
.ndo_bpf = mtk_xdp,
@ -314,7 +314,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -693,6 +693,12 @@ enum mtk_dev_state {
@@ -694,6 +694,12 @@ enum mtk_dev_state {
MTK_RESETTING
};
@ -327,7 +327,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* struct mtk_tx_buf - This struct holds the pointers to the memory pointed at
* by the TX descriptor s
* @skb: The SKB pointer of the packet being sent
@@ -702,7 +708,9 @@ enum mtk_dev_state {
@@ -703,7 +709,9 @@ enum mtk_dev_state {
* @dma_len1: The length of the second segment
*/
struct mtk_tx_buf {

View File

@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
MediaTek SoC family.
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3487,11 +3487,18 @@ static void mtk_get_strings(struct net_d
@@ -3488,11 +3488,18 @@ static void mtk_get_strings(struct net_d
int i;
switch (stringset) {
@ -46,7 +46,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
break;
}
}
@@ -3499,13 +3506,35 @@ static void mtk_get_strings(struct net_d
@@ -3500,13 +3507,35 @@ static void mtk_get_strings(struct net_d
static int mtk_get_sset_count(struct net_device *dev, int sset)
{
switch (sset) {
@ -84,7 +84,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void mtk_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *data)
{
@@ -3533,6 +3562,8 @@ static void mtk_get_ethtool_stats(struct
@@ -3534,6 +3563,8 @@ static void mtk_get_ethtool_stats(struct
for (i = 0; i < ARRAY_SIZE(mtk_ethtool_stats); i++)
*data_dst++ = *(data_src + mtk_ethtool_stats[i].offset);

View File

@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1479,6 +1479,41 @@ static void mtk_rx_put_buff(struct mtk_r
@@ -1480,6 +1480,41 @@ static void mtk_rx_put_buff(struct mtk_r
skb_free_frag(data);
}
@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int mtk_xdp_submit_frame(struct mtk_eth *eth, struct xdp_frame *xdpf,
struct net_device *dev, bool dma_map)
{
@@ -1489,9 +1524,8 @@ static int mtk_xdp_submit_frame(struct m
@@ -1490,9 +1525,8 @@ static int mtk_xdp_submit_frame(struct m
.first = true,
.last = true,
};
@ -68,7 +68,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mtk_tx_buf *tx_buf;
if (unlikely(test_bit(MTK_RESETTING, &eth->state)))
@@ -1511,36 +1545,18 @@ static int mtk_xdp_submit_frame(struct m
@@ -1512,36 +1546,18 @@ static int mtk_xdp_submit_frame(struct m
tx_buf = mtk_desc_to_tx_buf(ring, txd, soc->txrx.txd_size);
memset(tx_buf, 0, sizeof(*tx_buf));

View File

@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -987,23 +987,22 @@ static void mtk_tx_unmap(struct mtk_eth
@@ -988,23 +988,22 @@ static void mtk_tx_unmap(struct mtk_eth
}
}
@ -47,7 +47,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
tx_buf->flags = 0;
tx_buf->data = NULL;
@@ -1506,6 +1505,8 @@ static int mtk_xdp_frame_map(struct mtk_
@@ -1507,6 +1506,8 @@ static int mtk_xdp_frame_map(struct mtk_
mtk_tx_set_dma_desc(dev, txd, txd_info);
tx_buf->flags |= !mac->id ? MTK_TX_FLAGS_FPORT0 : MTK_TX_FLAGS_FPORT1;
@ -56,7 +56,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
txd_pdma = qdma_to_pdma(ring, txd);
setup_tx_buf(eth, tx_buf, txd_pdma, txd_info->addr, txd_info->size,
@@ -1517,43 +1518,69 @@ static int mtk_xdp_frame_map(struct mtk_
@@ -1518,43 +1519,69 @@ static int mtk_xdp_frame_map(struct mtk_
static int mtk_xdp_submit_frame(struct mtk_eth *eth, struct xdp_frame *xdpf,
struct net_device *dev, bool dma_map)
{
@ -140,7 +140,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
txd_pdma = qdma_to_pdma(ring, txd);
@@ -1580,7 +1607,24 @@ static int mtk_xdp_submit_frame(struct m
@@ -1581,7 +1608,24 @@ static int mtk_xdp_submit_frame(struct m
mtk_w32(eth, NEXT_DESP_IDX(idx, ring->dma_size),
MT7628_TX_CTX_IDX0);
}
@ -166,7 +166,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
spin_unlock(&eth->page_lock);
return err;
@@ -1909,18 +1953,15 @@ static int mtk_poll_tx_qdma(struct mtk_e
@@ -1910,18 +1954,15 @@ static int mtk_poll_tx_qdma(struct mtk_e
if (!tx_buf->data)
break;
@ -191,7 +191,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mtk_tx_unmap(eth, tx_buf, true);
ring->last_free = desc;
@@ -1951,17 +1992,15 @@ static int mtk_poll_tx_pdma(struct mtk_e
@@ -1952,17 +1993,15 @@ static int mtk_poll_tx_pdma(struct mtk_e
if (!tx_buf->data)
break;

View File

@ -18,7 +18,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1845,10 +1845,19 @@ static int mtk_poll_rx(struct napi_struc
@@ -1846,10 +1846,19 @@ static int mtk_poll_rx(struct napi_struc
skb->dev = netdev;
bytes += skb->len;
@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (*rxdcsum & eth->soc->txrx.rx_dma_l4_valid)
skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -1856,16 +1865,9 @@ static int mtk_poll_rx(struct napi_struc
@@ -1857,16 +1866,9 @@ static int mtk_poll_rx(struct napi_struc
skb_checksum_none_assert(skb);
skb->protocol = eth_type_trans(skb, netdev);

View File

@ -24,7 +24,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1412,7 +1412,7 @@ static void mtk_update_rx_cpu_idx(struct
@@ -1413,7 +1413,7 @@ static void mtk_update_rx_cpu_idx(struct
static bool mtk_page_pool_enabled(struct mtk_eth *eth)
{

View File

@ -57,7 +57,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
};
/* strings used by ethtool */
@@ -2924,6 +2928,7 @@ static int mtk_open(struct net_device *d
@@ -2925,6 +2929,7 @@ static int mtk_open(struct net_device *d
/* we run 2 netdevs on the same dma ring so we only bring it up once */
if (!refcount_read(&eth->dma_refcnt)) {
@ -65,7 +65,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
u32 gdm_config = MTK_GDMA_TO_PDMA;
int err;
@@ -2933,15 +2938,15 @@ static int mtk_open(struct net_device *d
@@ -2934,15 +2939,15 @@ static int mtk_open(struct net_device *d
return err;
}
@ -84,7 +84,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
refcount_set(&eth->dma_refcnt, 1);
}
else
@@ -4047,7 +4052,9 @@ static int mtk_probe(struct platform_dev
@@ -4048,7 +4053,9 @@ static int mtk_probe(struct platform_dev
}
if (eth->soc->offload_version) {
@ -105,7 +105,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
#define MTK_GDMA_DROP_ALL 0x7777
/* Unicast Filter MAC Address Register - Low */
@@ -952,6 +951,8 @@ struct mtk_reg_map {
@@ -953,6 +952,8 @@ struct mtk_reg_map {
u32 fq_blen; /* fq free page buffer length */
} qdma;
u32 gdm1_cnt;

View File

@ -44,7 +44,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4150,6 +4150,7 @@ static const struct mtk_soc_data mt7621_
@@ -4151,6 +4151,7 @@ static const struct mtk_soc_data mt7621_
.required_clks = MT7621_CLKS_BITMAP,
.required_pctl = false,
.offload_version = 2,
@ -52,7 +52,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4168,6 +4169,7 @@ static const struct mtk_soc_data mt7622_
@@ -4169,6 +4170,7 @@ static const struct mtk_soc_data mt7622_
.required_clks = MT7622_CLKS_BITMAP,
.required_pctl = false,
.offload_version = 2,
@ -60,7 +60,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4185,6 +4187,7 @@ static const struct mtk_soc_data mt7623_
@@ -4186,6 +4188,7 @@ static const struct mtk_soc_data mt7623_
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
.offload_version = 2,
@ -68,7 +68,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4218,6 +4221,7 @@ static const struct mtk_soc_data mt7986_
@@ -4219,6 +4222,7 @@ static const struct mtk_soc_data mt7986_
.caps = MT7986_CAPS,
.required_clks = MT7986_CLKS_BITMAP,
.required_pctl = false,
@ -78,7 +78,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.rxd_size = sizeof(struct mtk_rx_dma_v2),
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -966,6 +966,7 @@ struct mtk_reg_map {
@@ -967,6 +967,7 @@ struct mtk_reg_map {
* the target SoC
* @required_pctl A bool value to show whether the SoC requires
* the extra setup for those pins used by GMAC.
@ -86,7 +86,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
* @txd_size Tx DMA descriptor size.
* @rxd_size Rx DMA descriptor size.
* @rx_irq_done_mask Rx irq done register mask.
@@ -980,6 +981,7 @@ struct mtk_soc_data {
@@ -981,6 +982,7 @@ struct mtk_soc_data {
u32 required_clks;
bool required_pctl;
u8 offload_version;

View File

@ -48,7 +48,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1871,7 +1871,7 @@ static int mtk_poll_rx(struct napi_struc
@@ -1872,7 +1872,7 @@ static int mtk_poll_rx(struct napi_struc
reason = FIELD_GET(MTK_RXD4_PPE_CPU_REASON, trxd.rxd4);
if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED)
@ -57,7 +57,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) {
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
@@ -2929,7 +2929,8 @@ static int mtk_open(struct net_device *d
@@ -2930,7 +2930,8 @@ static int mtk_open(struct net_device *d
/* we run 2 netdevs on the same dma ring so we only bring it up once */
if (!refcount_read(&eth->dma_refcnt)) {
const struct mtk_soc_data *soc = eth->soc;
@ -67,7 +67,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
int err;
err = mtk_start_dma(eth);
@@ -2938,8 +2939,11 @@ static int mtk_open(struct net_device *d
@@ -2939,8 +2940,11 @@ static int mtk_open(struct net_device *d
return err;
}
@ -81,7 +81,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
mtk_gdm_config(eth, gdm_config);
@@ -2984,6 +2988,7 @@ static int mtk_stop(struct net_device *d
@@ -2985,6 +2989,7 @@ static int mtk_stop(struct net_device *d
{
struct mtk_mac *mac = netdev_priv(dev);
struct mtk_eth *eth = mac->hw;
@ -89,7 +89,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
phylink_stop(mac->phylink);
@@ -3011,8 +3016,8 @@ static int mtk_stop(struct net_device *d
@@ -3012,8 +3017,8 @@ static int mtk_stop(struct net_device *d
mtk_dma_free(eth);
@ -100,7 +100,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
return 0;
}
@@ -4052,12 +4057,19 @@ static int mtk_probe(struct platform_dev
@@ -4053,12 +4058,19 @@ static int mtk_probe(struct platform_dev
}
if (eth->soc->offload_version) {
@ -127,7 +127,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
err = mtk_eth_offload_init(eth);
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -1111,7 +1111,7 @@ struct mtk_eth {
@@ -1112,7 +1112,7 @@ struct mtk_eth {
int ip_align;

View File

@ -39,7 +39,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
};
/* strings used by ethtool */
@@ -3969,16 +3977,12 @@ static int mtk_probe(struct platform_dev
@@ -3970,16 +3978,12 @@ static int mtk_probe(struct platform_dev
for (i = 0;; i++) {
struct device_node *np = of_parse_phandle(pdev->dev.of_node,
"mediatek,wed", i);
@ -70,7 +70,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
/* QDMA descriptor txd4 */
#define TX_DMA_CHKSUM (0x7 << 29)
#define TX_DMA_TSO BIT(28)
@@ -953,6 +950,7 @@ struct mtk_reg_map {
@@ -954,6 +951,7 @@ struct mtk_reg_map {
u32 gdm1_cnt;
u32 gdma_to_ppe0;
u32 ppe_base;

View File

@ -21,7 +21,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4167,6 +4167,7 @@ static const struct mtk_soc_data mt7621_
@@ -4168,6 +4168,7 @@ static const struct mtk_soc_data mt7621_
.required_pctl = false,
.offload_version = 2,
.hash_offset = 2,
@ -29,7 +29,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4186,6 +4187,7 @@ static const struct mtk_soc_data mt7622_
@@ -4187,6 +4188,7 @@ static const struct mtk_soc_data mt7622_
.required_pctl = false,
.offload_version = 2,
.hash_offset = 2,
@ -37,7 +37,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4204,6 +4206,7 @@ static const struct mtk_soc_data mt7623_
@@ -4205,6 +4207,7 @@ static const struct mtk_soc_data mt7623_
.required_pctl = true,
.offload_version = 2,
.hash_offset = 2,
@ -47,7 +47,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.rxd_size = sizeof(struct mtk_rx_dma),
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -965,6 +965,7 @@ struct mtk_reg_map {
@@ -966,6 +966,7 @@ struct mtk_reg_map {
* @required_pctl A bool value to show whether the SoC requires
* the extra setup for those pins used by GMAC.
* @hash_offset Flow table hash offset.
@ -55,7 +55,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
* @txd_size Tx DMA descriptor size.
* @rxd_size Rx DMA descriptor size.
* @rx_irq_done_mask Rx irq done register mask.
@@ -980,6 +981,7 @@ struct mtk_soc_data {
@@ -981,6 +982,7 @@ struct mtk_soc_data {
bool required_pctl;
u8 offload_version;
u8 hash_offset;
@ -63,7 +63,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
netdev_features_t hw_features;
struct {
u32 txd_size;
@@ -1140,6 +1142,14 @@ struct mtk_mac {
@@ -1141,6 +1143,14 @@ struct mtk_mac {
/* the struct describing the SoC. these are declared in the soc_xyz.c files */
extern const struct of_device_id of_mtk_match[];

View File

@ -26,7 +26,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3894,6 +3894,7 @@ void mtk_eth_set_dma_device(struct mtk_e
@@ -3895,6 +3895,7 @@ void mtk_eth_set_dma_device(struct mtk_e
static int mtk_probe(struct platform_device *pdev)
{
@ -34,7 +34,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
struct device_node *mac_np;
struct mtk_eth *eth;
int err, i;
@@ -3974,16 +3975,31 @@ static int mtk_probe(struct platform_dev
@@ -3975,16 +3976,31 @@ static int mtk_probe(struct platform_dev
}
}

View File

@ -26,7 +26,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1858,12 +1858,14 @@ static int mtk_poll_rx(struct napi_struc
@@ -1859,12 +1859,14 @@ static int mtk_poll_rx(struct napi_struc
bytes += skb->len;
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
@ -41,7 +41,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
hash = trxd.rxd4 & MTK_RXD4_FOE_ENTRY;
if (hash != MTK_RXD4_FOE_ENTRY)
skb_set_hash(skb, jhash_1word(hash, 0),
@@ -1877,7 +1879,6 @@ static int mtk_poll_rx(struct napi_struc
@@ -1878,7 +1880,6 @@ static int mtk_poll_rx(struct napi_struc
skb_checksum_none_assert(skb);
skb->protocol = eth_type_trans(skb, netdev);
@ -49,7 +49,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED)
mtk_ppe_check_skb(eth->ppe[0], skb, hash);
@@ -4183,7 +4184,7 @@ static const struct mtk_soc_data mt7621_
@@ -4184,7 +4185,7 @@ static const struct mtk_soc_data mt7621_
.required_pctl = false,
.offload_version = 2,
.hash_offset = 2,
@ -58,7 +58,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4203,7 +4204,7 @@ static const struct mtk_soc_data mt7622_
@@ -4204,7 +4205,7 @@ static const struct mtk_soc_data mt7622_
.required_pctl = false,
.offload_version = 2,
.hash_offset = 2,
@ -67,7 +67,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4222,7 +4223,7 @@ static const struct mtk_soc_data mt7623_
@@ -4223,7 +4224,7 @@ static const struct mtk_soc_data mt7623_
.required_pctl = true,
.offload_version = 2,
.hash_offset = 2,
@ -76,7 +76,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4254,9 +4255,11 @@ static const struct mtk_soc_data mt7986_
@@ -4255,9 +4256,11 @@ static const struct mtk_soc_data mt7986_
.reg_map = &mt7986_reg_map,
.ana_rgc3 = 0x128,
.caps = MT7986_CAPS,
@ -90,7 +90,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
.rxd_size = sizeof(struct mtk_rx_dma_v2),
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -1150,6 +1150,78 @@ mtk_foe_get_entry(struct mtk_ppe *ppe, u
@@ -1151,6 +1151,78 @@ mtk_foe_get_entry(struct mtk_ppe *ppe, u
return ppe->foe_table + hash * soc->foe_entry_size;
}

View File

@ -16,7 +16,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4258,6 +4258,7 @@ static const struct mtk_soc_data mt7986_
@@ -4259,6 +4259,7 @@ static const struct mtk_soc_data mt7986_
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7986_CLKS_BITMAP,
.required_pctl = false,

View File

@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4010,19 +4010,23 @@ static int mtk_probe(struct platform_dev
@@ -4011,19 +4011,23 @@ static int mtk_probe(struct platform_dev
eth->irq[i] = platform_get_irq(pdev, i);
if (eth->irq[i] < 0) {
dev_err(&pdev->dev, "no IRQ%d resource found\n", i);
@ -45,7 +45,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
eth->clks[i] = NULL;
}
@@ -4033,7 +4037,7 @@ static int mtk_probe(struct platform_dev
@@ -4034,7 +4038,7 @@ static int mtk_probe(struct platform_dev
err = mtk_hw_init(eth);
if (err)
@ -54,7 +54,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
eth->hwlro = MTK_HAS_CAPS(eth->soc->caps, MTK_HWLRO);
@@ -4131,6 +4135,8 @@ err_free_dev:
@@ -4132,6 +4136,8 @@ err_free_dev:
mtk_free_dev(eth);
err_deinit_hw:
mtk_hw_deinit(eth);
@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return err;
}
@@ -4150,6 +4156,7 @@ static int mtk_remove(struct platform_de
@@ -4151,6 +4157,7 @@ static int mtk_remove(struct platform_de
phylink_disconnect_phy(mac->phylink);
}

View File

@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3175,6 +3175,30 @@ static void mtk_dim_tx(struct work_struc
@@ -3176,6 +3176,30 @@ static void mtk_dim_tx(struct work_struc
dim->state = DIM_START_MEASURE;
}
@ -45,7 +45,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int mtk_hw_init(struct mtk_eth *eth)
{
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
@@ -3249,8 +3273,16 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -3250,8 +3274,16 @@ static int mtk_hw_init(struct mtk_eth *e
* up with the more appropriate value when mtk_mac_config call is being
* invoked.
*/
@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Indicates CDM to parse the MTK special tag from CPU
* which also is working out for untag packets.
@@ -3366,7 +3398,6 @@ static int mtk_change_mtu(struct net_dev
@@ -3367,7 +3399,6 @@ static int mtk_change_mtu(struct net_dev
int length = new_mtu + MTK_RX_ETH_HLEN;
struct mtk_mac *mac = netdev_priv(dev);
struct mtk_eth *eth = mac->hw;
@ -71,7 +71,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (rcu_access_pointer(eth->prog) &&
length > MTK_PP_MAX_BUF_SIZE) {
@@ -3374,23 +3405,7 @@ static int mtk_change_mtu(struct net_dev
@@ -3375,23 +3406,7 @@ static int mtk_change_mtu(struct net_dev
return -EINVAL;
}

View File

@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3436,11 +3436,8 @@ static void mtk_pending_work(struct work
@@ -3437,11 +3437,8 @@ static void mtk_pending_work(struct work
rtnl_lock();
dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__);
@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* stop all devices to make sure that dma is properly shut down */
for (i = 0; i < MTK_MAC_COUNT; i++) {
if (!eth->netdev[i])
@@ -3474,7 +3471,7 @@ static void mtk_pending_work(struct work
@@ -3475,7 +3472,7 @@ static void mtk_pending_work(struct work
dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__);

View File

@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3238,16 +3238,17 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -3239,16 +3239,17 @@ static int mtk_hw_init(struct mtk_eth *e
return 0;
}
@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN,
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -444,18 +444,14 @@
@@ -445,18 +445,14 @@
/* ethernet reset control register */
#define ETHSYS_RSTCTRL 0x34
#define RSTCTRL_FE BIT(6)

View File

@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3199,6 +3199,27 @@ static void mtk_set_mcr_max_rx(struct mt
@@ -3200,6 +3200,27 @@ static void mtk_set_mcr_max_rx(struct mt
mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
}
@ -44,7 +44,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static int mtk_hw_init(struct mtk_eth *eth)
{
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
@@ -3238,22 +3259,9 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -3239,22 +3260,9 @@ static int mtk_hw_init(struct mtk_eth *e
return 0;
}

View File

@ -17,7 +17,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3220,7 +3220,54 @@ static void mtk_hw_reset(struct mtk_eth
@@ -3221,7 +3221,54 @@ static void mtk_hw_reset(struct mtk_eth
0x3ffffff);
}
@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
{
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
ETHSYS_DMA_AG_MAP_PPE;
@@ -3259,7 +3306,12 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -3260,7 +3307,12 @@ static int mtk_hw_init(struct mtk_eth *e
return 0;
}
@ -87,7 +87,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
/* Set FE to PDMAv2 if necessary */
@@ -3464,7 +3516,7 @@ static void mtk_pending_work(struct work
@@ -3465,7 +3517,7 @@ static void mtk_pending_work(struct work
if (eth->dev->pins)
pinctrl_select_state(eth->dev->pins->p,
eth->dev->pins->default_state);
@ -96,7 +96,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* restart DMA and enable IRQs */
for (i = 0; i < MTK_MAC_COUNT; i++) {
@@ -4056,7 +4108,7 @@ static int mtk_probe(struct platform_dev
@@ -4057,7 +4109,7 @@ static int mtk_probe(struct platform_dev
eth->msg_enable = netif_msg_init(mtk_msg_level, MTK_DEFAULT_MSG_ENABLE);
INIT_WORK(&eth->pending_work, mtk_pending_work);

View File

@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -2785,14 +2785,29 @@ static void mtk_dma_free(struct mtk_eth
@@ -2786,14 +2786,29 @@ static void mtk_dma_free(struct mtk_eth
kfree(eth->scratch_head);
}
@ -48,7 +48,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
schedule_work(&eth->pending_work);
}
@@ -3274,15 +3289,17 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -3275,15 +3290,17 @@ static int mtk_hw_init(struct mtk_eth *e
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
int i, val, ret;
@ -72,7 +72,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (eth->ethsys)
regmap_update_bits(eth->ethsys, ETHSYS_DMA_AG_MAP, dma_mask,
@@ -3408,8 +3425,10 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -3409,8 +3426,10 @@ static int mtk_hw_init(struct mtk_eth *e
return 0;
err_disable_pm:
@ -85,7 +85,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return ret;
}
@@ -3488,30 +3507,53 @@ static int mtk_do_ioctl(struct net_devic
@@ -3489,30 +3508,53 @@ static int mtk_do_ioctl(struct net_devic
return -EOPNOTSUPP;
}
@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (eth->dev->pins)
pinctrl_select_state(eth->dev->pins->p,
@@ -3522,15 +3564,19 @@ static void mtk_pending_work(struct work
@@ -3523,15 +3565,19 @@ static void mtk_pending_work(struct work
for (i = 0; i < MTK_MAC_COUNT; i++) {
if (!test_bit(i, &restart))
continue;

View File

@ -49,7 +49,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
};
/* strings used by ethtool */
@@ -3282,6 +3288,102 @@ static void mtk_hw_warm_reset(struct mtk
@@ -3283,6 +3289,102 @@ static void mtk_hw_warm_reset(struct mtk
val, rst_mask);
}
@ -152,7 +152,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static int mtk_hw_init(struct mtk_eth *eth, bool reset)
{
u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
@@ -3614,6 +3716,7 @@ static int mtk_cleanup(struct mtk_eth *e
@@ -3615,6 +3717,7 @@ static int mtk_cleanup(struct mtk_eth *e
mtk_unreg_dev(eth);
mtk_free_dev(eth);
cancel_work_sync(&eth->pending_work);
@ -160,7 +160,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return 0;
}
@@ -4041,6 +4144,7 @@ static int mtk_probe(struct platform_dev
@@ -4042,6 +4145,7 @@ static int mtk_probe(struct platform_dev
eth->rx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
INIT_WORK(&eth->rx_dim.work, mtk_dim_rx);
@ -168,7 +168,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
eth->tx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
INIT_WORK(&eth->tx_dim.work, mtk_dim_tx);
@@ -4245,6 +4349,8 @@ static int mtk_probe(struct platform_dev
@@ -4246,6 +4350,8 @@ static int mtk_probe(struct platform_dev
NAPI_POLL_WEIGHT);
platform_set_drvdata(pdev, eth);
@ -188,7 +188,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* QDMA Interrupt grouping registers */
#define MTK_RLS_DONE_INT BIT(0)
@@ -537,6 +539,17 @@
@@ -538,6 +540,17 @@
#define MT7628_SDM_RBCNT (MT7628_SDM_OFFSET + 0x10c)
#define MT7628_SDM_CS_ERR (MT7628_SDM_OFFSET + 0x110)
@ -206,7 +206,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
struct mtk_rx_dma {
unsigned int rxd1;
unsigned int rxd2;
@@ -933,6 +946,7 @@ struct mtk_reg_map {
@@ -934,6 +947,7 @@ struct mtk_reg_map {
u32 delay_irq; /* delay interrupt */
u32 irq_status; /* interrupt status */
u32 irq_mask; /* interrupt mask */
@ -214,7 +214,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
u32 int_grp;
} pdma;
struct {
@@ -959,6 +973,8 @@ struct mtk_reg_map {
@@ -960,6 +974,8 @@ struct mtk_reg_map {
u32 gdma_to_ppe0;
u32 ppe_base;
u32 wdma_base[2];
@ -223,7 +223,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
};
/* struct mtk_eth_data - This is the structure holding all differences
@@ -1001,6 +1017,8 @@ struct mtk_soc_data {
@@ -1002,6 +1018,8 @@ struct mtk_soc_data {
} txrx;
};
@ -232,7 +232,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* currently no SoC has more than 2 macs */
#define MTK_MAX_DEVS 2
@@ -1123,6 +1141,14 @@ struct mtk_eth {
@@ -1124,6 +1142,14 @@ struct mtk_eth {
struct rhashtable flow_table;
struct bpf_prog __rcu *prog;

View File

@ -14,7 +14,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3645,6 +3645,11 @@ static void mtk_pending_work(struct work
@@ -3646,6 +3646,11 @@ static void mtk_pending_work(struct work
set_bit(MTK_RESETTING, &eth->state);
mtk_prepare_for_reset(eth);
@ -26,7 +26,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* stop all devices to make sure that dma is properly shut down */
for (i = 0; i < MTK_MAC_COUNT; i++) {
@@ -3682,6 +3687,8 @@ static void mtk_pending_work(struct work
@@ -3683,6 +3688,8 @@ static void mtk_pending_work(struct work
clear_bit(MTK_RESETTING, &eth->state);

View File

@ -34,7 +34,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -1027,11 +1027,13 @@ struct mtk_soc_data {
@@ -1028,11 +1028,13 @@ struct mtk_soc_data {
* @regmap: The register map pointing at the range used to setup
* SGMII modes
* @ana_rgc3: The offset refers to register ANA_RGC3 related to regmap

View File

@ -24,7 +24,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -496,7 +496,7 @@
@@ -497,7 +497,7 @@
#define SGMII_SPEED_10 FIELD_PREP(SGMII_SPEED_MASK, 0)
#define SGMII_SPEED_100 FIELD_PREP(SGMII_SPEED_MASK, 1)
#define SGMII_SPEED_1000 FIELD_PREP(SGMII_SPEED_MASK, 2)

View File

@ -27,7 +27,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue);
static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue);
@@ -1711,9 +1714,6 @@ static int __init_dma_rx_desc_rings(stru
@@ -1712,9 +1715,6 @@ static int __init_dma_rx_desc_rings(stru
return -ENOMEM;
}
@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Setup the chained descriptor addresses */
if (priv->mode == STMMAC_CHAIN_MODE) {
if (priv->extend_desc)
@@ -1819,12 +1819,6 @@ static int __init_dma_tx_desc_rings(stru
@@ -1820,12 +1820,6 @@ static int __init_dma_tx_desc_rings(stru
tx_q->tx_skbuff[i] = NULL;
}
@ -50,7 +50,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
return 0;
}
@@ -2693,10 +2687,7 @@ static void stmmac_tx_err(struct stmmac_
@@ -2694,10 +2688,7 @@ static void stmmac_tx_err(struct stmmac_
stmmac_stop_tx_dma(priv, chan);
dma_free_tx_skbufs(priv, chan);
stmmac_clear_tx_descriptors(priv, chan);
@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
tx_q->dma_tx_phy, chan);
stmmac_start_tx_dma(priv, chan);
@@ -3780,6 +3771,8 @@ static int stmmac_open(struct net_device
@@ -3781,6 +3772,8 @@ static int stmmac_open(struct net_device
}
}
@ -71,7 +71,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
ret = stmmac_hw_setup(dev, true);
if (ret < 0) {
netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
@@ -6423,6 +6416,7 @@ void stmmac_enable_rx_queue(struct stmma
@@ -6424,6 +6417,7 @@ void stmmac_enable_rx_queue(struct stmma
return;
}
@ -79,7 +79,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_clear_rx_descriptors(priv, queue);
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
@@ -6484,6 +6478,7 @@ void stmmac_enable_tx_queue(struct stmma
@@ -6485,6 +6479,7 @@ void stmmac_enable_tx_queue(struct stmma
return;
}
@ -87,7 +87,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_clear_tx_descriptors(priv, queue);
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
@@ -7406,6 +7401,25 @@ int stmmac_suspend(struct device *dev)
@@ -7407,6 +7402,25 @@ int stmmac_suspend(struct device *dev)
}
EXPORT_SYMBOL_GPL(stmmac_suspend);
@ -113,7 +113,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/**
* stmmac_reset_queues_param - reset queue parameters
* @priv: device pointer
@@ -7416,22 +7430,11 @@ static void stmmac_reset_queues_param(st
@@ -7417,22 +7431,11 @@ static void stmmac_reset_queues_param(st
u32 tx_cnt = priv->plat->tx_queues_to_use;
u32 queue;

View File

@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3832,8 +3832,6 @@ static int stmmac_release(struct net_dev
@@ -3833,8 +3833,6 @@ static int stmmac_release(struct net_dev
struct stmmac_priv *priv = netdev_priv(dev);
u32 chan;
@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (device_may_wakeup(priv->device))
phylink_speed_down(priv->phylink, false);
/* Stop and disconnect the PHY */
@@ -3845,6 +3843,8 @@ static int stmmac_release(struct net_dev
@@ -3846,6 +3844,8 @@ static int stmmac_release(struct net_dev
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
hrtimer_cancel(&priv->tx_queue[chan].txtimer);

View File

@ -189,7 +189,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (tx_q->dirty_tx != tx_q->cur_tx)
return -EBUSY; /* still unfinished work */
@@ -1308,7 +1308,7 @@ static void stmmac_display_rx_rings(stru
@@ -1309,7 +1309,7 @@ static void stmmac_display_rx_rings(stru
/* Display RX rings */
for (queue = 0; queue < rx_cnt; queue++) {
@ -198,7 +198,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
pr_info("\tRX Queue %u rings\n", queue);
@@ -1321,7 +1321,7 @@ static void stmmac_display_rx_rings(stru
@@ -1322,7 +1322,7 @@ static void stmmac_display_rx_rings(stru
}
/* Display RX ring */
@ -207,7 +207,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
rx_q->dma_rx_phy, desc_size);
}
}
@@ -1335,7 +1335,7 @@ static void stmmac_display_tx_rings(stru
@@ -1336,7 +1336,7 @@ static void stmmac_display_tx_rings(stru
/* Display TX rings */
for (queue = 0; queue < tx_cnt; queue++) {
@ -216,7 +216,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
pr_info("\tTX Queue %d rings\n", queue);
@@ -1350,7 +1350,7 @@ static void stmmac_display_tx_rings(stru
@@ -1351,7 +1351,7 @@ static void stmmac_display_tx_rings(stru
desc_size = sizeof(struct dma_desc);
}
@ -225,7 +225,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tx_q->dma_tx_phy, desc_size);
}
}
@@ -1391,21 +1391,21 @@ static int stmmac_set_bfsize(int mtu, in
@@ -1392,21 +1392,21 @@ static int stmmac_set_bfsize(int mtu, in
*/
static void stmmac_clear_rx_descriptors(struct stmmac_priv *priv, u32 queue)
{
@ -253,7 +253,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
/**
@@ -1417,12 +1417,12 @@ static void stmmac_clear_rx_descriptors(
@@ -1418,12 +1418,12 @@ static void stmmac_clear_rx_descriptors(
*/
static void stmmac_clear_tx_descriptors(struct stmmac_priv *priv, u32 queue)
{
@ -269,7 +269,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct dma_desc *p;
if (priv->extend_desc)
@@ -1470,7 +1470,7 @@ static void stmmac_clear_descriptors(str
@@ -1471,7 +1471,7 @@ static void stmmac_clear_descriptors(str
static int stmmac_init_rx_buffers(struct stmmac_priv *priv, struct dma_desc *p,
int i, gfp_t flags, u32 queue)
{
@ -278,7 +278,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
if (!buf->page) {
@@ -1495,7 +1495,7 @@ static int stmmac_init_rx_buffers(struct
@@ -1496,7 +1496,7 @@ static int stmmac_init_rx_buffers(struct
buf->addr = page_pool_get_dma_addr(buf->page) + buf->page_offset;
stmmac_set_desc_addr(priv, p, buf->addr);
@ -287,7 +287,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_init_desc3(priv, p);
return 0;
@@ -1509,7 +1509,7 @@ static int stmmac_init_rx_buffers(struct
@@ -1510,7 +1510,7 @@ static int stmmac_init_rx_buffers(struct
*/
static void stmmac_free_rx_buffer(struct stmmac_priv *priv, u32 queue, int i)
{
@ -296,7 +296,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
if (buf->page)
@@ -1529,7 +1529,7 @@ static void stmmac_free_rx_buffer(struct
@@ -1530,7 +1530,7 @@ static void stmmac_free_rx_buffer(struct
*/
static void stmmac_free_tx_buffer(struct stmmac_priv *priv, u32 queue, int i)
{
@ -305,7 +305,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (tx_q->tx_skbuff_dma[i].buf &&
tx_q->tx_skbuff_dma[i].buf_type != STMMAC_TXBUF_T_XDP_TX) {
@@ -1574,17 +1574,17 @@ static void dma_free_rx_skbufs(struct st
@@ -1575,17 +1575,17 @@ static void dma_free_rx_skbufs(struct st
{
int i;
@ -326,7 +326,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct dma_desc *p;
int ret;
@@ -1611,10 +1611,10 @@ static int stmmac_alloc_rx_buffers(struc
@@ -1612,10 +1612,10 @@ static int stmmac_alloc_rx_buffers(struc
*/
static void dma_free_rx_xskbufs(struct stmmac_priv *priv, u32 queue)
{
@ -339,7 +339,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
if (!buf->xdp)
@@ -1627,10 +1627,10 @@ static void dma_free_rx_xskbufs(struct s
@@ -1628,10 +1628,10 @@ static void dma_free_rx_xskbufs(struct s
static int stmmac_alloc_rx_buffers_zc(struct stmmac_priv *priv, u32 queue)
{
@ -352,7 +352,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_rx_buffer *buf;
dma_addr_t dma_addr;
struct dma_desc *p;
@@ -1673,7 +1673,7 @@ static struct xsk_buff_pool *stmmac_get_
@@ -1674,7 +1674,7 @@ static struct xsk_buff_pool *stmmac_get_
*/
static int __init_dma_rx_desc_rings(struct stmmac_priv *priv, u32 queue, gfp_t flags)
{
@ -361,7 +361,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
int ret;
netif_dbg(priv, probe, priv->dev,
@@ -1719,11 +1719,11 @@ static int __init_dma_rx_desc_rings(stru
@@ -1720,11 +1720,11 @@ static int __init_dma_rx_desc_rings(stru
if (priv->extend_desc)
stmmac_mode_init(priv, rx_q->dma_erx,
rx_q->dma_rx_phy,
@ -375,7 +375,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
return 0;
@@ -1750,7 +1750,7 @@ static int init_dma_rx_desc_rings(struct
@@ -1751,7 +1751,7 @@ static int init_dma_rx_desc_rings(struct
err_init_rx_buffers:
while (queue >= 0) {
@ -384,7 +384,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (rx_q->xsk_pool)
dma_free_rx_xskbufs(priv, queue);
@@ -1779,7 +1779,7 @@ err_init_rx_buffers:
@@ -1780,7 +1780,7 @@ err_init_rx_buffers:
*/
static int __init_dma_tx_desc_rings(struct stmmac_priv *priv, u32 queue)
{
@ -393,7 +393,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
int i;
netif_dbg(priv, probe, priv->dev,
@@ -1791,16 +1791,16 @@ static int __init_dma_tx_desc_rings(stru
@@ -1792,16 +1792,16 @@ static int __init_dma_tx_desc_rings(stru
if (priv->extend_desc)
stmmac_mode_init(priv, tx_q->dma_etx,
tx_q->dma_tx_phy,
@ -413,7 +413,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct dma_desc *p;
if (priv->extend_desc)
@@ -1870,12 +1870,12 @@ static int init_dma_desc_rings(struct ne
@@ -1871,12 +1871,12 @@ static int init_dma_desc_rings(struct ne
*/
static void dma_free_tx_skbufs(struct stmmac_priv *priv, u32 queue)
{
@ -428,7 +428,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_free_tx_buffer(priv, queue, i);
if (tx_q->xsk_pool && tx_q->xsk_frames_done) {
@@ -1905,7 +1905,7 @@ static void stmmac_free_tx_skbufs(struct
@@ -1906,7 +1906,7 @@ static void stmmac_free_tx_skbufs(struct
*/
static void __free_dma_rx_desc_resources(struct stmmac_priv *priv, u32 queue)
{
@ -437,7 +437,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Release the DMA RX socket buffers */
if (rx_q->xsk_pool)
@@ -1918,11 +1918,11 @@ static void __free_dma_rx_desc_resources
@@ -1919,11 +1919,11 @@ static void __free_dma_rx_desc_resources
/* Free DMA regions of consistent memory previously allocated */
if (!priv->extend_desc)
@ -451,7 +451,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
sizeof(struct dma_extended_desc),
rx_q->dma_erx, rx_q->dma_rx_phy);
@@ -1951,7 +1951,7 @@ static void free_dma_rx_desc_resources(s
@@ -1952,7 +1952,7 @@ static void free_dma_rx_desc_resources(s
*/
static void __free_dma_tx_desc_resources(struct stmmac_priv *priv, u32 queue)
{
@ -460,7 +460,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
size_t size;
void *addr;
@@ -1969,7 +1969,7 @@ static void __free_dma_tx_desc_resources
@@ -1970,7 +1970,7 @@ static void __free_dma_tx_desc_resources
addr = tx_q->dma_tx;
}
@ -469,7 +469,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
dma_free_coherent(priv->device, size, addr, tx_q->dma_tx_phy);
@@ -1998,7 +1998,7 @@ static void free_dma_tx_desc_resources(s
@@ -1999,7 +1999,7 @@ static void free_dma_tx_desc_resources(s
*/
static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv, u32 queue)
{
@ -478,7 +478,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_channel *ch = &priv->channel[queue];
bool xdp_prog = stmmac_xdp_is_enabled(priv);
struct page_pool_params pp_params = { 0 };
@@ -2010,8 +2010,8 @@ static int __alloc_dma_rx_desc_resources
@@ -2011,8 +2011,8 @@ static int __alloc_dma_rx_desc_resources
rx_q->priv_data = priv;
pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
@ -489,7 +489,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
pp_params.order = ilog2(num_pages);
pp_params.nid = dev_to_node(priv->device);
pp_params.dev = priv->device;
@@ -2026,7 +2026,7 @@ static int __alloc_dma_rx_desc_resources
@@ -2027,7 +2027,7 @@ static int __alloc_dma_rx_desc_resources
return ret;
}
@ -498,7 +498,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
sizeof(*rx_q->buf_pool),
GFP_KERNEL);
if (!rx_q->buf_pool)
@@ -2034,7 +2034,7 @@ static int __alloc_dma_rx_desc_resources
@@ -2035,7 +2035,7 @@ static int __alloc_dma_rx_desc_resources
if (priv->extend_desc) {
rx_q->dma_erx = dma_alloc_coherent(priv->device,
@ -507,7 +507,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
sizeof(struct dma_extended_desc),
&rx_q->dma_rx_phy,
GFP_KERNEL);
@@ -2043,7 +2043,7 @@ static int __alloc_dma_rx_desc_resources
@@ -2044,7 +2044,7 @@ static int __alloc_dma_rx_desc_resources
} else {
rx_q->dma_rx = dma_alloc_coherent(priv->device,
@ -516,7 +516,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
sizeof(struct dma_desc),
&rx_q->dma_rx_phy,
GFP_KERNEL);
@@ -2100,20 +2100,20 @@ err_dma:
@@ -2101,20 +2101,20 @@ err_dma:
*/
static int __alloc_dma_tx_desc_resources(struct stmmac_priv *priv, u32 queue)
{
@ -540,7 +540,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
sizeof(struct sk_buff *),
GFP_KERNEL);
if (!tx_q->tx_skbuff)
@@ -2126,7 +2126,7 @@ static int __alloc_dma_tx_desc_resources
@@ -2127,7 +2127,7 @@ static int __alloc_dma_tx_desc_resources
else
size = sizeof(struct dma_desc);
@ -549,7 +549,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
addr = dma_alloc_coherent(priv->device, size,
&tx_q->dma_tx_phy, GFP_KERNEL);
@@ -2370,7 +2370,7 @@ static void stmmac_dma_operation_mode(st
@@ -2371,7 +2371,7 @@ static void stmmac_dma_operation_mode(st
/* configure all channels */
for (chan = 0; chan < rx_channels_count; chan++) {
@ -558,7 +558,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
u32 buf_size;
qmode = priv->plat->rx_queues_cfg[chan].mode_to_use;
@@ -2385,7 +2385,7 @@ static void stmmac_dma_operation_mode(st
@@ -2386,7 +2386,7 @@ static void stmmac_dma_operation_mode(st
chan);
} else {
stmmac_set_dma_bfsize(priv, priv->ioaddr,
@ -567,7 +567,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
chan);
}
}
@@ -2401,7 +2401,7 @@ static void stmmac_dma_operation_mode(st
@@ -2402,7 +2402,7 @@ static void stmmac_dma_operation_mode(st
static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
{
struct netdev_queue *nq = netdev_get_tx_queue(priv->dev, queue);
@ -576,7 +576,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct xsk_buff_pool *pool = tx_q->xsk_pool;
unsigned int entry = tx_q->cur_tx;
struct dma_desc *tx_desc = NULL;
@@ -2476,7 +2476,7 @@ static bool stmmac_xdp_xmit_zc(struct st
@@ -2477,7 +2477,7 @@ static bool stmmac_xdp_xmit_zc(struct st
stmmac_enable_dma_transmission(priv, priv->ioaddr);
@ -585,7 +585,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
entry = tx_q->cur_tx;
}
@@ -2502,7 +2502,7 @@ static bool stmmac_xdp_xmit_zc(struct st
@@ -2503,7 +2503,7 @@ static bool stmmac_xdp_xmit_zc(struct st
*/
static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue)
{
@ -594,7 +594,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
unsigned int bytes_compl = 0, pkts_compl = 0;
unsigned int entry, xmits = 0, count = 0;
@@ -2515,7 +2515,7 @@ static int stmmac_tx_clean(struct stmmac
@@ -2516,7 +2516,7 @@ static int stmmac_tx_clean(struct stmmac
entry = tx_q->dirty_tx;
/* Try to clean all TX complete frame in 1 shot */
@ -603,7 +603,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct xdp_frame *xdpf;
struct sk_buff *skb;
struct dma_desc *p;
@@ -2615,7 +2615,7 @@ static int stmmac_tx_clean(struct stmmac
@@ -2616,7 +2616,7 @@ static int stmmac_tx_clean(struct stmmac
stmmac_release_tx_desc(priv, p, priv->mode);
@ -612,7 +612,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
tx_q->dirty_tx = entry;
@@ -2680,7 +2680,7 @@ static int stmmac_tx_clean(struct stmmac
@@ -2681,7 +2681,7 @@ static int stmmac_tx_clean(struct stmmac
*/
static void stmmac_tx_err(struct stmmac_priv *priv, u32 chan)
{
@ -621,7 +621,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, chan));
@@ -2747,8 +2747,8 @@ static int stmmac_napi_check(struct stmm
@@ -2748,8 +2748,8 @@ static int stmmac_napi_check(struct stmm
{
int status = stmmac_dma_interrupt_status(priv, priv->ioaddr,
&priv->xstats, chan, dir);
@ -632,7 +632,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_channel *ch = &priv->channel[chan];
struct napi_struct *rx_napi;
struct napi_struct *tx_napi;
@@ -2924,7 +2924,7 @@ static int stmmac_init_dma_engine(struct
@@ -2925,7 +2925,7 @@ static int stmmac_init_dma_engine(struct
/* DMA RX Channel Configuration */
for (chan = 0; chan < rx_channels_count; chan++) {
@ -641,7 +641,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
rx_q->dma_rx_phy, chan);
@@ -2938,7 +2938,7 @@ static int stmmac_init_dma_engine(struct
@@ -2939,7 +2939,7 @@ static int stmmac_init_dma_engine(struct
/* DMA TX Channel Configuration */
for (chan = 0; chan < tx_channels_count; chan++) {
@ -650,7 +650,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
tx_q->dma_tx_phy, chan);
@@ -2953,7 +2953,7 @@ static int stmmac_init_dma_engine(struct
@@ -2954,7 +2954,7 @@ static int stmmac_init_dma_engine(struct
static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue)
{
@ -659,7 +659,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
hrtimer_start(&tx_q->txtimer,
STMMAC_COAL_TIMER(priv->tx_coal_timer[queue]),
@@ -3003,7 +3003,7 @@ static void stmmac_init_coalesce(struct
@@ -3004,7 +3004,7 @@ static void stmmac_init_coalesce(struct
u32 chan;
for (chan = 0; chan < tx_channel_count; chan++) {
@ -668,7 +668,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
priv->tx_coal_frames[chan] = STMMAC_TX_FRAMES;
priv->tx_coal_timer[chan] = STMMAC_COAL_TX_TIMER;
@@ -3025,12 +3025,12 @@ static void stmmac_set_rings_length(stru
@@ -3026,12 +3026,12 @@ static void stmmac_set_rings_length(stru
/* set TX ring length */
for (chan = 0; chan < tx_channels_count; chan++)
stmmac_set_tx_ring_len(priv, priv->ioaddr,
@ -683,7 +683,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
/**
@@ -3365,7 +3365,7 @@ static int stmmac_hw_setup(struct net_de
@@ -3366,7 +3366,7 @@ static int stmmac_hw_setup(struct net_de
/* Enable TSO */
if (priv->tso) {
for (chan = 0; chan < tx_cnt; chan++) {
@ -692,7 +692,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* TSO and TBS cannot co-exist */
if (tx_q->tbs & STMMAC_TBS_AVAIL)
@@ -3387,7 +3387,7 @@ static int stmmac_hw_setup(struct net_de
@@ -3388,7 +3388,7 @@ static int stmmac_hw_setup(struct net_de
/* TBS */
for (chan = 0; chan < tx_cnt; chan++) {
@ -701,7 +701,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
int enable = tx_q->tbs & STMMAC_TBS_AVAIL;
stmmac_enable_tbs(priv, priv->ioaddr, enable, chan);
@@ -3431,7 +3431,7 @@ static void stmmac_free_irq(struct net_d
@@ -3432,7 +3432,7 @@ static void stmmac_free_irq(struct net_d
for (j = irq_idx - 1; j >= 0; j--) {
if (priv->tx_irq[j] > 0) {
irq_set_affinity_hint(priv->tx_irq[j], NULL);
@ -710,7 +710,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
}
irq_idx = priv->plat->rx_queues_to_use;
@@ -3440,7 +3440,7 @@ static void stmmac_free_irq(struct net_d
@@ -3441,7 +3441,7 @@ static void stmmac_free_irq(struct net_d
for (j = irq_idx - 1; j >= 0; j--) {
if (priv->rx_irq[j] > 0) {
irq_set_affinity_hint(priv->rx_irq[j], NULL);
@ -719,7 +719,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
}
@@ -3573,7 +3573,7 @@ static int stmmac_request_irq_multi_msi(
@@ -3574,7 +3574,7 @@ static int stmmac_request_irq_multi_msi(
sprintf(int_name, "%s:%s-%d", dev->name, "rx", i);
ret = request_irq(priv->rx_irq[i],
stmmac_msi_intr_rx,
@ -728,7 +728,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (unlikely(ret < 0)) {
netdev_err(priv->dev,
"%s: alloc rx-%d MSI %d (error: %d)\n",
@@ -3596,7 +3596,7 @@ static int stmmac_request_irq_multi_msi(
@@ -3597,7 +3597,7 @@ static int stmmac_request_irq_multi_msi(
sprintf(int_name, "%s:%s-%d", dev->name, "tx", i);
ret = request_irq(priv->tx_irq[i],
stmmac_msi_intr_tx,
@ -737,7 +737,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (unlikely(ret < 0)) {
netdev_err(priv->dev,
"%s: alloc tx-%d MSI %d (error: %d)\n",
@@ -3727,21 +3727,21 @@ static int stmmac_open(struct net_device
@@ -3728,21 +3728,21 @@ static int stmmac_open(struct net_device
bfsize = 0;
if (bfsize < BUF_SIZE_16KiB)
@ -766,7 +766,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
int tbs_en = priv->plat->tx_queues_cfg[chan].tbs_en;
/* Setup per-TXQ tbs flag before TX descriptor alloc */
@@ -3799,7 +3799,7 @@ irq_error:
@@ -3800,7 +3800,7 @@ irq_error:
phylink_stop(priv->phylink);
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
@ -775,7 +775,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_hw_teardown(dev);
init_error:
@@ -3841,7 +3841,7 @@ static int stmmac_release(struct net_dev
@@ -3842,7 +3842,7 @@ static int stmmac_release(struct net_dev
stmmac_disable_all_queues(priv);
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
@ -784,7 +784,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
netif_tx_disable(dev);
@@ -3905,7 +3905,7 @@ static bool stmmac_vlan_insert(struct st
@@ -3906,7 +3906,7 @@ static bool stmmac_vlan_insert(struct st
return false;
stmmac_set_tx_owner(priv, p);
@ -793,7 +793,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
return true;
}
@@ -3923,7 +3923,7 @@ static bool stmmac_vlan_insert(struct st
@@ -3924,7 +3924,7 @@ static bool stmmac_vlan_insert(struct st
static void stmmac_tso_allocator(struct stmmac_priv *priv, dma_addr_t des,
int total_len, bool last_segment, u32 queue)
{
@ -802,7 +802,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct dma_desc *desc;
u32 buff_size;
int tmp_len;
@@ -3934,7 +3934,7 @@ static void stmmac_tso_allocator(struct
@@ -3935,7 +3935,7 @@ static void stmmac_tso_allocator(struct
dma_addr_t curr_addr;
tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx,
@ -811,7 +811,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
WARN_ON(tx_q->tx_skbuff[tx_q->cur_tx]);
if (tx_q->tbs & STMMAC_TBS_AVAIL)
@@ -3962,7 +3962,7 @@ static void stmmac_tso_allocator(struct
@@ -3963,7 +3963,7 @@ static void stmmac_tso_allocator(struct
static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue)
{
@ -820,7 +820,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
int desc_size;
if (likely(priv->extend_desc))
@@ -4024,7 +4024,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
@@ -4025,7 +4025,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
dma_addr_t des;
int i;
@ -829,7 +829,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
first_tx = tx_q->cur_tx;
/* Compute header lengths */
@@ -4064,7 +4064,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
@@ -4065,7 +4065,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
stmmac_set_mss(priv, mss_desc, mss);
tx_q->mss = mss;
tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx,
@ -838,7 +838,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
WARN_ON(tx_q->tx_skbuff[tx_q->cur_tx]);
}
@@ -4176,7 +4176,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
@@ -4177,7 +4177,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
* ndo_start_xmit will fill this descriptor the next time it's
* called and stmmac_tx_clean may clean up to this descriptor.
*/
@ -847,7 +847,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (unlikely(stmmac_tx_avail(priv, queue) <= (MAX_SKB_FRAGS + 1))) {
netif_dbg(priv, hw, priv->dev, "%s: stop transmitted packets\n",
@@ -4264,7 +4264,7 @@ static netdev_tx_t stmmac_xmit(struct sk
@@ -4265,7 +4265,7 @@ static netdev_tx_t stmmac_xmit(struct sk
int entry, first_tx;
dma_addr_t des;
@ -856,7 +856,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
first_tx = tx_q->cur_tx;
if (priv->tx_path_in_lpi_mode && priv->eee_sw_timer_en)
@@ -4327,7 +4327,7 @@ static netdev_tx_t stmmac_xmit(struct sk
@@ -4328,7 +4328,7 @@ static netdev_tx_t stmmac_xmit(struct sk
int len = skb_frag_size(frag);
bool last_segment = (i == (nfrags - 1));
@ -865,7 +865,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
WARN_ON(tx_q->tx_skbuff[entry]);
if (likely(priv->extend_desc))
@@ -4398,7 +4398,7 @@ static netdev_tx_t stmmac_xmit(struct sk
@@ -4399,7 +4399,7 @@ static netdev_tx_t stmmac_xmit(struct sk
* ndo_start_xmit will fill this descriptor the next time it's
* called and stmmac_tx_clean may clean up to this descriptor.
*/
@ -874,7 +874,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tx_q->cur_tx = entry;
if (netif_msg_pktdata(priv)) {
@@ -4513,7 +4513,7 @@ static void stmmac_rx_vlan(struct net_de
@@ -4514,7 +4514,7 @@ static void stmmac_rx_vlan(struct net_de
*/
static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue)
{
@ -883,7 +883,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
int dirty = stmmac_rx_dirty(priv, queue);
unsigned int entry = rx_q->dirty_rx;
@@ -4563,7 +4563,7 @@ static inline void stmmac_rx_refill(stru
@@ -4564,7 +4564,7 @@ static inline void stmmac_rx_refill(stru
dma_wmb();
stmmac_set_rx_owner(priv, p, use_rx_wd);
@ -892,7 +892,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
rx_q->dirty_rx = entry;
rx_q->rx_tail_addr = rx_q->dma_rx_phy +
@@ -4591,12 +4591,12 @@ static unsigned int stmmac_rx_buf1_len(s
@@ -4592,12 +4592,12 @@ static unsigned int stmmac_rx_buf1_len(s
/* First descriptor, not last descriptor and not split header */
if (status & rx_not_ls)
@ -907,7 +907,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
static unsigned int stmmac_rx_buf2_len(struct stmmac_priv *priv,
@@ -4612,7 +4612,7 @@ static unsigned int stmmac_rx_buf2_len(s
@@ -4613,7 +4613,7 @@ static unsigned int stmmac_rx_buf2_len(s
/* Not last descriptor */
if (status & rx_not_ls)
@ -916,7 +916,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
plen = stmmac_get_rx_frame_len(priv, p, coe);
@@ -4623,7 +4623,7 @@ static unsigned int stmmac_rx_buf2_len(s
@@ -4624,7 +4624,7 @@ static unsigned int stmmac_rx_buf2_len(s
static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
struct xdp_frame *xdpf, bool dma_map)
{
@ -925,7 +925,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
unsigned int entry = tx_q->cur_tx;
struct dma_desc *tx_desc;
dma_addr_t dma_addr;
@@ -4686,7 +4686,7 @@ static int stmmac_xdp_xmit_xdpf(struct s
@@ -4687,7 +4687,7 @@ static int stmmac_xdp_xmit_xdpf(struct s
stmmac_enable_dma_transmission(priv, priv->ioaddr);
@ -934,7 +934,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tx_q->cur_tx = entry;
return STMMAC_XDP_TX;
@@ -4860,7 +4860,7 @@ static void stmmac_dispatch_skb_zc(struc
@@ -4861,7 +4861,7 @@ static void stmmac_dispatch_skb_zc(struc
static bool stmmac_rx_refill_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
{
@ -943,7 +943,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
unsigned int entry = rx_q->dirty_rx;
struct dma_desc *rx_desc = NULL;
bool ret = true;
@@ -4903,7 +4903,7 @@ static bool stmmac_rx_refill_zc(struct s
@@ -4904,7 +4904,7 @@ static bool stmmac_rx_refill_zc(struct s
dma_wmb();
stmmac_set_rx_owner(priv, rx_desc, use_rx_wd);
@ -952,7 +952,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
if (rx_desc) {
@@ -4918,7 +4918,7 @@ static bool stmmac_rx_refill_zc(struct s
@@ -4919,7 +4919,7 @@ static bool stmmac_rx_refill_zc(struct s
static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
{
@ -961,7 +961,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
unsigned int count = 0, error = 0, len = 0;
int dirty = stmmac_rx_dirty(priv, queue);
unsigned int next_entry = rx_q->cur_rx;
@@ -4940,7 +4940,7 @@ static int stmmac_rx_zc(struct stmmac_pr
@@ -4941,7 +4941,7 @@ static int stmmac_rx_zc(struct stmmac_pr
desc_size = sizeof(struct dma_desc);
}
@ -970,7 +970,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
rx_q->dma_rx_phy, desc_size);
}
while (count < limit) {
@@ -4987,7 +4987,7 @@ read_again:
@@ -4988,7 +4988,7 @@ read_again:
/* Prefetch the next RX descriptor */
rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
@ -979,7 +979,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
next_entry = rx_q->cur_rx;
if (priv->extend_desc)
@@ -5108,7 +5108,7 @@ read_again:
@@ -5109,7 +5109,7 @@ read_again:
*/
static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
{
@ -988,7 +988,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_channel *ch = &priv->channel[queue];
unsigned int count = 0, error = 0, len = 0;
int status = 0, coe = priv->hw->rx_csum;
@@ -5121,7 +5121,7 @@ static int stmmac_rx(struct stmmac_priv
@@ -5122,7 +5122,7 @@ static int stmmac_rx(struct stmmac_priv
int buf_sz;
dma_dir = page_pool_get_dma_dir(rx_q->page_pool);
@ -997,7 +997,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (netif_msg_rx_status(priv)) {
void *rx_head;
@@ -5135,7 +5135,7 @@ static int stmmac_rx(struct stmmac_priv
@@ -5136,7 +5136,7 @@ static int stmmac_rx(struct stmmac_priv
desc_size = sizeof(struct dma_desc);
}
@ -1006,7 +1006,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
rx_q->dma_rx_phy, desc_size);
}
while (count < limit) {
@@ -5179,7 +5179,7 @@ read_again:
@@ -5180,7 +5180,7 @@ read_again:
break;
rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
@ -1015,7 +1015,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
next_entry = rx_q->cur_rx;
if (priv->extend_desc)
@@ -5313,7 +5313,7 @@ read_again:
@@ -5314,7 +5314,7 @@ read_again:
buf1_len, dma_dir);
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
buf->page, buf->page_offset, buf1_len,
@ -1024,7 +1024,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Data payload appended into SKB */
page_pool_release_page(rx_q->page_pool, buf->page);
@@ -5325,7 +5325,7 @@ read_again:
@@ -5326,7 +5326,7 @@ read_again:
buf2_len, dma_dir);
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
buf->sec_page, 0, buf2_len,
@ -1033,7 +1033,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Data payload appended into SKB */
page_pool_release_page(rx_q->page_pool, buf->sec_page);
@@ -5767,11 +5767,13 @@ static irqreturn_t stmmac_safety_interru
@@ -5768,11 +5768,13 @@ static irqreturn_t stmmac_safety_interru
static irqreturn_t stmmac_msi_intr_tx(int irq, void *data)
{
struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)data;
@ -1048,7 +1048,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (unlikely(!data)) {
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
@@ -5811,10 +5813,12 @@ static irqreturn_t stmmac_msi_intr_tx(in
@@ -5812,10 +5814,12 @@ static irqreturn_t stmmac_msi_intr_tx(in
static irqreturn_t stmmac_msi_intr_rx(int irq, void *data)
{
struct stmmac_rx_queue *rx_q = (struct stmmac_rx_queue *)data;
@ -1062,7 +1062,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (unlikely(!data)) {
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
@@ -5845,10 +5849,10 @@ static void stmmac_poll_controller(struc
@@ -5846,10 +5850,10 @@ static void stmmac_poll_controller(struc
if (priv->plat->multi_msi_en) {
for (i = 0; i < priv->plat->rx_queues_to_use; i++)
@ -1075,7 +1075,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
} else {
disable_irq(dev->irq);
stmmac_interrupt(dev->irq, dev);
@@ -6029,34 +6033,34 @@ static int stmmac_rings_status_show(stru
@@ -6030,34 +6034,34 @@ static int stmmac_rings_status_show(stru
return 0;
for (queue = 0; queue < rx_count; queue++) {
@ -1116,7 +1116,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
}
@@ -6397,7 +6401,7 @@ void stmmac_disable_rx_queue(struct stmm
@@ -6398,7 +6402,7 @@ void stmmac_disable_rx_queue(struct stmm
void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
{
@ -1125,7 +1125,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_channel *ch = &priv->channel[queue];
unsigned long flags;
u32 buf_size;
@@ -6434,7 +6438,7 @@ void stmmac_enable_rx_queue(struct stmma
@@ -6435,7 +6439,7 @@ void stmmac_enable_rx_queue(struct stmma
rx_q->queue_index);
} else {
stmmac_set_dma_bfsize(priv, priv->ioaddr,
@ -1134,7 +1134,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
rx_q->queue_index);
}
@@ -6460,7 +6464,7 @@ void stmmac_disable_tx_queue(struct stmm
@@ -6461,7 +6465,7 @@ void stmmac_disable_tx_queue(struct stmm
void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
{
@ -1143,7 +1143,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_channel *ch = &priv->channel[queue];
unsigned long flags;
int ret;
@@ -6510,7 +6514,7 @@ void stmmac_xdp_release(struct net_devic
@@ -6511,7 +6515,7 @@ void stmmac_xdp_release(struct net_devic
stmmac_disable_all_queues(priv);
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
@ -1152,7 +1152,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Free the IRQ lines */
stmmac_free_irq(dev, REQ_IRQ_ERR_ALL, 0);
@@ -6569,7 +6573,7 @@ int stmmac_xdp_open(struct net_device *d
@@ -6570,7 +6574,7 @@ int stmmac_xdp_open(struct net_device *d
/* DMA RX Channel Configuration */
for (chan = 0; chan < rx_cnt; chan++) {
@ -1161,7 +1161,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
rx_q->dma_rx_phy, chan);
@@ -6587,7 +6591,7 @@ int stmmac_xdp_open(struct net_device *d
@@ -6588,7 +6592,7 @@ int stmmac_xdp_open(struct net_device *d
rx_q->queue_index);
} else {
stmmac_set_dma_bfsize(priv, priv->ioaddr,
@ -1170,7 +1170,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
rx_q->queue_index);
}
@@ -6596,7 +6600,7 @@ int stmmac_xdp_open(struct net_device *d
@@ -6597,7 +6601,7 @@ int stmmac_xdp_open(struct net_device *d
/* DMA TX Channel Configuration */
for (chan = 0; chan < tx_cnt; chan++) {
@ -1179,7 +1179,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
tx_q->dma_tx_phy, chan);
@@ -6629,7 +6633,7 @@ int stmmac_xdp_open(struct net_device *d
@@ -6630,7 +6634,7 @@ int stmmac_xdp_open(struct net_device *d
irq_error:
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
@ -1188,7 +1188,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_hw_teardown(dev);
init_error:
@@ -6656,8 +6660,8 @@ int stmmac_xsk_wakeup(struct net_device
@@ -6657,8 +6661,8 @@ int stmmac_xsk_wakeup(struct net_device
queue >= priv->plat->tx_queues_to_use)
return -EINVAL;
@ -1199,7 +1199,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
ch = &priv->channel[queue];
if (!rx_q->xsk_pool && !tx_q->xsk_pool)
@@ -6913,8 +6917,8 @@ int stmmac_reinit_ringparam(struct net_d
@@ -6914,8 +6918,8 @@ int stmmac_reinit_ringparam(struct net_d
if (netif_running(dev))
stmmac_release(dev);
@ -1210,7 +1210,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (netif_running(dev))
ret = stmmac_open(dev);
@@ -7352,7 +7356,7 @@ int stmmac_suspend(struct device *dev)
@@ -7353,7 +7357,7 @@ int stmmac_suspend(struct device *dev)
stmmac_disable_all_queues(priv);
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
@ -1219,7 +1219,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (priv->eee_enabled) {
priv->tx_path_in_lpi_mode = false;
@@ -7403,7 +7407,7 @@ EXPORT_SYMBOL_GPL(stmmac_suspend);
@@ -7404,7 +7408,7 @@ EXPORT_SYMBOL_GPL(stmmac_suspend);
static void stmmac_reset_rx_queue(struct stmmac_priv *priv, u32 queue)
{
@ -1228,7 +1228,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
rx_q->cur_rx = 0;
rx_q->dirty_rx = 0;
@@ -7411,7 +7415,7 @@ static void stmmac_reset_rx_queue(struct
@@ -7412,7 +7416,7 @@ static void stmmac_reset_rx_queue(struct
static void stmmac_reset_tx_queue(struct stmmac_priv *priv, u32 queue)
{

View File

@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1299,7 +1299,8 @@ static int stmmac_phy_setup(struct stmma
@@ -1300,7 +1300,8 @@ static int stmmac_phy_setup(struct stmma
return 0;
}
@ -27,7 +27,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
{
u32 rx_cnt = priv->plat->rx_queues_to_use;
unsigned int desc_size;
@@ -1308,7 +1309,7 @@ static void stmmac_display_rx_rings(stru
@@ -1309,7 +1310,7 @@ static void stmmac_display_rx_rings(stru
/* Display RX rings */
for (queue = 0; queue < rx_cnt; queue++) {
@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
pr_info("\tRX Queue %u rings\n", queue);
@@ -1321,12 +1322,13 @@ static void stmmac_display_rx_rings(stru
@@ -1322,12 +1323,13 @@ static void stmmac_display_rx_rings(stru
}
/* Display RX ring */
@ -52,7 +52,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
{
u32 tx_cnt = priv->plat->tx_queues_to_use;
unsigned int desc_size;
@@ -1335,7 +1337,7 @@ static void stmmac_display_tx_rings(stru
@@ -1336,7 +1338,7 @@ static void stmmac_display_tx_rings(stru
/* Display TX rings */
for (queue = 0; queue < tx_cnt; queue++) {
@ -61,7 +61,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
pr_info("\tTX Queue %d rings\n", queue);
@@ -1350,18 +1352,19 @@ static void stmmac_display_tx_rings(stru
@@ -1351,18 +1353,19 @@ static void stmmac_display_tx_rings(stru
desc_size = sizeof(struct dma_desc);
}
@ -85,7 +85,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
static int stmmac_set_bfsize(int mtu, int bufsize)
@@ -1385,44 +1388,50 @@ static int stmmac_set_bfsize(int mtu, in
@@ -1386,44 +1389,50 @@ static int stmmac_set_bfsize(int mtu, in
/**
* stmmac_clear_rx_descriptors - clear RX descriptors
* @priv: driver private structure
@ -147,7 +147,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct dma_desc *p;
if (priv->extend_desc)
@@ -1439,10 +1448,12 @@ static void stmmac_clear_tx_descriptors(
@@ -1440,10 +1449,12 @@ static void stmmac_clear_tx_descriptors(
/**
* stmmac_clear_descriptors - clear descriptors
* @priv: driver private structure
@ -161,7 +161,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
{
u32 rx_queue_cnt = priv->plat->rx_queues_to_use;
u32 tx_queue_cnt = priv->plat->tx_queues_to_use;
@@ -1450,16 +1461,17 @@ static void stmmac_clear_descriptors(str
@@ -1451,16 +1462,17 @@ static void stmmac_clear_descriptors(str
/* Clear the RX descriptors */
for (queue = 0; queue < rx_queue_cnt; queue++)
@ -181,7 +181,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
* @p: descriptor pointer
* @i: descriptor index
* @flags: gfp flag
@@ -1467,10 +1479,12 @@ static void stmmac_clear_descriptors(str
@@ -1468,10 +1480,12 @@ static void stmmac_clear_descriptors(str
* Description: this function is called to allocate a receive buffer, perform
* the DMA mapping and init the descriptor.
*/
@ -196,7 +196,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
if (!buf->page) {
@@ -1495,7 +1509,7 @@ static int stmmac_init_rx_buffers(struct
@@ -1496,7 +1510,7 @@ static int stmmac_init_rx_buffers(struct
buf->addr = page_pool_get_dma_addr(buf->page) + buf->page_offset;
stmmac_set_desc_addr(priv, p, buf->addr);
@ -205,7 +205,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_init_desc3(priv, p);
return 0;
@@ -1504,12 +1518,13 @@ static int stmmac_init_rx_buffers(struct
@@ -1505,12 +1519,13 @@ static int stmmac_init_rx_buffers(struct
/**
* stmmac_free_rx_buffer - free RX dma buffers
* @priv: private structure
@ -222,7 +222,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
if (buf->page)
@@ -1524,12 +1539,15 @@ static void stmmac_free_rx_buffer(struct
@@ -1525,12 +1540,15 @@ static void stmmac_free_rx_buffer(struct
/**
* stmmac_free_tx_buffer - free RX dma buffers
* @priv: private structure
@ -240,7 +240,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (tx_q->tx_skbuff_dma[i].buf &&
tx_q->tx_skbuff_dma[i].buf_type != STMMAC_TXBUF_T_XDP_TX) {
@@ -1568,23 +1586,28 @@ static void stmmac_free_tx_buffer(struct
@@ -1569,23 +1587,28 @@ static void stmmac_free_tx_buffer(struct
/**
* dma_free_rx_skbufs - free RX dma buffers
* @priv: private structure
@ -276,7 +276,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct dma_desc *p;
int ret;
@@ -1593,7 +1616,7 @@ static int stmmac_alloc_rx_buffers(struc
@@ -1594,7 +1617,7 @@ static int stmmac_alloc_rx_buffers(struc
else
p = rx_q->dma_rx + i;
@ -285,7 +285,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
queue);
if (ret)
return ret;
@@ -1607,14 +1630,17 @@ static int stmmac_alloc_rx_buffers(struc
@@ -1608,14 +1631,17 @@ static int stmmac_alloc_rx_buffers(struc
/**
* dma_free_rx_xskbufs - free RX dma buffers from XSK pool
* @priv: private structure
@ -306,7 +306,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
if (!buf->xdp)
@@ -1625,12 +1651,14 @@ static void dma_free_rx_xskbufs(struct s
@@ -1626,12 +1652,14 @@ static void dma_free_rx_xskbufs(struct s
}
}
@ -324,7 +324,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_rx_buffer *buf;
dma_addr_t dma_addr;
struct dma_desc *p;
@@ -1665,22 +1693,25 @@ static struct xsk_buff_pool *stmmac_get_
@@ -1666,22 +1694,25 @@ static struct xsk_buff_pool *stmmac_get_
/**
* __init_dma_rx_desc_rings - init the RX descriptor ring (per queue)
* @priv: driver private structure
@ -353,7 +353,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
xdp_rxq_info_unreg_mem_model(&rx_q->xdp_rxq);
@@ -1707,9 +1738,9 @@ static int __init_dma_rx_desc_rings(stru
@@ -1708,9 +1739,9 @@ static int __init_dma_rx_desc_rings(stru
/* RX XDP ZC buffer pool may not be populated, e.g.
* xdpsock TX-only.
*/
@ -365,7 +365,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (ret < 0)
return -ENOMEM;
}
@@ -1719,17 +1750,19 @@ static int __init_dma_rx_desc_rings(stru
@@ -1720,17 +1751,19 @@ static int __init_dma_rx_desc_rings(stru
if (priv->extend_desc)
stmmac_mode_init(priv, rx_q->dma_erx,
rx_q->dma_rx_phy,
@ -388,7 +388,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
{
struct stmmac_priv *priv = netdev_priv(dev);
u32 rx_count = priv->plat->rx_queues_to_use;
@@ -1741,7 +1774,7 @@ static int init_dma_rx_desc_rings(struct
@@ -1742,7 +1775,7 @@ static int init_dma_rx_desc_rings(struct
"SKB addresses:\nskb\t\tskb data\tdma data\n");
for (queue = 0; queue < rx_count; queue++) {
@ -397,7 +397,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (ret)
goto err_init_rx_buffers;
}
@@ -1750,12 +1783,12 @@ static int init_dma_rx_desc_rings(struct
@@ -1751,12 +1784,12 @@ static int init_dma_rx_desc_rings(struct
err_init_rx_buffers:
while (queue >= 0) {
@ -413,7 +413,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
rx_q->buf_alloc_num = 0;
rx_q->xsk_pool = NULL;
@@ -1772,14 +1805,17 @@ err_init_rx_buffers:
@@ -1773,14 +1806,17 @@ err_init_rx_buffers:
/**
* __init_dma_tx_desc_rings - init the TX descriptor ring (per queue)
* @priv: driver private structure
@ -434,7 +434,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
int i;
netif_dbg(priv, probe, priv->dev,
@@ -1791,16 +1827,16 @@ static int __init_dma_tx_desc_rings(stru
@@ -1792,16 +1828,16 @@ static int __init_dma_tx_desc_rings(stru
if (priv->extend_desc)
stmmac_mode_init(priv, tx_q->dma_etx,
tx_q->dma_tx_phy,
@ -454,7 +454,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct dma_desc *p;
if (priv->extend_desc)
@@ -1822,7 +1858,8 @@ static int __init_dma_tx_desc_rings(stru
@@ -1823,7 +1859,8 @@ static int __init_dma_tx_desc_rings(stru
return 0;
}
@ -464,7 +464,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
{
struct stmmac_priv *priv = netdev_priv(dev);
u32 tx_queue_cnt;
@@ -1831,7 +1868,7 @@ static int init_dma_tx_desc_rings(struct
@@ -1832,7 +1869,7 @@ static int init_dma_tx_desc_rings(struct
tx_queue_cnt = priv->plat->tx_queues_to_use;
for (queue = 0; queue < tx_queue_cnt; queue++)
@ -473,7 +473,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
return 0;
}
@@ -1839,26 +1876,29 @@ static int init_dma_tx_desc_rings(struct
@@ -1840,26 +1877,29 @@ static int init_dma_tx_desc_rings(struct
/**
* init_dma_desc_rings - init the RX/TX descriptor rings
* @dev: net device structure
@ -508,7 +508,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
return ret;
}
@@ -1866,17 +1906,20 @@ static int init_dma_desc_rings(struct ne
@@ -1867,17 +1907,20 @@ static int init_dma_desc_rings(struct ne
/**
* dma_free_tx_skbufs - free TX dma buffers
* @priv: private structure
@ -533,7 +533,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (tx_q->xsk_pool && tx_q->xsk_frames_done) {
xsk_tx_completed(tx_q->xsk_pool, tx_q->xsk_frames_done);
@@ -1895,34 +1938,37 @@ static void stmmac_free_tx_skbufs(struct
@@ -1896,34 +1939,37 @@ static void stmmac_free_tx_skbufs(struct
u32 queue;
for (queue = 0; queue < tx_queue_cnt; queue++)
@ -578,7 +578,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
sizeof(struct dma_extended_desc),
rx_q->dma_erx, rx_q->dma_rx_phy);
@@ -1934,29 +1980,33 @@ static void __free_dma_rx_desc_resources
@@ -1935,29 +1981,33 @@ static void __free_dma_rx_desc_resources
page_pool_destroy(rx_q->page_pool);
}
@ -617,7 +617,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (priv->extend_desc) {
size = sizeof(struct dma_extended_desc);
@@ -1969,7 +2019,7 @@ static void __free_dma_tx_desc_resources
@@ -1970,7 +2020,7 @@ static void __free_dma_tx_desc_resources
addr = tx_q->dma_tx;
}
@ -626,7 +626,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
dma_free_coherent(priv->device, size, addr, tx_q->dma_tx_phy);
@@ -1977,28 +2027,32 @@ static void __free_dma_tx_desc_resources
@@ -1978,28 +2028,32 @@ static void __free_dma_tx_desc_resources
kfree(tx_q->tx_skbuff);
}
@ -663,7 +663,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct stmmac_channel *ch = &priv->channel[queue];
bool xdp_prog = stmmac_xdp_is_enabled(priv);
struct page_pool_params pp_params = { 0 };
@@ -2010,8 +2064,8 @@ static int __alloc_dma_rx_desc_resources
@@ -2011,8 +2065,8 @@ static int __alloc_dma_rx_desc_resources
rx_q->priv_data = priv;
pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
@ -674,7 +674,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
pp_params.order = ilog2(num_pages);
pp_params.nid = dev_to_node(priv->device);
pp_params.dev = priv->device;
@@ -2026,7 +2080,7 @@ static int __alloc_dma_rx_desc_resources
@@ -2027,7 +2081,7 @@ static int __alloc_dma_rx_desc_resources
return ret;
}
@ -683,7 +683,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
sizeof(*rx_q->buf_pool),
GFP_KERNEL);
if (!rx_q->buf_pool)
@@ -2034,7 +2088,7 @@ static int __alloc_dma_rx_desc_resources
@@ -2035,7 +2089,7 @@ static int __alloc_dma_rx_desc_resources
if (priv->extend_desc) {
rx_q->dma_erx = dma_alloc_coherent(priv->device,
@ -692,7 +692,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
sizeof(struct dma_extended_desc),
&rx_q->dma_rx_phy,
GFP_KERNEL);
@@ -2043,7 +2097,7 @@ static int __alloc_dma_rx_desc_resources
@@ -2044,7 +2098,7 @@ static int __alloc_dma_rx_desc_resources
} else {
rx_q->dma_rx = dma_alloc_coherent(priv->device,
@ -701,7 +701,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
sizeof(struct dma_desc),
&rx_q->dma_rx_phy,
GFP_KERNEL);
@@ -2068,7 +2122,8 @@ static int __alloc_dma_rx_desc_resources
@@ -2069,7 +2123,8 @@ static int __alloc_dma_rx_desc_resources
return 0;
}
@ -711,7 +711,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
{
u32 rx_count = priv->plat->rx_queues_to_use;
u32 queue;
@@ -2076,7 +2131,7 @@ static int alloc_dma_rx_desc_resources(s
@@ -2077,7 +2132,7 @@ static int alloc_dma_rx_desc_resources(s
/* RX queues buffers and DMA */
for (queue = 0; queue < rx_count; queue++) {
@ -720,7 +720,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (ret)
goto err_dma;
}
@@ -2084,7 +2139,7 @@ static int alloc_dma_rx_desc_resources(s
@@ -2085,7 +2140,7 @@ static int alloc_dma_rx_desc_resources(s
return 0;
err_dma:
@ -729,7 +729,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
return ret;
}
@@ -2092,28 +2147,31 @@ err_dma:
@@ -2093,28 +2148,31 @@ err_dma:
/**
* __alloc_dma_tx_desc_resources - alloc TX resources (per queue).
* @priv: private structure
@ -765,7 +765,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
sizeof(struct sk_buff *),
GFP_KERNEL);
if (!tx_q->tx_skbuff)
@@ -2126,7 +2184,7 @@ static int __alloc_dma_tx_desc_resources
@@ -2127,7 +2185,7 @@ static int __alloc_dma_tx_desc_resources
else
size = sizeof(struct dma_desc);
@ -774,7 +774,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
addr = dma_alloc_coherent(priv->device, size,
&tx_q->dma_tx_phy, GFP_KERNEL);
@@ -2143,7 +2201,8 @@ static int __alloc_dma_tx_desc_resources
@@ -2144,7 +2202,8 @@ static int __alloc_dma_tx_desc_resources
return 0;
}
@ -784,7 +784,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
{
u32 tx_count = priv->plat->tx_queues_to_use;
u32 queue;
@@ -2151,7 +2210,7 @@ static int alloc_dma_tx_desc_resources(s
@@ -2152,7 +2211,7 @@ static int alloc_dma_tx_desc_resources(s
/* TX queues buffers and DMA */
for (queue = 0; queue < tx_count; queue++) {
@ -793,7 +793,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (ret)
goto err_dma;
}
@@ -2159,27 +2218,29 @@ static int alloc_dma_tx_desc_resources(s
@@ -2160,27 +2219,29 @@ static int alloc_dma_tx_desc_resources(s
return 0;
err_dma:
@ -827,7 +827,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
return ret;
}
@@ -2187,16 +2248,18 @@ static int alloc_dma_desc_resources(stru
@@ -2188,16 +2249,18 @@ static int alloc_dma_desc_resources(stru
/**
* free_dma_desc_resources - free dma desc resources
* @priv: private structure
@ -849,7 +849,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
/**
@@ -2685,8 +2748,8 @@ static void stmmac_tx_err(struct stmmac_
@@ -2686,8 +2749,8 @@ static void stmmac_tx_err(struct stmmac_
netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, chan));
stmmac_stop_tx_dma(priv, chan);
@ -860,7 +860,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_reset_tx_queue(priv, chan);
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
tx_q->dma_tx_phy, chan);
@@ -3683,19 +3746,93 @@ static int stmmac_request_irq(struct net
@@ -3684,19 +3747,93 @@ static int stmmac_request_irq(struct net
}
/**
@ -957,7 +957,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
u32 chan;
int ret;
@@ -3722,45 +3859,10 @@ static int stmmac_open(struct net_device
@@ -3723,45 +3860,10 @@ static int stmmac_open(struct net_device
memset(&priv->xstats, 0, sizeof(struct stmmac_extra_stats));
priv->xstats.threshold = tc;
@ -1005,7 +1005,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (priv->plat->serdes_powerup) {
ret = priv->plat->serdes_powerup(dev, priv->plat->bsp_priv);
@@ -3803,14 +3905,28 @@ irq_error:
@@ -3804,14 +3906,28 @@ irq_error:
stmmac_hw_teardown(dev);
init_error:
@ -1036,7 +1036,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static void stmmac_fpe_stop_wq(struct stmmac_priv *priv)
{
set_bit(__FPE_REMOVING, &priv->fpe_task_state);
@@ -3857,7 +3973,7 @@ static int stmmac_release(struct net_dev
@@ -3858,7 +3974,7 @@ static int stmmac_release(struct net_dev
stmmac_stop_all_dma(priv);
/* Release and free the Rx/Tx resources */
@ -1045,7 +1045,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Disable the MAC Rx/Tx */
stmmac_mac_set(priv, priv->ioaddr, false);
@@ -6396,7 +6512,7 @@ void stmmac_disable_rx_queue(struct stmm
@@ -6397,7 +6513,7 @@ void stmmac_disable_rx_queue(struct stmm
spin_unlock_irqrestore(&ch->lock, flags);
stmmac_stop_rx_dma(priv, queue);
@ -1054,7 +1054,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
@@ -6407,21 +6523,21 @@ void stmmac_enable_rx_queue(struct stmma
@@ -6408,21 +6524,21 @@ void stmmac_enable_rx_queue(struct stmma
u32 buf_size;
int ret;
@ -1080,7 +1080,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
rx_q->dma_rx_phy, rx_q->queue_index);
@@ -6459,7 +6575,7 @@ void stmmac_disable_tx_queue(struct stmm
@@ -6460,7 +6576,7 @@ void stmmac_disable_tx_queue(struct stmm
spin_unlock_irqrestore(&ch->lock, flags);
stmmac_stop_tx_dma(priv, queue);
@ -1089,7 +1089,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
@@ -6469,21 +6585,21 @@ void stmmac_enable_tx_queue(struct stmma
@@ -6470,21 +6586,21 @@ void stmmac_enable_tx_queue(struct stmma
unsigned long flags;
int ret;
@ -1115,7 +1115,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
tx_q->dma_tx_phy, tx_q->queue_index);
@@ -6523,7 +6639,7 @@ void stmmac_xdp_release(struct net_devic
@@ -6524,7 +6640,7 @@ void stmmac_xdp_release(struct net_devic
stmmac_stop_all_dma(priv);
/* Release and free the Rx/Tx resources */
@ -1124,7 +1124,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Disable the MAC Rx/Tx */
stmmac_mac_set(priv, priv->ioaddr, false);
@@ -6548,14 +6664,14 @@ int stmmac_xdp_open(struct net_device *d
@@ -6549,14 +6665,14 @@ int stmmac_xdp_open(struct net_device *d
u32 chan;
int ret;
@ -1141,7 +1141,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (ret < 0) {
netdev_err(dev, "%s: DMA descriptors initialization failed\n",
__func__);
@@ -6637,7 +6753,7 @@ irq_error:
@@ -6638,7 +6754,7 @@ irq_error:
stmmac_hw_teardown(dev);
init_error:
@ -1150,7 +1150,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
dma_desc_error:
return ret;
}
@@ -7498,7 +7614,7 @@ int stmmac_resume(struct device *dev)
@@ -7499,7 +7615,7 @@ int stmmac_resume(struct device *dev)
stmmac_reset_queues_param(priv);
stmmac_free_tx_skbufs(priv);

View File

@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5625,18 +5625,15 @@ static int stmmac_change_mtu(struct net_
@@ -5626,18 +5626,15 @@ static int stmmac_change_mtu(struct net_
{
struct stmmac_priv *priv = netdev_priv(dev);
int txfifosz = priv->plat->tx_fifo_size;
@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (stmmac_xdp_is_enabled(priv) && new_mtu > ETH_DATA_LEN) {
netdev_dbg(priv->dev, "Jumbo frames not supported for XDP\n");
return -EINVAL;
@@ -5648,8 +5645,29 @@ static int stmmac_change_mtu(struct net_
@@ -5649,8 +5646,29 @@ static int stmmac_change_mtu(struct net_
if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
return -EINVAL;

View File

@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2711,9 +2711,6 @@ mt7531_mac_config(struct dsa_switch *ds,
@@ -2716,9 +2716,6 @@ mt7531_mac_config(struct dsa_switch *ds,
case PHY_INTERFACE_MODE_NA:
case PHY_INTERFACE_MODE_1000BASEX:
case PHY_INTERFACE_MODE_2500BASEX:
@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return mt7531_sgmii_setup_mode_force(priv, port, interface);
default:
return -EINVAL;
@@ -2789,13 +2786,6 @@ unsupported:
@@ -2794,13 +2791,6 @@ unsupported:
return;
}
@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
mcr_new = mcr_cur;
mcr_new &= ~PMCR_LINK_SETTINGS_MASK;
@@ -2932,6 +2922,9 @@ static void mt753x_phylink_get_caps(stru
@@ -2937,6 +2927,9 @@ static void mt753x_phylink_get_caps(stru
config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
MAC_10 | MAC_100 | MAC_1000FD;
@ -53,7 +53,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* This driver does not make use of the speed, duplex, pause or the
* advertisement in its mac_config, so it is safe to mark this driver
* as non-legacy.
@@ -2997,6 +2990,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
@@ -3002,6 +2995,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
status = mt7530_read(priv, MT7531_PCS_CONTROL_1(port));
state->link = !!(status & MT7531_SGMII_LINK_STATUS);
@ -61,7 +61,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (state->interface == PHY_INTERFACE_MODE_SGMII &&
(status & MT7531_SGMII_AN_ENABLE)) {
val = mt7530_read(priv, MT7531_PCS_SPEED_ABILITY(port));
@@ -3027,16 +3021,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
@@ -3032,16 +3026,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
return 0;
}
@ -109,7 +109,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
@@ -3077,6 +3099,8 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3082,6 +3104,8 @@ mt753x_setup(struct dsa_switch *ds)
priv->pcs[i].pcs.ops = priv->info->pcs_ops;
priv->pcs[i].priv = priv;
priv->pcs[i].port = i;

View File

@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
} \
\
/* __*init sections */ \
@@ -1017,6 +1027,8 @@
@@ -1022,6 +1032,8 @@
#define COMMON_DISCARDS \
SANITIZER_DISCARDS \

View File

@ -50,9 +50,9 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
/**************************************************
* MII
**************************************************/
@@ -1542,6 +1554,14 @@ int bgmac_enet_probe(struct bgmac *bgmac
/* Omit FCS from max MTU size */
net_dev->max_mtu = BGMAC_RX_MAX_FRAME_SIZE - ETH_FCS_LEN;
@@ -1546,6 +1558,14 @@ int bgmac_enet_probe(struct bgmac *bgmac
bgmac->in_init = false;
+ if ((bgmac->feature_flags & BGMAC_FEAT_SRAB) && !bgmac_b53_pdata.regs) {
+ bgmac_b53_pdata.regs = ioremap(0x18007000, 0x1000);
@ -65,7 +65,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
err = register_netdev(bgmac->net_dev);
if (err) {
dev_err(bgmac->dev, "Cannot register net device\n");
@@ -1564,6 +1584,10 @@ EXPORT_SYMBOL_GPL(bgmac_enet_probe);
@@ -1568,6 +1588,10 @@ EXPORT_SYMBOL_GPL(bgmac_enet_probe);
void bgmac_enet_remove(struct bgmac *bgmac)
{
@ -86,7 +86,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
struct bgmac_slot_info {
union {
@@ -495,6 +496,9 @@ struct bgmac {
@@ -497,6 +498,9 @@ struct bgmac {
void (*cmn_maskset32)(struct bgmac *bgmac, u16 offset, u32 mask,
u32 set);
int (*phy_connect)(struct bgmac *bgmac);

View File

@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2952,6 +2952,8 @@ static const struct seq_operations locks
@@ -2953,6 +2953,8 @@ static const struct seq_operations locks
static int __init proc_locks_init(void)
{

View File

@ -286,7 +286,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
void nf_conntrack_ecache_work(struct net *net, enum nf_ct_ecache_state state)
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -711,12 +711,19 @@ static size_t ctnetlink_nlmsg_size(const
@@ -712,12 +712,19 @@ static size_t ctnetlink_nlmsg_size(const
}
static int

Some files were not shown because too many files have changed in this diff Show More