Merge branch 'openwrt:master' into master
This commit is contained in:
commit
2c7f72bd1a
75 changed files with 2465 additions and 366 deletions
|
@ -1,2 +1,2 @@
|
||||||
LINUX_VERSION-5.10 = .165
|
LINUX_VERSION-5.10 = .166
|
||||||
LINUX_KERNEL_HASH-5.10.165 = 971defc48f19ed0a2a7ffd4b48234619cac28895c985c6d747f5b707ba47af0d
|
LINUX_KERNEL_HASH-5.10.166 = 0051a1780e5bda0efc68dafab7c728b8283d2b028fedb439418f478be7d3e1af
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
LINUX_VERSION-5.15 = .90
|
LINUX_VERSION-5.15 = .91
|
||||||
LINUX_KERNEL_HASH-5.15.90 = e6fd430022686753af7516fe7544f96aab379509dc5b7829017bdcd92b393b42
|
LINUX_KERNEL_HASH-5.15.91 = a63c2bb1beb15f1aea9c63cf80559f5b7ab58afd2da2fa5e7670c515ebe1fe80
|
||||||
|
|
|
@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
|
||||||
|
|
||||||
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
|
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_DATE:=2022-12-22
|
PKG_SOURCE_DATE:=2023-02-02
|
||||||
PKG_SOURCE_VERSION:=5b509e80384ab019ac11aa90c81ec0dbb5b0d7f2
|
PKG_SOURCE_VERSION:=b2360d59747c6fed2b65bc1c3563c10593c83f3e
|
||||||
PKG_MIRROR_HASH:=6fc25df4d28becd010ff4971b23731c08b53e69381a9e4c868091899712f78a9
|
PKG_MIRROR_HASH:=f85f00fa8f549de348a115f92c4f0235e413ed924669aece390c7570882526dd
|
||||||
|
|
||||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||||
PKG_USE_NINJA:=0
|
PKG_USE_NINJA:=0
|
||||||
|
@ -40,7 +40,8 @@ define KernelPackage/mt76-default
|
||||||
SUBMENU:=Wireless Drivers
|
SUBMENU:=Wireless Drivers
|
||||||
DEPENDS:= \
|
DEPENDS:= \
|
||||||
+kmod-mac80211 \
|
+kmod-mac80211 \
|
||||||
+@DRIVER_11AC_SUPPORT
|
+@DRIVER_11AC_SUPPORT \
|
||||||
|
+@KERNEL_PAGE_POOL
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define KernelPackage/mt76
|
define KernelPackage/mt76
|
||||||
|
|
|
@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
#ifdef CONFIG_MACB_USE_HWSTAMP
|
#ifdef CONFIG_MACB_USE_HWSTAMP
|
||||||
--- a/drivers/net/ethernet/cadence/macb_main.c
|
--- a/drivers/net/ethernet/cadence/macb_main.c
|
||||||
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
||||||
@@ -3831,15 +3831,15 @@ static int macb_init(struct platform_dev
|
@@ -3824,15 +3824,15 @@ static int macb_init(struct platform_dev
|
||||||
if (!(bp->caps & MACB_CAPS_USRIO_DISABLED)) {
|
if (!(bp->caps & MACB_CAPS_USRIO_DISABLED)) {
|
||||||
val = 0;
|
val = 0;
|
||||||
if (phy_interface_mode_is_rgmii(bp->phy_interface))
|
if (phy_interface_mode_is_rgmii(bp->phy_interface))
|
||||||
|
@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
macb_or_gem_writel(bp, USRIO, val);
|
macb_or_gem_writel(bp, USRIO, val);
|
||||||
}
|
}
|
||||||
@@ -4357,6 +4357,13 @@ static int fu540_c000_init(struct platfo
|
@@ -4350,6 +4350,13 @@ static int fu540_c000_init(struct platfo
|
||||||
return macb_init(pdev);
|
return macb_init(pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
static const struct macb_config fu540_c000_config = {
|
static const struct macb_config fu540_c000_config = {
|
||||||
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
|
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
|
||||||
MACB_CAPS_GEM_HAS_PTP,
|
MACB_CAPS_GEM_HAS_PTP,
|
||||||
@@ -4364,12 +4371,14 @@ static const struct macb_config fu540_c0
|
@@ -4357,12 +4364,14 @@ static const struct macb_config fu540_c0
|
||||||
.clk_init = fu540_c000_clk_init,
|
.clk_init = fu540_c000_clk_init,
|
||||||
.init = fu540_c000_init,
|
.init = fu540_c000_init,
|
||||||
.jumbo_max_len = 10240,
|
.jumbo_max_len = 10240,
|
||||||
|
@ -98,7 +98,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct macb_config sama5d3macb_config = {
|
static const struct macb_config sama5d3macb_config = {
|
||||||
@@ -4377,6 +4386,7 @@ static const struct macb_config sama5d3m
|
@@ -4370,6 +4379,7 @@ static const struct macb_config sama5d3m
|
||||||
| MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
|
| MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
|
||||||
.clk_init = macb_clk_init,
|
.clk_init = macb_clk_init,
|
||||||
.init = macb_init,
|
.init = macb_init,
|
||||||
|
@ -106,7 +106,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct macb_config pc302gem_config = {
|
static const struct macb_config pc302gem_config = {
|
||||||
@@ -4384,6 +4394,7 @@ static const struct macb_config pc302gem
|
@@ -4377,6 +4387,7 @@ static const struct macb_config pc302gem
|
||||||
.dma_burst_length = 16,
|
.dma_burst_length = 16,
|
||||||
.clk_init = macb_clk_init,
|
.clk_init = macb_clk_init,
|
||||||
.init = macb_init,
|
.init = macb_init,
|
||||||
|
@ -114,7 +114,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct macb_config sama5d2_config = {
|
static const struct macb_config sama5d2_config = {
|
||||||
@@ -4391,6 +4402,7 @@ static const struct macb_config sama5d2_
|
@@ -4384,6 +4395,7 @@ static const struct macb_config sama5d2_
|
||||||
.dma_burst_length = 16,
|
.dma_burst_length = 16,
|
||||||
.clk_init = macb_clk_init,
|
.clk_init = macb_clk_init,
|
||||||
.init = macb_init,
|
.init = macb_init,
|
||||||
|
@ -122,7 +122,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct macb_config sama5d3_config = {
|
static const struct macb_config sama5d3_config = {
|
||||||
@@ -4400,6 +4412,7 @@ static const struct macb_config sama5d3_
|
@@ -4393,6 +4405,7 @@ static const struct macb_config sama5d3_
|
||||||
.clk_init = macb_clk_init,
|
.clk_init = macb_clk_init,
|
||||||
.init = macb_init,
|
.init = macb_init,
|
||||||
.jumbo_max_len = 10240,
|
.jumbo_max_len = 10240,
|
||||||
|
@ -130,7 +130,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct macb_config sama5d4_config = {
|
static const struct macb_config sama5d4_config = {
|
||||||
@@ -4407,18 +4420,21 @@ static const struct macb_config sama5d4_
|
@@ -4400,18 +4413,21 @@ static const struct macb_config sama5d4_
|
||||||
.dma_burst_length = 4,
|
.dma_burst_length = 4,
|
||||||
.clk_init = macb_clk_init,
|
.clk_init = macb_clk_init,
|
||||||
.init = macb_init,
|
.init = macb_init,
|
||||||
|
@ -152,7 +152,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct macb_config zynqmp_config = {
|
static const struct macb_config zynqmp_config = {
|
||||||
@@ -4429,6 +4445,7 @@ static const struct macb_config zynqmp_c
|
@@ -4422,6 +4438,7 @@ static const struct macb_config zynqmp_c
|
||||||
.clk_init = macb_clk_init,
|
.clk_init = macb_clk_init,
|
||||||
.init = macb_init,
|
.init = macb_init,
|
||||||
.jumbo_max_len = 10240,
|
.jumbo_max_len = 10240,
|
||||||
|
@ -160,7 +160,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct macb_config zynq_config = {
|
static const struct macb_config zynq_config = {
|
||||||
@@ -4437,6 +4454,7 @@ static const struct macb_config zynq_con
|
@@ -4430,6 +4447,7 @@ static const struct macb_config zynq_con
|
||||||
.dma_burst_length = 16,
|
.dma_burst_length = 16,
|
||||||
.clk_init = macb_clk_init,
|
.clk_init = macb_clk_init,
|
||||||
.init = macb_init,
|
.init = macb_init,
|
||||||
|
@ -168,7 +168,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct of_device_id macb_dt_ids[] = {
|
static const struct of_device_id macb_dt_ids[] = {
|
||||||
@@ -4557,6 +4575,8 @@ static int macb_probe(struct platform_de
|
@@ -4550,6 +4568,8 @@ static int macb_probe(struct platform_de
|
||||||
bp->wol |= MACB_WOL_HAS_MAGIC_PACKET;
|
bp->wol |= MACB_WOL_HAS_MAGIC_PACKET;
|
||||||
device_set_wakeup_capable(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
|
device_set_wakeup_capable(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/cadence/macb_main.c
|
--- a/drivers/net/ethernet/cadence/macb_main.c
|
||||||
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
||||||
@@ -3606,6 +3606,20 @@ static void macb_probe_queues(void __iom
|
@@ -3599,6 +3599,20 @@ static void macb_probe_queues(void __iom
|
||||||
*num_queues = hweight32(*queue_mask);
|
*num_queues = hweight32(*queue_mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
static int macb_clk_init(struct platform_device *pdev, struct clk **pclk,
|
static int macb_clk_init(struct platform_device *pdev, struct clk **pclk,
|
||||||
struct clk **hclk, struct clk **tx_clk,
|
struct clk **hclk, struct clk **tx_clk,
|
||||||
struct clk **rx_clk, struct clk **tsu_clk)
|
struct clk **rx_clk, struct clk **tsu_clk)
|
||||||
@@ -4668,11 +4682,7 @@ err_out_free_netdev:
|
@@ -4661,11 +4675,7 @@ err_out_free_netdev:
|
||||||
free_netdev(dev);
|
free_netdev(dev);
|
||||||
|
|
||||||
err_disable_clocks:
|
err_disable_clocks:
|
||||||
|
@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
pm_runtime_set_suspended(&pdev->dev);
|
pm_runtime_set_suspended(&pdev->dev);
|
||||||
pm_runtime_dont_use_autosuspend(&pdev->dev);
|
pm_runtime_dont_use_autosuspend(&pdev->dev);
|
||||||
@@ -4697,11 +4707,8 @@ static int macb_remove(struct platform_d
|
@@ -4690,11 +4700,8 @@ static int macb_remove(struct platform_d
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
pm_runtime_dont_use_autosuspend(&pdev->dev);
|
pm_runtime_dont_use_autosuspend(&pdev->dev);
|
||||||
if (!pm_runtime_suspended(&pdev->dev)) {
|
if (!pm_runtime_suspended(&pdev->dev)) {
|
||||||
|
@ -62,7 +62,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
pm_runtime_set_suspended(&pdev->dev);
|
pm_runtime_set_suspended(&pdev->dev);
|
||||||
}
|
}
|
||||||
phylink_destroy(bp->phylink);
|
phylink_destroy(bp->phylink);
|
||||||
@@ -4880,13 +4887,10 @@ static int __maybe_unused macb_runtime_s
|
@@ -4873,13 +4880,10 @@ static int __maybe_unused macb_runtime_s
|
||||||
struct net_device *netdev = dev_get_drvdata(dev);
|
struct net_device *netdev = dev_get_drvdata(dev);
|
||||||
struct macb *bp = netdev_priv(netdev);
|
struct macb *bp = netdev_priv(netdev);
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/cadence/macb_main.c
|
--- a/drivers/net/ethernet/cadence/macb_main.c
|
||||||
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
||||||
@@ -4338,8 +4338,10 @@ static int fu540_c000_clk_init(struct pl
|
@@ -4331,8 +4331,10 @@ static int fu540_c000_clk_init(struct pl
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
mgmt = devm_kzalloc(&pdev->dev, sizeof(*mgmt), GFP_KERNEL);
|
mgmt = devm_kzalloc(&pdev->dev, sizeof(*mgmt), GFP_KERNEL);
|
||||||
|
@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
init.name = "sifive-gemgxl-mgmt";
|
init.name = "sifive-gemgxl-mgmt";
|
||||||
init.ops = &fu540_c000_ops;
|
init.ops = &fu540_c000_ops;
|
||||||
@@ -4350,16 +4352,26 @@ static int fu540_c000_clk_init(struct pl
|
@@ -4343,16 +4345,26 @@ static int fu540_c000_clk_init(struct pl
|
||||||
mgmt->hw.init = &init;
|
mgmt->hw.init = &init;
|
||||||
|
|
||||||
*tx_clk = devm_clk_register(&pdev->dev, &mgmt->hw);
|
*tx_clk = devm_clk_register(&pdev->dev, &mgmt->hw);
|
||||||
|
|
|
@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/cadence/macb_main.c
|
--- a/drivers/net/ethernet/cadence/macb_main.c
|
||||||
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
||||||
@@ -4390,6 +4390,14 @@ static const struct macb_usrio_config ma
|
@@ -4383,6 +4383,14 @@ static const struct macb_usrio_config ma
|
||||||
.refclk = MACB_BIT(CLKEN),
|
.refclk = MACB_BIT(CLKEN),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
static const struct macb_config fu540_c000_config = {
|
static const struct macb_config fu540_c000_config = {
|
||||||
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
|
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
|
||||||
MACB_CAPS_GEM_HAS_PTP,
|
MACB_CAPS_GEM_HAS_PTP,
|
||||||
@@ -4483,6 +4491,14 @@ static const struct macb_config zynq_con
|
@@ -4476,6 +4484,14 @@ static const struct macb_config zynq_con
|
||||||
.usrio = &macb_default_usrio,
|
.usrio = &macb_default_usrio,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
static const struct of_device_id macb_dt_ids[] = {
|
static const struct of_device_id macb_dt_ids[] = {
|
||||||
{ .compatible = "cdns,at32ap7000-macb" },
|
{ .compatible = "cdns,at32ap7000-macb" },
|
||||||
{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
|
{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
|
||||||
@@ -4500,6 +4516,7 @@ static const struct of_device_id macb_dt
|
@@ -4493,6 +4509,7 @@ static const struct of_device_id macb_dt
|
||||||
{ .compatible = "cdns,zynqmp-gem", .data = &zynqmp_config},
|
{ .compatible = "cdns,zynqmp-gem", .data = &zynqmp_config},
|
||||||
{ .compatible = "cdns,zynq-gem", .data = &zynq_config },
|
{ .compatible = "cdns,zynq-gem", .data = &zynq_config },
|
||||||
{ .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config },
|
{ .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config },
|
||||||
|
|
|
@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/cadence/macb_main.c
|
--- a/drivers/net/ethernet/cadence/macb_main.c
|
||||||
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
||||||
@@ -4499,6 +4499,14 @@ static const struct macb_config sama7g5_
|
@@ -4492,6 +4492,14 @@ static const struct macb_config sama7g5_
|
||||||
.usrio = &sama7g5_usrio,
|
.usrio = &sama7g5_usrio,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
static const struct of_device_id macb_dt_ids[] = {
|
static const struct of_device_id macb_dt_ids[] = {
|
||||||
{ .compatible = "cdns,at32ap7000-macb" },
|
{ .compatible = "cdns,at32ap7000-macb" },
|
||||||
{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
|
{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
|
||||||
@@ -4517,6 +4525,7 @@ static const struct of_device_id macb_dt
|
@@ -4510,6 +4518,7 @@ static const struct of_device_id macb_dt
|
||||||
{ .compatible = "cdns,zynq-gem", .data = &zynq_config },
|
{ .compatible = "cdns,zynq-gem", .data = &zynq_config },
|
||||||
{ .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config },
|
{ .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config },
|
||||||
{ .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
|
{ .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
|
||||||
|
|
|
@ -20,7 +20,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/cadence/macb_main.c
|
--- a/drivers/net/ethernet/cadence/macb_main.c
|
||||||
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
||||||
@@ -3868,6 +3868,13 @@ static int macb_init(struct platform_dev
|
@@ -3861,6 +3861,13 @@ static int macb_init(struct platform_dev
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
#if defined(CONFIG_OF)
|
#if defined(CONFIG_OF)
|
||||||
/* 1518 rounded up */
|
/* 1518 rounded up */
|
||||||
#define AT91ETHER_MAX_RBUFF_SZ 0x600
|
#define AT91ETHER_MAX_RBUFF_SZ 0x600
|
||||||
@@ -4383,13 +4390,6 @@ static int fu540_c000_init(struct platfo
|
@@ -4376,13 +4383,6 @@ static int fu540_c000_init(struct platfo
|
||||||
return macb_init(pdev);
|
return macb_init(pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
static const struct macb_usrio_config sama7g5_usrio = {
|
static const struct macb_usrio_config sama7g5_usrio = {
|
||||||
.mii = 0,
|
.mii = 0,
|
||||||
.rmii = 1,
|
.rmii = 1,
|
||||||
@@ -4538,6 +4538,7 @@ static const struct macb_config default_
|
@@ -4531,6 +4531,7 @@ static const struct macb_config default_
|
||||||
.dma_burst_length = 16,
|
.dma_burst_length = 16,
|
||||||
.clk_init = macb_clk_init,
|
.clk_init = macb_clk_init,
|
||||||
.init = macb_init,
|
.init = macb_init,
|
||||||
|
|
|
@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||||
|
|
||||||
--- a/drivers/spi/spidev.c
|
--- a/drivers/spi/spidev.c
|
||||||
+++ b/drivers/spi/spidev.c
|
+++ b/drivers/spi/spidev.c
|
||||||
@@ -761,7 +761,7 @@ static int spidev_probe(struct spi_devic
|
@@ -759,7 +759,7 @@ static int spidev_probe(struct spi_devic
|
||||||
* compatible string, it is a Linux implementation thing
|
* compatible string, it is a Linux implementation thing
|
||||||
* rather than a description of the hardware.
|
* rather than a description of the hardware.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||||
#define USB_VENDOR_ID_BELKIN 0x050d
|
#define USB_VENDOR_ID_BELKIN 0x050d
|
||||||
#define USB_DEVICE_ID_FLIP_KVM 0x3201
|
#define USB_DEVICE_ID_FLIP_KVM 0x3201
|
||||||
|
|
||||||
@@ -1316,6 +1319,9 @@
|
@@ -1315,6 +1318,9 @@
|
||||||
#define USB_VENDOR_ID_XAT 0x2505
|
#define USB_VENDOR_ID_XAT 0x2505
|
||||||
#define USB_DEVICE_ID_XAT_CSR 0x0220
|
#define USB_DEVICE_ID_XAT_CSR 0x0220
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL },
|
||||||
@@ -198,6 +199,7 @@ static const struct hid_device_id hid_qu
|
@@ -197,6 +198,7 @@ static const struct hid_device_id hid_qu
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_GROUP_AUDIO), HID_QUIRK_NOGET },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_GROUP_AUDIO), HID_QUIRK_NOGET },
|
||||||
|
|
|
@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||||
|
|
||||||
--- a/drivers/spi/spidev.c
|
--- a/drivers/spi/spidev.c
|
||||||
+++ b/drivers/spi/spidev.c
|
+++ b/drivers/spi/spidev.c
|
||||||
@@ -680,6 +680,7 @@ static const struct file_operations spid
|
@@ -678,6 +678,7 @@ static const struct file_operations spid
|
||||||
static struct class *spidev_class;
|
static struct class *spidev_class;
|
||||||
|
|
||||||
static const struct spi_device_id spidev_spi_ids[] = {
|
static const struct spi_device_id spidev_spi_ids[] = {
|
||||||
|
|
|
@ -33,7 +33,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||||
enum udp_conntrack {
|
enum udp_conntrack {
|
||||||
--- a/net/netfilter/nf_conntrack_proto_tcp.c
|
--- a/net/netfilter/nf_conntrack_proto_tcp.c
|
||||||
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
|
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
|
||||||
@@ -1447,6 +1447,11 @@ void nf_conntrack_tcp_init_net(struct ne
|
@@ -1457,6 +1457,11 @@ void nf_conntrack_tcp_init_net(struct ne
|
||||||
tn->tcp_loose = nf_ct_tcp_loose;
|
tn->tcp_loose = nf_ct_tcp_loose;
|
||||||
tn->tcp_be_liberal = nf_ct_tcp_be_liberal;
|
tn->tcp_be_liberal = nf_ct_tcp_be_liberal;
|
||||||
tn->tcp_max_retrans = nf_ct_tcp_max_retrans;
|
tn->tcp_max_retrans = nf_ct_tcp_max_retrans;
|
||||||
|
@ -58,7 +58,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||||
NF_SYSCTL_CT_PROTO_TCP_LOOSE,
|
NF_SYSCTL_CT_PROTO_TCP_LOOSE,
|
||||||
NF_SYSCTL_CT_PROTO_TCP_LIBERAL,
|
NF_SYSCTL_CT_PROTO_TCP_LIBERAL,
|
||||||
NF_SYSCTL_CT_PROTO_TCP_MAX_RETRANS,
|
NF_SYSCTL_CT_PROTO_TCP_MAX_RETRANS,
|
||||||
@@ -758,6 +762,20 @@ static struct ctl_table nf_ct_sysctl_tab
|
@@ -757,6 +761,20 @@ static struct ctl_table nf_ct_sysctl_tab
|
||||||
.mode = 0644,
|
.mode = 0644,
|
||||||
.proc_handler = proc_dointvec_jiffies,
|
.proc_handler = proc_dointvec_jiffies,
|
||||||
},
|
},
|
||||||
|
@ -79,7 +79,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||||
[NF_SYSCTL_CT_PROTO_TCP_LOOSE] = {
|
[NF_SYSCTL_CT_PROTO_TCP_LOOSE] = {
|
||||||
.procname = "nf_conntrack_tcp_loose",
|
.procname = "nf_conntrack_tcp_loose",
|
||||||
.maxlen = sizeof(int),
|
.maxlen = sizeof(int),
|
||||||
@@ -967,6 +985,12 @@ static void nf_conntrack_standalone_init
|
@@ -960,6 +978,12 @@ static void nf_conntrack_standalone_init
|
||||||
XASSIGN(LIBERAL, &tn->tcp_be_liberal);
|
XASSIGN(LIBERAL, &tn->tcp_be_liberal);
|
||||||
XASSIGN(MAX_RETRANS, &tn->tcp_max_retrans);
|
XASSIGN(MAX_RETRANS, &tn->tcp_max_retrans);
|
||||||
#undef XASSIGN
|
#undef XASSIGN
|
||||||
|
|
|
@ -58,7 +58,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||||
NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP,
|
NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP,
|
||||||
NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6,
|
NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6,
|
||||||
#ifdef CONFIG_NF_CT_PROTO_SCTP
|
#ifdef CONFIG_NF_CT_PROTO_SCTP
|
||||||
@@ -810,6 +814,20 @@ static struct ctl_table nf_ct_sysctl_tab
|
@@ -809,6 +813,20 @@ static struct ctl_table nf_ct_sysctl_tab
|
||||||
.mode = 0644,
|
.mode = 0644,
|
||||||
.proc_handler = proc_dointvec_jiffies,
|
.proc_handler = proc_dointvec_jiffies,
|
||||||
},
|
},
|
||||||
|
@ -79,7 +79,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||||
[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP] = {
|
[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP] = {
|
||||||
.procname = "nf_conntrack_icmp_timeout",
|
.procname = "nf_conntrack_icmp_timeout",
|
||||||
.maxlen = sizeof(unsigned int),
|
.maxlen = sizeof(unsigned int),
|
||||||
@@ -1078,6 +1096,10 @@ static int nf_conntrack_standalone_init_
|
@@ -1070,6 +1088,10 @@ static int nf_conntrack_standalone_init_
|
||||||
table[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6].data = &nf_icmpv6_pernet(net)->timeout;
|
table[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6].data = &nf_icmpv6_pernet(net)->timeout;
|
||||||
table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP].data = &un->timeouts[UDP_CT_UNREPLIED];
|
table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP].data = &un->timeouts[UDP_CT_UNREPLIED];
|
||||||
table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_STREAM].data = &un->timeouts[UDP_CT_REPLIED];
|
table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_STREAM].data = &un->timeouts[UDP_CT_REPLIED];
|
||||||
|
|
|
@ -73,7 +73,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||||
|
|
||||||
--- a/net/netfilter/nf_conntrack_proto_tcp.c
|
--- a/net/netfilter/nf_conntrack_proto_tcp.c
|
||||||
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
|
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
|
||||||
@@ -1450,7 +1450,6 @@ void nf_conntrack_tcp_init_net(struct ne
|
@@ -1460,7 +1460,6 @@ void nf_conntrack_tcp_init_net(struct ne
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
||||||
tn->offload_timeout = 30 * HZ;
|
tn->offload_timeout = 30 * HZ;
|
||||||
|
@ -109,7 +109,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||||
#endif
|
#endif
|
||||||
NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP,
|
NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP,
|
||||||
NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6,
|
NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6,
|
||||||
@@ -773,12 +771,6 @@ static struct ctl_table nf_ct_sysctl_tab
|
@@ -772,12 +770,6 @@ static struct ctl_table nf_ct_sysctl_tab
|
||||||
.mode = 0644,
|
.mode = 0644,
|
||||||
.proc_handler = proc_dointvec_jiffies,
|
.proc_handler = proc_dointvec_jiffies,
|
||||||
},
|
},
|
||||||
|
@ -122,7 +122,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||||
#endif
|
#endif
|
||||||
[NF_SYSCTL_CT_PROTO_TCP_LOOSE] = {
|
[NF_SYSCTL_CT_PROTO_TCP_LOOSE] = {
|
||||||
.procname = "nf_conntrack_tcp_loose",
|
.procname = "nf_conntrack_tcp_loose",
|
||||||
@@ -821,12 +813,6 @@ static struct ctl_table nf_ct_sysctl_tab
|
@@ -820,12 +812,6 @@ static struct ctl_table nf_ct_sysctl_tab
|
||||||
.mode = 0644,
|
.mode = 0644,
|
||||||
.proc_handler = proc_dointvec_jiffies,
|
.proc_handler = proc_dointvec_jiffies,
|
||||||
},
|
},
|
||||||
|
@ -135,7 +135,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||||
#endif
|
#endif
|
||||||
[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP] = {
|
[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP] = {
|
||||||
.procname = "nf_conntrack_icmp_timeout",
|
.procname = "nf_conntrack_icmp_timeout",
|
||||||
@@ -1006,7 +992,6 @@ static void nf_conntrack_standalone_init
|
@@ -999,7 +985,6 @@ static void nf_conntrack_standalone_init
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
||||||
table[NF_SYSCTL_CT_PROTO_TIMEOUT_TCP_OFFLOAD].data = &tn->offload_timeout;
|
table[NF_SYSCTL_CT_PROTO_TIMEOUT_TCP_OFFLOAD].data = &tn->offload_timeout;
|
||||||
|
@ -143,7 +143,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1098,7 +1083,6 @@ static int nf_conntrack_standalone_init_
|
@@ -1090,7 +1075,6 @@ static int nf_conntrack_standalone_init_
|
||||||
table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_STREAM].data = &un->timeouts[UDP_CT_REPLIED];
|
table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_STREAM].data = &un->timeouts[UDP_CT_REPLIED];
|
||||||
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
||||||
table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_OFFLOAD].data = &un->offload_timeout;
|
table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_OFFLOAD].data = &un->offload_timeout;
|
||||||
|
|
|
@ -423,7 +423,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
if (bgmac->irq < 0)
|
if (bgmac->irq < 0)
|
||||||
--- a/drivers/net/ethernet/cadence/macb_main.c
|
--- a/drivers/net/ethernet/cadence/macb_main.c
|
||||||
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
+++ b/drivers/net/ethernet/cadence/macb_main.c
|
||||||
@@ -4487,7 +4487,6 @@ static int macb_probe(struct platform_de
|
@@ -4480,7 +4480,6 @@ static int macb_probe(struct platform_de
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
struct resource *regs;
|
struct resource *regs;
|
||||||
void __iomem *mem;
|
void __iomem *mem;
|
||||||
|
@ -431,7 +431,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
struct macb *bp;
|
struct macb *bp;
|
||||||
int err, val;
|
int err, val;
|
||||||
|
|
||||||
@@ -4600,15 +4599,11 @@ static int macb_probe(struct platform_de
|
@@ -4593,15 +4592,11 @@ static int macb_probe(struct platform_de
|
||||||
if (bp->caps & MACB_CAPS_NEEDS_RSTONUBR)
|
if (bp->caps & MACB_CAPS_NEEDS_RSTONUBR)
|
||||||
bp->rx_intr_mask |= MACB_BIT(RXUBR);
|
bp->rx_intr_mask |= MACB_BIT(RXUBR);
|
||||||
|
|
||||||
|
@ -1360,7 +1360,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
int irq;
|
int irq;
|
||||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
@@ -5008,7 +5008,7 @@ int stmmac_dvr_probe(struct device *devi
|
@@ -5013,7 +5013,7 @@ int stmmac_dvr_probe(struct device *devi
|
||||||
priv->wol_irq = res->wol_irq;
|
priv->wol_irq = res->wol_irq;
|
||||||
priv->lpi_irq = res->lpi_irq;
|
priv->lpi_irq = res->lpi_irq;
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,8 @@ Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
||||||
|
|
||||||
--- a/Makefile
|
--- a/Makefile
|
||||||
+++ b/Makefile
|
+++ b/Makefile
|
||||||
@@ -432,7 +432,8 @@ HOSTCXX = g++
|
@@ -433,7 +433,8 @@ endif
|
||||||
endif
|
HOSTPKG_CONFIG = pkg-config
|
||||||
|
|
||||||
export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
||||||
- -O2 -fomit-frame-pointer -std=gnu89
|
- -O2 -fomit-frame-pointer -std=gnu89
|
||||||
|
|
|
@ -49,7 +49,7 @@ Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
||||||
|
|
||||||
--- a/Makefile
|
--- a/Makefile
|
||||||
+++ b/Makefile
|
+++ b/Makefile
|
||||||
@@ -516,7 +516,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror
|
@@ -517,7 +517,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror
|
||||||
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
|
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
|
||||||
-Werror=implicit-function-declaration -Werror=implicit-int \
|
-Werror=implicit-function-declaration -Werror=implicit-int \
|
||||||
-Werror=return-type -Wno-format-security \
|
-Werror=return-type -Wno-format-security \
|
||||||
|
|
|
@ -32,8 +32,8 @@ Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
||||||
|
|
||||||
--- a/Makefile
|
--- a/Makefile
|
||||||
+++ b/Makefile
|
+++ b/Makefile
|
||||||
@@ -432,7 +432,7 @@ HOSTCXX = g++
|
@@ -433,7 +433,7 @@ endif
|
||||||
endif
|
HOSTPKG_CONFIG = pkg-config
|
||||||
|
|
||||||
export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
||||||
- -O2 -fomit-frame-pointer -std=gnu89 \
|
- -O2 -fomit-frame-pointer -std=gnu89 \
|
||||||
|
|
|
@ -287,7 +287,7 @@ Change-Id: I25d9eda8c6bdc7c3653b9f210a159d6c247c81e8
|
||||||
struct pglist_data *pgdat;
|
struct pglist_data *pgdat;
|
||||||
--- a/kernel/exit.c
|
--- a/kernel/exit.c
|
||||||
+++ b/kernel/exit.c
|
+++ b/kernel/exit.c
|
||||||
@@ -422,6 +422,7 @@ assign_new_owner:
|
@@ -469,6 +469,7 @@ assign_new_owner:
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
WRITE_ONCE(mm->owner, c);
|
WRITE_ONCE(mm->owner, c);
|
||||||
|
|
|
@ -0,0 +1,98 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Thu, 17 Nov 2022 00:35:04 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: do not overwrite mtu
|
||||||
|
configuration running reset routine
|
||||||
|
|
||||||
|
Restore user configured MTU running mtk_hw_init() during tx timeout routine
|
||||||
|
since it will be overwritten after a hw reset.
|
||||||
|
|
||||||
|
Reported-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
Fixes: 9ea4d311509f ("net: ethernet: mediatek: add the whole ethernet reset into the reset process")
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
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
|
||||||
|
dim->state = DIM_START_MEASURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void mtk_set_mcr_max_rx(struct mtk_mac *mac, u32 val)
|
||||||
|
+{
|
||||||
|
+ struct mtk_eth *eth = mac->hw;
|
||||||
|
+ u32 mcr_cur, mcr_new;
|
||||||
|
+
|
||||||
|
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
|
||||||
|
+ mcr_new = mcr_cur & ~MAC_MCR_MAX_RX_MASK;
|
||||||
|
+
|
||||||
|
+ if (val <= 1518)
|
||||||
|
+ mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1518);
|
||||||
|
+ else if (val <= 1536)
|
||||||
|
+ mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1536);
|
||||||
|
+ else if (val <= 1552)
|
||||||
|
+ mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1552);
|
||||||
|
+ else
|
||||||
|
+ mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_2048);
|
||||||
|
+
|
||||||
|
+ if (mcr_new != mcr_cur)
|
||||||
|
+ mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
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
|
||||||
|
* up with the more appropriate value when mtk_mac_config call is being
|
||||||
|
* invoked.
|
||||||
|
*/
|
||||||
|
- for (i = 0; i < MTK_MAC_COUNT; i++)
|
||||||
|
+ for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||||
|
+ struct net_device *dev = eth->netdev[i];
|
||||||
|
+
|
||||||
|
mtk_w32(eth, MAC_MCR_FORCE_LINK_DOWN, MTK_MAC_MCR(i));
|
||||||
|
+ if (dev) {
|
||||||
|
+ struct mtk_mac *mac = netdev_priv(dev);
|
||||||
|
+
|
||||||
|
+ mtk_set_mcr_max_rx(mac, dev->mtu + MTK_RX_ETH_HLEN);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
|
||||||
|
/* 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
|
||||||
|
int length = new_mtu + MTK_RX_ETH_HLEN;
|
||||||
|
struct mtk_mac *mac = netdev_priv(dev);
|
||||||
|
struct mtk_eth *eth = mac->hw;
|
||||||
|
- u32 mcr_cur, mcr_new;
|
||||||
|
|
||||||
|
if (rcu_access_pointer(eth->prog) &&
|
||||||
|
length > MTK_PP_MAX_BUF_SIZE) {
|
||||||
|
@@ -3374,23 +3405,7 @@ static int mtk_change_mtu(struct net_dev
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
- 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;
|
||||||
|
-
|
||||||
|
- if (length <= 1518)
|
||||||
|
- mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1518);
|
||||||
|
- else if (length <= 1536)
|
||||||
|
- mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1536);
|
||||||
|
- else if (length <= 1552)
|
||||||
|
- mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1552);
|
||||||
|
- else
|
||||||
|
- mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_2048);
|
||||||
|
-
|
||||||
|
- if (mcr_new != mcr_cur)
|
||||||
|
- mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
+ mtk_set_mcr_max_rx(mac, length);
|
||||||
|
dev->mtu = new_mtu;
|
||||||
|
|
||||||
|
return 0;
|
|
@ -0,0 +1,36 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Thu, 17 Nov 2022 00:58:46 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: remove cpu_relax in
|
||||||
|
mtk_pending_work
|
||||||
|
|
||||||
|
Get rid of cpu_relax in mtk_pending_work routine since MTK_RESETTING is
|
||||||
|
set only in mtk_pending_work() and it runs holding rtnl lock
|
||||||
|
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
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
|
||||||
|
rtnl_lock();
|
||||||
|
|
||||||
|
dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__);
|
||||||
|
+ set_bit(MTK_RESETTING, ð->state);
|
||||||
|
|
||||||
|
- while (test_and_set_bit_lock(MTK_RESETTING, ð->state))
|
||||||
|
- cpu_relax();
|
||||||
|
-
|
||||||
|
- dev_dbg(eth->dev, "[%s][%d] mtk_stop starts\n", __func__, __LINE__);
|
||||||
|
/* 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
|
||||||
|
|
||||||
|
dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__);
|
||||||
|
|
||||||
|
- clear_bit_unlock(MTK_RESETTING, ð->state);
|
||||||
|
+ clear_bit(MTK_RESETTING, ð->state);
|
||||||
|
|
||||||
|
rtnl_unlock();
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Thu, 17 Nov 2022 15:29:53 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: fix RSTCTRL_PPE{0,1} definitions
|
||||||
|
|
||||||
|
Fix RSTCTRL_PPE0 and RSTCTRL_PPE1 register mask definitions for
|
||||||
|
MTK_NETSYS_V2.
|
||||||
|
Remove duplicated definitions.
|
||||||
|
|
||||||
|
Fixes: 160d3a9b1929 ("net: ethernet: mtk_eth_soc: introduce MTK_NETSYS_V2 support")
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
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
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
- val = RSTCTRL_FE | RSTCTRL_PPE;
|
||||||
|
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
||||||
|
regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0);
|
||||||
|
-
|
||||||
|
- val |= RSTCTRL_ETH;
|
||||||
|
- if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
|
||||||
|
- val |= RSTCTRL_PPE1;
|
||||||
|
+ val = RSTCTRL_PPE0_V2;
|
||||||
|
+ } else {
|
||||||
|
+ val = RSTCTRL_PPE0;
|
||||||
|
}
|
||||||
|
|
||||||
|
- ethsys_reset(eth, val);
|
||||||
|
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
|
||||||
|
+ val |= RSTCTRL_PPE1;
|
||||||
|
+
|
||||||
|
+ ethsys_reset(eth, RSTCTRL_ETH | RSTCTRL_FE | val);
|
||||||
|
|
||||||
|
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
||||||
|
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 @@
|
||||||
|
/* ethernet reset control register */
|
||||||
|
#define ETHSYS_RSTCTRL 0x34
|
||||||
|
#define RSTCTRL_FE BIT(6)
|
||||||
|
-#define RSTCTRL_PPE BIT(31)
|
||||||
|
-#define RSTCTRL_PPE1 BIT(30)
|
||||||
|
+#define RSTCTRL_PPE0 BIT(31)
|
||||||
|
+#define RSTCTRL_PPE0_V2 BIT(30)
|
||||||
|
+#define RSTCTRL_PPE1 BIT(31)
|
||||||
|
#define RSTCTRL_ETH BIT(23)
|
||||||
|
|
||||||
|
/* ethernet reset check idle register */
|
||||||
|
#define ETHSYS_FE_RST_CHK_IDLE_EN 0x28
|
||||||
|
|
||||||
|
-/* ethernet reset control register */
|
||||||
|
-#define ETHSYS_RSTCTRL 0x34
|
||||||
|
-#define RSTCTRL_FE BIT(6)
|
||||||
|
-#define RSTCTRL_PPE BIT(31)
|
||||||
|
-
|
||||||
|
/* ethernet dma channel agent map */
|
||||||
|
#define ETHSYS_DMA_AG_MAP 0x408
|
||||||
|
#define ETHSYS_DMA_AG_MAP_PDMA BIT(0)
|
|
@ -0,0 +1,80 @@
|
||||||
|
From: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Date: Thu, 24 Nov 2022 11:18:14 +0800
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_wed: add wcid overwritten support for wed
|
||||||
|
v1
|
||||||
|
|
||||||
|
All wed versions should enable the wcid overwritten feature,
|
||||||
|
since the wcid size is controlled by the wlan driver.
|
||||||
|
|
||||||
|
Tested-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Co-developed-by: Bo Jiao <bo.jiao@mediatek.com>
|
||||||
|
Signed-off-by: Bo Jiao <bo.jiao@mediatek.com>
|
||||||
|
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
@@ -526,9 +526,9 @@ mtk_wed_dma_disable(struct mtk_wed_devic
|
||||||
|
MTK_WED_WPDMA_RX_D_RX_DRV_EN);
|
||||||
|
wed_clr(dev, MTK_WED_WDMA_GLO_CFG,
|
||||||
|
MTK_WED_WDMA_GLO_CFG_TX_DDONE_CHK);
|
||||||
|
-
|
||||||
|
- mtk_wed_set_512_support(dev, false);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ mtk_wed_set_512_support(dev, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
@@ -1297,9 +1297,10 @@ mtk_wed_start(struct mtk_wed_device *dev
|
||||||
|
if (mtk_wed_rro_cfg(dev))
|
||||||
|
return;
|
||||||
|
|
||||||
|
- mtk_wed_set_512_support(dev, dev->wlan.wcid_512);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ mtk_wed_set_512_support(dev, dev->wlan.wcid_512);
|
||||||
|
+
|
||||||
|
mtk_wed_dma_enable(dev);
|
||||||
|
dev->running = true;
|
||||||
|
}
|
||||||
|
@@ -1365,11 +1366,13 @@ mtk_wed_attach(struct mtk_wed_device *de
|
||||||
|
}
|
||||||
|
|
||||||
|
mtk_wed_hw_init_early(dev);
|
||||||
|
- if (hw->version == 1)
|
||||||
|
+ if (hw->version == 1) {
|
||||||
|
regmap_update_bits(hw->hifsys, HIFSYS_DMA_AG_MAP,
|
||||||
|
BIT(hw->index), 0);
|
||||||
|
- else
|
||||||
|
+ } else {
|
||||||
|
+ dev->rev_id = wed_r32(dev, MTK_WED_REV_ID);
|
||||||
|
ret = mtk_wed_wo_init(hw);
|
||||||
|
+ }
|
||||||
|
out:
|
||||||
|
if (ret)
|
||||||
|
mtk_wed_detach(dev);
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed_regs.h
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
|
||||||
|
@@ -20,6 +20,8 @@ struct mtk_wdma_desc {
|
||||||
|
__le32 info;
|
||||||
|
} __packed __aligned(4);
|
||||||
|
|
||||||
|
+#define MTK_WED_REV_ID 0x004
|
||||||
|
+
|
||||||
|
#define MTK_WED_RESET 0x008
|
||||||
|
#define MTK_WED_RESET_TX_BM BIT(0)
|
||||||
|
#define MTK_WED_RESET_TX_FREE_AGENT BIT(4)
|
||||||
|
--- a/include/linux/soc/mediatek/mtk_wed.h
|
||||||
|
+++ b/include/linux/soc/mediatek/mtk_wed.h
|
||||||
|
@@ -85,6 +85,9 @@ struct mtk_wed_device {
|
||||||
|
int irq;
|
||||||
|
u8 version;
|
||||||
|
|
||||||
|
+ /* used by wlan driver */
|
||||||
|
+ u32 rev_id;
|
||||||
|
+
|
||||||
|
struct mtk_wed_ring tx_ring[MTK_WED_TX_QUEUES];
|
||||||
|
struct mtk_wed_ring rx_ring[MTK_WED_RX_QUEUES];
|
||||||
|
struct mtk_wed_ring txfree_ring;
|
|
@ -0,0 +1,85 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Thu, 24 Nov 2022 16:22:51 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_wed: return status value in
|
||||||
|
mtk_wdma_rx_reset
|
||||||
|
|
||||||
|
Move MTK_WDMA_RESET_IDX configuration in mtk_wdma_rx_reset routine.
|
||||||
|
Increase poll timeout to 10ms in order to be aligned with vendor sdk.
|
||||||
|
This is a preliminary patch to add Wireless Ethernet Dispatcher reset
|
||||||
|
support.
|
||||||
|
|
||||||
|
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
@@ -101,17 +101,21 @@ mtk_wdma_read_reset(struct mtk_wed_devic
|
||||||
|
return wdma_r32(dev, MTK_WDMA_GLO_CFG);
|
||||||
|
}
|
||||||
|
|
||||||
|
-static void
|
||||||
|
+static int
|
||||||
|
mtk_wdma_rx_reset(struct mtk_wed_device *dev)
|
||||||
|
{
|
||||||
|
u32 status, mask = MTK_WDMA_GLO_CFG_RX_DMA_BUSY;
|
||||||
|
- int i;
|
||||||
|
+ int i, ret;
|
||||||
|
|
||||||
|
wdma_clr(dev, MTK_WDMA_GLO_CFG, MTK_WDMA_GLO_CFG_RX_DMA_EN);
|
||||||
|
- if (readx_poll_timeout(mtk_wdma_read_reset, dev, status,
|
||||||
|
- !(status & mask), 0, 1000))
|
||||||
|
+ ret = readx_poll_timeout(mtk_wdma_read_reset, dev, status,
|
||||||
|
+ !(status & mask), 0, 10000);
|
||||||
|
+ if (ret)
|
||||||
|
dev_err(dev->hw->dev, "rx reset failed\n");
|
||||||
|
|
||||||
|
+ wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_RX);
|
||||||
|
+ wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
|
||||||
|
+
|
||||||
|
for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++) {
|
||||||
|
if (dev->rx_wdma[i].desc)
|
||||||
|
continue;
|
||||||
|
@@ -119,6 +123,8 @@ mtk_wdma_rx_reset(struct mtk_wed_device
|
||||||
|
wdma_w32(dev,
|
||||||
|
MTK_WDMA_RING_RX(i) + MTK_WED_RING_OFS_CPU_IDX, 0);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
@@ -565,9 +571,7 @@ mtk_wed_detach(struct mtk_wed_device *de
|
||||||
|
|
||||||
|
mtk_wed_stop(dev);
|
||||||
|
|
||||||
|
- wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_RX);
|
||||||
|
- wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
|
||||||
|
-
|
||||||
|
+ mtk_wdma_rx_reset(dev);
|
||||||
|
mtk_wed_reset(dev, MTK_WED_RESET_WED);
|
||||||
|
if (mtk_wed_get_rx_capa(dev)) {
|
||||||
|
wdma_clr(dev, MTK_WDMA_GLO_CFG, MTK_WDMA_GLO_CFG_TX_DMA_EN);
|
||||||
|
@@ -582,7 +586,6 @@ mtk_wed_detach(struct mtk_wed_device *de
|
||||||
|
mtk_wed_wo_reset(dev);
|
||||||
|
mtk_wed_free_rx_rings(dev);
|
||||||
|
mtk_wed_wo_deinit(hw);
|
||||||
|
- mtk_wdma_rx_reset(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dev->wlan.bus_type == MTK_WED_BUS_PCIE) {
|
||||||
|
@@ -1006,11 +1009,7 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
||||||
|
wed_w32(dev, MTK_WED_RESET_IDX, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
- wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_RX);
|
||||||
|
- wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
|
||||||
|
-
|
||||||
|
- if (mtk_wed_get_rx_capa(dev))
|
||||||
|
- mtk_wdma_rx_reset(dev);
|
||||||
|
+ mtk_wdma_rx_reset(dev);
|
||||||
|
|
||||||
|
if (busy) {
|
||||||
|
mtk_wed_reset(dev, MTK_WED_RESET_WDMA_INT_AGENT);
|
|
@ -0,0 +1,52 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Thu, 24 Nov 2022 16:22:52 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_wed: move MTK_WDMA_RESET_IDX_TX
|
||||||
|
configuration in mtk_wdma_tx_reset
|
||||||
|
|
||||||
|
Remove duplicated code. Increase poll timeout to 10ms in order to be
|
||||||
|
aligned with vendor sdk.
|
||||||
|
This is a preliminary patch to add Wireless Ethernet Dispatcher reset
|
||||||
|
support.
|
||||||
|
|
||||||
|
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
@@ -135,16 +135,15 @@ mtk_wdma_tx_reset(struct mtk_wed_device
|
||||||
|
|
||||||
|
wdma_clr(dev, MTK_WDMA_GLO_CFG, MTK_WDMA_GLO_CFG_TX_DMA_EN);
|
||||||
|
if (readx_poll_timeout(mtk_wdma_read_reset, dev, status,
|
||||||
|
- !(status & mask), 0, 1000))
|
||||||
|
+ !(status & mask), 0, 10000))
|
||||||
|
dev_err(dev->hw->dev, "tx reset failed\n");
|
||||||
|
|
||||||
|
- for (i = 0; i < ARRAY_SIZE(dev->tx_wdma); i++) {
|
||||||
|
- if (dev->tx_wdma[i].desc)
|
||||||
|
- continue;
|
||||||
|
+ wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_TX);
|
||||||
|
+ wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
|
||||||
|
|
||||||
|
+ for (i = 0; i < ARRAY_SIZE(dev->tx_wdma); i++)
|
||||||
|
wdma_w32(dev,
|
||||||
|
MTK_WDMA_RING_TX(i) + MTK_WED_RING_OFS_CPU_IDX, 0);
|
||||||
|
- }
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
@@ -573,12 +572,6 @@ mtk_wed_detach(struct mtk_wed_device *de
|
||||||
|
|
||||||
|
mtk_wdma_rx_reset(dev);
|
||||||
|
mtk_wed_reset(dev, MTK_WED_RESET_WED);
|
||||||
|
- if (mtk_wed_get_rx_capa(dev)) {
|
||||||
|
- wdma_clr(dev, MTK_WDMA_GLO_CFG, MTK_WDMA_GLO_CFG_TX_DMA_EN);
|
||||||
|
- wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_TX);
|
||||||
|
- wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
mtk_wed_free_tx_buffer(dev);
|
||||||
|
mtk_wed_free_tx_rings(dev);
|
||||||
|
|
|
@ -0,0 +1,98 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Thu, 24 Nov 2022 16:22:53 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_wed: update mtk_wed_stop
|
||||||
|
|
||||||
|
Update mtk_wed_stop routine and rename old mtk_wed_stop() to
|
||||||
|
mtk_wed_deinit(). This is a preliminary patch to add Wireless Ethernet
|
||||||
|
Dispatcher reset support.
|
||||||
|
|
||||||
|
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
@@ -539,14 +539,8 @@ mtk_wed_dma_disable(struct mtk_wed_devic
|
||||||
|
static void
|
||||||
|
mtk_wed_stop(struct mtk_wed_device *dev)
|
||||||
|
{
|
||||||
|
- mtk_wed_dma_disable(dev);
|
||||||
|
mtk_wed_set_ext_int(dev, false);
|
||||||
|
|
||||||
|
- wed_clr(dev, MTK_WED_CTRL,
|
||||||
|
- MTK_WED_CTRL_WDMA_INT_AGENT_EN |
|
||||||
|
- MTK_WED_CTRL_WPDMA_INT_AGENT_EN |
|
||||||
|
- MTK_WED_CTRL_WED_TX_BM_EN |
|
||||||
|
- MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
||||||
|
wed_w32(dev, MTK_WED_WPDMA_INT_TRIGGER, 0);
|
||||||
|
wed_w32(dev, MTK_WED_WDMA_INT_TRIGGER, 0);
|
||||||
|
wdma_w32(dev, MTK_WDMA_INT_MASK, 0);
|
||||||
|
@@ -558,7 +552,27 @@ mtk_wed_stop(struct mtk_wed_device *dev)
|
||||||
|
|
||||||
|
wed_w32(dev, MTK_WED_EXT_INT_MASK1, 0);
|
||||||
|
wed_w32(dev, MTK_WED_EXT_INT_MASK2, 0);
|
||||||
|
- wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_WED_RX_BM_EN);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+mtk_wed_deinit(struct mtk_wed_device *dev)
|
||||||
|
+{
|
||||||
|
+ mtk_wed_stop(dev);
|
||||||
|
+ mtk_wed_dma_disable(dev);
|
||||||
|
+
|
||||||
|
+ wed_clr(dev, MTK_WED_CTRL,
|
||||||
|
+ MTK_WED_CTRL_WDMA_INT_AGENT_EN |
|
||||||
|
+ MTK_WED_CTRL_WPDMA_INT_AGENT_EN |
|
||||||
|
+ MTK_WED_CTRL_WED_TX_BM_EN |
|
||||||
|
+ MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
||||||
|
+
|
||||||
|
+ if (dev->hw->version == 1)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ wed_clr(dev, MTK_WED_CTRL,
|
||||||
|
+ MTK_WED_CTRL_RX_ROUTE_QM_EN |
|
||||||
|
+ MTK_WED_CTRL_WED_RX_BM_EN |
|
||||||
|
+ MTK_WED_CTRL_RX_RRO_QM_EN);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
@@ -568,7 +582,7 @@ mtk_wed_detach(struct mtk_wed_device *de
|
||||||
|
|
||||||
|
mutex_lock(&hw_lock);
|
||||||
|
|
||||||
|
- mtk_wed_stop(dev);
|
||||||
|
+ mtk_wed_deinit(dev);
|
||||||
|
|
||||||
|
mtk_wdma_rx_reset(dev);
|
||||||
|
mtk_wed_reset(dev, MTK_WED_RESET_WED);
|
||||||
|
@@ -677,7 +691,7 @@ mtk_wed_hw_init_early(struct mtk_wed_dev
|
||||||
|
{
|
||||||
|
u32 mask, set;
|
||||||
|
|
||||||
|
- mtk_wed_stop(dev);
|
||||||
|
+ mtk_wed_deinit(dev);
|
||||||
|
mtk_wed_reset(dev, MTK_WED_RESET_WED);
|
||||||
|
mtk_wed_set_wpdma(dev);
|
||||||
|
|
||||||
|
--- a/include/linux/soc/mediatek/mtk_wed.h
|
||||||
|
+++ b/include/linux/soc/mediatek/mtk_wed.h
|
||||||
|
@@ -234,6 +234,8 @@ mtk_wed_get_rx_capa(struct mtk_wed_devic
|
||||||
|
(_dev)->ops->ppe_check(_dev, _skb, _reason, _hash)
|
||||||
|
#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) \
|
||||||
|
(_dev)->ops->msg_update(_dev, _id, _msg, _len)
|
||||||
|
+#define mtk_wed_device_stop(_dev) (_dev)->ops->stop(_dev)
|
||||||
|
+#define mtk_wed_device_dma_reset(_dev) (_dev)->ops->reset_dma(_dev)
|
||||||
|
#else
|
||||||
|
static inline bool mtk_wed_device_active(struct mtk_wed_device *dev)
|
||||||
|
{
|
||||||
|
@@ -250,6 +252,8 @@ static inline bool mtk_wed_device_active
|
||||||
|
#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs) -ENODEV
|
||||||
|
#define mtk_wed_device_ppe_check(_dev, _skb, _reason, _hash) do {} while (0)
|
||||||
|
#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) -ENODEV
|
||||||
|
+#define mtk_wed_device_stop(_dev) do {} while (0)
|
||||||
|
+#define mtk_wed_device_dma_reset(_dev) do {} while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,309 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Thu, 24 Nov 2022 16:22:54 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_wed: add mtk_wed_rx_reset routine
|
||||||
|
|
||||||
|
Introduce mtk_wed_rx_reset routine in order to reset rx DMA for Wireless
|
||||||
|
Ethernet Dispatcher available on MT7986 SoC.
|
||||||
|
|
||||||
|
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
@@ -951,42 +951,130 @@ mtk_wed_ring_reset(struct mtk_wed_ring *
|
||||||
|
}
|
||||||
|
|
||||||
|
static u32
|
||||||
|
-mtk_wed_check_busy(struct mtk_wed_device *dev)
|
||||||
|
+mtk_wed_check_busy(struct mtk_wed_device *dev, u32 reg, u32 mask)
|
||||||
|
{
|
||||||
|
- if (wed_r32(dev, MTK_WED_GLO_CFG) & MTK_WED_GLO_CFG_TX_DMA_BUSY)
|
||||||
|
- return true;
|
||||||
|
-
|
||||||
|
- if (wed_r32(dev, MTK_WED_WPDMA_GLO_CFG) &
|
||||||
|
- MTK_WED_WPDMA_GLO_CFG_TX_DRV_BUSY)
|
||||||
|
- return true;
|
||||||
|
-
|
||||||
|
- if (wed_r32(dev, MTK_WED_CTRL) & MTK_WED_CTRL_WDMA_INT_AGENT_BUSY)
|
||||||
|
- return true;
|
||||||
|
-
|
||||||
|
- if (wed_r32(dev, MTK_WED_WDMA_GLO_CFG) &
|
||||||
|
- MTK_WED_WDMA_GLO_CFG_RX_DRV_BUSY)
|
||||||
|
- return true;
|
||||||
|
-
|
||||||
|
- if (wdma_r32(dev, MTK_WDMA_GLO_CFG) &
|
||||||
|
- MTK_WED_WDMA_GLO_CFG_RX_DRV_BUSY)
|
||||||
|
- return true;
|
||||||
|
-
|
||||||
|
- if (wed_r32(dev, MTK_WED_CTRL) &
|
||||||
|
- (MTK_WED_CTRL_WED_TX_BM_BUSY | MTK_WED_CTRL_WED_TX_FREE_AGENT_BUSY))
|
||||||
|
- return true;
|
||||||
|
-
|
||||||
|
- return false;
|
||||||
|
+ return !!(wed_r32(dev, reg) & mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
-mtk_wed_poll_busy(struct mtk_wed_device *dev)
|
||||||
|
+mtk_wed_poll_busy(struct mtk_wed_device *dev, u32 reg, u32 mask)
|
||||||
|
{
|
||||||
|
int sleep = 15000;
|
||||||
|
int timeout = 100 * sleep;
|
||||||
|
u32 val;
|
||||||
|
|
||||||
|
return read_poll_timeout(mtk_wed_check_busy, val, !val, sleep,
|
||||||
|
- timeout, false, dev);
|
||||||
|
+ timeout, false, dev, reg, mask);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int
|
||||||
|
+mtk_wed_rx_reset(struct mtk_wed_device *dev)
|
||||||
|
+{
|
||||||
|
+ struct mtk_wed_wo *wo = dev->hw->wed_wo;
|
||||||
|
+ u8 val = MTK_WED_WO_STATE_SER_RESET;
|
||||||
|
+ int i, ret;
|
||||||
|
+
|
||||||
|
+ ret = mtk_wed_mcu_send_msg(wo, MTK_WED_MODULE_ID_WO,
|
||||||
|
+ MTK_WED_WO_CMD_CHANGE_STATE, &val,
|
||||||
|
+ sizeof(val), true);
|
||||||
|
+ if (ret)
|
||||||
|
+ return ret;
|
||||||
|
+
|
||||||
|
+ wed_clr(dev, MTK_WED_WPDMA_RX_D_GLO_CFG, MTK_WED_WPDMA_RX_D_RX_DRV_EN);
|
||||||
|
+ ret = mtk_wed_poll_busy(dev, MTK_WED_WPDMA_RX_D_GLO_CFG,
|
||||||
|
+ MTK_WED_WPDMA_RX_D_RX_DRV_BUSY);
|
||||||
|
+ if (ret) {
|
||||||
|
+ mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_INT_AGENT);
|
||||||
|
+ mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_RX_D_DRV);
|
||||||
|
+ } else {
|
||||||
|
+ wed_w32(dev, MTK_WED_WPDMA_RX_D_RST_IDX,
|
||||||
|
+ MTK_WED_WPDMA_RX_D_RST_CRX_IDX |
|
||||||
|
+ MTK_WED_WPDMA_RX_D_RST_DRV_IDX);
|
||||||
|
+
|
||||||
|
+ wed_set(dev, MTK_WED_WPDMA_RX_D_GLO_CFG,
|
||||||
|
+ MTK_WED_WPDMA_RX_D_RST_INIT_COMPLETE |
|
||||||
|
+ MTK_WED_WPDMA_RX_D_FSM_RETURN_IDLE);
|
||||||
|
+ wed_clr(dev, MTK_WED_WPDMA_RX_D_GLO_CFG,
|
||||||
|
+ MTK_WED_WPDMA_RX_D_RST_INIT_COMPLETE |
|
||||||
|
+ MTK_WED_WPDMA_RX_D_FSM_RETURN_IDLE);
|
||||||
|
+
|
||||||
|
+ wed_w32(dev, MTK_WED_WPDMA_RX_D_RST_IDX, 0);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* reset rro qm */
|
||||||
|
+ wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_RX_RRO_QM_EN);
|
||||||
|
+ ret = mtk_wed_poll_busy(dev, MTK_WED_CTRL,
|
||||||
|
+ MTK_WED_CTRL_RX_RRO_QM_BUSY);
|
||||||
|
+ if (ret) {
|
||||||
|
+ mtk_wed_reset(dev, MTK_WED_RESET_RX_RRO_QM);
|
||||||
|
+ } else {
|
||||||
|
+ wed_set(dev, MTK_WED_RROQM_RST_IDX,
|
||||||
|
+ MTK_WED_RROQM_RST_IDX_MIOD |
|
||||||
|
+ MTK_WED_RROQM_RST_IDX_FDBK);
|
||||||
|
+ wed_w32(dev, MTK_WED_RROQM_RST_IDX, 0);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* reset route qm */
|
||||||
|
+ wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_RX_ROUTE_QM_EN);
|
||||||
|
+ ret = mtk_wed_poll_busy(dev, MTK_WED_CTRL,
|
||||||
|
+ MTK_WED_CTRL_RX_ROUTE_QM_BUSY);
|
||||||
|
+ if (ret)
|
||||||
|
+ mtk_wed_reset(dev, MTK_WED_RESET_RX_ROUTE_QM);
|
||||||
|
+ else
|
||||||
|
+ wed_set(dev, MTK_WED_RTQM_GLO_CFG,
|
||||||
|
+ MTK_WED_RTQM_Q_RST);
|
||||||
|
+
|
||||||
|
+ /* reset tx wdma */
|
||||||
|
+ mtk_wdma_tx_reset(dev);
|
||||||
|
+
|
||||||
|
+ /* reset tx wdma drv */
|
||||||
|
+ wed_clr(dev, MTK_WED_WDMA_GLO_CFG, MTK_WED_WDMA_GLO_CFG_TX_DRV_EN);
|
||||||
|
+ mtk_wed_poll_busy(dev, MTK_WED_CTRL,
|
||||||
|
+ MTK_WED_CTRL_WDMA_INT_AGENT_BUSY);
|
||||||
|
+ mtk_wed_reset(dev, MTK_WED_RESET_WDMA_TX_DRV);
|
||||||
|
+
|
||||||
|
+ /* reset wed rx dma */
|
||||||
|
+ ret = mtk_wed_poll_busy(dev, MTK_WED_GLO_CFG,
|
||||||
|
+ MTK_WED_GLO_CFG_RX_DMA_BUSY);
|
||||||
|
+ wed_clr(dev, MTK_WED_GLO_CFG, MTK_WED_GLO_CFG_RX_DMA_EN);
|
||||||
|
+ if (ret) {
|
||||||
|
+ mtk_wed_reset(dev, MTK_WED_RESET_WED_RX_DMA);
|
||||||
|
+ } else {
|
||||||
|
+ struct mtk_eth *eth = dev->hw->eth;
|
||||||
|
+
|
||||||
|
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
|
||||||
|
+ wed_set(dev, MTK_WED_RESET_IDX,
|
||||||
|
+ MTK_WED_RESET_IDX_RX_V2);
|
||||||
|
+ else
|
||||||
|
+ wed_set(dev, MTK_WED_RESET_IDX, MTK_WED_RESET_IDX_RX);
|
||||||
|
+ wed_w32(dev, MTK_WED_RESET_IDX, 0);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* reset rx bm */
|
||||||
|
+ wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_WED_RX_BM_EN);
|
||||||
|
+ mtk_wed_poll_busy(dev, MTK_WED_CTRL,
|
||||||
|
+ MTK_WED_CTRL_WED_RX_BM_BUSY);
|
||||||
|
+ mtk_wed_reset(dev, MTK_WED_RESET_RX_BM);
|
||||||
|
+
|
||||||
|
+ /* wo change to enable state */
|
||||||
|
+ val = MTK_WED_WO_STATE_ENABLE;
|
||||||
|
+ ret = mtk_wed_mcu_send_msg(wo, MTK_WED_MODULE_ID_WO,
|
||||||
|
+ MTK_WED_WO_CMD_CHANGE_STATE, &val,
|
||||||
|
+ sizeof(val), true);
|
||||||
|
+ if (ret)
|
||||||
|
+ return ret;
|
||||||
|
+
|
||||||
|
+ /* wed_rx_ring_reset */
|
||||||
|
+ for (i = 0; i < ARRAY_SIZE(dev->rx_ring); i++) {
|
||||||
|
+ if (!dev->rx_ring[i].desc)
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ mtk_wed_ring_reset(&dev->rx_ring[i], MTK_WED_RX_RING_SIZE,
|
||||||
|
+ false);
|
||||||
|
+ }
|
||||||
|
+ mtk_wed_free_rx_buffer(dev);
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
@@ -1004,19 +1092,23 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (mtk_wed_poll_busy(dev))
|
||||||
|
- busy = mtk_wed_check_busy(dev);
|
||||||
|
-
|
||||||
|
+ /* 1. reset WED tx DMA */
|
||||||
|
+ wed_clr(dev, MTK_WED_GLO_CFG, MTK_WED_GLO_CFG_TX_DMA_EN);
|
||||||
|
+ busy = mtk_wed_poll_busy(dev, MTK_WED_GLO_CFG,
|
||||||
|
+ MTK_WED_GLO_CFG_TX_DMA_BUSY);
|
||||||
|
if (busy) {
|
||||||
|
mtk_wed_reset(dev, MTK_WED_RESET_WED_TX_DMA);
|
||||||
|
} else {
|
||||||
|
- wed_w32(dev, MTK_WED_RESET_IDX,
|
||||||
|
- MTK_WED_RESET_IDX_TX |
|
||||||
|
- MTK_WED_RESET_IDX_RX);
|
||||||
|
+ wed_w32(dev, MTK_WED_RESET_IDX, MTK_WED_RESET_IDX_TX);
|
||||||
|
wed_w32(dev, MTK_WED_RESET_IDX, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
- mtk_wdma_rx_reset(dev);
|
||||||
|
+ /* 2. reset WDMA rx DMA */
|
||||||
|
+ busy = !!mtk_wdma_rx_reset(dev);
|
||||||
|
+ wed_clr(dev, MTK_WED_WDMA_GLO_CFG, MTK_WED_WDMA_GLO_CFG_RX_DRV_EN);
|
||||||
|
+ if (!busy)
|
||||||
|
+ busy = mtk_wed_poll_busy(dev, MTK_WED_WDMA_GLO_CFG,
|
||||||
|
+ MTK_WED_WDMA_GLO_CFG_RX_DRV_BUSY);
|
||||||
|
|
||||||
|
if (busy) {
|
||||||
|
mtk_wed_reset(dev, MTK_WED_RESET_WDMA_INT_AGENT);
|
||||||
|
@@ -1033,6 +1125,9 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
||||||
|
MTK_WED_WDMA_GLO_CFG_RST_INIT_COMPLETE);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* 3. reset WED WPDMA tx */
|
||||||
|
+ wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
||||||
|
+
|
||||||
|
for (i = 0; i < 100; i++) {
|
||||||
|
val = wed_r32(dev, MTK_WED_TX_BM_INTF);
|
||||||
|
if (FIELD_GET(MTK_WED_TX_BM_INTF_TKFIFO_FDEP, val) == 0x40)
|
||||||
|
@@ -1040,8 +1135,19 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
||||||
|
}
|
||||||
|
|
||||||
|
mtk_wed_reset(dev, MTK_WED_RESET_TX_FREE_AGENT);
|
||||||
|
+ wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_WED_TX_BM_EN);
|
||||||
|
mtk_wed_reset(dev, MTK_WED_RESET_TX_BM);
|
||||||
|
|
||||||
|
+ /* 4. reset WED WPDMA tx */
|
||||||
|
+ busy = mtk_wed_poll_busy(dev, MTK_WED_WPDMA_GLO_CFG,
|
||||||
|
+ MTK_WED_WPDMA_GLO_CFG_TX_DRV_BUSY);
|
||||||
|
+ wed_clr(dev, MTK_WED_WPDMA_GLO_CFG,
|
||||||
|
+ MTK_WED_WPDMA_GLO_CFG_TX_DRV_EN |
|
||||||
|
+ MTK_WED_WPDMA_GLO_CFG_RX_DRV_EN);
|
||||||
|
+ if (!busy)
|
||||||
|
+ busy = mtk_wed_poll_busy(dev, MTK_WED_WPDMA_GLO_CFG,
|
||||||
|
+ MTK_WED_WPDMA_GLO_CFG_RX_DRV_BUSY);
|
||||||
|
+
|
||||||
|
if (busy) {
|
||||||
|
mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_INT_AGENT);
|
||||||
|
mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_TX_DRV);
|
||||||
|
@@ -1052,6 +1158,17 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
||||||
|
MTK_WED_WPDMA_RESET_IDX_RX);
|
||||||
|
wed_w32(dev, MTK_WED_WPDMA_RESET_IDX, 0);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ dev->init_done = false;
|
||||||
|
+ if (dev->hw->version == 1)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ if (!busy) {
|
||||||
|
+ wed_w32(dev, MTK_WED_RESET_IDX, MTK_WED_RESET_WPDMA_IDX_RX);
|
||||||
|
+ wed_w32(dev, MTK_WED_RESET_IDX, 0);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ mtk_wed_rx_reset(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
@@ -1274,6 +1391,9 @@ mtk_wed_start(struct mtk_wed_device *dev
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
+ if (mtk_wed_get_rx_capa(dev) && mtk_wed_rx_buffer_alloc(dev))
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++)
|
||||||
|
if (!dev->rx_wdma[i].desc)
|
||||||
|
mtk_wed_wdma_rx_ring_setup(dev, i, 16);
|
||||||
|
@@ -1362,10 +1482,6 @@ mtk_wed_attach(struct mtk_wed_device *de
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
if (mtk_wed_get_rx_capa(dev)) {
|
||||||
|
- ret = mtk_wed_rx_buffer_alloc(dev);
|
||||||
|
- if (ret)
|
||||||
|
- goto out;
|
||||||
|
-
|
||||||
|
ret = mtk_wed_rro_alloc(dev);
|
||||||
|
if (ret)
|
||||||
|
goto out;
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed_regs.h
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
|
||||||
|
@@ -24,11 +24,15 @@ struct mtk_wdma_desc {
|
||||||
|
|
||||||
|
#define MTK_WED_RESET 0x008
|
||||||
|
#define MTK_WED_RESET_TX_BM BIT(0)
|
||||||
|
+#define MTK_WED_RESET_RX_BM BIT(1)
|
||||||
|
#define MTK_WED_RESET_TX_FREE_AGENT BIT(4)
|
||||||
|
#define MTK_WED_RESET_WPDMA_TX_DRV BIT(8)
|
||||||
|
#define MTK_WED_RESET_WPDMA_RX_DRV BIT(9)
|
||||||
|
+#define MTK_WED_RESET_WPDMA_RX_D_DRV BIT(10)
|
||||||
|
#define MTK_WED_RESET_WPDMA_INT_AGENT BIT(11)
|
||||||
|
#define MTK_WED_RESET_WED_TX_DMA BIT(12)
|
||||||
|
+#define MTK_WED_RESET_WED_RX_DMA BIT(13)
|
||||||
|
+#define MTK_WED_RESET_WDMA_TX_DRV BIT(16)
|
||||||
|
#define MTK_WED_RESET_WDMA_RX_DRV BIT(17)
|
||||||
|
#define MTK_WED_RESET_WDMA_INT_AGENT BIT(19)
|
||||||
|
#define MTK_WED_RESET_RX_RRO_QM BIT(20)
|
||||||
|
@@ -158,6 +162,8 @@ struct mtk_wdma_desc {
|
||||||
|
#define MTK_WED_RESET_IDX 0x20c
|
||||||
|
#define MTK_WED_RESET_IDX_TX GENMASK(3, 0)
|
||||||
|
#define MTK_WED_RESET_IDX_RX GENMASK(17, 16)
|
||||||
|
+#define MTK_WED_RESET_IDX_RX_V2 GENMASK(7, 6)
|
||||||
|
+#define MTK_WED_RESET_WPDMA_IDX_RX GENMASK(31, 30)
|
||||||
|
|
||||||
|
#define MTK_WED_TX_MIB(_n) (0x2a0 + (_n) * 4)
|
||||||
|
#define MTK_WED_RX_MIB(_n) (0x2e0 + (_n) * 4)
|
||||||
|
@@ -267,6 +273,9 @@ struct mtk_wdma_desc {
|
||||||
|
|
||||||
|
#define MTK_WED_WPDMA_RX_D_GLO_CFG 0x75c
|
||||||
|
#define MTK_WED_WPDMA_RX_D_RX_DRV_EN BIT(0)
|
||||||
|
+#define MTK_WED_WPDMA_RX_D_RX_DRV_BUSY BIT(1)
|
||||||
|
+#define MTK_WED_WPDMA_RX_D_FSM_RETURN_IDLE BIT(3)
|
||||||
|
+#define MTK_WED_WPDMA_RX_D_RST_INIT_COMPLETE BIT(4)
|
||||||
|
#define MTK_WED_WPDMA_RX_D_INIT_PHASE_RXEN_SEL GENMASK(11, 7)
|
||||||
|
#define MTK_WED_WPDMA_RX_D_RXD_READ_LEN GENMASK(31, 24)
|
||||||
|
|
|
@ -0,0 +1,103 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Thu, 24 Nov 2022 16:22:55 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_wed: add reset to tx_ring_setup callback
|
||||||
|
|
||||||
|
Introduce reset parameter to mtk_wed_tx_ring_setup signature.
|
||||||
|
This is a preliminary patch to add Wireless Ethernet Dispatcher reset
|
||||||
|
support.
|
||||||
|
|
||||||
|
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
@@ -1188,7 +1188,8 @@ mtk_wed_ring_alloc(struct mtk_wed_device
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
-mtk_wed_wdma_rx_ring_setup(struct mtk_wed_device *dev, int idx, int size)
|
||||||
|
+mtk_wed_wdma_rx_ring_setup(struct mtk_wed_device *dev, int idx, int size,
|
||||||
|
+ bool reset)
|
||||||
|
{
|
||||||
|
u32 desc_size = sizeof(struct mtk_wdma_desc) * dev->hw->version;
|
||||||
|
struct mtk_wed_ring *wdma;
|
||||||
|
@@ -1197,8 +1198,8 @@ mtk_wed_wdma_rx_ring_setup(struct mtk_we
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
wdma = &dev->rx_wdma[idx];
|
||||||
|
- if (mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE, desc_size,
|
||||||
|
- true))
|
||||||
|
+ if (!reset && mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE,
|
||||||
|
+ desc_size, true))
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
wdma_w32(dev, MTK_WDMA_RING_RX(idx) + MTK_WED_RING_OFS_BASE,
|
||||||
|
@@ -1396,7 +1397,7 @@ mtk_wed_start(struct mtk_wed_device *dev
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++)
|
||||||
|
if (!dev->rx_wdma[i].desc)
|
||||||
|
- mtk_wed_wdma_rx_ring_setup(dev, i, 16);
|
||||||
|
+ mtk_wed_wdma_rx_ring_setup(dev, i, 16, false);
|
||||||
|
|
||||||
|
mtk_wed_hw_init(dev);
|
||||||
|
mtk_wed_configure_irq(dev, irq_mask);
|
||||||
|
@@ -1505,7 +1506,8 @@ unlock:
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
-mtk_wed_tx_ring_setup(struct mtk_wed_device *dev, int idx, void __iomem *regs)
|
||||||
|
+mtk_wed_tx_ring_setup(struct mtk_wed_device *dev, int idx, void __iomem *regs,
|
||||||
|
+ bool reset)
|
||||||
|
{
|
||||||
|
struct mtk_wed_ring *ring = &dev->tx_ring[idx];
|
||||||
|
|
||||||
|
@@ -1524,11 +1526,12 @@ mtk_wed_tx_ring_setup(struct mtk_wed_dev
|
||||||
|
if (WARN_ON(idx >= ARRAY_SIZE(dev->tx_ring)))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
- if (mtk_wed_ring_alloc(dev, ring, MTK_WED_TX_RING_SIZE,
|
||||||
|
- sizeof(*ring->desc), true))
|
||||||
|
+ if (!reset && mtk_wed_ring_alloc(dev, ring, MTK_WED_TX_RING_SIZE,
|
||||||
|
+ sizeof(*ring->desc), true))
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
- if (mtk_wed_wdma_rx_ring_setup(dev, idx, MTK_WED_WDMA_RING_SIZE))
|
||||||
|
+ if (mtk_wed_wdma_rx_ring_setup(dev, idx, MTK_WED_WDMA_RING_SIZE,
|
||||||
|
+ reset))
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
ring->reg_base = MTK_WED_RING_TX(idx);
|
||||||
|
--- a/include/linux/soc/mediatek/mtk_wed.h
|
||||||
|
+++ b/include/linux/soc/mediatek/mtk_wed.h
|
||||||
|
@@ -158,7 +158,7 @@ struct mtk_wed_device {
|
||||||
|
struct mtk_wed_ops {
|
||||||
|
int (*attach)(struct mtk_wed_device *dev);
|
||||||
|
int (*tx_ring_setup)(struct mtk_wed_device *dev, int ring,
|
||||||
|
- void __iomem *regs);
|
||||||
|
+ void __iomem *regs, bool reset);
|
||||||
|
int (*rx_ring_setup)(struct mtk_wed_device *dev, int ring,
|
||||||
|
void __iomem *regs);
|
||||||
|
int (*txfree_ring_setup)(struct mtk_wed_device *dev,
|
||||||
|
@@ -216,8 +216,8 @@ mtk_wed_get_rx_capa(struct mtk_wed_devic
|
||||||
|
#define mtk_wed_device_active(_dev) !!(_dev)->ops
|
||||||
|
#define mtk_wed_device_detach(_dev) (_dev)->ops->detach(_dev)
|
||||||
|
#define mtk_wed_device_start(_dev, _mask) (_dev)->ops->start(_dev, _mask)
|
||||||
|
-#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs) \
|
||||||
|
- (_dev)->ops->tx_ring_setup(_dev, _ring, _regs)
|
||||||
|
+#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs, _reset) \
|
||||||
|
+ (_dev)->ops->tx_ring_setup(_dev, _ring, _regs, _reset)
|
||||||
|
#define mtk_wed_device_txfree_ring_setup(_dev, _regs) \
|
||||||
|
(_dev)->ops->txfree_ring_setup(_dev, _regs)
|
||||||
|
#define mtk_wed_device_reg_read(_dev, _reg) \
|
||||||
|
@@ -243,7 +243,7 @@ static inline bool mtk_wed_device_active
|
||||||
|
}
|
||||||
|
#define mtk_wed_device_detach(_dev) do {} while (0)
|
||||||
|
#define mtk_wed_device_start(_dev, _mask) do {} while (0)
|
||||||
|
-#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs) -ENODEV
|
||||||
|
+#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs, _reset) -ENODEV
|
||||||
|
#define mtk_wed_device_txfree_ring_setup(_dev, _ring, _regs) -ENODEV
|
||||||
|
#define mtk_wed_device_reg_read(_dev, _reg) 0
|
||||||
|
#define mtk_wed_device_reg_write(_dev, _reg, _val) do {} while (0)
|
|
@ -0,0 +1,103 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Thu, 1 Dec 2022 16:26:53 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_wed: fix sleep while atomic in
|
||||||
|
mtk_wed_wo_queue_refill
|
||||||
|
|
||||||
|
In order to fix the following sleep while atomic bug always alloc pages
|
||||||
|
with GFP_ATOMIC in mtk_wed_wo_queue_refill since page_frag_alloc runs in
|
||||||
|
spin_lock critical section.
|
||||||
|
|
||||||
|
[ 9.049719] Hardware name: MediaTek MT7986a RFB (DT)
|
||||||
|
[ 9.054665] Call trace:
|
||||||
|
[ 9.057096] dump_backtrace+0x0/0x154
|
||||||
|
[ 9.060751] show_stack+0x14/0x1c
|
||||||
|
[ 9.064052] dump_stack_lvl+0x64/0x7c
|
||||||
|
[ 9.067702] dump_stack+0x14/0x2c
|
||||||
|
[ 9.071001] ___might_sleep+0xec/0x120
|
||||||
|
[ 9.074736] __might_sleep+0x4c/0x9c
|
||||||
|
[ 9.078296] __alloc_pages+0x184/0x2e4
|
||||||
|
[ 9.082030] page_frag_alloc_align+0x98/0x1ac
|
||||||
|
[ 9.086369] mtk_wed_wo_queue_refill+0x134/0x234
|
||||||
|
[ 9.090974] mtk_wed_wo_init+0x174/0x2c0
|
||||||
|
[ 9.094881] mtk_wed_attach+0x7c8/0x7e0
|
||||||
|
[ 9.098701] mt7915_mmio_wed_init+0x1f0/0x3a0 [mt7915e]
|
||||||
|
[ 9.103940] mt7915_pci_probe+0xec/0x3bc [mt7915e]
|
||||||
|
[ 9.108727] pci_device_probe+0xac/0x13c
|
||||||
|
[ 9.112638] really_probe.part.0+0x98/0x2f4
|
||||||
|
[ 9.116807] __driver_probe_device+0x94/0x13c
|
||||||
|
[ 9.121147] driver_probe_device+0x40/0x114
|
||||||
|
[ 9.125314] __driver_attach+0x7c/0x180
|
||||||
|
[ 9.129133] bus_for_each_dev+0x5c/0x90
|
||||||
|
[ 9.132953] driver_attach+0x20/0x2c
|
||||||
|
[ 9.136513] bus_add_driver+0x104/0x1fc
|
||||||
|
[ 9.140333] driver_register+0x74/0x120
|
||||||
|
[ 9.144153] __pci_register_driver+0x40/0x50
|
||||||
|
[ 9.148407] mt7915_init+0x5c/0x1000 [mt7915e]
|
||||||
|
[ 9.152848] do_one_initcall+0x40/0x25c
|
||||||
|
[ 9.156669] do_init_module+0x44/0x230
|
||||||
|
[ 9.160403] load_module+0x1f30/0x2750
|
||||||
|
[ 9.164135] __do_sys_init_module+0x150/0x200
|
||||||
|
[ 9.168475] __arm64_sys_init_module+0x18/0x20
|
||||||
|
[ 9.172901] invoke_syscall.constprop.0+0x4c/0xe0
|
||||||
|
[ 9.177589] do_el0_svc+0x48/0xe0
|
||||||
|
[ 9.180889] el0_svc+0x14/0x50
|
||||||
|
[ 9.183929] el0t_64_sync_handler+0x9c/0x120
|
||||||
|
[ 9.188183] el0t_64_sync+0x158/0x15c
|
||||||
|
|
||||||
|
Fixes: 799684448e3e ("net: ethernet: mtk_wed: introduce wed wo support")
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
|
||||||
|
Link: https://lore.kernel.org/r/67ca94bdd3d9eaeb86e52b3050fbca0bcf7bb02f.1669908312.git.lorenzo@kernel.org
|
||||||
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed_wo.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.c
|
||||||
|
@@ -133,17 +133,18 @@ mtk_wed_wo_dequeue(struct mtk_wed_wo *wo
|
||||||
|
|
||||||
|
static int
|
||||||
|
mtk_wed_wo_queue_refill(struct mtk_wed_wo *wo, struct mtk_wed_wo_queue *q,
|
||||||
|
- gfp_t gfp, bool rx)
|
||||||
|
+ bool rx)
|
||||||
|
{
|
||||||
|
enum dma_data_direction dir = rx ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
|
||||||
|
int n_buf = 0;
|
||||||
|
|
||||||
|
spin_lock_bh(&q->lock);
|
||||||
|
while (q->queued < q->n_desc) {
|
||||||
|
- void *buf = page_frag_alloc(&q->cache, q->buf_size, gfp);
|
||||||
|
struct mtk_wed_wo_queue_entry *entry;
|
||||||
|
dma_addr_t addr;
|
||||||
|
+ void *buf;
|
||||||
|
|
||||||
|
+ buf = page_frag_alloc(&q->cache, q->buf_size, GFP_ATOMIC);
|
||||||
|
if (!buf)
|
||||||
|
break;
|
||||||
|
|
||||||
|
@@ -215,7 +216,7 @@ mtk_wed_wo_rx_run_queue(struct mtk_wed_w
|
||||||
|
mtk_wed_mcu_rx_unsolicited_event(wo, skb);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (mtk_wed_wo_queue_refill(wo, q, GFP_ATOMIC, true)) {
|
||||||
|
+ if (mtk_wed_wo_queue_refill(wo, q, true)) {
|
||||||
|
u32 index = (q->head - 1) % q->n_desc;
|
||||||
|
|
||||||
|
mtk_wed_wo_queue_kick(wo, q, index);
|
||||||
|
@@ -432,7 +433,7 @@ mtk_wed_wo_hardware_init(struct mtk_wed_
|
||||||
|
if (ret)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
- mtk_wed_wo_queue_refill(wo, &wo->q_tx, GFP_KERNEL, false);
|
||||||
|
+ mtk_wed_wo_queue_refill(wo, &wo->q_tx, false);
|
||||||
|
mtk_wed_wo_queue_reset(wo, &wo->q_tx);
|
||||||
|
|
||||||
|
regs.desc_base = MTK_WED_WO_CCIF_DUMMY5;
|
||||||
|
@@ -446,7 +447,7 @@ mtk_wed_wo_hardware_init(struct mtk_wed_
|
||||||
|
if (ret)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
- mtk_wed_wo_queue_refill(wo, &wo->q_rx, GFP_KERNEL, true);
|
||||||
|
+ mtk_wed_wo_queue_refill(wo, &wo->q_rx, true);
|
||||||
|
mtk_wed_wo_queue_reset(wo, &wo->q_rx);
|
||||||
|
|
||||||
|
/* rx queue irqmask */
|
|
@ -0,0 +1,52 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Tue, 10 Jan 2023 10:31:26 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_wed: get rid of queue lock for rx queue
|
||||||
|
|
||||||
|
Queue spinlock is currently held in mtk_wed_wo_queue_rx_clean and
|
||||||
|
mtk_wed_wo_queue_refill routines for MTK Wireless Ethernet Dispatcher
|
||||||
|
MCU rx queue. mtk_wed_wo_queue_refill() is running during initialization
|
||||||
|
and in rx tasklet while mtk_wed_wo_queue_rx_clean() is running in
|
||||||
|
mtk_wed_wo_hw_deinit() during hw de-init phase after rx tasklet has been
|
||||||
|
disabled. Since mtk_wed_wo_queue_rx_clean and mtk_wed_wo_queue_refill
|
||||||
|
routines can't run concurrently get rid of spinlock for mcu rx queue.
|
||||||
|
|
||||||
|
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Link: https://lore.kernel.org/r/36ec3b729542ea60898471d890796f745479ba32.1673342990.git.lorenzo@kernel.org
|
||||||
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed_wo.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.c
|
||||||
|
@@ -138,7 +138,6 @@ mtk_wed_wo_queue_refill(struct mtk_wed_w
|
||||||
|
enum dma_data_direction dir = rx ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
|
||||||
|
int n_buf = 0;
|
||||||
|
|
||||||
|
- spin_lock_bh(&q->lock);
|
||||||
|
while (q->queued < q->n_desc) {
|
||||||
|
struct mtk_wed_wo_queue_entry *entry;
|
||||||
|
dma_addr_t addr;
|
||||||
|
@@ -172,7 +171,6 @@ mtk_wed_wo_queue_refill(struct mtk_wed_w
|
||||||
|
q->queued++;
|
||||||
|
n_buf++;
|
||||||
|
}
|
||||||
|
- spin_unlock_bh(&q->lock);
|
||||||
|
|
||||||
|
return n_buf;
|
||||||
|
}
|
||||||
|
@@ -316,7 +314,6 @@ mtk_wed_wo_queue_rx_clean(struct mtk_wed
|
||||||
|
{
|
||||||
|
struct page *page;
|
||||||
|
|
||||||
|
- spin_lock_bh(&q->lock);
|
||||||
|
for (;;) {
|
||||||
|
void *buf = mtk_wed_wo_dequeue(wo, q, NULL, true);
|
||||||
|
|
||||||
|
@@ -325,7 +322,6 @@ mtk_wed_wo_queue_rx_clean(struct mtk_wed
|
||||||
|
|
||||||
|
skb_free_frag(buf);
|
||||||
|
}
|
||||||
|
- spin_unlock_bh(&q->lock);
|
||||||
|
|
||||||
|
if (!q->cache.va)
|
||||||
|
return;
|
|
@ -0,0 +1,75 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Thu, 12 Jan 2023 10:21:29 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_wed: get rid of queue lock for tx queue
|
||||||
|
|
||||||
|
Similar to MTK Wireless Ethernet Dispatcher (WED) MCU rx queue,
|
||||||
|
we do not need to protect WED MCU tx queue with a spin lock since
|
||||||
|
the tx queue is accessed in the two following routines:
|
||||||
|
- mtk_wed_wo_queue_tx_skb():
|
||||||
|
it is run at initialization and during mt7915 normal operation.
|
||||||
|
Moreover MCU messages are serialized through MCU mutex.
|
||||||
|
- mtk_wed_wo_queue_tx_clean():
|
||||||
|
it runs just at mt7915 driver module unload when no more messages
|
||||||
|
are sent to the MCU.
|
||||||
|
|
||||||
|
Remove tx queue spinlock.
|
||||||
|
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Link: https://lore.kernel.org/r/7bd0337b2a13ab1a63673b7c03fd35206b3b284e.1673515140.git.lorenzo@kernel.org
|
||||||
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed_wo.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.c
|
||||||
|
@@ -258,7 +258,6 @@ mtk_wed_wo_queue_alloc(struct mtk_wed_wo
|
||||||
|
int n_desc, int buf_size, int index,
|
||||||
|
struct mtk_wed_wo_queue_regs *regs)
|
||||||
|
{
|
||||||
|
- spin_lock_init(&q->lock);
|
||||||
|
q->regs = *regs;
|
||||||
|
q->n_desc = n_desc;
|
||||||
|
q->buf_size = buf_size;
|
||||||
|
@@ -290,7 +289,6 @@ mtk_wed_wo_queue_tx_clean(struct mtk_wed
|
||||||
|
struct page *page;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
- spin_lock_bh(&q->lock);
|
||||||
|
for (i = 0; i < q->n_desc; i++) {
|
||||||
|
struct mtk_wed_wo_queue_entry *entry = &q->entry[i];
|
||||||
|
|
||||||
|
@@ -299,7 +297,6 @@ mtk_wed_wo_queue_tx_clean(struct mtk_wed
|
||||||
|
skb_free_frag(entry->buf);
|
||||||
|
entry->buf = NULL;
|
||||||
|
}
|
||||||
|
- spin_unlock_bh(&q->lock);
|
||||||
|
|
||||||
|
if (!q->cache.va)
|
||||||
|
return;
|
||||||
|
@@ -347,8 +344,6 @@ int mtk_wed_wo_queue_tx_skb(struct mtk_w
|
||||||
|
int ret = 0, index;
|
||||||
|
u32 ctrl;
|
||||||
|
|
||||||
|
- spin_lock_bh(&q->lock);
|
||||||
|
-
|
||||||
|
q->tail = mtk_wed_mmio_r32(wo, q->regs.dma_idx);
|
||||||
|
index = (q->head + 1) % q->n_desc;
|
||||||
|
if (q->tail == index) {
|
||||||
|
@@ -379,8 +374,6 @@ int mtk_wed_wo_queue_tx_skb(struct mtk_w
|
||||||
|
mtk_wed_wo_queue_kick(wo, q, q->head);
|
||||||
|
mtk_wed_wo_kickout(wo);
|
||||||
|
out:
|
||||||
|
- spin_unlock_bh(&q->lock);
|
||||||
|
-
|
||||||
|
dev_kfree_skb(skb);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed_wo.h
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.h
|
||||||
|
@@ -211,7 +211,6 @@ struct mtk_wed_wo_queue {
|
||||||
|
struct mtk_wed_wo_queue_regs regs;
|
||||||
|
|
||||||
|
struct page_frag_cache cache;
|
||||||
|
- spinlock_t lock;
|
||||||
|
|
||||||
|
struct mtk_wed_wo_queue_desc *desc;
|
||||||
|
dma_addr_t desc_dma;
|
|
@ -0,0 +1,70 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Sat, 14 Jan 2023 18:01:28 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: introduce mtk_hw_reset utility
|
||||||
|
routine
|
||||||
|
|
||||||
|
This is a preliminary patch to add Wireless Ethernet Dispatcher reset
|
||||||
|
support.
|
||||||
|
|
||||||
|
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
|
||||||
|
Tested-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
|
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
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
|
||||||
|
mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void mtk_hw_reset(struct mtk_eth *eth)
|
||||||
|
+{
|
||||||
|
+ u32 val;
|
||||||
|
+
|
||||||
|
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
||||||
|
+ regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0);
|
||||||
|
+ val = RSTCTRL_PPE0_V2;
|
||||||
|
+ } else {
|
||||||
|
+ val = RSTCTRL_PPE0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
|
||||||
|
+ val |= RSTCTRL_PPE1;
|
||||||
|
+
|
||||||
|
+ ethsys_reset(eth, RSTCTRL_ETH | RSTCTRL_FE | val);
|
||||||
|
+
|
||||||
|
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
|
||||||
|
+ regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN,
|
||||||
|
+ 0x3ffffff);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
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
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
||||||
|
- regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0);
|
||||||
|
- val = RSTCTRL_PPE0_V2;
|
||||||
|
- } else {
|
||||||
|
- val = RSTCTRL_PPE0;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
|
||||||
|
- val |= RSTCTRL_PPE1;
|
||||||
|
-
|
||||||
|
- ethsys_reset(eth, RSTCTRL_ETH | RSTCTRL_FE | val);
|
||||||
|
+ mtk_hw_reset(eth);
|
||||||
|
|
||||||
|
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
||||||
|
- regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN,
|
||||||
|
- 0x3ffffff);
|
||||||
|
-
|
||||||
|
/* Set FE to PDMAv2 if necessary */
|
||||||
|
val = mtk_r32(eth, MTK_FE_GLO_MISC);
|
||||||
|
mtk_w32(eth, val | BIT(4), MTK_FE_GLO_MISC);
|
|
@ -0,0 +1,107 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Sat, 14 Jan 2023 18:01:29 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: introduce mtk_hw_warm_reset
|
||||||
|
support
|
||||||
|
|
||||||
|
Introduce mtk_hw_warm_reset utility routine. This is a preliminary patch
|
||||||
|
to align reset procedure to vendor sdk and avoid to power down the chip
|
||||||
|
during hw reset.
|
||||||
|
|
||||||
|
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
|
||||||
|
Tested-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
|
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
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
|
||||||
|
0x3ffffff);
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int mtk_hw_init(struct mtk_eth *eth)
|
||||||
|
+static u32 mtk_hw_reset_read(struct mtk_eth *eth)
|
||||||
|
+{
|
||||||
|
+ u32 val;
|
||||||
|
+
|
||||||
|
+ regmap_read(eth->ethsys, ETHSYS_RSTCTRL, &val);
|
||||||
|
+ return val;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void mtk_hw_warm_reset(struct mtk_eth *eth)
|
||||||
|
+{
|
||||||
|
+ u32 rst_mask, val;
|
||||||
|
+
|
||||||
|
+ regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL, RSTCTRL_FE,
|
||||||
|
+ RSTCTRL_FE);
|
||||||
|
+ if (readx_poll_timeout_atomic(mtk_hw_reset_read, eth, val,
|
||||||
|
+ val & RSTCTRL_FE, 1, 1000)) {
|
||||||
|
+ dev_err(eth->dev, "warm reset failed\n");
|
||||||
|
+ mtk_hw_reset(eth);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
|
||||||
|
+ rst_mask = RSTCTRL_ETH | RSTCTRL_PPE0_V2;
|
||||||
|
+ else
|
||||||
|
+ rst_mask = RSTCTRL_ETH | RSTCTRL_PPE0;
|
||||||
|
+
|
||||||
|
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
|
||||||
|
+ rst_mask |= RSTCTRL_PPE1;
|
||||||
|
+
|
||||||
|
+ regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL, rst_mask, rst_mask);
|
||||||
|
+
|
||||||
|
+ udelay(1);
|
||||||
|
+ val = mtk_hw_reset_read(eth);
|
||||||
|
+ if (!(val & rst_mask))
|
||||||
|
+ dev_err(eth->dev, "warm reset stage0 failed %08x (%08x)\n",
|
||||||
|
+ val, rst_mask);
|
||||||
|
+
|
||||||
|
+ rst_mask |= RSTCTRL_FE;
|
||||||
|
+ regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL, rst_mask, ~rst_mask);
|
||||||
|
+
|
||||||
|
+ udelay(1);
|
||||||
|
+ val = mtk_hw_reset_read(eth);
|
||||||
|
+ if (val & rst_mask)
|
||||||
|
+ dev_err(eth->dev, "warm reset stage1 failed %08x (%08x)\n",
|
||||||
|
+ val, rst_mask);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int mtk_hw_init(struct mtk_eth *eth, bool reset)
|
||||||
|
{
|
||||||
|
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
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
- mtk_hw_reset(eth);
|
||||||
|
+ msleep(100);
|
||||||
|
+
|
||||||
|
+ if (reset)
|
||||||
|
+ mtk_hw_warm_reset(eth);
|
||||||
|
+ else
|
||||||
|
+ mtk_hw_reset(eth);
|
||||||
|
|
||||||
|
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
|
||||||
|
if (eth->dev->pins)
|
||||||
|
pinctrl_select_state(eth->dev->pins->p,
|
||||||
|
eth->dev->pins->default_state);
|
||||||
|
- mtk_hw_init(eth);
|
||||||
|
+ mtk_hw_init(eth, true);
|
||||||
|
|
||||||
|
/* restart DMA and enable IRQs */
|
||||||
|
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||||
|
@@ -4056,7 +4108,7 @@ static int mtk_probe(struct platform_dev
|
||||||
|
eth->msg_enable = netif_msg_init(mtk_msg_level, MTK_DEFAULT_MSG_ENABLE);
|
||||||
|
INIT_WORK(ð->pending_work, mtk_pending_work);
|
||||||
|
|
||||||
|
- err = mtk_hw_init(eth);
|
||||||
|
+ err = mtk_hw_init(eth, false);
|
||||||
|
if (err)
|
||||||
|
goto err_wed_exit;
|
||||||
|
|
|
@ -0,0 +1,262 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Sat, 14 Jan 2023 18:01:30 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: align reset procedure to vendor
|
||||||
|
sdk
|
||||||
|
|
||||||
|
Avoid to power-down the ethernet chip during hw reset and align reset
|
||||||
|
procedure to vendor sdk.
|
||||||
|
|
||||||
|
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
|
||||||
|
Tested-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
|
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
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
|
||||||
|
kfree(eth->scratch_head);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static bool mtk_hw_reset_check(struct mtk_eth *eth)
|
||||||
|
+{
|
||||||
|
+ u32 val = mtk_r32(eth, MTK_INT_STATUS2);
|
||||||
|
+
|
||||||
|
+ return (val & MTK_FE_INT_FQ_EMPTY) || (val & MTK_FE_INT_RFIFO_UF) ||
|
||||||
|
+ (val & MTK_FE_INT_RFIFO_OV) || (val & MTK_FE_INT_TSO_FAIL) ||
|
||||||
|
+ (val & MTK_FE_INT_TSO_ALIGN) || (val & MTK_FE_INT_TSO_ILLEGAL);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void mtk_tx_timeout(struct net_device *dev, unsigned int txqueue)
|
||||||
|
{
|
||||||
|
struct mtk_mac *mac = netdev_priv(dev);
|
||||||
|
struct mtk_eth *eth = mac->hw;
|
||||||
|
|
||||||
|
+ if (test_bit(MTK_RESETTING, ð->state))
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ if (!mtk_hw_reset_check(eth))
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
eth->netdev[mac->id]->stats.tx_errors++;
|
||||||
|
- netif_err(eth, tx_err, dev,
|
||||||
|
- "transmit timed out\n");
|
||||||
|
+ netif_err(eth, tx_err, dev, "transmit timed out\n");
|
||||||
|
+
|
||||||
|
schedule_work(ð->pending_work);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -3274,15 +3289,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;
|
||||||
|
|
||||||
|
- if (test_and_set_bit(MTK_HW_INIT, ð->state))
|
||||||
|
+ if (!reset && test_and_set_bit(MTK_HW_INIT, ð->state))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
- pm_runtime_enable(eth->dev);
|
||||||
|
- pm_runtime_get_sync(eth->dev);
|
||||||
|
+ if (!reset) {
|
||||||
|
+ pm_runtime_enable(eth->dev);
|
||||||
|
+ pm_runtime_get_sync(eth->dev);
|
||||||
|
|
||||||
|
- ret = mtk_clk_enable(eth);
|
||||||
|
- if (ret)
|
||||||
|
- goto err_disable_pm;
|
||||||
|
+ ret = mtk_clk_enable(eth);
|
||||||
|
+ if (ret)
|
||||||
|
+ goto err_disable_pm;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
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
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
err_disable_pm:
|
||||||
|
- pm_runtime_put_sync(eth->dev);
|
||||||
|
- pm_runtime_disable(eth->dev);
|
||||||
|
+ if (!reset) {
|
||||||
|
+ pm_runtime_put_sync(eth->dev);
|
||||||
|
+ pm_runtime_disable(eth->dev);
|
||||||
|
+ }
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
@@ -3488,30 +3507,53 @@ static int mtk_do_ioctl(struct net_devic
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void mtk_prepare_for_reset(struct mtk_eth *eth)
|
||||||
|
+{
|
||||||
|
+ u32 val;
|
||||||
|
+ int i;
|
||||||
|
+
|
||||||
|
+ /* disabe FE P3 and P4 */
|
||||||
|
+ val = mtk_r32(eth, MTK_FE_GLO_CFG) | MTK_FE_LINK_DOWN_P3;
|
||||||
|
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
|
||||||
|
+ val |= MTK_FE_LINK_DOWN_P4;
|
||||||
|
+ mtk_w32(eth, val, MTK_FE_GLO_CFG);
|
||||||
|
+
|
||||||
|
+ /* adjust PPE configurations to prepare for reset */
|
||||||
|
+ for (i = 0; i < ARRAY_SIZE(eth->ppe); i++)
|
||||||
|
+ mtk_ppe_prepare_reset(eth->ppe[i]);
|
||||||
|
+
|
||||||
|
+ /* disable NETSYS interrupts */
|
||||||
|
+ mtk_w32(eth, 0, MTK_FE_INT_ENABLE);
|
||||||
|
+
|
||||||
|
+ /* force link down GMAC */
|
||||||
|
+ for (i = 0; i < 2; i++) {
|
||||||
|
+ val = mtk_r32(eth, MTK_MAC_MCR(i)) & ~MAC_MCR_FORCE_LINK;
|
||||||
|
+ mtk_w32(eth, val, MTK_MAC_MCR(i));
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void mtk_pending_work(struct work_struct *work)
|
||||||
|
{
|
||||||
|
struct mtk_eth *eth = container_of(work, struct mtk_eth, pending_work);
|
||||||
|
- int err, i;
|
||||||
|
unsigned long restart = 0;
|
||||||
|
+ u32 val;
|
||||||
|
+ int i;
|
||||||
|
|
||||||
|
rtnl_lock();
|
||||||
|
-
|
||||||
|
- dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__);
|
||||||
|
set_bit(MTK_RESETTING, ð->state);
|
||||||
|
|
||||||
|
+ mtk_prepare_for_reset(eth);
|
||||||
|
+
|
||||||
|
/* stop all devices to make sure that dma is properly shut down */
|
||||||
|
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||||
|
- if (!eth->netdev[i])
|
||||||
|
+ if (!eth->netdev[i] || !netif_running(eth->netdev[i]))
|
||||||
|
continue;
|
||||||
|
+
|
||||||
|
mtk_stop(eth->netdev[i]);
|
||||||
|
__set_bit(i, &restart);
|
||||||
|
}
|
||||||
|
- dev_dbg(eth->dev, "[%s][%d] mtk_stop ends\n", __func__, __LINE__);
|
||||||
|
|
||||||
|
- /* restart underlying hardware such as power, clock, pin mux
|
||||||
|
- * and the connected phy
|
||||||
|
- */
|
||||||
|
- mtk_hw_deinit(eth);
|
||||||
|
+ usleep_range(15000, 16000);
|
||||||
|
|
||||||
|
if (eth->dev->pins)
|
||||||
|
pinctrl_select_state(eth->dev->pins->p,
|
||||||
|
@@ -3522,15 +3564,19 @@ static void mtk_pending_work(struct work
|
||||||
|
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||||
|
if (!test_bit(i, &restart))
|
||||||
|
continue;
|
||||||
|
- err = mtk_open(eth->netdev[i]);
|
||||||
|
- if (err) {
|
||||||
|
+
|
||||||
|
+ if (mtk_open(eth->netdev[i])) {
|
||||||
|
netif_alert(eth, ifup, eth->netdev[i],
|
||||||
|
- "Driver up/down cycle failed, closing device.\n");
|
||||||
|
+ "Driver up/down cycle failed\n");
|
||||||
|
dev_close(eth->netdev[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__);
|
||||||
|
+ /* enabe FE P3 and P4 */
|
||||||
|
+ val = mtk_r32(eth, MTK_FE_GLO_CFG) & ~MTK_FE_LINK_DOWN_P3;
|
||||||
|
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
|
||||||
|
+ val &= ~MTK_FE_LINK_DOWN_P4;
|
||||||
|
+ mtk_w32(eth, val, MTK_FE_GLO_CFG);
|
||||||
|
|
||||||
|
clear_bit(MTK_RESETTING, ð->state);
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
|
@@ -72,12 +72,24 @@
|
||||||
|
#define MTK_HW_LRO_REPLACE_DELTA 1000
|
||||||
|
#define MTK_HW_LRO_SDL_REMAIN_ROOM 1522
|
||||||
|
|
||||||
|
+/* Frame Engine Global Configuration */
|
||||||
|
+#define MTK_FE_GLO_CFG 0x00
|
||||||
|
+#define MTK_FE_LINK_DOWN_P3 BIT(11)
|
||||||
|
+#define MTK_FE_LINK_DOWN_P4 BIT(12)
|
||||||
|
+
|
||||||
|
/* Frame Engine Global Reset Register */
|
||||||
|
#define MTK_RST_GL 0x04
|
||||||
|
#define RST_GL_PSE BIT(0)
|
||||||
|
|
||||||
|
/* Frame Engine Interrupt Status Register */
|
||||||
|
#define MTK_INT_STATUS2 0x08
|
||||||
|
+#define MTK_FE_INT_ENABLE 0x0c
|
||||||
|
+#define MTK_FE_INT_FQ_EMPTY BIT(8)
|
||||||
|
+#define MTK_FE_INT_TSO_FAIL BIT(12)
|
||||||
|
+#define MTK_FE_INT_TSO_ILLEGAL BIT(13)
|
||||||
|
+#define MTK_FE_INT_TSO_ALIGN BIT(14)
|
||||||
|
+#define MTK_FE_INT_RFIFO_OV BIT(18)
|
||||||
|
+#define MTK_FE_INT_RFIFO_UF BIT(19)
|
||||||
|
#define MTK_GDM1_AF BIT(28)
|
||||||
|
#define MTK_GDM2_AF BIT(29)
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
|
@@ -716,6 +716,33 @@ int mtk_foe_entry_idle_time(struct mtk_p
|
||||||
|
return __mtk_foe_entry_idle_time(ppe, entry->data.ib1);
|
||||||
|
}
|
||||||
|
|
||||||
|
+int mtk_ppe_prepare_reset(struct mtk_ppe *ppe)
|
||||||
|
+{
|
||||||
|
+ if (!ppe)
|
||||||
|
+ return -EINVAL;
|
||||||
|
+
|
||||||
|
+ /* disable KA */
|
||||||
|
+ ppe_clear(ppe, MTK_PPE_TB_CFG, MTK_PPE_TB_CFG_KEEPALIVE);
|
||||||
|
+ ppe_clear(ppe, MTK_PPE_BIND_LMT1, MTK_PPE_NTU_KEEPALIVE);
|
||||||
|
+ ppe_w32(ppe, MTK_PPE_KEEPALIVE, 0);
|
||||||
|
+ usleep_range(10000, 11000);
|
||||||
|
+
|
||||||
|
+ /* set KA timer to maximum */
|
||||||
|
+ ppe_set(ppe, MTK_PPE_BIND_LMT1, MTK_PPE_NTU_KEEPALIVE);
|
||||||
|
+ ppe_w32(ppe, MTK_PPE_KEEPALIVE, 0xffffffff);
|
||||||
|
+
|
||||||
|
+ /* set KA tick select */
|
||||||
|
+ ppe_set(ppe, MTK_PPE_TB_CFG, MTK_PPE_TB_TICK_SEL);
|
||||||
|
+ ppe_set(ppe, MTK_PPE_TB_CFG, MTK_PPE_TB_CFG_KEEPALIVE);
|
||||||
|
+ usleep_range(10000, 11000);
|
||||||
|
+
|
||||||
|
+ /* disable scan mode */
|
||||||
|
+ ppe_clear(ppe, MTK_PPE_TB_CFG, MTK_PPE_TB_CFG_SCAN_MODE);
|
||||||
|
+ usleep_range(10000, 11000);
|
||||||
|
+
|
||||||
|
+ return mtk_ppe_wait_busy(ppe);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base,
|
||||||
|
int version, int index)
|
||||||
|
{
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
|
||||||
|
@@ -306,6 +306,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
|
||||||
|
int version, int index);
|
||||||
|
void mtk_ppe_start(struct mtk_ppe *ppe);
|
||||||
|
int mtk_ppe_stop(struct mtk_ppe *ppe);
|
||||||
|
+int mtk_ppe_prepare_reset(struct mtk_ppe *ppe);
|
||||||
|
|
||||||
|
void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash);
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
|
||||||
|
@@ -58,6 +58,12 @@
|
||||||
|
#define MTK_PPE_TB_CFG_SCAN_MODE GENMASK(17, 16)
|
||||||
|
#define MTK_PPE_TB_CFG_HASH_DEBUG GENMASK(19, 18)
|
||||||
|
#define MTK_PPE_TB_CFG_INFO_SEL BIT(20)
|
||||||
|
+#define MTK_PPE_TB_TICK_SEL BIT(24)
|
||||||
|
+
|
||||||
|
+#define MTK_PPE_BIND_LMT1 0x230
|
||||||
|
+#define MTK_PPE_NTU_KEEPALIVE GENMASK(23, 16)
|
||||||
|
+
|
||||||
|
+#define MTK_PPE_KEEPALIVE 0x234
|
||||||
|
|
||||||
|
enum {
|
||||||
|
MTK_PPE_SCAN_MODE_DISABLED,
|
|
@ -0,0 +1,249 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Sat, 14 Jan 2023 18:01:31 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: add dma checks to
|
||||||
|
mtk_hw_reset_check
|
||||||
|
|
||||||
|
Introduce mtk_hw_check_dma_hang routine to monitor possible dma hangs.
|
||||||
|
|
||||||
|
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
|
||||||
|
Tested-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
|
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
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
|
||||||
|
@@ -50,6 +50,7 @@ static const struct mtk_reg_map mtk_reg_
|
||||||
|
.delay_irq = 0x0a0c,
|
||||||
|
.irq_status = 0x0a20,
|
||||||
|
.irq_mask = 0x0a28,
|
||||||
|
+ .adma_rx_dbg0 = 0x0a38,
|
||||||
|
.int_grp = 0x0a50,
|
||||||
|
},
|
||||||
|
.qdma = {
|
||||||
|
@@ -79,6 +80,8 @@ static const struct mtk_reg_map mtk_reg_
|
||||||
|
[0] = 0x2800,
|
||||||
|
[1] = 0x2c00,
|
||||||
|
},
|
||||||
|
+ .pse_iq_sta = 0x0110,
|
||||||
|
+ .pse_oq_sta = 0x0118,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct mtk_reg_map mt7628_reg_map = {
|
||||||
|
@@ -109,6 +112,7 @@ static const struct mtk_reg_map mt7986_r
|
||||||
|
.delay_irq = 0x620c,
|
||||||
|
.irq_status = 0x6220,
|
||||||
|
.irq_mask = 0x6228,
|
||||||
|
+ .adma_rx_dbg0 = 0x6238,
|
||||||
|
.int_grp = 0x6250,
|
||||||
|
},
|
||||||
|
.qdma = {
|
||||||
|
@@ -138,6 +142,8 @@ static const struct mtk_reg_map mt7986_r
|
||||||
|
[0] = 0x4800,
|
||||||
|
[1] = 0x4c00,
|
||||||
|
},
|
||||||
|
+ .pse_iq_sta = 0x0180,
|
||||||
|
+ .pse_oq_sta = 0x01a0,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* strings used by ethtool */
|
||||||
|
@@ -3282,6 +3288,102 @@ static void mtk_hw_warm_reset(struct mtk
|
||||||
|
val, rst_mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static bool mtk_hw_check_dma_hang(struct mtk_eth *eth)
|
||||||
|
+{
|
||||||
|
+ const struct mtk_reg_map *reg_map = eth->soc->reg_map;
|
||||||
|
+ bool gmac1_tx, gmac2_tx, gdm1_tx, gdm2_tx;
|
||||||
|
+ bool oq_hang, cdm1_busy, adma_busy;
|
||||||
|
+ bool wtx_busy, cdm_full, oq_free;
|
||||||
|
+ u32 wdidx, val, gdm1_fc, gdm2_fc;
|
||||||
|
+ bool qfsm_hang, qfwd_hang;
|
||||||
|
+ bool ret = false;
|
||||||
|
+
|
||||||
|
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
|
||||||
|
+ return false;
|
||||||
|
+
|
||||||
|
+ /* WDMA sanity checks */
|
||||||
|
+ wdidx = mtk_r32(eth, reg_map->wdma_base[0] + 0xc);
|
||||||
|
+
|
||||||
|
+ val = mtk_r32(eth, reg_map->wdma_base[0] + 0x204);
|
||||||
|
+ wtx_busy = FIELD_GET(MTK_TX_DMA_BUSY, val);
|
||||||
|
+
|
||||||
|
+ val = mtk_r32(eth, reg_map->wdma_base[0] + 0x230);
|
||||||
|
+ cdm_full = !FIELD_GET(MTK_CDM_TXFIFO_RDY, val);
|
||||||
|
+
|
||||||
|
+ oq_free = (!(mtk_r32(eth, reg_map->pse_oq_sta) & GENMASK(24, 16)) &&
|
||||||
|
+ !(mtk_r32(eth, reg_map->pse_oq_sta + 0x4) & GENMASK(8, 0)) &&
|
||||||
|
+ !(mtk_r32(eth, reg_map->pse_oq_sta + 0x10) & GENMASK(24, 16)));
|
||||||
|
+
|
||||||
|
+ if (wdidx == eth->reset.wdidx && wtx_busy && cdm_full && oq_free) {
|
||||||
|
+ if (++eth->reset.wdma_hang_count > 2) {
|
||||||
|
+ eth->reset.wdma_hang_count = 0;
|
||||||
|
+ ret = true;
|
||||||
|
+ }
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* QDMA sanity checks */
|
||||||
|
+ qfsm_hang = !!mtk_r32(eth, reg_map->qdma.qtx_cfg + 0x234);
|
||||||
|
+ qfwd_hang = !mtk_r32(eth, reg_map->qdma.qtx_cfg + 0x308);
|
||||||
|
+
|
||||||
|
+ gdm1_tx = FIELD_GET(GENMASK(31, 16), mtk_r32(eth, MTK_FE_GDM1_FSM)) > 0;
|
||||||
|
+ gdm2_tx = FIELD_GET(GENMASK(31, 16), mtk_r32(eth, MTK_FE_GDM2_FSM)) > 0;
|
||||||
|
+ gmac1_tx = FIELD_GET(GENMASK(31, 24), mtk_r32(eth, MTK_MAC_FSM(0))) != 1;
|
||||||
|
+ gmac2_tx = FIELD_GET(GENMASK(31, 24), mtk_r32(eth, MTK_MAC_FSM(1))) != 1;
|
||||||
|
+ gdm1_fc = mtk_r32(eth, reg_map->gdm1_cnt + 0x24);
|
||||||
|
+ gdm2_fc = mtk_r32(eth, reg_map->gdm1_cnt + 0x64);
|
||||||
|
+
|
||||||
|
+ if (qfsm_hang && qfwd_hang &&
|
||||||
|
+ ((gdm1_tx && gmac1_tx && gdm1_fc < 1) ||
|
||||||
|
+ (gdm2_tx && gmac2_tx && gdm2_fc < 1))) {
|
||||||
|
+ if (++eth->reset.qdma_hang_count > 2) {
|
||||||
|
+ eth->reset.qdma_hang_count = 0;
|
||||||
|
+ ret = true;
|
||||||
|
+ }
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* ADMA sanity checks */
|
||||||
|
+ oq_hang = !!(mtk_r32(eth, reg_map->pse_oq_sta) & GENMASK(8, 0));
|
||||||
|
+ cdm1_busy = !!(mtk_r32(eth, MTK_FE_CDM1_FSM) & GENMASK(31, 16));
|
||||||
|
+ adma_busy = !(mtk_r32(eth, reg_map->pdma.adma_rx_dbg0) & GENMASK(4, 0)) &&
|
||||||
|
+ !(mtk_r32(eth, reg_map->pdma.adma_rx_dbg0) & BIT(6));
|
||||||
|
+
|
||||||
|
+ if (oq_hang && cdm1_busy && adma_busy) {
|
||||||
|
+ if (++eth->reset.adma_hang_count > 2) {
|
||||||
|
+ eth->reset.adma_hang_count = 0;
|
||||||
|
+ ret = true;
|
||||||
|
+ }
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ eth->reset.wdma_hang_count = 0;
|
||||||
|
+ eth->reset.qdma_hang_count = 0;
|
||||||
|
+ eth->reset.adma_hang_count = 0;
|
||||||
|
+out:
|
||||||
|
+ eth->reset.wdidx = wdidx;
|
||||||
|
+
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void mtk_hw_reset_monitor_work(struct work_struct *work)
|
||||||
|
+{
|
||||||
|
+ struct delayed_work *del_work = to_delayed_work(work);
|
||||||
|
+ struct mtk_eth *eth = container_of(del_work, struct mtk_eth,
|
||||||
|
+ reset.monitor_work);
|
||||||
|
+
|
||||||
|
+ if (test_bit(MTK_RESETTING, ð->state))
|
||||||
|
+ goto out;
|
||||||
|
+
|
||||||
|
+ /* DMA stuck checks */
|
||||||
|
+ if (mtk_hw_check_dma_hang(eth))
|
||||||
|
+ schedule_work(ð->pending_work);
|
||||||
|
+
|
||||||
|
+out:
|
||||||
|
+ schedule_delayed_work(ð->reset.monitor_work,
|
||||||
|
+ MTK_DMA_MONITOR_TIMEOUT);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
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
|
||||||
|
mtk_unreg_dev(eth);
|
||||||
|
mtk_free_dev(eth);
|
||||||
|
cancel_work_sync(ð->pending_work);
|
||||||
|
+ cancel_delayed_work_sync(ð->reset.monitor_work);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@@ -4041,6 +4144,7 @@ static int mtk_probe(struct platform_dev
|
||||||
|
|
||||||
|
eth->rx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
|
||||||
|
INIT_WORK(ð->rx_dim.work, mtk_dim_rx);
|
||||||
|
+ INIT_DELAYED_WORK(ð->reset.monitor_work, mtk_hw_reset_monitor_work);
|
||||||
|
|
||||||
|
eth->tx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
|
||||||
|
INIT_WORK(ð->tx_dim.work, mtk_dim_tx);
|
||||||
|
@@ -4245,6 +4349,8 @@ static int mtk_probe(struct platform_dev
|
||||||
|
NAPI_POLL_WEIGHT);
|
||||||
|
|
||||||
|
platform_set_drvdata(pdev, eth);
|
||||||
|
+ schedule_delayed_work(ð->reset.monitor_work,
|
||||||
|
+ MTK_DMA_MONITOR_TIMEOUT);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
|
@@ -256,6 +256,8 @@
|
||||||
|
|
||||||
|
#define MTK_RX_DONE_INT_V2 BIT(14)
|
||||||
|
|
||||||
|
+#define MTK_CDM_TXFIFO_RDY BIT(7)
|
||||||
|
+
|
||||||
|
/* QDMA Interrupt grouping registers */
|
||||||
|
#define MTK_RLS_DONE_INT BIT(0)
|
||||||
|
|
||||||
|
@@ -537,6 +539,17 @@
|
||||||
|
#define MT7628_SDM_RBCNT (MT7628_SDM_OFFSET + 0x10c)
|
||||||
|
#define MT7628_SDM_CS_ERR (MT7628_SDM_OFFSET + 0x110)
|
||||||
|
|
||||||
|
+#define MTK_FE_CDM1_FSM 0x220
|
||||||
|
+#define MTK_FE_CDM2_FSM 0x224
|
||||||
|
+#define MTK_FE_CDM3_FSM 0x238
|
||||||
|
+#define MTK_FE_CDM4_FSM 0x298
|
||||||
|
+#define MTK_FE_CDM5_FSM 0x318
|
||||||
|
+#define MTK_FE_CDM6_FSM 0x328
|
||||||
|
+#define MTK_FE_GDM1_FSM 0x228
|
||||||
|
+#define MTK_FE_GDM2_FSM 0x22C
|
||||||
|
+
|
||||||
|
+#define MTK_MAC_FSM(x) (0x1010C + ((x) * 0x100))
|
||||||
|
+
|
||||||
|
struct mtk_rx_dma {
|
||||||
|
unsigned int rxd1;
|
||||||
|
unsigned int rxd2;
|
||||||
|
@@ -933,6 +946,7 @@ struct mtk_reg_map {
|
||||||
|
u32 delay_irq; /* delay interrupt */
|
||||||
|
u32 irq_status; /* interrupt status */
|
||||||
|
u32 irq_mask; /* interrupt mask */
|
||||||
|
+ u32 adma_rx_dbg0;
|
||||||
|
u32 int_grp;
|
||||||
|
} pdma;
|
||||||
|
struct {
|
||||||
|
@@ -959,6 +973,8 @@ struct mtk_reg_map {
|
||||||
|
u32 gdma_to_ppe0;
|
||||||
|
u32 ppe_base;
|
||||||
|
u32 wdma_base[2];
|
||||||
|
+ u32 pse_iq_sta;
|
||||||
|
+ u32 pse_oq_sta;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* struct mtk_eth_data - This is the structure holding all differences
|
||||||
|
@@ -1001,6 +1017,8 @@ struct mtk_soc_data {
|
||||||
|
} txrx;
|
||||||
|
};
|
||||||
|
|
||||||
|
+#define MTK_DMA_MONITOR_TIMEOUT msecs_to_jiffies(1000)
|
||||||
|
+
|
||||||
|
/* currently no SoC has more than 2 macs */
|
||||||
|
#define MTK_MAX_DEVS 2
|
||||||
|
|
||||||
|
@@ -1123,6 +1141,14 @@ struct mtk_eth {
|
||||||
|
struct rhashtable flow_table;
|
||||||
|
|
||||||
|
struct bpf_prog __rcu *prog;
|
||||||
|
+
|
||||||
|
+ struct {
|
||||||
|
+ struct delayed_work monitor_work;
|
||||||
|
+ u32 wdidx;
|
||||||
|
+ u8 wdma_hang_count;
|
||||||
|
+ u8 qdma_hang_count;
|
||||||
|
+ u8 adma_hang_count;
|
||||||
|
+ } reset;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* struct mtk_mac - the structure that holds the info about the MACs of the
|
|
@ -0,0 +1,124 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Sat, 14 Jan 2023 18:01:32 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_wed: add reset/reset_complete callbacks
|
||||||
|
|
||||||
|
Introduce reset and reset_complete wlan callback to schedule WLAN driver
|
||||||
|
reset when ethernet/wed driver is resetting.
|
||||||
|
|
||||||
|
Tested-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
|
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
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
|
||||||
|
set_bit(MTK_RESETTING, ð->state);
|
||||||
|
|
||||||
|
mtk_prepare_for_reset(eth);
|
||||||
|
+ mtk_wed_fe_reset();
|
||||||
|
+ /* Run again reset preliminary configuration in order to avoid any
|
||||||
|
+ * possible race during FE reset since it can run releasing RTNL lock.
|
||||||
|
+ */
|
||||||
|
+ mtk_prepare_for_reset(eth);
|
||||||
|
|
||||||
|
/* 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
|
||||||
|
|
||||||
|
clear_bit(MTK_RESETTING, ð->state);
|
||||||
|
|
||||||
|
+ mtk_wed_fe_reset_complete();
|
||||||
|
+
|
||||||
|
rtnl_unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
@@ -205,6 +205,48 @@ mtk_wed_wo_reset(struct mtk_wed_device *
|
||||||
|
iounmap(reg);
|
||||||
|
}
|
||||||
|
|
||||||
|
+void mtk_wed_fe_reset(void)
|
||||||
|
+{
|
||||||
|
+ int i;
|
||||||
|
+
|
||||||
|
+ mutex_lock(&hw_lock);
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < ARRAY_SIZE(hw_list); i++) {
|
||||||
|
+ struct mtk_wed_hw *hw = hw_list[i];
|
||||||
|
+ struct mtk_wed_device *dev = hw->wed_dev;
|
||||||
|
+ int err;
|
||||||
|
+
|
||||||
|
+ if (!dev || !dev->wlan.reset)
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ /* reset callback blocks until WLAN reset is completed */
|
||||||
|
+ err = dev->wlan.reset(dev);
|
||||||
|
+ if (err)
|
||||||
|
+ dev_err(dev->dev, "wlan reset failed: %d\n", err);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ mutex_unlock(&hw_lock);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void mtk_wed_fe_reset_complete(void)
|
||||||
|
+{
|
||||||
|
+ int i;
|
||||||
|
+
|
||||||
|
+ mutex_lock(&hw_lock);
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < ARRAY_SIZE(hw_list); i++) {
|
||||||
|
+ struct mtk_wed_hw *hw = hw_list[i];
|
||||||
|
+ struct mtk_wed_device *dev = hw->wed_dev;
|
||||||
|
+
|
||||||
|
+ if (!dev || !dev->wlan.reset_complete)
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ dev->wlan.reset_complete(dev);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ mutex_unlock(&hw_lock);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static struct mtk_wed_hw *
|
||||||
|
mtk_wed_assign(struct mtk_wed_device *dev)
|
||||||
|
{
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.h
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.h
|
||||||
|
@@ -128,6 +128,8 @@ void mtk_wed_add_hw(struct device_node *
|
||||||
|
void mtk_wed_exit(void);
|
||||||
|
int mtk_wed_flow_add(int index);
|
||||||
|
void mtk_wed_flow_remove(int index);
|
||||||
|
+void mtk_wed_fe_reset(void);
|
||||||
|
+void mtk_wed_fe_reset_complete(void);
|
||||||
|
#else
|
||||||
|
static inline void
|
||||||
|
mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
|
||||||
|
@@ -147,6 +149,13 @@ static inline void mtk_wed_flow_remove(i
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
+static inline void mtk_wed_fe_reset(void)
|
||||||
|
+{
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static inline void mtk_wed_fe_reset_complete(void)
|
||||||
|
+{
|
||||||
|
+}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_DEBUG_FS
|
||||||
|
--- a/include/linux/soc/mediatek/mtk_wed.h
|
||||||
|
+++ b/include/linux/soc/mediatek/mtk_wed.h
|
||||||
|
@@ -151,6 +151,8 @@ struct mtk_wed_device {
|
||||||
|
void (*release_rx_buf)(struct mtk_wed_device *wed);
|
||||||
|
void (*update_wo_rx_stats)(struct mtk_wed_device *wed,
|
||||||
|
struct mtk_wed_wo_rx_stats *stats);
|
||||||
|
+ int (*reset)(struct mtk_wed_device *wed);
|
||||||
|
+ void (*reset_complete)(struct mtk_wed_device *wed);
|
||||||
|
} wlan;
|
||||||
|
#endif
|
||||||
|
};
|
|
@ -0,0 +1,106 @@
|
||||||
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Date: Mon, 5 Dec 2022 12:34:42 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_wed: add reset to rx_ring_setup callback
|
||||||
|
|
||||||
|
This patch adds reset parameter to mtk_wed_rx_ring_setup signature
|
||||||
|
in order to align rx_ring_setup callback to tx_ring_setup one introduced
|
||||||
|
in 'commit 23dca7a90017 ("net: ethernet: mtk_wed: add reset to
|
||||||
|
tx_ring_setup callback")'
|
||||||
|
|
||||||
|
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
||||||
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
|
||||||
|
Link: https://lore.kernel.org/r/29c6e7a5469e784406cf3e2920351d1207713d05.1670239984.git.lorenzo@kernel.org
|
||||||
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
@@ -1259,7 +1259,8 @@ mtk_wed_wdma_rx_ring_setup(struct mtk_we
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
-mtk_wed_wdma_tx_ring_setup(struct mtk_wed_device *dev, int idx, int size)
|
||||||
|
+mtk_wed_wdma_tx_ring_setup(struct mtk_wed_device *dev, int idx, int size,
|
||||||
|
+ bool reset)
|
||||||
|
{
|
||||||
|
u32 desc_size = sizeof(struct mtk_wdma_desc) * dev->hw->version;
|
||||||
|
struct mtk_wed_ring *wdma;
|
||||||
|
@@ -1268,8 +1269,8 @@ mtk_wed_wdma_tx_ring_setup(struct mtk_we
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
wdma = &dev->tx_wdma[idx];
|
||||||
|
- if (mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE, desc_size,
|
||||||
|
- true))
|
||||||
|
+ if (!reset && mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE,
|
||||||
|
+ desc_size, true))
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_BASE,
|
||||||
|
@@ -1279,6 +1280,9 @@ mtk_wed_wdma_tx_ring_setup(struct mtk_we
|
||||||
|
wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_CPU_IDX, 0);
|
||||||
|
wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_DMA_IDX, 0);
|
||||||
|
|
||||||
|
+ if (reset)
|
||||||
|
+ mtk_wed_ring_reset(wdma, MTK_WED_WDMA_RING_SIZE, true);
|
||||||
|
+
|
||||||
|
if (!idx) {
|
||||||
|
wed_w32(dev, MTK_WED_WDMA_RING_TX + MTK_WED_RING_OFS_BASE,
|
||||||
|
wdma->desc_phys);
|
||||||
|
@@ -1618,18 +1622,20 @@ mtk_wed_txfree_ring_setup(struct mtk_wed
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
-mtk_wed_rx_ring_setup(struct mtk_wed_device *dev, int idx, void __iomem *regs)
|
||||||
|
+mtk_wed_rx_ring_setup(struct mtk_wed_device *dev, int idx, void __iomem *regs,
|
||||||
|
+ bool reset)
|
||||||
|
{
|
||||||
|
struct mtk_wed_ring *ring = &dev->rx_ring[idx];
|
||||||
|
|
||||||
|
if (WARN_ON(idx >= ARRAY_SIZE(dev->rx_ring)))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
- if (mtk_wed_ring_alloc(dev, ring, MTK_WED_RX_RING_SIZE,
|
||||||
|
- sizeof(*ring->desc), false))
|
||||||
|
+ if (!reset && mtk_wed_ring_alloc(dev, ring, MTK_WED_RX_RING_SIZE,
|
||||||
|
+ sizeof(*ring->desc), false))
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
- if (mtk_wed_wdma_tx_ring_setup(dev, idx, MTK_WED_WDMA_RING_SIZE))
|
||||||
|
+ if (mtk_wed_wdma_tx_ring_setup(dev, idx, MTK_WED_WDMA_RING_SIZE,
|
||||||
|
+ reset))
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
ring->reg_base = MTK_WED_RING_RX_DATA(idx);
|
||||||
|
--- a/include/linux/soc/mediatek/mtk_wed.h
|
||||||
|
+++ b/include/linux/soc/mediatek/mtk_wed.h
|
||||||
|
@@ -162,7 +162,7 @@ struct mtk_wed_ops {
|
||||||
|
int (*tx_ring_setup)(struct mtk_wed_device *dev, int ring,
|
||||||
|
void __iomem *regs, bool reset);
|
||||||
|
int (*rx_ring_setup)(struct mtk_wed_device *dev, int ring,
|
||||||
|
- void __iomem *regs);
|
||||||
|
+ void __iomem *regs, bool reset);
|
||||||
|
int (*txfree_ring_setup)(struct mtk_wed_device *dev,
|
||||||
|
void __iomem *regs);
|
||||||
|
int (*msg_update)(struct mtk_wed_device *dev, int cmd_id,
|
||||||
|
@@ -230,8 +230,8 @@ mtk_wed_get_rx_capa(struct mtk_wed_devic
|
||||||
|
(_dev)->ops->irq_get(_dev, _mask)
|
||||||
|
#define mtk_wed_device_irq_set_mask(_dev, _mask) \
|
||||||
|
(_dev)->ops->irq_set_mask(_dev, _mask)
|
||||||
|
-#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs) \
|
||||||
|
- (_dev)->ops->rx_ring_setup(_dev, _ring, _regs)
|
||||||
|
+#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs, _reset) \
|
||||||
|
+ (_dev)->ops->rx_ring_setup(_dev, _ring, _regs, _reset)
|
||||||
|
#define mtk_wed_device_ppe_check(_dev, _skb, _reason, _hash) \
|
||||||
|
(_dev)->ops->ppe_check(_dev, _skb, _reason, _hash)
|
||||||
|
#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) \
|
||||||
|
@@ -251,7 +251,7 @@ static inline bool mtk_wed_device_active
|
||||||
|
#define mtk_wed_device_reg_write(_dev, _reg, _val) do {} while (0)
|
||||||
|
#define mtk_wed_device_irq_get(_dev, _mask) 0
|
||||||
|
#define mtk_wed_device_irq_set_mask(_dev, _mask) do {} while (0)
|
||||||
|
-#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs) -ENODEV
|
||||||
|
+#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs, _reset) -ENODEV
|
||||||
|
#define mtk_wed_device_ppe_check(_dev, _skb, _reason, _hash) do {} while (0)
|
||||||
|
#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) -ENODEV
|
||||||
|
#define mtk_wed_device_stop(_dev) do {} while (0)
|
|
@ -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_tx_timer_arm(struct stmmac_priv *priv, u32 queue);
|
||||||
static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue);
|
static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue);
|
||||||
|
|
||||||
@@ -1705,9 +1708,6 @@ static int __init_dma_rx_desc_rings(stru
|
@@ -1710,9 +1713,6 @@ static int __init_dma_rx_desc_rings(stru
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
/* Setup the chained descriptor addresses */
|
/* Setup the chained descriptor addresses */
|
||||||
if (priv->mode == STMMAC_CHAIN_MODE) {
|
if (priv->mode == STMMAC_CHAIN_MODE) {
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -1813,12 +1813,6 @@ static int __init_dma_tx_desc_rings(stru
|
@@ -1818,12 +1818,6 @@ static int __init_dma_tx_desc_rings(stru
|
||||||
tx_q->tx_skbuff[i] = NULL;
|
tx_q->tx_skbuff[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2687,10 +2681,7 @@ static void stmmac_tx_err(struct stmmac_
|
@@ -2692,10 +2686,7 @@ static void stmmac_tx_err(struct stmmac_
|
||||||
stmmac_stop_tx_dma(priv, chan);
|
stmmac_stop_tx_dma(priv, chan);
|
||||||
dma_free_tx_skbufs(priv, chan);
|
dma_free_tx_skbufs(priv, chan);
|
||||||
stmmac_clear_tx_descriptors(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,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
tx_q->dma_tx_phy, chan);
|
tx_q->dma_tx_phy, chan);
|
||||||
stmmac_start_tx_dma(priv, chan);
|
stmmac_start_tx_dma(priv, chan);
|
||||||
@@ -3774,6 +3765,8 @@ static int stmmac_open(struct net_device
|
@@ -3779,6 +3770,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);
|
ret = stmmac_hw_setup(dev, true);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
|
netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
|
||||||
@@ -6417,6 +6410,7 @@ void stmmac_enable_rx_queue(struct stmma
|
@@ -6422,6 +6415,7 @@ void stmmac_enable_rx_queue(struct stmma
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
stmmac_clear_rx_descriptors(priv, queue);
|
stmmac_clear_rx_descriptors(priv, queue);
|
||||||
|
|
||||||
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
@@ -6478,6 +6472,7 @@ void stmmac_enable_tx_queue(struct stmma
|
@@ -6483,6 +6477,7 @@ void stmmac_enable_tx_queue(struct stmma
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
stmmac_clear_tx_descriptors(priv, queue);
|
stmmac_clear_tx_descriptors(priv, queue);
|
||||||
|
|
||||||
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
@@ -7400,6 +7395,25 @@ int stmmac_suspend(struct device *dev)
|
@@ -7405,6 +7400,25 @@ int stmmac_suspend(struct device *dev)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(stmmac_suspend);
|
EXPORT_SYMBOL_GPL(stmmac_suspend);
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
/**
|
/**
|
||||||
* stmmac_reset_queues_param - reset queue parameters
|
* stmmac_reset_queues_param - reset queue parameters
|
||||||
* @priv: device pointer
|
* @priv: device pointer
|
||||||
@@ -7410,22 +7424,11 @@ static void stmmac_reset_queues_param(st
|
@@ -7415,22 +7429,11 @@ static void stmmac_reset_queues_param(st
|
||||||
u32 tx_cnt = priv->plat->tx_queues_to_use;
|
u32 tx_cnt = priv->plat->tx_queues_to_use;
|
||||||
u32 queue;
|
u32 queue;
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
@@ -3826,8 +3826,6 @@ static int stmmac_release(struct net_dev
|
@@ -3831,8 +3831,6 @@ static int stmmac_release(struct net_dev
|
||||||
struct stmmac_priv *priv = netdev_priv(dev);
|
struct stmmac_priv *priv = netdev_priv(dev);
|
||||||
u32 chan;
|
u32 chan;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
if (device_may_wakeup(priv->device))
|
if (device_may_wakeup(priv->device))
|
||||||
phylink_speed_down(priv->phylink, false);
|
phylink_speed_down(priv->phylink, false);
|
||||||
/* Stop and disconnect the PHY */
|
/* Stop and disconnect the PHY */
|
||||||
@@ -3839,6 +3837,8 @@ static int stmmac_release(struct net_dev
|
@@ -3844,6 +3842,8 @@ static int stmmac_release(struct net_dev
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
||||||
hrtimer_cancel(&priv->tx_queue[chan].txtimer);
|
hrtimer_cancel(&priv->tx_queue[chan].txtimer);
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
if (tx_q->dirty_tx != tx_q->cur_tx)
|
if (tx_q->dirty_tx != tx_q->cur_tx)
|
||||||
return -EBUSY; /* still unfinished work */
|
return -EBUSY; /* still unfinished work */
|
||||||
@@ -1302,7 +1302,7 @@ static void stmmac_display_rx_rings(stru
|
@@ -1307,7 +1307,7 @@ static void stmmac_display_rx_rings(stru
|
||||||
|
|
||||||
/* Display RX rings */
|
/* Display RX rings */
|
||||||
for (queue = 0; queue < rx_cnt; queue++) {
|
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);
|
pr_info("\tRX Queue %u rings\n", queue);
|
||||||
|
|
||||||
@@ -1315,7 +1315,7 @@ static void stmmac_display_rx_rings(stru
|
@@ -1320,7 +1320,7 @@ static void stmmac_display_rx_rings(stru
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display RX ring */
|
/* Display RX ring */
|
||||||
|
@ -207,7 +207,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
rx_q->dma_rx_phy, desc_size);
|
rx_q->dma_rx_phy, desc_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1329,7 +1329,7 @@ static void stmmac_display_tx_rings(stru
|
@@ -1334,7 +1334,7 @@ static void stmmac_display_tx_rings(stru
|
||||||
|
|
||||||
/* Display TX rings */
|
/* Display TX rings */
|
||||||
for (queue = 0; queue < tx_cnt; queue++) {
|
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);
|
pr_info("\tTX Queue %d rings\n", queue);
|
||||||
|
|
||||||
@@ -1344,7 +1344,7 @@ static void stmmac_display_tx_rings(stru
|
@@ -1349,7 +1349,7 @@ static void stmmac_display_tx_rings(stru
|
||||||
desc_size = sizeof(struct dma_desc);
|
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);
|
tx_q->dma_tx_phy, desc_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1385,21 +1385,21 @@ static int stmmac_set_bfsize(int mtu, in
|
@@ -1390,21 +1390,21 @@ static int stmmac_set_bfsize(int mtu, in
|
||||||
*/
|
*/
|
||||||
static void stmmac_clear_rx_descriptors(struct stmmac_priv *priv, u32 queue)
|
static void stmmac_clear_rx_descriptors(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
|
@ -253,7 +253,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1411,12 +1411,12 @@ static void stmmac_clear_rx_descriptors(
|
@@ -1416,12 +1416,12 @@ static void stmmac_clear_rx_descriptors(
|
||||||
*/
|
*/
|
||||||
static void stmmac_clear_tx_descriptors(struct stmmac_priv *priv, u32 queue)
|
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;
|
struct dma_desc *p;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -1464,7 +1464,7 @@ static void stmmac_clear_descriptors(str
|
@@ -1469,7 +1469,7 @@ static void stmmac_clear_descriptors(str
|
||||||
static int stmmac_init_rx_buffers(struct stmmac_priv *priv, struct dma_desc *p,
|
static int stmmac_init_rx_buffers(struct stmmac_priv *priv, struct dma_desc *p,
|
||||||
int i, gfp_t flags, u32 queue)
|
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];
|
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
||||||
|
|
||||||
if (!buf->page) {
|
if (!buf->page) {
|
||||||
@@ -1489,7 +1489,7 @@ static int stmmac_init_rx_buffers(struct
|
@@ -1494,7 +1494,7 @@ static int stmmac_init_rx_buffers(struct
|
||||||
buf->addr = page_pool_get_dma_addr(buf->page) + buf->page_offset;
|
buf->addr = page_pool_get_dma_addr(buf->page) + buf->page_offset;
|
||||||
|
|
||||||
stmmac_set_desc_addr(priv, p, buf->addr);
|
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);
|
stmmac_init_desc3(priv, p);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1503,7 +1503,7 @@ static int stmmac_init_rx_buffers(struct
|
@@ -1508,7 +1508,7 @@ static int stmmac_init_rx_buffers(struct
|
||||||
*/
|
*/
|
||||||
static void stmmac_free_rx_buffer(struct stmmac_priv *priv, u32 queue, int i)
|
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];
|
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
||||||
|
|
||||||
if (buf->page)
|
if (buf->page)
|
||||||
@@ -1523,7 +1523,7 @@ static void stmmac_free_rx_buffer(struct
|
@@ -1528,7 +1528,7 @@ static void stmmac_free_rx_buffer(struct
|
||||||
*/
|
*/
|
||||||
static void stmmac_free_tx_buffer(struct stmmac_priv *priv, u32 queue, int i)
|
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 &&
|
if (tx_q->tx_skbuff_dma[i].buf &&
|
||||||
tx_q->tx_skbuff_dma[i].buf_type != STMMAC_TXBUF_T_XDP_TX) {
|
tx_q->tx_skbuff_dma[i].buf_type != STMMAC_TXBUF_T_XDP_TX) {
|
||||||
@@ -1568,17 +1568,17 @@ static void dma_free_rx_skbufs(struct st
|
@@ -1573,17 +1573,17 @@ static void dma_free_rx_skbufs(struct st
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -1605,10 +1605,10 @@ static int stmmac_alloc_rx_buffers(struc
|
@@ -1610,10 +1610,10 @@ static int stmmac_alloc_rx_buffers(struc
|
||||||
*/
|
*/
|
||||||
static void dma_free_rx_xskbufs(struct stmmac_priv *priv, u32 queue)
|
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];
|
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
||||||
|
|
||||||
if (!buf->xdp)
|
if (!buf->xdp)
|
||||||
@@ -1621,10 +1621,10 @@ static void dma_free_rx_xskbufs(struct s
|
@@ -1626,10 +1626,10 @@ static void dma_free_rx_xskbufs(struct s
|
||||||
|
|
||||||
static int stmmac_alloc_rx_buffers_zc(struct stmmac_priv *priv, u32 queue)
|
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;
|
struct stmmac_rx_buffer *buf;
|
||||||
dma_addr_t dma_addr;
|
dma_addr_t dma_addr;
|
||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
@@ -1667,7 +1667,7 @@ static struct xsk_buff_pool *stmmac_get_
|
@@ -1672,7 +1672,7 @@ static struct xsk_buff_pool *stmmac_get_
|
||||||
*/
|
*/
|
||||||
static int __init_dma_rx_desc_rings(struct stmmac_priv *priv, u32 queue, gfp_t flags)
|
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;
|
int ret;
|
||||||
|
|
||||||
netif_dbg(priv, probe, priv->dev,
|
netif_dbg(priv, probe, priv->dev,
|
||||||
@@ -1713,11 +1713,11 @@ static int __init_dma_rx_desc_rings(stru
|
@@ -1718,11 +1718,11 @@ static int __init_dma_rx_desc_rings(stru
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
stmmac_mode_init(priv, rx_q->dma_erx,
|
stmmac_mode_init(priv, rx_q->dma_erx,
|
||||||
rx_q->dma_rx_phy,
|
rx_q->dma_rx_phy,
|
||||||
|
@ -375,7 +375,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1744,7 +1744,7 @@ static int init_dma_rx_desc_rings(struct
|
@@ -1749,7 +1749,7 @@ static int init_dma_rx_desc_rings(struct
|
||||||
|
|
||||||
err_init_rx_buffers:
|
err_init_rx_buffers:
|
||||||
while (queue >= 0) {
|
while (queue >= 0) {
|
||||||
|
@ -384,7 +384,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
if (rx_q->xsk_pool)
|
if (rx_q->xsk_pool)
|
||||||
dma_free_rx_xskbufs(priv, queue);
|
dma_free_rx_xskbufs(priv, queue);
|
||||||
@@ -1773,7 +1773,7 @@ err_init_rx_buffers:
|
@@ -1778,7 +1778,7 @@ err_init_rx_buffers:
|
||||||
*/
|
*/
|
||||||
static int __init_dma_tx_desc_rings(struct stmmac_priv *priv, u32 queue)
|
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;
|
int i;
|
||||||
|
|
||||||
netif_dbg(priv, probe, priv->dev,
|
netif_dbg(priv, probe, priv->dev,
|
||||||
@@ -1785,16 +1785,16 @@ static int __init_dma_tx_desc_rings(stru
|
@@ -1790,16 +1790,16 @@ static int __init_dma_tx_desc_rings(stru
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
stmmac_mode_init(priv, tx_q->dma_etx,
|
stmmac_mode_init(priv, tx_q->dma_etx,
|
||||||
tx_q->dma_tx_phy,
|
tx_q->dma_tx_phy,
|
||||||
|
@ -413,7 +413,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -1864,12 +1864,12 @@ static int init_dma_desc_rings(struct ne
|
@@ -1869,12 +1869,12 @@ static int init_dma_desc_rings(struct ne
|
||||||
*/
|
*/
|
||||||
static void dma_free_tx_skbufs(struct stmmac_priv *priv, u32 queue)
|
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);
|
stmmac_free_tx_buffer(priv, queue, i);
|
||||||
|
|
||||||
if (tx_q->xsk_pool && tx_q->xsk_frames_done) {
|
if (tx_q->xsk_pool && tx_q->xsk_frames_done) {
|
||||||
@@ -1899,7 +1899,7 @@ static void stmmac_free_tx_skbufs(struct
|
@@ -1904,7 +1904,7 @@ static void stmmac_free_tx_skbufs(struct
|
||||||
*/
|
*/
|
||||||
static void __free_dma_rx_desc_resources(struct stmmac_priv *priv, u32 queue)
|
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 */
|
/* Release the DMA RX socket buffers */
|
||||||
if (rx_q->xsk_pool)
|
if (rx_q->xsk_pool)
|
||||||
@@ -1912,11 +1912,11 @@ static void __free_dma_rx_desc_resources
|
@@ -1917,11 +1917,11 @@ static void __free_dma_rx_desc_resources
|
||||||
|
|
||||||
/* Free DMA regions of consistent memory previously allocated */
|
/* Free DMA regions of consistent memory previously allocated */
|
||||||
if (!priv->extend_desc)
|
if (!priv->extend_desc)
|
||||||
|
@ -451,7 +451,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
sizeof(struct dma_extended_desc),
|
sizeof(struct dma_extended_desc),
|
||||||
rx_q->dma_erx, rx_q->dma_rx_phy);
|
rx_q->dma_erx, rx_q->dma_rx_phy);
|
||||||
|
|
||||||
@@ -1945,7 +1945,7 @@ static void free_dma_rx_desc_resources(s
|
@@ -1950,7 +1950,7 @@ static void free_dma_rx_desc_resources(s
|
||||||
*/
|
*/
|
||||||
static void __free_dma_tx_desc_resources(struct stmmac_priv *priv, u32 queue)
|
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;
|
size_t size;
|
||||||
void *addr;
|
void *addr;
|
||||||
|
|
||||||
@@ -1963,7 +1963,7 @@ static void __free_dma_tx_desc_resources
|
@@ -1968,7 +1968,7 @@ static void __free_dma_tx_desc_resources
|
||||||
addr = tx_q->dma_tx;
|
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);
|
dma_free_coherent(priv->device, size, addr, tx_q->dma_tx_phy);
|
||||||
|
|
||||||
@@ -1992,7 +1992,7 @@ static void free_dma_tx_desc_resources(s
|
@@ -1997,7 +1997,7 @@ static void free_dma_tx_desc_resources(s
|
||||||
*/
|
*/
|
||||||
static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv, u32 queue)
|
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];
|
struct stmmac_channel *ch = &priv->channel[queue];
|
||||||
bool xdp_prog = stmmac_xdp_is_enabled(priv);
|
bool xdp_prog = stmmac_xdp_is_enabled(priv);
|
||||||
struct page_pool_params pp_params = { 0 };
|
struct page_pool_params pp_params = { 0 };
|
||||||
@@ -2004,8 +2004,8 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2009,8 +2009,8 @@ static int __alloc_dma_rx_desc_resources
|
||||||
rx_q->priv_data = priv;
|
rx_q->priv_data = priv;
|
||||||
|
|
||||||
pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
|
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.order = ilog2(num_pages);
|
||||||
pp_params.nid = dev_to_node(priv->device);
|
pp_params.nid = dev_to_node(priv->device);
|
||||||
pp_params.dev = priv->device;
|
pp_params.dev = priv->device;
|
||||||
@@ -2020,7 +2020,7 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2025,7 +2025,7 @@ static int __alloc_dma_rx_desc_resources
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,7 +498,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
sizeof(*rx_q->buf_pool),
|
sizeof(*rx_q->buf_pool),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!rx_q->buf_pool)
|
if (!rx_q->buf_pool)
|
||||||
@@ -2028,7 +2028,7 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2033,7 +2033,7 @@ static int __alloc_dma_rx_desc_resources
|
||||||
|
|
||||||
if (priv->extend_desc) {
|
if (priv->extend_desc) {
|
||||||
rx_q->dma_erx = dma_alloc_coherent(priv->device,
|
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),
|
sizeof(struct dma_extended_desc),
|
||||||
&rx_q->dma_rx_phy,
|
&rx_q->dma_rx_phy,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
@@ -2037,7 +2037,7 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2042,7 +2042,7 @@ static int __alloc_dma_rx_desc_resources
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
rx_q->dma_rx = dma_alloc_coherent(priv->device,
|
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),
|
sizeof(struct dma_desc),
|
||||||
&rx_q->dma_rx_phy,
|
&rx_q->dma_rx_phy,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
@@ -2094,20 +2094,20 @@ err_dma:
|
@@ -2099,20 +2099,20 @@ err_dma:
|
||||||
*/
|
*/
|
||||||
static int __alloc_dma_tx_desc_resources(struct stmmac_priv *priv, u32 queue)
|
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 *),
|
sizeof(struct sk_buff *),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!tx_q->tx_skbuff)
|
if (!tx_q->tx_skbuff)
|
||||||
@@ -2120,7 +2120,7 @@ static int __alloc_dma_tx_desc_resources
|
@@ -2125,7 +2125,7 @@ static int __alloc_dma_tx_desc_resources
|
||||||
else
|
else
|
||||||
size = sizeof(struct dma_desc);
|
size = sizeof(struct dma_desc);
|
||||||
|
|
||||||
|
@ -549,7 +549,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
addr = dma_alloc_coherent(priv->device, size,
|
addr = dma_alloc_coherent(priv->device, size,
|
||||||
&tx_q->dma_tx_phy, GFP_KERNEL);
|
&tx_q->dma_tx_phy, GFP_KERNEL);
|
||||||
@@ -2364,7 +2364,7 @@ static void stmmac_dma_operation_mode(st
|
@@ -2369,7 +2369,7 @@ static void stmmac_dma_operation_mode(st
|
||||||
|
|
||||||
/* configure all channels */
|
/* configure all channels */
|
||||||
for (chan = 0; chan < rx_channels_count; chan++) {
|
for (chan = 0; chan < rx_channels_count; chan++) {
|
||||||
|
@ -558,7 +558,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
u32 buf_size;
|
u32 buf_size;
|
||||||
|
|
||||||
qmode = priv->plat->rx_queues_cfg[chan].mode_to_use;
|
qmode = priv->plat->rx_queues_cfg[chan].mode_to_use;
|
||||||
@@ -2379,7 +2379,7 @@ static void stmmac_dma_operation_mode(st
|
@@ -2384,7 +2384,7 @@ static void stmmac_dma_operation_mode(st
|
||||||
chan);
|
chan);
|
||||||
} else {
|
} else {
|
||||||
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
||||||
|
@ -567,7 +567,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
chan);
|
chan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2395,7 +2395,7 @@ static void stmmac_dma_operation_mode(st
|
@@ -2400,7 +2400,7 @@ static void stmmac_dma_operation_mode(st
|
||||||
static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
|
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);
|
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;
|
struct xsk_buff_pool *pool = tx_q->xsk_pool;
|
||||||
unsigned int entry = tx_q->cur_tx;
|
unsigned int entry = tx_q->cur_tx;
|
||||||
struct dma_desc *tx_desc = NULL;
|
struct dma_desc *tx_desc = NULL;
|
||||||
@@ -2470,7 +2470,7 @@ static bool stmmac_xdp_xmit_zc(struct st
|
@@ -2475,7 +2475,7 @@ static bool stmmac_xdp_xmit_zc(struct st
|
||||||
|
|
||||||
stmmac_enable_dma_transmission(priv, priv->ioaddr);
|
stmmac_enable_dma_transmission(priv, priv->ioaddr);
|
||||||
|
|
||||||
|
@ -585,7 +585,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
entry = tx_q->cur_tx;
|
entry = tx_q->cur_tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2496,7 +2496,7 @@ static bool stmmac_xdp_xmit_zc(struct st
|
@@ -2501,7 +2501,7 @@ static bool stmmac_xdp_xmit_zc(struct st
|
||||||
*/
|
*/
|
||||||
static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue)
|
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 bytes_compl = 0, pkts_compl = 0;
|
||||||
unsigned int entry, xmits = 0, count = 0;
|
unsigned int entry, xmits = 0, count = 0;
|
||||||
|
|
||||||
@@ -2509,7 +2509,7 @@ static int stmmac_tx_clean(struct stmmac
|
@@ -2514,7 +2514,7 @@ static int stmmac_tx_clean(struct stmmac
|
||||||
entry = tx_q->dirty_tx;
|
entry = tx_q->dirty_tx;
|
||||||
|
|
||||||
/* Try to clean all TX complete frame in 1 shot */
|
/* 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 xdp_frame *xdpf;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
@@ -2609,7 +2609,7 @@ static int stmmac_tx_clean(struct stmmac
|
@@ -2614,7 +2614,7 @@ static int stmmac_tx_clean(struct stmmac
|
||||||
|
|
||||||
stmmac_release_tx_desc(priv, p, priv->mode);
|
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;
|
tx_q->dirty_tx = entry;
|
||||||
|
|
||||||
@@ -2674,7 +2674,7 @@ static int stmmac_tx_clean(struct stmmac
|
@@ -2679,7 +2679,7 @@ static int stmmac_tx_clean(struct stmmac
|
||||||
*/
|
*/
|
||||||
static void stmmac_tx_err(struct stmmac_priv *priv, u32 chan)
|
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));
|
netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, chan));
|
||||||
|
|
||||||
@@ -2741,8 +2741,8 @@ static int stmmac_napi_check(struct stmm
|
@@ -2746,8 +2746,8 @@ static int stmmac_napi_check(struct stmm
|
||||||
{
|
{
|
||||||
int status = stmmac_dma_interrupt_status(priv, priv->ioaddr,
|
int status = stmmac_dma_interrupt_status(priv, priv->ioaddr,
|
||||||
&priv->xstats, chan, dir);
|
&priv->xstats, chan, dir);
|
||||||
|
@ -632,7 +632,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
struct stmmac_channel *ch = &priv->channel[chan];
|
struct stmmac_channel *ch = &priv->channel[chan];
|
||||||
struct napi_struct *rx_napi;
|
struct napi_struct *rx_napi;
|
||||||
struct napi_struct *tx_napi;
|
struct napi_struct *tx_napi;
|
||||||
@@ -2918,7 +2918,7 @@ static int stmmac_init_dma_engine(struct
|
@@ -2923,7 +2923,7 @@ static int stmmac_init_dma_engine(struct
|
||||||
|
|
||||||
/* DMA RX Channel Configuration */
|
/* DMA RX Channel Configuration */
|
||||||
for (chan = 0; chan < rx_channels_count; chan++) {
|
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,
|
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
rx_q->dma_rx_phy, chan);
|
rx_q->dma_rx_phy, chan);
|
||||||
@@ -2932,7 +2932,7 @@ static int stmmac_init_dma_engine(struct
|
@@ -2937,7 +2937,7 @@ static int stmmac_init_dma_engine(struct
|
||||||
|
|
||||||
/* DMA TX Channel Configuration */
|
/* DMA TX Channel Configuration */
|
||||||
for (chan = 0; chan < tx_channels_count; chan++) {
|
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,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
tx_q->dma_tx_phy, chan);
|
tx_q->dma_tx_phy, chan);
|
||||||
@@ -2947,7 +2947,7 @@ static int stmmac_init_dma_engine(struct
|
@@ -2952,7 +2952,7 @@ static int stmmac_init_dma_engine(struct
|
||||||
|
|
||||||
static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue)
|
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,
|
hrtimer_start(&tx_q->txtimer,
|
||||||
STMMAC_COAL_TIMER(priv->tx_coal_timer[queue]),
|
STMMAC_COAL_TIMER(priv->tx_coal_timer[queue]),
|
||||||
@@ -2997,7 +2997,7 @@ static void stmmac_init_coalesce(struct
|
@@ -3002,7 +3002,7 @@ static void stmmac_init_coalesce(struct
|
||||||
u32 chan;
|
u32 chan;
|
||||||
|
|
||||||
for (chan = 0; chan < tx_channel_count; 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_frames[chan] = STMMAC_TX_FRAMES;
|
||||||
priv->tx_coal_timer[chan] = STMMAC_COAL_TX_TIMER;
|
priv->tx_coal_timer[chan] = STMMAC_COAL_TX_TIMER;
|
||||||
@@ -3019,12 +3019,12 @@ static void stmmac_set_rings_length(stru
|
@@ -3024,12 +3024,12 @@ static void stmmac_set_rings_length(stru
|
||||||
/* set TX ring length */
|
/* set TX ring length */
|
||||||
for (chan = 0; chan < tx_channels_count; chan++)
|
for (chan = 0; chan < tx_channels_count; chan++)
|
||||||
stmmac_set_tx_ring_len(priv, priv->ioaddr,
|
stmmac_set_tx_ring_len(priv, priv->ioaddr,
|
||||||
|
@ -683,7 +683,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3359,7 +3359,7 @@ static int stmmac_hw_setup(struct net_de
|
@@ -3364,7 +3364,7 @@ static int stmmac_hw_setup(struct net_de
|
||||||
/* Enable TSO */
|
/* Enable TSO */
|
||||||
if (priv->tso) {
|
if (priv->tso) {
|
||||||
for (chan = 0; chan < tx_cnt; chan++) {
|
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 */
|
/* TSO and TBS cannot co-exist */
|
||||||
if (tx_q->tbs & STMMAC_TBS_AVAIL)
|
if (tx_q->tbs & STMMAC_TBS_AVAIL)
|
||||||
@@ -3381,7 +3381,7 @@ static int stmmac_hw_setup(struct net_de
|
@@ -3386,7 +3386,7 @@ static int stmmac_hw_setup(struct net_de
|
||||||
|
|
||||||
/* TBS */
|
/* TBS */
|
||||||
for (chan = 0; chan < tx_cnt; chan++) {
|
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;
|
int enable = tx_q->tbs & STMMAC_TBS_AVAIL;
|
||||||
|
|
||||||
stmmac_enable_tbs(priv, priv->ioaddr, enable, chan);
|
stmmac_enable_tbs(priv, priv->ioaddr, enable, chan);
|
||||||
@@ -3425,7 +3425,7 @@ static void stmmac_free_irq(struct net_d
|
@@ -3430,7 +3430,7 @@ static void stmmac_free_irq(struct net_d
|
||||||
for (j = irq_idx - 1; j >= 0; j--) {
|
for (j = irq_idx - 1; j >= 0; j--) {
|
||||||
if (priv->tx_irq[j] > 0) {
|
if (priv->tx_irq[j] > 0) {
|
||||||
irq_set_affinity_hint(priv->tx_irq[j], NULL);
|
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;
|
irq_idx = priv->plat->rx_queues_to_use;
|
||||||
@@ -3434,7 +3434,7 @@ static void stmmac_free_irq(struct net_d
|
@@ -3439,7 +3439,7 @@ static void stmmac_free_irq(struct net_d
|
||||||
for (j = irq_idx - 1; j >= 0; j--) {
|
for (j = irq_idx - 1; j >= 0; j--) {
|
||||||
if (priv->rx_irq[j] > 0) {
|
if (priv->rx_irq[j] > 0) {
|
||||||
irq_set_affinity_hint(priv->rx_irq[j], NULL);
|
irq_set_affinity_hint(priv->rx_irq[j], NULL);
|
||||||
|
@ -719,7 +719,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3567,7 +3567,7 @@ static int stmmac_request_irq_multi_msi(
|
@@ -3572,7 +3572,7 @@ static int stmmac_request_irq_multi_msi(
|
||||||
sprintf(int_name, "%s:%s-%d", dev->name, "rx", i);
|
sprintf(int_name, "%s:%s-%d", dev->name, "rx", i);
|
||||||
ret = request_irq(priv->rx_irq[i],
|
ret = request_irq(priv->rx_irq[i],
|
||||||
stmmac_msi_intr_rx,
|
stmmac_msi_intr_rx,
|
||||||
|
@ -728,7 +728,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
if (unlikely(ret < 0)) {
|
if (unlikely(ret < 0)) {
|
||||||
netdev_err(priv->dev,
|
netdev_err(priv->dev,
|
||||||
"%s: alloc rx-%d MSI %d (error: %d)\n",
|
"%s: alloc rx-%d MSI %d (error: %d)\n",
|
||||||
@@ -3590,7 +3590,7 @@ static int stmmac_request_irq_multi_msi(
|
@@ -3595,7 +3595,7 @@ static int stmmac_request_irq_multi_msi(
|
||||||
sprintf(int_name, "%s:%s-%d", dev->name, "tx", i);
|
sprintf(int_name, "%s:%s-%d", dev->name, "tx", i);
|
||||||
ret = request_irq(priv->tx_irq[i],
|
ret = request_irq(priv->tx_irq[i],
|
||||||
stmmac_msi_intr_tx,
|
stmmac_msi_intr_tx,
|
||||||
|
@ -737,7 +737,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
if (unlikely(ret < 0)) {
|
if (unlikely(ret < 0)) {
|
||||||
netdev_err(priv->dev,
|
netdev_err(priv->dev,
|
||||||
"%s: alloc tx-%d MSI %d (error: %d)\n",
|
"%s: alloc tx-%d MSI %d (error: %d)\n",
|
||||||
@@ -3721,21 +3721,21 @@ static int stmmac_open(struct net_device
|
@@ -3726,21 +3726,21 @@ static int stmmac_open(struct net_device
|
||||||
bfsize = 0;
|
bfsize = 0;
|
||||||
|
|
||||||
if (bfsize < BUF_SIZE_16KiB)
|
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;
|
int tbs_en = priv->plat->tx_queues_cfg[chan].tbs_en;
|
||||||
|
|
||||||
/* Setup per-TXQ tbs flag before TX descriptor alloc */
|
/* Setup per-TXQ tbs flag before TX descriptor alloc */
|
||||||
@@ -3793,7 +3793,7 @@ irq_error:
|
@@ -3798,7 +3798,7 @@ irq_error:
|
||||||
phylink_stop(priv->phylink);
|
phylink_stop(priv->phylink);
|
||||||
|
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
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);
|
stmmac_hw_teardown(dev);
|
||||||
init_error:
|
init_error:
|
||||||
@@ -3835,7 +3835,7 @@ static int stmmac_release(struct net_dev
|
@@ -3840,7 +3840,7 @@ static int stmmac_release(struct net_dev
|
||||||
stmmac_disable_all_queues(priv);
|
stmmac_disable_all_queues(priv);
|
||||||
|
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
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);
|
netif_tx_disable(dev);
|
||||||
|
|
||||||
@@ -3899,7 +3899,7 @@ static bool stmmac_vlan_insert(struct st
|
@@ -3904,7 +3904,7 @@ static bool stmmac_vlan_insert(struct st
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stmmac_set_tx_owner(priv, p);
|
stmmac_set_tx_owner(priv, p);
|
||||||
|
@ -793,7 +793,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3917,7 +3917,7 @@ static bool stmmac_vlan_insert(struct st
|
@@ -3922,7 +3922,7 @@ static bool stmmac_vlan_insert(struct st
|
||||||
static void stmmac_tso_allocator(struct stmmac_priv *priv, dma_addr_t des,
|
static void stmmac_tso_allocator(struct stmmac_priv *priv, dma_addr_t des,
|
||||||
int total_len, bool last_segment, u32 queue)
|
int total_len, bool last_segment, u32 queue)
|
||||||
{
|
{
|
||||||
|
@ -802,7 +802,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
struct dma_desc *desc;
|
struct dma_desc *desc;
|
||||||
u32 buff_size;
|
u32 buff_size;
|
||||||
int tmp_len;
|
int tmp_len;
|
||||||
@@ -3928,7 +3928,7 @@ static void stmmac_tso_allocator(struct
|
@@ -3933,7 +3933,7 @@ static void stmmac_tso_allocator(struct
|
||||||
dma_addr_t curr_addr;
|
dma_addr_t curr_addr;
|
||||||
|
|
||||||
tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx,
|
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]);
|
WARN_ON(tx_q->tx_skbuff[tx_q->cur_tx]);
|
||||||
|
|
||||||
if (tx_q->tbs & STMMAC_TBS_AVAIL)
|
if (tx_q->tbs & STMMAC_TBS_AVAIL)
|
||||||
@@ -3956,7 +3956,7 @@ static void stmmac_tso_allocator(struct
|
@@ -3961,7 +3961,7 @@ static void stmmac_tso_allocator(struct
|
||||||
|
|
||||||
static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue)
|
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;
|
int desc_size;
|
||||||
|
|
||||||
if (likely(priv->extend_desc))
|
if (likely(priv->extend_desc))
|
||||||
@@ -4018,7 +4018,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
|
@@ -4023,7 +4023,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
|
||||||
dma_addr_t des;
|
dma_addr_t des;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -829,7 +829,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
first_tx = tx_q->cur_tx;
|
first_tx = tx_q->cur_tx;
|
||||||
|
|
||||||
/* Compute header lengths */
|
/* Compute header lengths */
|
||||||
@@ -4058,7 +4058,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
|
@@ -4063,7 +4063,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
|
||||||
stmmac_set_mss(priv, mss_desc, mss);
|
stmmac_set_mss(priv, mss_desc, mss);
|
||||||
tx_q->mss = mss;
|
tx_q->mss = mss;
|
||||||
tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx,
|
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]);
|
WARN_ON(tx_q->tx_skbuff[tx_q->cur_tx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4170,7 +4170,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
|
@@ -4175,7 +4175,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
|
||||||
* ndo_start_xmit will fill this descriptor the next time it's
|
* ndo_start_xmit will fill this descriptor the next time it's
|
||||||
* called and stmmac_tx_clean may clean up to this descriptor.
|
* 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))) {
|
if (unlikely(stmmac_tx_avail(priv, queue) <= (MAX_SKB_FRAGS + 1))) {
|
||||||
netif_dbg(priv, hw, priv->dev, "%s: stop transmitted packets\n",
|
netif_dbg(priv, hw, priv->dev, "%s: stop transmitted packets\n",
|
||||||
@@ -4258,7 +4258,7 @@ static netdev_tx_t stmmac_xmit(struct sk
|
@@ -4263,7 +4263,7 @@ static netdev_tx_t stmmac_xmit(struct sk
|
||||||
int entry, first_tx;
|
int entry, first_tx;
|
||||||
dma_addr_t des;
|
dma_addr_t des;
|
||||||
|
|
||||||
|
@ -856,7 +856,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
first_tx = tx_q->cur_tx;
|
first_tx = tx_q->cur_tx;
|
||||||
|
|
||||||
if (priv->tx_path_in_lpi_mode && priv->eee_sw_timer_en)
|
if (priv->tx_path_in_lpi_mode && priv->eee_sw_timer_en)
|
||||||
@@ -4321,7 +4321,7 @@ static netdev_tx_t stmmac_xmit(struct sk
|
@@ -4326,7 +4326,7 @@ static netdev_tx_t stmmac_xmit(struct sk
|
||||||
int len = skb_frag_size(frag);
|
int len = skb_frag_size(frag);
|
||||||
bool last_segment = (i == (nfrags - 1));
|
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]);
|
WARN_ON(tx_q->tx_skbuff[entry]);
|
||||||
|
|
||||||
if (likely(priv->extend_desc))
|
if (likely(priv->extend_desc))
|
||||||
@@ -4392,7 +4392,7 @@ static netdev_tx_t stmmac_xmit(struct sk
|
@@ -4397,7 +4397,7 @@ static netdev_tx_t stmmac_xmit(struct sk
|
||||||
* ndo_start_xmit will fill this descriptor the next time it's
|
* ndo_start_xmit will fill this descriptor the next time it's
|
||||||
* called and stmmac_tx_clean may clean up to this descriptor.
|
* 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;
|
tx_q->cur_tx = entry;
|
||||||
|
|
||||||
if (netif_msg_pktdata(priv)) {
|
if (netif_msg_pktdata(priv)) {
|
||||||
@@ -4507,7 +4507,7 @@ static void stmmac_rx_vlan(struct net_de
|
@@ -4512,7 +4512,7 @@ static void stmmac_rx_vlan(struct net_de
|
||||||
*/
|
*/
|
||||||
static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue)
|
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);
|
int dirty = stmmac_rx_dirty(priv, queue);
|
||||||
unsigned int entry = rx_q->dirty_rx;
|
unsigned int entry = rx_q->dirty_rx;
|
||||||
|
|
||||||
@@ -4557,7 +4557,7 @@ static inline void stmmac_rx_refill(stru
|
@@ -4562,7 +4562,7 @@ static inline void stmmac_rx_refill(stru
|
||||||
dma_wmb();
|
dma_wmb();
|
||||||
stmmac_set_rx_owner(priv, p, use_rx_wd);
|
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->dirty_rx = entry;
|
||||||
rx_q->rx_tail_addr = rx_q->dma_rx_phy +
|
rx_q->rx_tail_addr = rx_q->dma_rx_phy +
|
||||||
@@ -4585,12 +4585,12 @@ static unsigned int stmmac_rx_buf1_len(s
|
@@ -4590,12 +4590,12 @@ static unsigned int stmmac_rx_buf1_len(s
|
||||||
|
|
||||||
/* First descriptor, not last descriptor and not split header */
|
/* First descriptor, not last descriptor and not split header */
|
||||||
if (status & rx_not_ls)
|
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,
|
static unsigned int stmmac_rx_buf2_len(struct stmmac_priv *priv,
|
||||||
@@ -4606,7 +4606,7 @@ static unsigned int stmmac_rx_buf2_len(s
|
@@ -4611,7 +4611,7 @@ static unsigned int stmmac_rx_buf2_len(s
|
||||||
|
|
||||||
/* Not last descriptor */
|
/* Not last descriptor */
|
||||||
if (status & rx_not_ls)
|
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);
|
plen = stmmac_get_rx_frame_len(priv, p, coe);
|
||||||
|
|
||||||
@@ -4617,7 +4617,7 @@ static unsigned int stmmac_rx_buf2_len(s
|
@@ -4622,7 +4622,7 @@ static unsigned int stmmac_rx_buf2_len(s
|
||||||
static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
|
static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
|
||||||
struct xdp_frame *xdpf, bool dma_map)
|
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;
|
unsigned int entry = tx_q->cur_tx;
|
||||||
struct dma_desc *tx_desc;
|
struct dma_desc *tx_desc;
|
||||||
dma_addr_t dma_addr;
|
dma_addr_t dma_addr;
|
||||||
@@ -4680,7 +4680,7 @@ static int stmmac_xdp_xmit_xdpf(struct s
|
@@ -4685,7 +4685,7 @@ static int stmmac_xdp_xmit_xdpf(struct s
|
||||||
|
|
||||||
stmmac_enable_dma_transmission(priv, priv->ioaddr);
|
stmmac_enable_dma_transmission(priv, priv->ioaddr);
|
||||||
|
|
||||||
|
@ -934,7 +934,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
tx_q->cur_tx = entry;
|
tx_q->cur_tx = entry;
|
||||||
|
|
||||||
return STMMAC_XDP_TX;
|
return STMMAC_XDP_TX;
|
||||||
@@ -4854,7 +4854,7 @@ static void stmmac_dispatch_skb_zc(struc
|
@@ -4859,7 +4859,7 @@ static void stmmac_dispatch_skb_zc(struc
|
||||||
|
|
||||||
static bool stmmac_rx_refill_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
|
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;
|
unsigned int entry = rx_q->dirty_rx;
|
||||||
struct dma_desc *rx_desc = NULL;
|
struct dma_desc *rx_desc = NULL;
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
@@ -4897,7 +4897,7 @@ static bool stmmac_rx_refill_zc(struct s
|
@@ -4902,7 +4902,7 @@ static bool stmmac_rx_refill_zc(struct s
|
||||||
dma_wmb();
|
dma_wmb();
|
||||||
stmmac_set_rx_owner(priv, rx_desc, use_rx_wd);
|
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) {
|
if (rx_desc) {
|
||||||
@@ -4912,7 +4912,7 @@ static bool stmmac_rx_refill_zc(struct s
|
@@ -4917,7 +4917,7 @@ static bool stmmac_rx_refill_zc(struct s
|
||||||
|
|
||||||
static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
|
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;
|
unsigned int count = 0, error = 0, len = 0;
|
||||||
int dirty = stmmac_rx_dirty(priv, queue);
|
int dirty = stmmac_rx_dirty(priv, queue);
|
||||||
unsigned int next_entry = rx_q->cur_rx;
|
unsigned int next_entry = rx_q->cur_rx;
|
||||||
@@ -4934,7 +4934,7 @@ static int stmmac_rx_zc(struct stmmac_pr
|
@@ -4939,7 +4939,7 @@ static int stmmac_rx_zc(struct stmmac_pr
|
||||||
desc_size = sizeof(struct dma_desc);
|
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);
|
rx_q->dma_rx_phy, desc_size);
|
||||||
}
|
}
|
||||||
while (count < limit) {
|
while (count < limit) {
|
||||||
@@ -4981,7 +4981,7 @@ read_again:
|
@@ -4986,7 +4986,7 @@ read_again:
|
||||||
|
|
||||||
/* Prefetch the next RX descriptor */
|
/* Prefetch the next RX descriptor */
|
||||||
rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
|
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;
|
next_entry = rx_q->cur_rx;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -5102,7 +5102,7 @@ read_again:
|
@@ -5107,7 +5107,7 @@ read_again:
|
||||||
*/
|
*/
|
||||||
static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
|
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];
|
struct stmmac_channel *ch = &priv->channel[queue];
|
||||||
unsigned int count = 0, error = 0, len = 0;
|
unsigned int count = 0, error = 0, len = 0;
|
||||||
int status = 0, coe = priv->hw->rx_csum;
|
int status = 0, coe = priv->hw->rx_csum;
|
||||||
@@ -5115,7 +5115,7 @@ static int stmmac_rx(struct stmmac_priv
|
@@ -5120,7 +5120,7 @@ static int stmmac_rx(struct stmmac_priv
|
||||||
int buf_sz;
|
int buf_sz;
|
||||||
|
|
||||||
dma_dir = page_pool_get_dma_dir(rx_q->page_pool);
|
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)) {
|
if (netif_msg_rx_status(priv)) {
|
||||||
void *rx_head;
|
void *rx_head;
|
||||||
@@ -5129,7 +5129,7 @@ static int stmmac_rx(struct stmmac_priv
|
@@ -5134,7 +5134,7 @@ static int stmmac_rx(struct stmmac_priv
|
||||||
desc_size = sizeof(struct dma_desc);
|
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);
|
rx_q->dma_rx_phy, desc_size);
|
||||||
}
|
}
|
||||||
while (count < limit) {
|
while (count < limit) {
|
||||||
@@ -5173,7 +5173,7 @@ read_again:
|
@@ -5178,7 +5178,7 @@ read_again:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
|
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;
|
next_entry = rx_q->cur_rx;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -5307,7 +5307,7 @@ read_again:
|
@@ -5312,7 +5312,7 @@ read_again:
|
||||||
buf1_len, dma_dir);
|
buf1_len, dma_dir);
|
||||||
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
||||||
buf->page, buf->page_offset, buf1_len,
|
buf->page, buf->page_offset, buf1_len,
|
||||||
|
@ -1024,7 +1024,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
/* Data payload appended into SKB */
|
/* Data payload appended into SKB */
|
||||||
page_pool_release_page(rx_q->page_pool, buf->page);
|
page_pool_release_page(rx_q->page_pool, buf->page);
|
||||||
@@ -5319,7 +5319,7 @@ read_again:
|
@@ -5324,7 +5324,7 @@ read_again:
|
||||||
buf2_len, dma_dir);
|
buf2_len, dma_dir);
|
||||||
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
||||||
buf->sec_page, 0, buf2_len,
|
buf->sec_page, 0, buf2_len,
|
||||||
|
@ -1033,7 +1033,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
/* Data payload appended into SKB */
|
/* Data payload appended into SKB */
|
||||||
page_pool_release_page(rx_q->page_pool, buf->sec_page);
|
page_pool_release_page(rx_q->page_pool, buf->sec_page);
|
||||||
@@ -5761,11 +5761,13 @@ static irqreturn_t stmmac_safety_interru
|
@@ -5766,11 +5766,13 @@ static irqreturn_t stmmac_safety_interru
|
||||||
static irqreturn_t stmmac_msi_intr_tx(int irq, void *data)
|
static irqreturn_t stmmac_msi_intr_tx(int irq, void *data)
|
||||||
{
|
{
|
||||||
struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)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)) {
|
if (unlikely(!data)) {
|
||||||
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
|
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
|
||||||
@@ -5805,10 +5807,12 @@ static irqreturn_t stmmac_msi_intr_tx(in
|
@@ -5810,10 +5812,12 @@ static irqreturn_t stmmac_msi_intr_tx(in
|
||||||
static irqreturn_t stmmac_msi_intr_rx(int irq, void *data)
|
static irqreturn_t stmmac_msi_intr_rx(int irq, void *data)
|
||||||
{
|
{
|
||||||
struct stmmac_rx_queue *rx_q = (struct stmmac_rx_queue *)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)) {
|
if (unlikely(!data)) {
|
||||||
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
|
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
|
||||||
@@ -5839,10 +5843,10 @@ static void stmmac_poll_controller(struc
|
@@ -5844,10 +5848,10 @@ static void stmmac_poll_controller(struc
|
||||||
|
|
||||||
if (priv->plat->multi_msi_en) {
|
if (priv->plat->multi_msi_en) {
|
||||||
for (i = 0; i < priv->plat->rx_queues_to_use; i++)
|
for (i = 0; i < priv->plat->rx_queues_to_use; i++)
|
||||||
|
@ -1075,7 +1075,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
} else {
|
} else {
|
||||||
disable_irq(dev->irq);
|
disable_irq(dev->irq);
|
||||||
stmmac_interrupt(dev->irq, dev);
|
stmmac_interrupt(dev->irq, dev);
|
||||||
@@ -6023,34 +6027,34 @@ static int stmmac_rings_status_show(stru
|
@@ -6028,34 +6032,34 @@ static int stmmac_rings_status_show(stru
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (queue = 0; queue < rx_count; queue++) {
|
for (queue = 0; queue < rx_count; queue++) {
|
||||||
|
@ -1116,7 +1116,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6391,7 +6395,7 @@ void stmmac_disable_rx_queue(struct stmm
|
@@ -6396,7 +6400,7 @@ void stmmac_disable_rx_queue(struct stmm
|
||||||
|
|
||||||
void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
|
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];
|
struct stmmac_channel *ch = &priv->channel[queue];
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u32 buf_size;
|
u32 buf_size;
|
||||||
@@ -6428,7 +6432,7 @@ void stmmac_enable_rx_queue(struct stmma
|
@@ -6433,7 +6437,7 @@ void stmmac_enable_rx_queue(struct stmma
|
||||||
rx_q->queue_index);
|
rx_q->queue_index);
|
||||||
} else {
|
} else {
|
||||||
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
||||||
|
@ -1134,7 +1134,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
rx_q->queue_index);
|
rx_q->queue_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6454,7 +6458,7 @@ void stmmac_disable_tx_queue(struct stmm
|
@@ -6459,7 +6463,7 @@ void stmmac_disable_tx_queue(struct stmm
|
||||||
|
|
||||||
void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
|
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];
|
struct stmmac_channel *ch = &priv->channel[queue];
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -6504,7 +6508,7 @@ void stmmac_xdp_release(struct net_devic
|
@@ -6509,7 +6513,7 @@ void stmmac_xdp_release(struct net_devic
|
||||||
stmmac_disable_all_queues(priv);
|
stmmac_disable_all_queues(priv);
|
||||||
|
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
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 */
|
/* Free the IRQ lines */
|
||||||
stmmac_free_irq(dev, REQ_IRQ_ERR_ALL, 0);
|
stmmac_free_irq(dev, REQ_IRQ_ERR_ALL, 0);
|
||||||
@@ -6563,7 +6567,7 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6568,7 +6572,7 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
|
|
||||||
/* DMA RX Channel Configuration */
|
/* DMA RX Channel Configuration */
|
||||||
for (chan = 0; chan < rx_cnt; chan++) {
|
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,
|
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
rx_q->dma_rx_phy, chan);
|
rx_q->dma_rx_phy, chan);
|
||||||
@@ -6581,7 +6585,7 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6586,7 +6590,7 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
rx_q->queue_index);
|
rx_q->queue_index);
|
||||||
} else {
|
} else {
|
||||||
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
||||||
|
@ -1170,7 +1170,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
rx_q->queue_index);
|
rx_q->queue_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6590,7 +6594,7 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6595,7 +6599,7 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
|
|
||||||
/* DMA TX Channel Configuration */
|
/* DMA TX Channel Configuration */
|
||||||
for (chan = 0; chan < tx_cnt; chan++) {
|
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,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
tx_q->dma_tx_phy, chan);
|
tx_q->dma_tx_phy, chan);
|
||||||
@@ -6623,7 +6627,7 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6628,7 +6632,7 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
|
|
||||||
irq_error:
|
irq_error:
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
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);
|
stmmac_hw_teardown(dev);
|
||||||
init_error:
|
init_error:
|
||||||
@@ -6650,8 +6654,8 @@ int stmmac_xsk_wakeup(struct net_device
|
@@ -6655,8 +6659,8 @@ int stmmac_xsk_wakeup(struct net_device
|
||||||
queue >= priv->plat->tx_queues_to_use)
|
queue >= priv->plat->tx_queues_to_use)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
@ -1199,7 +1199,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
ch = &priv->channel[queue];
|
ch = &priv->channel[queue];
|
||||||
|
|
||||||
if (!rx_q->xsk_pool && !tx_q->xsk_pool)
|
if (!rx_q->xsk_pool && !tx_q->xsk_pool)
|
||||||
@@ -6907,8 +6911,8 @@ int stmmac_reinit_ringparam(struct net_d
|
@@ -6912,8 +6916,8 @@ int stmmac_reinit_ringparam(struct net_d
|
||||||
if (netif_running(dev))
|
if (netif_running(dev))
|
||||||
stmmac_release(dev);
|
stmmac_release(dev);
|
||||||
|
|
||||||
|
@ -1210,7 +1210,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
if (netif_running(dev))
|
if (netif_running(dev))
|
||||||
ret = stmmac_open(dev);
|
ret = stmmac_open(dev);
|
||||||
@@ -7346,7 +7350,7 @@ int stmmac_suspend(struct device *dev)
|
@@ -7351,7 +7355,7 @@ int stmmac_suspend(struct device *dev)
|
||||||
stmmac_disable_all_queues(priv);
|
stmmac_disable_all_queues(priv);
|
||||||
|
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
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) {
|
if (priv->eee_enabled) {
|
||||||
priv->tx_path_in_lpi_mode = false;
|
priv->tx_path_in_lpi_mode = false;
|
||||||
@@ -7397,7 +7401,7 @@ EXPORT_SYMBOL_GPL(stmmac_suspend);
|
@@ -7402,7 +7406,7 @@ EXPORT_SYMBOL_GPL(stmmac_suspend);
|
||||||
|
|
||||||
static void stmmac_reset_rx_queue(struct stmmac_priv *priv, u32 queue)
|
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->cur_rx = 0;
|
||||||
rx_q->dirty_rx = 0;
|
rx_q->dirty_rx = 0;
|
||||||
@@ -7405,7 +7409,7 @@ static void stmmac_reset_rx_queue(struct
|
@@ -7410,7 +7414,7 @@ static void stmmac_reset_rx_queue(struct
|
||||||
|
|
||||||
static void stmmac_reset_tx_queue(struct stmmac_priv *priv, u32 queue)
|
static void stmmac_reset_tx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
@@ -1293,7 +1293,8 @@ static int stmmac_phy_setup(struct stmma
|
@@ -1298,7 +1298,8 @@ static int stmmac_phy_setup(struct stmma
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
{
|
{
|
||||||
u32 rx_cnt = priv->plat->rx_queues_to_use;
|
u32 rx_cnt = priv->plat->rx_queues_to_use;
|
||||||
unsigned int desc_size;
|
unsigned int desc_size;
|
||||||
@@ -1302,7 +1303,7 @@ static void stmmac_display_rx_rings(stru
|
@@ -1307,7 +1308,7 @@ static void stmmac_display_rx_rings(stru
|
||||||
|
|
||||||
/* Display RX rings */
|
/* Display RX rings */
|
||||||
for (queue = 0; queue < rx_cnt; queue++) {
|
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);
|
pr_info("\tRX Queue %u rings\n", queue);
|
||||||
|
|
||||||
@@ -1315,12 +1316,13 @@ static void stmmac_display_rx_rings(stru
|
@@ -1320,12 +1321,13 @@ static void stmmac_display_rx_rings(stru
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display RX ring */
|
/* Display RX ring */
|
||||||
|
@ -52,7 +52,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
{
|
{
|
||||||
u32 tx_cnt = priv->plat->tx_queues_to_use;
|
u32 tx_cnt = priv->plat->tx_queues_to_use;
|
||||||
unsigned int desc_size;
|
unsigned int desc_size;
|
||||||
@@ -1329,7 +1331,7 @@ static void stmmac_display_tx_rings(stru
|
@@ -1334,7 +1336,7 @@ static void stmmac_display_tx_rings(stru
|
||||||
|
|
||||||
/* Display TX rings */
|
/* Display TX rings */
|
||||||
for (queue = 0; queue < tx_cnt; queue++) {
|
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);
|
pr_info("\tTX Queue %d rings\n", queue);
|
||||||
|
|
||||||
@@ -1344,18 +1346,19 @@ static void stmmac_display_tx_rings(stru
|
@@ -1349,18 +1351,19 @@ static void stmmac_display_tx_rings(stru
|
||||||
desc_size = sizeof(struct dma_desc);
|
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)
|
static int stmmac_set_bfsize(int mtu, int bufsize)
|
||||||
@@ -1379,44 +1382,50 @@ static int stmmac_set_bfsize(int mtu, in
|
@@ -1384,44 +1387,50 @@ static int stmmac_set_bfsize(int mtu, in
|
||||||
/**
|
/**
|
||||||
* stmmac_clear_rx_descriptors - clear RX descriptors
|
* stmmac_clear_rx_descriptors - clear RX descriptors
|
||||||
* @priv: driver private structure
|
* @priv: driver private structure
|
||||||
|
@ -147,7 +147,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -1433,10 +1442,12 @@ static void stmmac_clear_tx_descriptors(
|
@@ -1438,10 +1447,12 @@ static void stmmac_clear_tx_descriptors(
|
||||||
/**
|
/**
|
||||||
* stmmac_clear_descriptors - clear descriptors
|
* stmmac_clear_descriptors - clear descriptors
|
||||||
* @priv: driver private structure
|
* @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 rx_queue_cnt = priv->plat->rx_queues_to_use;
|
||||||
u32 tx_queue_cnt = priv->plat->tx_queues_to_use;
|
u32 tx_queue_cnt = priv->plat->tx_queues_to_use;
|
||||||
@@ -1444,16 +1455,17 @@ static void stmmac_clear_descriptors(str
|
@@ -1449,16 +1460,17 @@ static void stmmac_clear_descriptors(str
|
||||||
|
|
||||||
/* Clear the RX descriptors */
|
/* Clear the RX descriptors */
|
||||||
for (queue = 0; queue < rx_queue_cnt; queue++)
|
for (queue = 0; queue < rx_queue_cnt; queue++)
|
||||||
|
@ -181,7 +181,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
* @p: descriptor pointer
|
* @p: descriptor pointer
|
||||||
* @i: descriptor index
|
* @i: descriptor index
|
||||||
* @flags: gfp flag
|
* @flags: gfp flag
|
||||||
@@ -1461,10 +1473,12 @@ static void stmmac_clear_descriptors(str
|
@@ -1466,10 +1478,12 @@ static void stmmac_clear_descriptors(str
|
||||||
* Description: this function is called to allocate a receive buffer, perform
|
* Description: this function is called to allocate a receive buffer, perform
|
||||||
* the DMA mapping and init the descriptor.
|
* 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];
|
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
||||||
|
|
||||||
if (!buf->page) {
|
if (!buf->page) {
|
||||||
@@ -1489,7 +1503,7 @@ static int stmmac_init_rx_buffers(struct
|
@@ -1494,7 +1508,7 @@ static int stmmac_init_rx_buffers(struct
|
||||||
buf->addr = page_pool_get_dma_addr(buf->page) + buf->page_offset;
|
buf->addr = page_pool_get_dma_addr(buf->page) + buf->page_offset;
|
||||||
|
|
||||||
stmmac_set_desc_addr(priv, p, buf->addr);
|
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);
|
stmmac_init_desc3(priv, p);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1498,12 +1512,13 @@ static int stmmac_init_rx_buffers(struct
|
@@ -1503,12 +1517,13 @@ static int stmmac_init_rx_buffers(struct
|
||||||
/**
|
/**
|
||||||
* stmmac_free_rx_buffer - free RX dma buffers
|
* stmmac_free_rx_buffer - free RX dma buffers
|
||||||
* @priv: private structure
|
* @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];
|
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
||||||
|
|
||||||
if (buf->page)
|
if (buf->page)
|
||||||
@@ -1518,12 +1533,15 @@ static void stmmac_free_rx_buffer(struct
|
@@ -1523,12 +1538,15 @@ static void stmmac_free_rx_buffer(struct
|
||||||
/**
|
/**
|
||||||
* stmmac_free_tx_buffer - free RX dma buffers
|
* stmmac_free_tx_buffer - free RX dma buffers
|
||||||
* @priv: private structure
|
* @priv: private structure
|
||||||
|
@ -240,7 +240,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
if (tx_q->tx_skbuff_dma[i].buf &&
|
if (tx_q->tx_skbuff_dma[i].buf &&
|
||||||
tx_q->tx_skbuff_dma[i].buf_type != STMMAC_TXBUF_T_XDP_TX) {
|
tx_q->tx_skbuff_dma[i].buf_type != STMMAC_TXBUF_T_XDP_TX) {
|
||||||
@@ -1562,23 +1580,28 @@ static void stmmac_free_tx_buffer(struct
|
@@ -1567,23 +1585,28 @@ static void stmmac_free_tx_buffer(struct
|
||||||
/**
|
/**
|
||||||
* dma_free_rx_skbufs - free RX dma buffers
|
* dma_free_rx_skbufs - free RX dma buffers
|
||||||
* @priv: private structure
|
* @priv: private structure
|
||||||
|
@ -276,7 +276,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -1587,7 +1610,7 @@ static int stmmac_alloc_rx_buffers(struc
|
@@ -1592,7 +1615,7 @@ static int stmmac_alloc_rx_buffers(struc
|
||||||
else
|
else
|
||||||
p = rx_q->dma_rx + i;
|
p = rx_q->dma_rx + i;
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
queue);
|
queue);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1601,14 +1624,17 @@ static int stmmac_alloc_rx_buffers(struc
|
@@ -1606,14 +1629,17 @@ static int stmmac_alloc_rx_buffers(struc
|
||||||
/**
|
/**
|
||||||
* dma_free_rx_xskbufs - free RX dma buffers from XSK pool
|
* dma_free_rx_xskbufs - free RX dma buffers from XSK pool
|
||||||
* @priv: private structure
|
* @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];
|
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
||||||
|
|
||||||
if (!buf->xdp)
|
if (!buf->xdp)
|
||||||
@@ -1619,12 +1645,14 @@ static void dma_free_rx_xskbufs(struct s
|
@@ -1624,12 +1650,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;
|
struct stmmac_rx_buffer *buf;
|
||||||
dma_addr_t dma_addr;
|
dma_addr_t dma_addr;
|
||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
@@ -1659,22 +1687,25 @@ static struct xsk_buff_pool *stmmac_get_
|
@@ -1664,22 +1692,25 @@ static struct xsk_buff_pool *stmmac_get_
|
||||||
/**
|
/**
|
||||||
* __init_dma_rx_desc_rings - init the RX descriptor ring (per queue)
|
* __init_dma_rx_desc_rings - init the RX descriptor ring (per queue)
|
||||||
* @priv: driver private structure
|
* @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);
|
xdp_rxq_info_unreg_mem_model(&rx_q->xdp_rxq);
|
||||||
|
|
||||||
@@ -1701,9 +1732,9 @@ static int __init_dma_rx_desc_rings(stru
|
@@ -1706,9 +1737,9 @@ static int __init_dma_rx_desc_rings(stru
|
||||||
/* RX XDP ZC buffer pool may not be populated, e.g.
|
/* RX XDP ZC buffer pool may not be populated, e.g.
|
||||||
* xdpsock TX-only.
|
* xdpsock TX-only.
|
||||||
*/
|
*/
|
||||||
|
@ -365,7 +365,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
@@ -1713,17 +1744,19 @@ static int __init_dma_rx_desc_rings(stru
|
@@ -1718,17 +1749,19 @@ static int __init_dma_rx_desc_rings(stru
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
stmmac_mode_init(priv, rx_q->dma_erx,
|
stmmac_mode_init(priv, rx_q->dma_erx,
|
||||||
rx_q->dma_rx_phy,
|
rx_q->dma_rx_phy,
|
||||||
|
@ -388,7 +388,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
{
|
{
|
||||||
struct stmmac_priv *priv = netdev_priv(dev);
|
struct stmmac_priv *priv = netdev_priv(dev);
|
||||||
u32 rx_count = priv->plat->rx_queues_to_use;
|
u32 rx_count = priv->plat->rx_queues_to_use;
|
||||||
@@ -1735,7 +1768,7 @@ static int init_dma_rx_desc_rings(struct
|
@@ -1740,7 +1773,7 @@ static int init_dma_rx_desc_rings(struct
|
||||||
"SKB addresses:\nskb\t\tskb data\tdma data\n");
|
"SKB addresses:\nskb\t\tskb data\tdma data\n");
|
||||||
|
|
||||||
for (queue = 0; queue < rx_count; queue++) {
|
for (queue = 0; queue < rx_count; queue++) {
|
||||||
|
@ -397,7 +397,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_init_rx_buffers;
|
goto err_init_rx_buffers;
|
||||||
}
|
}
|
||||||
@@ -1744,12 +1777,12 @@ static int init_dma_rx_desc_rings(struct
|
@@ -1749,12 +1782,12 @@ static int init_dma_rx_desc_rings(struct
|
||||||
|
|
||||||
err_init_rx_buffers:
|
err_init_rx_buffers:
|
||||||
while (queue >= 0) {
|
while (queue >= 0) {
|
||||||
|
@ -413,7 +413,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
rx_q->buf_alloc_num = 0;
|
rx_q->buf_alloc_num = 0;
|
||||||
rx_q->xsk_pool = NULL;
|
rx_q->xsk_pool = NULL;
|
||||||
@@ -1766,14 +1799,17 @@ err_init_rx_buffers:
|
@@ -1771,14 +1804,17 @@ err_init_rx_buffers:
|
||||||
/**
|
/**
|
||||||
* __init_dma_tx_desc_rings - init the TX descriptor ring (per queue)
|
* __init_dma_tx_desc_rings - init the TX descriptor ring (per queue)
|
||||||
* @priv: driver private structure
|
* @priv: driver private structure
|
||||||
|
@ -434,7 +434,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
netif_dbg(priv, probe, priv->dev,
|
netif_dbg(priv, probe, priv->dev,
|
||||||
@@ -1785,16 +1821,16 @@ static int __init_dma_tx_desc_rings(stru
|
@@ -1790,16 +1826,16 @@ static int __init_dma_tx_desc_rings(stru
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
stmmac_mode_init(priv, tx_q->dma_etx,
|
stmmac_mode_init(priv, tx_q->dma_etx,
|
||||||
tx_q->dma_tx_phy,
|
tx_q->dma_tx_phy,
|
||||||
|
@ -454,7 +454,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -1816,7 +1852,8 @@ static int __init_dma_tx_desc_rings(stru
|
@@ -1821,7 +1857,8 @@ static int __init_dma_tx_desc_rings(stru
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -464,7 +464,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
{
|
{
|
||||||
struct stmmac_priv *priv = netdev_priv(dev);
|
struct stmmac_priv *priv = netdev_priv(dev);
|
||||||
u32 tx_queue_cnt;
|
u32 tx_queue_cnt;
|
||||||
@@ -1825,7 +1862,7 @@ static int init_dma_tx_desc_rings(struct
|
@@ -1830,7 +1867,7 @@ static int init_dma_tx_desc_rings(struct
|
||||||
tx_queue_cnt = priv->plat->tx_queues_to_use;
|
tx_queue_cnt = priv->plat->tx_queues_to_use;
|
||||||
|
|
||||||
for (queue = 0; queue < tx_queue_cnt; queue++)
|
for (queue = 0; queue < tx_queue_cnt; queue++)
|
||||||
|
@ -473,7 +473,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1833,26 +1870,29 @@ static int init_dma_tx_desc_rings(struct
|
@@ -1838,26 +1875,29 @@ static int init_dma_tx_desc_rings(struct
|
||||||
/**
|
/**
|
||||||
* init_dma_desc_rings - init the RX/TX descriptor rings
|
* init_dma_desc_rings - init the RX/TX descriptor rings
|
||||||
* @dev: net device structure
|
* @dev: net device structure
|
||||||
|
@ -508,7 +508,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -1860,17 +1900,20 @@ static int init_dma_desc_rings(struct ne
|
@@ -1865,17 +1905,20 @@ static int init_dma_desc_rings(struct ne
|
||||||
/**
|
/**
|
||||||
* dma_free_tx_skbufs - free TX dma buffers
|
* dma_free_tx_skbufs - free TX dma buffers
|
||||||
* @priv: private structure
|
* @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) {
|
if (tx_q->xsk_pool && tx_q->xsk_frames_done) {
|
||||||
xsk_tx_completed(tx_q->xsk_pool, tx_q->xsk_frames_done);
|
xsk_tx_completed(tx_q->xsk_pool, tx_q->xsk_frames_done);
|
||||||
@@ -1889,34 +1932,37 @@ static void stmmac_free_tx_skbufs(struct
|
@@ -1894,34 +1937,37 @@ static void stmmac_free_tx_skbufs(struct
|
||||||
u32 queue;
|
u32 queue;
|
||||||
|
|
||||||
for (queue = 0; queue < tx_queue_cnt; 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),
|
sizeof(struct dma_extended_desc),
|
||||||
rx_q->dma_erx, rx_q->dma_rx_phy);
|
rx_q->dma_erx, rx_q->dma_rx_phy);
|
||||||
|
|
||||||
@@ -1928,29 +1974,33 @@ static void __free_dma_rx_desc_resources
|
@@ -1933,29 +1979,33 @@ static void __free_dma_rx_desc_resources
|
||||||
page_pool_destroy(rx_q->page_pool);
|
page_pool_destroy(rx_q->page_pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,7 +617,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
if (priv->extend_desc) {
|
if (priv->extend_desc) {
|
||||||
size = sizeof(struct dma_extended_desc);
|
size = sizeof(struct dma_extended_desc);
|
||||||
@@ -1963,7 +2013,7 @@ static void __free_dma_tx_desc_resources
|
@@ -1968,7 +2018,7 @@ static void __free_dma_tx_desc_resources
|
||||||
addr = tx_q->dma_tx;
|
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);
|
dma_free_coherent(priv->device, size, addr, tx_q->dma_tx_phy);
|
||||||
|
|
||||||
@@ -1971,28 +2021,32 @@ static void __free_dma_tx_desc_resources
|
@@ -1976,28 +2026,32 @@ static void __free_dma_tx_desc_resources
|
||||||
kfree(tx_q->tx_skbuff);
|
kfree(tx_q->tx_skbuff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -663,7 +663,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
struct stmmac_channel *ch = &priv->channel[queue];
|
struct stmmac_channel *ch = &priv->channel[queue];
|
||||||
bool xdp_prog = stmmac_xdp_is_enabled(priv);
|
bool xdp_prog = stmmac_xdp_is_enabled(priv);
|
||||||
struct page_pool_params pp_params = { 0 };
|
struct page_pool_params pp_params = { 0 };
|
||||||
@@ -2004,8 +2058,8 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2009,8 +2063,8 @@ static int __alloc_dma_rx_desc_resources
|
||||||
rx_q->priv_data = priv;
|
rx_q->priv_data = priv;
|
||||||
|
|
||||||
pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
|
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.order = ilog2(num_pages);
|
||||||
pp_params.nid = dev_to_node(priv->device);
|
pp_params.nid = dev_to_node(priv->device);
|
||||||
pp_params.dev = priv->device;
|
pp_params.dev = priv->device;
|
||||||
@@ -2020,7 +2074,7 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2025,7 +2079,7 @@ static int __alloc_dma_rx_desc_resources
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -683,7 +683,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
sizeof(*rx_q->buf_pool),
|
sizeof(*rx_q->buf_pool),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!rx_q->buf_pool)
|
if (!rx_q->buf_pool)
|
||||||
@@ -2028,7 +2082,7 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2033,7 +2087,7 @@ static int __alloc_dma_rx_desc_resources
|
||||||
|
|
||||||
if (priv->extend_desc) {
|
if (priv->extend_desc) {
|
||||||
rx_q->dma_erx = dma_alloc_coherent(priv->device,
|
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),
|
sizeof(struct dma_extended_desc),
|
||||||
&rx_q->dma_rx_phy,
|
&rx_q->dma_rx_phy,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
@@ -2037,7 +2091,7 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2042,7 +2096,7 @@ static int __alloc_dma_rx_desc_resources
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
rx_q->dma_rx = dma_alloc_coherent(priv->device,
|
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),
|
sizeof(struct dma_desc),
|
||||||
&rx_q->dma_rx_phy,
|
&rx_q->dma_rx_phy,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
@@ -2062,7 +2116,8 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2067,7 +2121,8 @@ static int __alloc_dma_rx_desc_resources
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -711,7 +711,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
{
|
{
|
||||||
u32 rx_count = priv->plat->rx_queues_to_use;
|
u32 rx_count = priv->plat->rx_queues_to_use;
|
||||||
u32 queue;
|
u32 queue;
|
||||||
@@ -2070,7 +2125,7 @@ static int alloc_dma_rx_desc_resources(s
|
@@ -2075,7 +2130,7 @@ static int alloc_dma_rx_desc_resources(s
|
||||||
|
|
||||||
/* RX queues buffers and DMA */
|
/* RX queues buffers and DMA */
|
||||||
for (queue = 0; queue < rx_count; queue++) {
|
for (queue = 0; queue < rx_count; queue++) {
|
||||||
|
@ -720,7 +720,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_dma;
|
goto err_dma;
|
||||||
}
|
}
|
||||||
@@ -2078,7 +2133,7 @@ static int alloc_dma_rx_desc_resources(s
|
@@ -2083,7 +2138,7 @@ static int alloc_dma_rx_desc_resources(s
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_dma:
|
err_dma:
|
||||||
|
@ -729,7 +729,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -2086,28 +2141,31 @@ err_dma:
|
@@ -2091,28 +2146,31 @@ err_dma:
|
||||||
/**
|
/**
|
||||||
* __alloc_dma_tx_desc_resources - alloc TX resources (per queue).
|
* __alloc_dma_tx_desc_resources - alloc TX resources (per queue).
|
||||||
* @priv: private structure
|
* @priv: private structure
|
||||||
|
@ -765,7 +765,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
sizeof(struct sk_buff *),
|
sizeof(struct sk_buff *),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!tx_q->tx_skbuff)
|
if (!tx_q->tx_skbuff)
|
||||||
@@ -2120,7 +2178,7 @@ static int __alloc_dma_tx_desc_resources
|
@@ -2125,7 +2183,7 @@ static int __alloc_dma_tx_desc_resources
|
||||||
else
|
else
|
||||||
size = sizeof(struct dma_desc);
|
size = sizeof(struct dma_desc);
|
||||||
|
|
||||||
|
@ -774,7 +774,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
addr = dma_alloc_coherent(priv->device, size,
|
addr = dma_alloc_coherent(priv->device, size,
|
||||||
&tx_q->dma_tx_phy, GFP_KERNEL);
|
&tx_q->dma_tx_phy, GFP_KERNEL);
|
||||||
@@ -2137,7 +2195,8 @@ static int __alloc_dma_tx_desc_resources
|
@@ -2142,7 +2200,8 @@ static int __alloc_dma_tx_desc_resources
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -784,7 +784,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
{
|
{
|
||||||
u32 tx_count = priv->plat->tx_queues_to_use;
|
u32 tx_count = priv->plat->tx_queues_to_use;
|
||||||
u32 queue;
|
u32 queue;
|
||||||
@@ -2145,7 +2204,7 @@ static int alloc_dma_tx_desc_resources(s
|
@@ -2150,7 +2209,7 @@ static int alloc_dma_tx_desc_resources(s
|
||||||
|
|
||||||
/* TX queues buffers and DMA */
|
/* TX queues buffers and DMA */
|
||||||
for (queue = 0; queue < tx_count; queue++) {
|
for (queue = 0; queue < tx_count; queue++) {
|
||||||
|
@ -793,7 +793,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_dma;
|
goto err_dma;
|
||||||
}
|
}
|
||||||
@@ -2153,27 +2212,29 @@ static int alloc_dma_tx_desc_resources(s
|
@@ -2158,27 +2217,29 @@ static int alloc_dma_tx_desc_resources(s
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_dma:
|
err_dma:
|
||||||
|
@ -827,7 +827,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -2181,16 +2242,18 @@ static int alloc_dma_desc_resources(stru
|
@@ -2186,16 +2247,18 @@ static int alloc_dma_desc_resources(stru
|
||||||
/**
|
/**
|
||||||
* free_dma_desc_resources - free dma desc resources
|
* free_dma_desc_resources - free dma desc resources
|
||||||
* @priv: private structure
|
* @priv: private structure
|
||||||
|
@ -849,7 +849,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2679,8 +2742,8 @@ static void stmmac_tx_err(struct stmmac_
|
@@ -2684,8 +2747,8 @@ static void stmmac_tx_err(struct stmmac_
|
||||||
netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, chan));
|
netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, chan));
|
||||||
|
|
||||||
stmmac_stop_tx_dma(priv, 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_reset_tx_queue(priv, chan);
|
||||||
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
tx_q->dma_tx_phy, chan);
|
tx_q->dma_tx_phy, chan);
|
||||||
@@ -3677,19 +3740,93 @@ static int stmmac_request_irq(struct net
|
@@ -3682,19 +3745,93 @@ static int stmmac_request_irq(struct net
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -957,7 +957,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
u32 chan;
|
u32 chan;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -3716,45 +3853,10 @@ static int stmmac_open(struct net_device
|
@@ -3721,45 +3858,10 @@ static int stmmac_open(struct net_device
|
||||||
memset(&priv->xstats, 0, sizeof(struct stmmac_extra_stats));
|
memset(&priv->xstats, 0, sizeof(struct stmmac_extra_stats));
|
||||||
priv->xstats.threshold = tc;
|
priv->xstats.threshold = tc;
|
||||||
|
|
||||||
|
@ -1005,7 +1005,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
if (priv->plat->serdes_powerup) {
|
if (priv->plat->serdes_powerup) {
|
||||||
ret = priv->plat->serdes_powerup(dev, priv->plat->bsp_priv);
|
ret = priv->plat->serdes_powerup(dev, priv->plat->bsp_priv);
|
||||||
@@ -3797,14 +3899,28 @@ irq_error:
|
@@ -3802,14 +3904,28 @@ irq_error:
|
||||||
|
|
||||||
stmmac_hw_teardown(dev);
|
stmmac_hw_teardown(dev);
|
||||||
init_error:
|
init_error:
|
||||||
|
@ -1036,7 +1036,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
static void stmmac_fpe_stop_wq(struct stmmac_priv *priv)
|
static void stmmac_fpe_stop_wq(struct stmmac_priv *priv)
|
||||||
{
|
{
|
||||||
set_bit(__FPE_REMOVING, &priv->fpe_task_state);
|
set_bit(__FPE_REMOVING, &priv->fpe_task_state);
|
||||||
@@ -3851,7 +3967,7 @@ static int stmmac_release(struct net_dev
|
@@ -3856,7 +3972,7 @@ static int stmmac_release(struct net_dev
|
||||||
stmmac_stop_all_dma(priv);
|
stmmac_stop_all_dma(priv);
|
||||||
|
|
||||||
/* Release and free the Rx/Tx resources */
|
/* Release and free the Rx/Tx resources */
|
||||||
|
@ -1045,7 +1045,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
/* Disable the MAC Rx/Tx */
|
/* Disable the MAC Rx/Tx */
|
||||||
stmmac_mac_set(priv, priv->ioaddr, false);
|
stmmac_mac_set(priv, priv->ioaddr, false);
|
||||||
@@ -6390,7 +6506,7 @@ void stmmac_disable_rx_queue(struct stmm
|
@@ -6395,7 +6511,7 @@ void stmmac_disable_rx_queue(struct stmm
|
||||||
spin_unlock_irqrestore(&ch->lock, flags);
|
spin_unlock_irqrestore(&ch->lock, flags);
|
||||||
|
|
||||||
stmmac_stop_rx_dma(priv, queue);
|
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)
|
void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
@@ -6401,21 +6517,21 @@ void stmmac_enable_rx_queue(struct stmma
|
@@ -6406,21 +6522,21 @@ void stmmac_enable_rx_queue(struct stmma
|
||||||
u32 buf_size;
|
u32 buf_size;
|
||||||
int ret;
|
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,
|
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
rx_q->dma_rx_phy, rx_q->queue_index);
|
rx_q->dma_rx_phy, rx_q->queue_index);
|
||||||
@@ -6453,7 +6569,7 @@ void stmmac_disable_tx_queue(struct stmm
|
@@ -6458,7 +6574,7 @@ void stmmac_disable_tx_queue(struct stmm
|
||||||
spin_unlock_irqrestore(&ch->lock, flags);
|
spin_unlock_irqrestore(&ch->lock, flags);
|
||||||
|
|
||||||
stmmac_stop_tx_dma(priv, queue);
|
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)
|
void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
@@ -6463,21 +6579,21 @@ void stmmac_enable_tx_queue(struct stmma
|
@@ -6468,21 +6584,21 @@ void stmmac_enable_tx_queue(struct stmma
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret;
|
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,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
tx_q->dma_tx_phy, tx_q->queue_index);
|
tx_q->dma_tx_phy, tx_q->queue_index);
|
||||||
@@ -6517,7 +6633,7 @@ void stmmac_xdp_release(struct net_devic
|
@@ -6522,7 +6638,7 @@ void stmmac_xdp_release(struct net_devic
|
||||||
stmmac_stop_all_dma(priv);
|
stmmac_stop_all_dma(priv);
|
||||||
|
|
||||||
/* Release and free the Rx/Tx resources */
|
/* Release and free the Rx/Tx resources */
|
||||||
|
@ -1124,7 +1124,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
/* Disable the MAC Rx/Tx */
|
/* Disable the MAC Rx/Tx */
|
||||||
stmmac_mac_set(priv, priv->ioaddr, false);
|
stmmac_mac_set(priv, priv->ioaddr, false);
|
||||||
@@ -6542,14 +6658,14 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6547,14 +6663,14 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
u32 chan;
|
u32 chan;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -1141,7 +1141,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
netdev_err(dev, "%s: DMA descriptors initialization failed\n",
|
netdev_err(dev, "%s: DMA descriptors initialization failed\n",
|
||||||
__func__);
|
__func__);
|
||||||
@@ -6631,7 +6747,7 @@ irq_error:
|
@@ -6636,7 +6752,7 @@ irq_error:
|
||||||
|
|
||||||
stmmac_hw_teardown(dev);
|
stmmac_hw_teardown(dev);
|
||||||
init_error:
|
init_error:
|
||||||
|
@ -1150,7 +1150,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
dma_desc_error:
|
dma_desc_error:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -7492,7 +7608,7 @@ int stmmac_resume(struct device *dev)
|
@@ -7497,7 +7613,7 @@ int stmmac_resume(struct device *dev)
|
||||||
stmmac_reset_queues_param(priv);
|
stmmac_reset_queues_param(priv);
|
||||||
|
|
||||||
stmmac_free_tx_skbufs(priv);
|
stmmac_free_tx_skbufs(priv);
|
||||||
|
|
|
@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
@@ -5619,18 +5619,15 @@ static int stmmac_change_mtu(struct net_
|
@@ -5624,18 +5624,15 @@ static int stmmac_change_mtu(struct net_
|
||||||
{
|
{
|
||||||
struct stmmac_priv *priv = netdev_priv(dev);
|
struct stmmac_priv *priv = netdev_priv(dev);
|
||||||
int txfifosz = priv->plat->tx_fifo_size;
|
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) {
|
if (stmmac_xdp_is_enabled(priv) && new_mtu > ETH_DATA_LEN) {
|
||||||
netdev_dbg(priv->dev, "Jumbo frames not supported for XDP\n");
|
netdev_dbg(priv->dev, "Jumbo frames not supported for XDP\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -5642,8 +5639,29 @@ static int stmmac_change_mtu(struct net_
|
@@ -5647,8 +5644,29 @@ static int stmmac_change_mtu(struct net_
|
||||||
if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
|
if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
|
|
@ -77,11 +77,14 @@
|
||||||
struct mtk_wed_device {
|
struct mtk_wed_device {
|
||||||
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
|
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
|
||||||
const struct mtk_wed_ops *ops;
|
const struct mtk_wed_ops *ops;
|
||||||
@@ -28,30 +83,71 @@ struct mtk_wed_device {
|
@@ -28,30 +83,76 @@ struct mtk_wed_device {
|
||||||
bool init_done, running;
|
bool init_done, running;
|
||||||
int wdma_idx;
|
int wdma_idx;
|
||||||
int irq;
|
int irq;
|
||||||
+ u8 version;
|
+ u8 version;
|
||||||
|
+
|
||||||
|
+ /* used by wlan driver */
|
||||||
|
+ u32 rev_id;
|
||||||
|
|
||||||
struct mtk_wed_ring tx_ring[MTK_WED_TX_QUEUES];
|
struct mtk_wed_ring tx_ring[MTK_WED_TX_QUEUES];
|
||||||
+ struct mtk_wed_ring rx_ring[MTK_WED_RX_QUEUES];
|
+ struct mtk_wed_ring rx_ring[MTK_WED_RX_QUEUES];
|
||||||
|
@ -148,15 +151,19 @@
|
||||||
+ void (*release_rx_buf)(struct mtk_wed_device *wed);
|
+ void (*release_rx_buf)(struct mtk_wed_device *wed);
|
||||||
+ void (*update_wo_rx_stats)(struct mtk_wed_device *wed,
|
+ void (*update_wo_rx_stats)(struct mtk_wed_device *wed,
|
||||||
+ struct mtk_wed_wo_rx_stats *stats);
|
+ struct mtk_wed_wo_rx_stats *stats);
|
||||||
|
+ int (*reset)(struct mtk_wed_device *wed);
|
||||||
|
+ void (*reset_complete)(struct mtk_wed_device *wed);
|
||||||
} wlan;
|
} wlan;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
@@ -60,9 +156,15 @@ struct mtk_wed_ops {
|
@@ -59,10 +160,16 @@ struct mtk_wed_device {
|
||||||
|
struct mtk_wed_ops {
|
||||||
int (*attach)(struct mtk_wed_device *dev);
|
int (*attach)(struct mtk_wed_device *dev);
|
||||||
int (*tx_ring_setup)(struct mtk_wed_device *dev, int ring,
|
int (*tx_ring_setup)(struct mtk_wed_device *dev, int ring,
|
||||||
void __iomem *regs);
|
- void __iomem *regs);
|
||||||
|
+ void __iomem *regs, bool reset);
|
||||||
+ int (*rx_ring_setup)(struct mtk_wed_device *dev, int ring,
|
+ int (*rx_ring_setup)(struct mtk_wed_device *dev, int ring,
|
||||||
+ void __iomem *regs);
|
+ void __iomem *regs, bool reset);
|
||||||
int (*txfree_ring_setup)(struct mtk_wed_device *dev,
|
int (*txfree_ring_setup)(struct mtk_wed_device *dev,
|
||||||
void __iomem *regs);
|
void __iomem *regs);
|
||||||
+ int (*msg_update)(struct mtk_wed_device *dev, int cmd_id,
|
+ int (*msg_update)(struct mtk_wed_device *dev, int cmd_id,
|
||||||
|
@ -167,7 +174,7 @@
|
||||||
|
|
||||||
void (*stop)(struct mtk_wed_device *dev);
|
void (*stop)(struct mtk_wed_device *dev);
|
||||||
void (*start)(struct mtk_wed_device *dev, u32 irq_mask);
|
void (*start)(struct mtk_wed_device *dev, u32 irq_mask);
|
||||||
@@ -97,6 +199,16 @@ mtk_wed_device_attach(struct mtk_wed_dev
|
@@ -97,12 +204,22 @@ mtk_wed_device_attach(struct mtk_wed_dev
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,26 +191,45 @@
|
||||||
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
|
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
|
||||||
#define mtk_wed_device_active(_dev) !!(_dev)->ops
|
#define mtk_wed_device_active(_dev) !!(_dev)->ops
|
||||||
#define mtk_wed_device_detach(_dev) (_dev)->ops->detach(_dev)
|
#define mtk_wed_device_detach(_dev) (_dev)->ops->detach(_dev)
|
||||||
@@ -113,6 +225,12 @@ mtk_wed_device_attach(struct mtk_wed_dev
|
#define mtk_wed_device_start(_dev, _mask) (_dev)->ops->start(_dev, _mask)
|
||||||
|
-#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs) \
|
||||||
|
- (_dev)->ops->tx_ring_setup(_dev, _ring, _regs)
|
||||||
|
+#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs, _reset) \
|
||||||
|
+ (_dev)->ops->tx_ring_setup(_dev, _ring, _regs, _reset)
|
||||||
|
#define mtk_wed_device_txfree_ring_setup(_dev, _regs) \
|
||||||
|
(_dev)->ops->txfree_ring_setup(_dev, _regs)
|
||||||
|
#define mtk_wed_device_reg_read(_dev, _reg) \
|
||||||
|
@@ -113,6 +230,14 @@ mtk_wed_device_attach(struct mtk_wed_dev
|
||||||
(_dev)->ops->irq_get(_dev, _mask)
|
(_dev)->ops->irq_get(_dev, _mask)
|
||||||
#define mtk_wed_device_irq_set_mask(_dev, _mask) \
|
#define mtk_wed_device_irq_set_mask(_dev, _mask) \
|
||||||
(_dev)->ops->irq_set_mask(_dev, _mask)
|
(_dev)->ops->irq_set_mask(_dev, _mask)
|
||||||
+#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs) \
|
+#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs, _reset) \
|
||||||
+ (_dev)->ops->rx_ring_setup(_dev, _ring, _regs)
|
+ (_dev)->ops->rx_ring_setup(_dev, _ring, _regs, _reset)
|
||||||
+#define mtk_wed_device_ppe_check(_dev, _skb, _reason, _hash) \
|
+#define mtk_wed_device_ppe_check(_dev, _skb, _reason, _hash) \
|
||||||
+ (_dev)->ops->ppe_check(_dev, _skb, _reason, _hash)
|
+ (_dev)->ops->ppe_check(_dev, _skb, _reason, _hash)
|
||||||
+#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) \
|
+#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) \
|
||||||
+ (_dev)->ops->msg_update(_dev, _id, _msg, _len)
|
+ (_dev)->ops->msg_update(_dev, _id, _msg, _len)
|
||||||
|
+#define mtk_wed_device_stop(_dev) (_dev)->ops->stop(_dev)
|
||||||
|
+#define mtk_wed_device_dma_reset(_dev) (_dev)->ops->reset_dma(_dev)
|
||||||
#else
|
#else
|
||||||
static inline bool mtk_wed_device_active(struct mtk_wed_device *dev)
|
static inline bool mtk_wed_device_active(struct mtk_wed_device *dev)
|
||||||
{
|
{
|
||||||
@@ -126,6 +244,9 @@ static inline bool mtk_wed_device_active
|
@@ -120,12 +245,17 @@ static inline bool mtk_wed_device_active
|
||||||
|
}
|
||||||
|
#define mtk_wed_device_detach(_dev) do {} while (0)
|
||||||
|
#define mtk_wed_device_start(_dev, _mask) do {} while (0)
|
||||||
|
-#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs) -ENODEV
|
||||||
|
+#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs, _reset) -ENODEV
|
||||||
|
#define mtk_wed_device_txfree_ring_setup(_dev, _ring, _regs) -ENODEV
|
||||||
|
#define mtk_wed_device_reg_read(_dev, _reg) 0
|
||||||
#define mtk_wed_device_reg_write(_dev, _reg, _val) do {} while (0)
|
#define mtk_wed_device_reg_write(_dev, _reg, _val) do {} while (0)
|
||||||
#define mtk_wed_device_irq_get(_dev, _mask) 0
|
#define mtk_wed_device_irq_get(_dev, _mask) 0
|
||||||
#define mtk_wed_device_irq_set_mask(_dev, _mask) do {} while (0)
|
#define mtk_wed_device_irq_set_mask(_dev, _mask) do {} while (0)
|
||||||
+#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs) -ENODEV
|
+#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs, _reset) -ENODEV
|
||||||
+#define mtk_wed_device_ppe_check(_dev, _skb, _reason, _hash) do {} while (0)
|
+#define mtk_wed_device_ppe_check(_dev, _skb, _reason, _hash) do {} while (0)
|
||||||
+#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) -ENODEV
|
+#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) -ENODEV
|
||||||
|
+#define mtk_wed_device_stop(_dev) do {} while (0)
|
||||||
|
+#define mtk_wed_device_dma_reset(_dev) do {} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,7 +11,7 @@ Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
|
||||||
|
|
||||||
--- a/drivers/spi/spidev.c
|
--- a/drivers/spi/spidev.c
|
||||||
+++ b/drivers/spi/spidev.c
|
+++ b/drivers/spi/spidev.c
|
||||||
@@ -693,6 +693,7 @@ static const struct of_device_id spidev_
|
@@ -691,6 +691,7 @@ static const struct of_device_id spidev_
|
||||||
{ .compatible = "lwn,bk4" },
|
{ .compatible = "lwn,bk4" },
|
||||||
{ .compatible = "dh,dhcom-board" },
|
{ .compatible = "dh,dhcom-board" },
|
||||||
{ .compatible = "menlo,m53cpld" },
|
{ .compatible = "menlo,m53cpld" },
|
||||||
|
|
|
@ -12,7 +12,7 @@ Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
|
||||||
|
|
||||||
--- a/drivers/spi/spidev.c
|
--- a/drivers/spi/spidev.c
|
||||||
+++ b/drivers/spi/spidev.c
|
+++ b/drivers/spi/spidev.c
|
||||||
@@ -694,6 +694,7 @@ static const struct of_device_id spidev_
|
@@ -692,6 +692,7 @@ static const struct of_device_id spidev_
|
||||||
{ .compatible = "dh,dhcom-board" },
|
{ .compatible = "dh,dhcom-board" },
|
||||||
{ .compatible = "menlo,m53cpld" },
|
{ .compatible = "menlo,m53cpld" },
|
||||||
{ .compatible = "silabs,em3581" },
|
{ .compatible = "silabs,em3581" },
|
||||||
|
|
|
@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
static bool enable_hooks __read_mostly;
|
static bool enable_hooks __read_mostly;
|
||||||
MODULE_PARM_DESC(enable_hooks, "Always enable conntrack hooks");
|
MODULE_PARM_DESC(enable_hooks, "Always enable conntrack hooks");
|
||||||
module_param(enable_hooks, bool, 0000);
|
module_param(enable_hooks, bool, 0000);
|
||||||
@@ -658,6 +661,7 @@ enum nf_ct_sysctl_index {
|
@@ -657,6 +660,7 @@ enum nf_ct_sysctl_index {
|
||||||
NF_SYSCTL_CT_PROTO_TIMEOUT_GRE_STREAM,
|
NF_SYSCTL_CT_PROTO_TIMEOUT_GRE_STREAM,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
__NF_SYSCTL_CT_LAST_SYSCTL,
|
__NF_SYSCTL_CT_LAST_SYSCTL,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1000,6 +1004,13 @@ static struct ctl_table nf_ct_sysctl_tab
|
@@ -993,6 +997,13 @@ static struct ctl_table nf_ct_sysctl_tab
|
||||||
.proc_handler = proc_dointvec_jiffies,
|
.proc_handler = proc_dointvec_jiffies,
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -53,7 +53,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
|
|
||||||
--- a/net/ipv4/fib_semantics.c
|
--- a/net/ipv4/fib_semantics.c
|
||||||
+++ b/net/ipv4/fib_semantics.c
|
+++ b/net/ipv4/fib_semantics.c
|
||||||
@@ -142,6 +142,10 @@ const struct fib_prop fib_props[RTN_MAX
|
@@ -143,6 +143,10 @@ const struct fib_prop fib_props[RTN_MAX
|
||||||
.error = -EINVAL,
|
.error = -EINVAL,
|
||||||
.scope = RT_SCOPE_NOWHERE,
|
.scope = RT_SCOPE_NOWHERE,
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,12 +10,12 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
--- a/Makefile
|
--- a/Makefile
|
||||||
+++ b/Makefile
|
+++ b/Makefile
|
||||||
@@ -526,7 +526,7 @@ KBUILD_LDFLAGS_MODULE :=
|
@@ -527,7 +527,7 @@ KBUILD_LDFLAGS_MODULE :=
|
||||||
KBUILD_LDFLAGS :=
|
KBUILD_LDFLAGS :=
|
||||||
CLANG_FLAGS :=
|
CLANG_FLAGS :=
|
||||||
|
|
||||||
-export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
|
-export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC HOSTPKG_CONFIG
|
||||||
+export ARCH SRCARCH SUBARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
|
+export ARCH SRCARCH SUBARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC HOSTPKG_CONFIG
|
||||||
export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
|
export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
|
||||||
export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
|
export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
|
||||||
export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD
|
export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD
|
||||||
|
|
|
@ -14,7 +14,7 @@ Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
|
||||||
|
|
||||||
--- a/drivers/spi/spidev.c
|
--- a/drivers/spi/spidev.c
|
||||||
+++ b/drivers/spi/spidev.c
|
+++ b/drivers/spi/spidev.c
|
||||||
@@ -693,6 +693,7 @@ static const struct spi_device_id spidev
|
@@ -691,6 +691,7 @@ static const struct spi_device_id spidev
|
||||||
{ .name = "m53cpld" },
|
{ .name = "m53cpld" },
|
||||||
{ .name = "spi-petra" },
|
{ .name = "spi-petra" },
|
||||||
{ .name = "spi-authenta" },
|
{ .name = "spi-authenta" },
|
||||||
|
@ -22,7 +22,7 @@ Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
|
MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
|
||||||
@@ -707,6 +708,7 @@ static const struct of_device_id spidev_
|
@@ -705,6 +706,7 @@ static const struct of_device_id spidev_
|
||||||
{ .compatible = "menlo,m53cpld" },
|
{ .compatible = "menlo,m53cpld" },
|
||||||
{ .compatible = "cisco,spi-petra" },
|
{ .compatible = "cisco,spi-petra" },
|
||||||
{ .compatible = "micron,spi-authenta" },
|
{ .compatible = "micron,spi-authenta" },
|
||||||
|
|
|
@ -14,7 +14,7 @@ Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
|
||||||
|
|
||||||
--- a/drivers/spi/spidev.c
|
--- a/drivers/spi/spidev.c
|
||||||
+++ b/drivers/spi/spidev.c
|
+++ b/drivers/spi/spidev.c
|
||||||
@@ -694,6 +694,7 @@ static const struct spi_device_id spidev
|
@@ -692,6 +692,7 @@ static const struct spi_device_id spidev
|
||||||
{ .name = "spi-petra" },
|
{ .name = "spi-petra" },
|
||||||
{ .name = "spi-authenta" },
|
{ .name = "spi-authenta" },
|
||||||
{ .name = "em3581" },
|
{ .name = "em3581" },
|
||||||
|
@ -22,7 +22,7 @@ Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
|
MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
|
||||||
@@ -709,6 +710,7 @@ static const struct of_device_id spidev_
|
@@ -707,6 +708,7 @@ static const struct of_device_id spidev_
|
||||||
{ .compatible = "cisco,spi-petra" },
|
{ .compatible = "cisco,spi-petra" },
|
||||||
{ .compatible = "micron,spi-authenta" },
|
{ .compatible = "micron,spi-authenta" },
|
||||||
{ .compatible = "silabs,em3581" },
|
{ .compatible = "silabs,em3581" },
|
||||||
|
|
|
@ -48,7 +48,7 @@ Signed-off-by: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com>
|
||||||
NF_SYSCTL_CT_PROTO_TCP_IGNORE_INVALID_RST,
|
NF_SYSCTL_CT_PROTO_TCP_IGNORE_INVALID_RST,
|
||||||
NF_SYSCTL_CT_PROTO_TCP_MAX_RETRANS,
|
NF_SYSCTL_CT_PROTO_TCP_MAX_RETRANS,
|
||||||
NF_SYSCTL_CT_PROTO_TIMEOUT_UDP,
|
NF_SYSCTL_CT_PROTO_TIMEOUT_UDP,
|
||||||
@@ -849,6 +850,14 @@ static struct ctl_table nf_ct_sysctl_tab
|
@@ -848,6 +849,14 @@ static struct ctl_table nf_ct_sysctl_tab
|
||||||
.extra1 = SYSCTL_ZERO,
|
.extra1 = SYSCTL_ZERO,
|
||||||
.extra2 = SYSCTL_ONE,
|
.extra2 = SYSCTL_ONE,
|
||||||
},
|
},
|
||||||
|
@ -63,7 +63,7 @@ Signed-off-by: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com>
|
||||||
[NF_SYSCTL_CT_PROTO_TCP_IGNORE_INVALID_RST] = {
|
[NF_SYSCTL_CT_PROTO_TCP_IGNORE_INVALID_RST] = {
|
||||||
.procname = "nf_conntrack_tcp_ignore_invalid_rst",
|
.procname = "nf_conntrack_tcp_ignore_invalid_rst",
|
||||||
.maxlen = sizeof(u8),
|
.maxlen = sizeof(u8),
|
||||||
@@ -1065,6 +1074,7 @@ static void nf_conntrack_standalone_init
|
@@ -1058,6 +1067,7 @@ static void nf_conntrack_standalone_init
|
||||||
|
|
||||||
XASSIGN(LOOSE, &tn->tcp_loose);
|
XASSIGN(LOOSE, &tn->tcp_loose);
|
||||||
XASSIGN(LIBERAL, &tn->tcp_be_liberal);
|
XASSIGN(LIBERAL, &tn->tcp_be_liberal);
|
||||||
|
|
|
@ -53,7 +53,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
|
|
||||||
--- a/net/ipv4/fib_semantics.c
|
--- a/net/ipv4/fib_semantics.c
|
||||||
+++ b/net/ipv4/fib_semantics.c
|
+++ b/net/ipv4/fib_semantics.c
|
||||||
@@ -142,6 +142,10 @@ const struct fib_prop fib_props[RTN_MAX
|
@@ -143,6 +143,10 @@ const struct fib_prop fib_props[RTN_MAX
|
||||||
.error = -EINVAL,
|
.error = -EINVAL,
|
||||||
.scope = RT_SCOPE_NOWHERE,
|
.scope = RT_SCOPE_NOWHERE,
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
@@ -2802,8 +2802,8 @@ static irqreturn_t mtk_handle_irq_rx(int
|
@@ -2823,8 +2823,8 @@ static irqreturn_t mtk_handle_irq_rx(int
|
||||||
|
|
||||||
eth->rx_events++;
|
eth->rx_events++;
|
||||||
if (likely(napi_schedule_prep(ð->rx_napi))) {
|
if (likely(napi_schedule_prep(ð->rx_napi))) {
|
||||||
|
@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
}
|
}
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
@@ -2815,8 +2815,8 @@ static irqreturn_t mtk_handle_irq_tx(int
|
@@ -2836,8 +2836,8 @@ static irqreturn_t mtk_handle_irq_tx(int
|
||||||
|
|
||||||
eth->tx_events++;
|
eth->tx_events++;
|
||||||
if (likely(napi_schedule_prep(ð->tx_napi))) {
|
if (likely(napi_schedule_prep(ð->tx_napi))) {
|
||||||
|
@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
}
|
}
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
@@ -4120,6 +4120,8 @@ static int mtk_probe(struct platform_dev
|
@@ -4350,6 +4350,8 @@ static int mtk_probe(struct platform_dev
|
||||||
* for NAPI to work
|
* for NAPI to work
|
||||||
*/
|
*/
|
||||||
init_dummy_netdev(ð->dummy_dev);
|
init_dummy_netdev(ð->dummy_dev);
|
||||||
|
|
|
@ -53,7 +53,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
@@ -4090,7 +4090,9 @@ static int mtk_probe(struct platform_dev
|
@@ -4320,7 +4320,9 @@ static int mtk_probe(struct platform_dev
|
||||||
u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400;
|
u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400;
|
||||||
|
|
||||||
eth->ppe[i] = mtk_ppe_init(eth, eth->base + ppe_addr,
|
eth->ppe[i] = mtk_ppe_init(eth, eth->base + ppe_addr,
|
||||||
|
@ -64,7 +64,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
if (!eth->ppe[i]) {
|
if (!eth->ppe[i]) {
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto err_free_dev;
|
goto err_free_dev;
|
||||||
@@ -4213,6 +4215,7 @@ static const struct mtk_soc_data mt7622_
|
@@ -4445,6 +4447,7 @@ static const struct mtk_soc_data mt7622_
|
||||||
.required_pctl = false,
|
.required_pctl = false,
|
||||||
.offload_version = 2,
|
.offload_version = 2,
|
||||||
.hash_offset = 2,
|
.hash_offset = 2,
|
||||||
|
@ -72,7 +72,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
||||||
.txrx = {
|
.txrx = {
|
||||||
.txd_size = sizeof(struct mtk_tx_dma),
|
.txd_size = sizeof(struct mtk_tx_dma),
|
||||||
@@ -4250,6 +4253,7 @@ static const struct mtk_soc_data mt7629_
|
@@ -4482,6 +4485,7 @@ static const struct mtk_soc_data mt7629_
|
||||||
.hw_features = MTK_HW_FEATURES,
|
.hw_features = MTK_HW_FEATURES,
|
||||||
.required_clks = MT7629_CLKS_BITMAP,
|
.required_clks = MT7629_CLKS_BITMAP,
|
||||||
.required_pctl = false,
|
.required_pctl = false,
|
||||||
|
@ -80,7 +80,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
.txrx = {
|
.txrx = {
|
||||||
.txd_size = sizeof(struct mtk_tx_dma),
|
.txd_size = sizeof(struct mtk_tx_dma),
|
||||||
.rxd_size = sizeof(struct mtk_rx_dma),
|
.rxd_size = sizeof(struct mtk_rx_dma),
|
||||||
@@ -4270,6 +4274,7 @@ static const struct mtk_soc_data mt7986_
|
@@ -4502,6 +4506,7 @@ static const struct mtk_soc_data mt7986_
|
||||||
.offload_version = 2,
|
.offload_version = 2,
|
||||||
.hash_offset = 4,
|
.hash_offset = 4,
|
||||||
.foe_entry_size = sizeof(struct mtk_foe_entry),
|
.foe_entry_size = sizeof(struct mtk_foe_entry),
|
||||||
|
@ -90,7 +90,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
.rxd_size = sizeof(struct mtk_rx_dma_v2),
|
.rxd_size = sizeof(struct mtk_rx_dma_v2),
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
@@ -983,6 +983,7 @@ struct mtk_soc_data {
|
@@ -1007,6 +1007,7 @@ struct mtk_soc_data {
|
||||||
u8 hash_offset;
|
u8 hash_offset;
|
||||||
u16 foe_entry_size;
|
u16 foe_entry_size;
|
||||||
netdev_features_t hw_features;
|
netdev_features_t hw_features;
|
||||||
|
@ -171,8 +171,8 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
dma_wmb();
|
dma_wmb();
|
||||||
|
|
||||||
mtk_ppe_cache_clear(ppe);
|
mtk_ppe_cache_clear(ppe);
|
||||||
@@ -716,14 +766,42 @@ int mtk_foe_entry_idle_time(struct mtk_p
|
@@ -743,14 +793,42 @@ int mtk_ppe_prepare_reset(struct mtk_ppe
|
||||||
return __mtk_foe_entry_idle_time(ppe, entry->data.ib1);
|
return mtk_ppe_wait_busy(ppe);
|
||||||
}
|
}
|
||||||
|
|
||||||
+struct mtk_foe_accounting *mtk_foe_entry_get_mib(struct mtk_ppe *ppe, u32 index,
|
+struct mtk_foe_accounting *mtk_foe_entry_get_mib(struct mtk_ppe *ppe, u32 index,
|
||||||
|
@ -215,7 +215,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
|
|
||||||
ppe = devm_kzalloc(dev, sizeof(*ppe), GFP_KERNEL);
|
ppe = devm_kzalloc(dev, sizeof(*ppe), GFP_KERNEL);
|
||||||
if (!ppe)
|
if (!ppe)
|
||||||
@@ -738,6 +816,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
|
@@ -765,6 +843,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
|
||||||
ppe->eth = eth;
|
ppe->eth = eth;
|
||||||
ppe->dev = dev;
|
ppe->dev = dev;
|
||||||
ppe->version = version;
|
ppe->version = version;
|
||||||
|
@ -223,7 +223,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
|
|
||||||
foe = dmam_alloc_coherent(ppe->dev,
|
foe = dmam_alloc_coherent(ppe->dev,
|
||||||
MTK_PPE_ENTRIES * soc->foe_entry_size,
|
MTK_PPE_ENTRIES * soc->foe_entry_size,
|
||||||
@@ -753,6 +832,25 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
|
@@ -780,6 +859,25 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
|
||||||
if (!ppe->foe_flow)
|
if (!ppe->foe_flow)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
mtk_ppe_debugfs_init(ppe, index);
|
mtk_ppe_debugfs_init(ppe, index);
|
||||||
|
|
||||||
return ppe;
|
return ppe;
|
||||||
@@ -867,6 +965,16 @@ void mtk_ppe_start(struct mtk_ppe *ppe)
|
@@ -894,6 +992,16 @@ void mtk_ppe_start(struct mtk_ppe *ppe)
|
||||||
ppe_w32(ppe, MTK_PPE_DEFAULT_CPU_PORT1, 0xcb777);
|
ppe_w32(ppe, MTK_PPE_DEFAULT_CPU_PORT1, 0xcb777);
|
||||||
ppe_w32(ppe, MTK_PPE_SBW_CTRL, 0x7f);
|
ppe_w32(ppe, MTK_PPE_SBW_CTRL, 0x7f);
|
||||||
}
|
}
|
||||||
|
@ -319,8 +319,8 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
+ int version, int index, bool accounting);
|
+ int version, int index, bool accounting);
|
||||||
void mtk_ppe_start(struct mtk_ppe *ppe);
|
void mtk_ppe_start(struct mtk_ppe *ppe);
|
||||||
int mtk_ppe_stop(struct mtk_ppe *ppe);
|
int mtk_ppe_stop(struct mtk_ppe *ppe);
|
||||||
|
int mtk_ppe_prepare_reset(struct mtk_ppe *ppe);
|
||||||
@@ -354,5 +373,7 @@ int mtk_foe_entry_commit(struct mtk_ppe
|
@@ -355,5 +374,7 @@ int mtk_foe_entry_commit(struct mtk_ppe
|
||||||
void mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
|
void mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
|
||||||
int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
|
int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
|
||||||
int mtk_ppe_debugfs_init(struct mtk_ppe *ppe, int index);
|
int mtk_ppe_debugfs_init(struct mtk_ppe *ppe, int index);
|
||||||
|
@ -386,7 +386,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
|
||||||
@@ -143,6 +143,20 @@ enum {
|
@@ -149,6 +149,20 @@ enum {
|
||||||
|
|
||||||
#define MTK_PPE_MIB_TB_BASE 0x338
|
#define MTK_PPE_MIB_TB_BASE 0x338
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
@@ -894,7 +894,7 @@ static int mtk_init_fq_dma(struct mtk_et
|
@@ -900,7 +900,7 @@ static int mtk_init_fq_dma(struct mtk_et
|
||||||
{
|
{
|
||||||
const struct mtk_soc_data *soc = eth->soc;
|
const struct mtk_soc_data *soc = eth->soc;
|
||||||
dma_addr_t phy_ring_tail;
|
dma_addr_t phy_ring_tail;
|
||||||
|
@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
dma_addr_t dma_addr;
|
dma_addr_t dma_addr;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -2148,19 +2148,25 @@ static int mtk_tx_alloc(struct mtk_eth *
|
@@ -2154,19 +2154,25 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||||
struct mtk_tx_ring *ring = ð->tx_ring;
|
struct mtk_tx_ring *ring = ð->tx_ring;
|
||||||
int i, sz = soc->txrx.txd_size;
|
int i, sz = soc->txrx.txd_size;
|
||||||
struct mtk_tx_dma_v2 *txd;
|
struct mtk_tx_dma_v2 *txd;
|
||||||
|
@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
u32 next_ptr = ring->phys + next * sz;
|
u32 next_ptr = ring->phys + next * sz;
|
||||||
|
|
||||||
txd = ring->dma + i * sz;
|
txd = ring->dma + i * sz;
|
||||||
@@ -2180,22 +2186,22 @@ static int mtk_tx_alloc(struct mtk_eth *
|
@@ -2186,22 +2192,22 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||||
* descriptors in ring->dma_pdma.
|
* descriptors in ring->dma_pdma.
|
||||||
*/
|
*/
|
||||||
if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
|
if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
|
||||||
|
@ -79,7 +79,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
ring->thresh = MAX_SKB_FRAGS;
|
ring->thresh = MAX_SKB_FRAGS;
|
||||||
|
|
||||||
/* make sure that all changes to the dma ring are flushed before we
|
/* make sure that all changes to the dma ring are flushed before we
|
||||||
@@ -2207,14 +2213,14 @@ static int mtk_tx_alloc(struct mtk_eth *
|
@@ -2213,14 +2219,14 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||||
mtk_w32(eth, ring->phys, soc->reg_map->qdma.ctx_ptr);
|
mtk_w32(eth, ring->phys, soc->reg_map->qdma.ctx_ptr);
|
||||||
mtk_w32(eth, ring->phys, soc->reg_map->qdma.dtx_ptr);
|
mtk_w32(eth, ring->phys, soc->reg_map->qdma.dtx_ptr);
|
||||||
mtk_w32(eth,
|
mtk_w32(eth,
|
||||||
|
@ -96,7 +96,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
mtk_w32(eth, 0, MT7628_TX_CTX_IDX0);
|
mtk_w32(eth, 0, MT7628_TX_CTX_IDX0);
|
||||||
mtk_w32(eth, MT7628_PST_DTX_IDX0, soc->reg_map->pdma.rst_idx);
|
mtk_w32(eth, MT7628_PST_DTX_IDX0, soc->reg_map->pdma.rst_idx);
|
||||||
}
|
}
|
||||||
@@ -2232,7 +2238,7 @@ static void mtk_tx_clean(struct mtk_eth
|
@@ -2238,7 +2244,7 @@ static void mtk_tx_clean(struct mtk_eth
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (ring->buf) {
|
if (ring->buf) {
|
||||||
|
@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
mtk_tx_unmap(eth, &ring->buf[i], false);
|
mtk_tx_unmap(eth, &ring->buf[i], false);
|
||||||
kfree(ring->buf);
|
kfree(ring->buf);
|
||||||
ring->buf = NULL;
|
ring->buf = NULL;
|
||||||
@@ -2240,14 +2246,14 @@ static void mtk_tx_clean(struct mtk_eth
|
@@ -2246,14 +2252,14 @@ static void mtk_tx_clean(struct mtk_eth
|
||||||
|
|
||||||
if (ring->dma) {
|
if (ring->dma) {
|
||||||
dma_free_coherent(eth->dma_dev,
|
dma_free_coherent(eth->dma_dev,
|
||||||
|
@ -122,7 +122,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
ring->dma_pdma, ring->phys_pdma);
|
ring->dma_pdma, ring->phys_pdma);
|
||||||
ring->dma_pdma = NULL;
|
ring->dma_pdma = NULL;
|
||||||
}
|
}
|
||||||
@@ -2767,7 +2773,7 @@ static void mtk_dma_free(struct mtk_eth
|
@@ -2773,7 +2779,7 @@ static void mtk_dma_free(struct mtk_eth
|
||||||
netdev_reset_queue(eth->netdev[i]);
|
netdev_reset_queue(eth->netdev[i]);
|
||||||
if (eth->scratch_ring) {
|
if (eth->scratch_ring) {
|
||||||
dma_free_coherent(eth->dma_dev,
|
dma_free_coherent(eth->dma_dev,
|
||||||
|
|
|
@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
@@ -4199,7 +4199,7 @@ static const struct mtk_soc_data mt7621_
|
@@ -4431,7 +4431,7 @@ static const struct mtk_soc_data mt7621_
|
||||||
.hw_features = MTK_HW_FEATURES,
|
.hw_features = MTK_HW_FEATURES,
|
||||||
.required_clks = MT7621_CLKS_BITMAP,
|
.required_clks = MT7621_CLKS_BITMAP,
|
||||||
.required_pctl = false,
|
.required_pctl = false,
|
||||||
|
@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
.hash_offset = 2,
|
.hash_offset = 2,
|
||||||
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
||||||
.txrx = {
|
.txrx = {
|
||||||
@@ -4239,7 +4239,7 @@ static const struct mtk_soc_data mt7623_
|
@@ -4471,7 +4471,7 @@ static const struct mtk_soc_data mt7623_
|
||||||
.hw_features = MTK_HW_FEATURES,
|
.hw_features = MTK_HW_FEATURES,
|
||||||
.required_clks = MT7623_CLKS_BITMAP,
|
.required_clks = MT7623_CLKS_BITMAP,
|
||||||
.required_pctl = true,
|
.required_pctl = true,
|
||||||
|
|
|
@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
@@ -54,6 +54,7 @@ static const struct mtk_reg_map mtk_reg_
|
@@ -55,6 +55,7 @@ static const struct mtk_reg_map mtk_reg_
|
||||||
},
|
},
|
||||||
.qdma = {
|
.qdma = {
|
||||||
.qtx_cfg = 0x1800,
|
.qtx_cfg = 0x1800,
|
||||||
|
@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
.rx_ptr = 0x1900,
|
.rx_ptr = 0x1900,
|
||||||
.rx_cnt_cfg = 0x1904,
|
.rx_cnt_cfg = 0x1904,
|
||||||
.qcrx_ptr = 0x1908,
|
.qcrx_ptr = 0x1908,
|
||||||
@@ -61,6 +62,7 @@ static const struct mtk_reg_map mtk_reg_
|
@@ -62,6 +63,7 @@ static const struct mtk_reg_map mtk_reg_
|
||||||
.rst_idx = 0x1a08,
|
.rst_idx = 0x1a08,
|
||||||
.delay_irq = 0x1a0c,
|
.delay_irq = 0x1a0c,
|
||||||
.fc_th = 0x1a10,
|
.fc_th = 0x1a10,
|
||||||
|
@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
.int_grp = 0x1a20,
|
.int_grp = 0x1a20,
|
||||||
.hred = 0x1a44,
|
.hred = 0x1a44,
|
||||||
.ctx_ptr = 0x1b00,
|
.ctx_ptr = 0x1b00,
|
||||||
@@ -113,6 +115,7 @@ static const struct mtk_reg_map mt7986_r
|
@@ -117,6 +119,7 @@ static const struct mtk_reg_map mt7986_r
|
||||||
},
|
},
|
||||||
.qdma = {
|
.qdma = {
|
||||||
.qtx_cfg = 0x4400,
|
.qtx_cfg = 0x4400,
|
||||||
|
@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
.rx_ptr = 0x4500,
|
.rx_ptr = 0x4500,
|
||||||
.rx_cnt_cfg = 0x4504,
|
.rx_cnt_cfg = 0x4504,
|
||||||
.qcrx_ptr = 0x4508,
|
.qcrx_ptr = 0x4508,
|
||||||
@@ -130,6 +133,7 @@ static const struct mtk_reg_map mt7986_r
|
@@ -134,6 +137,7 @@ static const struct mtk_reg_map mt7986_r
|
||||||
.fq_tail = 0x4724,
|
.fq_tail = 0x4724,
|
||||||
.fq_count = 0x4728,
|
.fq_count = 0x4728,
|
||||||
.fq_blen = 0x472c,
|
.fq_blen = 0x472c,
|
||||||
|
@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
},
|
},
|
||||||
.gdm1_cnt = 0x1c00,
|
.gdm1_cnt = 0x1c00,
|
||||||
.gdma_to_ppe0 = 0x3333,
|
.gdma_to_ppe0 = 0x3333,
|
||||||
@@ -570,6 +574,75 @@ static void mtk_mac_link_down(struct phy
|
@@ -576,6 +580,75 @@ static void mtk_mac_link_down(struct phy
|
||||||
mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
|
mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
static void mtk_mac_link_up(struct phylink_config *config,
|
static void mtk_mac_link_up(struct phylink_config *config,
|
||||||
struct phy_device *phy,
|
struct phy_device *phy,
|
||||||
unsigned int mode, phy_interface_t interface,
|
unsigned int mode, phy_interface_t interface,
|
||||||
@@ -595,6 +668,8 @@ static void mtk_mac_link_up(struct phyli
|
@@ -601,6 +674,8 @@ static void mtk_mac_link_up(struct phyli
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
/* Configure duplex */
|
/* Configure duplex */
|
||||||
if (duplex == DUPLEX_FULL)
|
if (duplex == DUPLEX_FULL)
|
||||||
mcr |= MAC_MCR_FORCE_DPX;
|
mcr |= MAC_MCR_FORCE_DPX;
|
||||||
@@ -1053,7 +1128,8 @@ static void mtk_tx_set_dma_desc_v1(struc
|
@@ -1059,7 +1134,8 @@ static void mtk_tx_set_dma_desc_v1(struc
|
||||||
|
|
||||||
WRITE_ONCE(desc->txd1, info->addr);
|
WRITE_ONCE(desc->txd1, info->addr);
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
if (info->last)
|
if (info->last)
|
||||||
data |= TX_DMA_LS0;
|
data |= TX_DMA_LS0;
|
||||||
WRITE_ONCE(desc->txd3, data);
|
WRITE_ONCE(desc->txd3, data);
|
||||||
@@ -1087,9 +1163,6 @@ static void mtk_tx_set_dma_desc_v2(struc
|
@@ -1093,9 +1169,6 @@ static void mtk_tx_set_dma_desc_v2(struc
|
||||||
data |= TX_DMA_LS0;
|
data |= TX_DMA_LS0;
|
||||||
WRITE_ONCE(desc->txd3, data);
|
WRITE_ONCE(desc->txd3, data);
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
data = (mac->id + 1) << TX_DMA_FPORT_SHIFT_V2; /* forward port */
|
data = (mac->id + 1) << TX_DMA_FPORT_SHIFT_V2; /* forward port */
|
||||||
data |= TX_DMA_SWC_V2 | QID_BITS_V2(info->qid);
|
data |= TX_DMA_SWC_V2 | QID_BITS_V2(info->qid);
|
||||||
WRITE_ONCE(desc->txd4, data);
|
WRITE_ONCE(desc->txd4, data);
|
||||||
@@ -1133,11 +1206,12 @@ static int mtk_tx_map(struct sk_buff *sk
|
@@ -1139,11 +1212,12 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||||
.gso = gso,
|
.gso = gso,
|
||||||
.csum = skb->ip_summed == CHECKSUM_PARTIAL,
|
.csum = skb->ip_summed == CHECKSUM_PARTIAL,
|
||||||
.vlan = skb_vlan_tag_present(skb),
|
.vlan = skb_vlan_tag_present(skb),
|
||||||
|
@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
struct mtk_mac *mac = netdev_priv(dev);
|
struct mtk_mac *mac = netdev_priv(dev);
|
||||||
struct mtk_eth *eth = mac->hw;
|
struct mtk_eth *eth = mac->hw;
|
||||||
const struct mtk_soc_data *soc = eth->soc;
|
const struct mtk_soc_data *soc = eth->soc;
|
||||||
@@ -1145,8 +1219,10 @@ static int mtk_tx_map(struct sk_buff *sk
|
@@ -1151,8 +1225,10 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||||
struct mtk_tx_dma *itxd_pdma, *txd_pdma;
|
struct mtk_tx_dma *itxd_pdma, *txd_pdma;
|
||||||
struct mtk_tx_buf *itx_buf, *tx_buf;
|
struct mtk_tx_buf *itx_buf, *tx_buf;
|
||||||
int i, n_desc = 1;
|
int i, n_desc = 1;
|
||||||
|
@ -184,7 +184,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
itxd = ring->next_free;
|
itxd = ring->next_free;
|
||||||
itxd_pdma = qdma_to_pdma(ring, itxd);
|
itxd_pdma = qdma_to_pdma(ring, itxd);
|
||||||
if (itxd == ring->last_free)
|
if (itxd == ring->last_free)
|
||||||
@@ -1195,7 +1271,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
@@ -1201,7 +1277,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||||
memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
|
memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
|
||||||
txd_info.size = min_t(unsigned int, frag_size,
|
txd_info.size = min_t(unsigned int, frag_size,
|
||||||
soc->txrx.dma_max_len);
|
soc->txrx.dma_max_len);
|
||||||
|
@ -193,7 +193,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
txd_info.last = i == skb_shinfo(skb)->nr_frags - 1 &&
|
txd_info.last = i == skb_shinfo(skb)->nr_frags - 1 &&
|
||||||
!(frag_size - txd_info.size);
|
!(frag_size - txd_info.size);
|
||||||
txd_info.addr = skb_frag_dma_map(eth->dma_dev, frag,
|
txd_info.addr = skb_frag_dma_map(eth->dma_dev, frag,
|
||||||
@@ -1234,7 +1310,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
@@ -1240,7 +1316,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||||
txd_pdma->txd2 |= TX_DMA_LS1;
|
txd_pdma->txd2 |= TX_DMA_LS1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
skb_tx_timestamp(skb);
|
skb_tx_timestamp(skb);
|
||||||
|
|
||||||
ring->next_free = mtk_qdma_phys_to_virt(ring, txd->txd2);
|
ring->next_free = mtk_qdma_phys_to_virt(ring, txd->txd2);
|
||||||
@@ -1246,8 +1322,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
@@ -1252,8 +1328,7 @@ static int mtk_tx_map(struct sk_buff *sk
|
||||||
wmb();
|
wmb();
|
||||||
|
|
||||||
if (MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
|
if (MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
|
||||||
|
@ -212,7 +212,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
mtk_w32(eth, txd->txd2, soc->reg_map->qdma.ctx_ptr);
|
mtk_w32(eth, txd->txd2, soc->reg_map->qdma.ctx_ptr);
|
||||||
} else {
|
} else {
|
||||||
int next_idx;
|
int next_idx;
|
||||||
@@ -1316,7 +1391,7 @@ static void mtk_wake_queue(struct mtk_et
|
@@ -1322,7 +1397,7 @@ static void mtk_wake_queue(struct mtk_et
|
||||||
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||||
if (!eth->netdev[i])
|
if (!eth->netdev[i])
|
||||||
continue;
|
continue;
|
||||||
|
@ -221,7 +221,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1340,7 +1415,7 @@ static netdev_tx_t mtk_start_xmit(struct
|
@@ -1346,7 +1421,7 @@ static netdev_tx_t mtk_start_xmit(struct
|
||||||
|
|
||||||
tx_num = mtk_cal_txd_req(eth, skb);
|
tx_num = mtk_cal_txd_req(eth, skb);
|
||||||
if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
|
if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
|
||||||
|
@ -230,7 +230,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
netif_err(eth, tx_queued, dev,
|
netif_err(eth, tx_queued, dev,
|
||||||
"Tx Ring full when queue awake!\n");
|
"Tx Ring full when queue awake!\n");
|
||||||
spin_unlock(ð->page_lock);
|
spin_unlock(ð->page_lock);
|
||||||
@@ -1366,7 +1441,7 @@ static netdev_tx_t mtk_start_xmit(struct
|
@@ -1372,7 +1447,7 @@ static netdev_tx_t mtk_start_xmit(struct
|
||||||
goto drop;
|
goto drop;
|
||||||
|
|
||||||
if (unlikely(atomic_read(&ring->free_count) <= ring->thresh))
|
if (unlikely(atomic_read(&ring->free_count) <= ring->thresh))
|
||||||
|
@ -239,7 +239,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
spin_unlock(ð->page_lock);
|
spin_unlock(ð->page_lock);
|
||||||
|
|
||||||
@@ -1533,10 +1608,12 @@ static int mtk_xdp_submit_frame(struct m
|
@@ -1539,10 +1614,12 @@ static int mtk_xdp_submit_frame(struct m
|
||||||
struct skb_shared_info *sinfo = xdp_get_shared_info_from_frame(xdpf);
|
struct skb_shared_info *sinfo = xdp_get_shared_info_from_frame(xdpf);
|
||||||
const struct mtk_soc_data *soc = eth->soc;
|
const struct mtk_soc_data *soc = eth->soc;
|
||||||
struct mtk_tx_ring *ring = ð->tx_ring;
|
struct mtk_tx_ring *ring = ð->tx_ring;
|
||||||
|
@ -252,7 +252,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
};
|
};
|
||||||
int err, index = 0, n_desc = 1, nr_frags;
|
int err, index = 0, n_desc = 1, nr_frags;
|
||||||
struct mtk_tx_dma *htxd, *txd, *txd_pdma;
|
struct mtk_tx_dma *htxd, *txd, *txd_pdma;
|
||||||
@@ -1587,6 +1664,7 @@ static int mtk_xdp_submit_frame(struct m
|
@@ -1593,6 +1670,7 @@ static int mtk_xdp_submit_frame(struct m
|
||||||
memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
|
memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
|
||||||
txd_info.size = skb_frag_size(&sinfo->frags[index]);
|
txd_info.size = skb_frag_size(&sinfo->frags[index]);
|
||||||
txd_info.last = index + 1 == nr_frags;
|
txd_info.last = index + 1 == nr_frags;
|
||||||
|
@ -260,7 +260,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
data = skb_frag_address(&sinfo->frags[index]);
|
data = skb_frag_address(&sinfo->frags[index]);
|
||||||
|
|
||||||
index++;
|
index++;
|
||||||
@@ -1938,8 +2016,46 @@ rx_done:
|
@@ -1944,8 +2022,46 @@ rx_done:
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
{
|
{
|
||||||
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
|
const struct mtk_reg_map *reg_map = eth->soc->reg_map;
|
||||||
struct mtk_tx_ring *ring = ð->tx_ring;
|
struct mtk_tx_ring *ring = ð->tx_ring;
|
||||||
@@ -1969,12 +2085,9 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
@@ -1975,12 +2091,9 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (tx_buf->data != (void *)MTK_DMA_DUMMY_DESC) {
|
if (tx_buf->data != (void *)MTK_DMA_DUMMY_DESC) {
|
||||||
|
@ -323,7 +323,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
budget--;
|
budget--;
|
||||||
}
|
}
|
||||||
mtk_tx_unmap(eth, tx_buf, true);
|
mtk_tx_unmap(eth, tx_buf, true);
|
||||||
@@ -1992,7 +2105,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
@@ -1998,7 +2111,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mtk_poll_tx_pdma(struct mtk_eth *eth, int budget,
|
static int mtk_poll_tx_pdma(struct mtk_eth *eth, int budget,
|
||||||
|
@ -332,7 +332,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
{
|
{
|
||||||
struct mtk_tx_ring *ring = ð->tx_ring;
|
struct mtk_tx_ring *ring = ð->tx_ring;
|
||||||
struct mtk_tx_buf *tx_buf;
|
struct mtk_tx_buf *tx_buf;
|
||||||
@@ -2008,12 +2121,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
|
@@ -2014,12 +2127,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (tx_buf->data != (void *)MTK_DMA_DUMMY_DESC) {
|
if (tx_buf->data != (void *)MTK_DMA_DUMMY_DESC) {
|
||||||
|
@ -347,7 +347,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
budget--;
|
budget--;
|
||||||
}
|
}
|
||||||
mtk_tx_unmap(eth, tx_buf, true);
|
mtk_tx_unmap(eth, tx_buf, true);
|
||||||
@@ -2034,26 +2143,15 @@ static int mtk_poll_tx(struct mtk_eth *e
|
@@ -2040,26 +2149,15 @@ static int mtk_poll_tx(struct mtk_eth *e
|
||||||
{
|
{
|
||||||
struct mtk_tx_ring *ring = ð->tx_ring;
|
struct mtk_tx_ring *ring = ð->tx_ring;
|
||||||
struct dim_sample dim_sample = {};
|
struct dim_sample dim_sample = {};
|
||||||
|
@ -379,7 +379,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
dim_update_sample(eth->tx_events, eth->tx_packets, eth->tx_bytes,
|
dim_update_sample(eth->tx_events, eth->tx_packets, eth->tx_bytes,
|
||||||
&dim_sample);
|
&dim_sample);
|
||||||
@@ -2063,7 +2161,7 @@ static int mtk_poll_tx(struct mtk_eth *e
|
@@ -2069,7 +2167,7 @@ static int mtk_poll_tx(struct mtk_eth *e
|
||||||
(atomic_read(&ring->free_count) > ring->thresh))
|
(atomic_read(&ring->free_count) > ring->thresh))
|
||||||
mtk_wake_queue(eth);
|
mtk_wake_queue(eth);
|
||||||
|
|
||||||
|
@ -388,7 +388,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mtk_handle_status_irq(struct mtk_eth *eth)
|
static void mtk_handle_status_irq(struct mtk_eth *eth)
|
||||||
@@ -2149,6 +2247,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
@@ -2155,6 +2253,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||||
int i, sz = soc->txrx.txd_size;
|
int i, sz = soc->txrx.txd_size;
|
||||||
struct mtk_tx_dma_v2 *txd;
|
struct mtk_tx_dma_v2 *txd;
|
||||||
int ring_size;
|
int ring_size;
|
||||||
|
@ -396,7 +396,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
if (MTK_HAS_CAPS(soc->caps, MTK_QDMA))
|
if (MTK_HAS_CAPS(soc->caps, MTK_QDMA))
|
||||||
ring_size = MTK_QDMA_RING_SIZE;
|
ring_size = MTK_QDMA_RING_SIZE;
|
||||||
@@ -2216,8 +2315,25 @@ static int mtk_tx_alloc(struct mtk_eth *
|
@@ -2222,8 +2321,25 @@ static int mtk_tx_alloc(struct mtk_eth *
|
||||||
ring->phys + ((ring_size - 1) * sz),
|
ring->phys + ((ring_size - 1) * sz),
|
||||||
soc->reg_map->qdma.crx_ptr);
|
soc->reg_map->qdma.crx_ptr);
|
||||||
mtk_w32(eth, ring->last_free_ptr, soc->reg_map->qdma.drx_ptr);
|
mtk_w32(eth, ring->last_free_ptr, soc->reg_map->qdma.drx_ptr);
|
||||||
|
@ -424,7 +424,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
} else {
|
} else {
|
||||||
mtk_w32(eth, ring->phys_pdma, MT7628_TX_BASE_PTR0);
|
mtk_w32(eth, ring->phys_pdma, MT7628_TX_BASE_PTR0);
|
||||||
mtk_w32(eth, ring_size, MT7628_TX_MAX_CNT0);
|
mtk_w32(eth, ring_size, MT7628_TX_MAX_CNT0);
|
||||||
@@ -2882,7 +2998,7 @@ static int mtk_start_dma(struct mtk_eth
|
@@ -2903,7 +3019,7 @@ static int mtk_start_dma(struct mtk_eth
|
||||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
|
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
|
||||||
val |= MTK_MUTLI_CNT | MTK_RESV_BUF |
|
val |= MTK_MUTLI_CNT | MTK_RESV_BUF |
|
||||||
MTK_WCOMP_EN | MTK_DMAD_WR_WDONE |
|
MTK_WCOMP_EN | MTK_DMAD_WR_WDONE |
|
||||||
|
@ -433,7 +433,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
else
|
else
|
||||||
val |= MTK_RX_BT_32DWORDS;
|
val |= MTK_RX_BT_32DWORDS;
|
||||||
mtk_w32(eth, val, reg_map->qdma.glo_cfg);
|
mtk_w32(eth, val, reg_map->qdma.glo_cfg);
|
||||||
@@ -2928,6 +3044,45 @@ static void mtk_gdm_config(struct mtk_et
|
@@ -2949,6 +3065,45 @@ static void mtk_gdm_config(struct mtk_et
|
||||||
mtk_w32(eth, 0, MTK_RST_GL);
|
mtk_w32(eth, 0, MTK_RST_GL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,7 +479,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
static int mtk_open(struct net_device *dev)
|
static int mtk_open(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct mtk_mac *mac = netdev_priv(dev);
|
struct mtk_mac *mac = netdev_priv(dev);
|
||||||
@@ -2972,7 +3127,8 @@ static int mtk_open(struct net_device *d
|
@@ -2993,7 +3148,8 @@ static int mtk_open(struct net_device *d
|
||||||
refcount_inc(ð->dma_refcnt);
|
refcount_inc(ð->dma_refcnt);
|
||||||
|
|
||||||
phylink_start(mac->phylink);
|
phylink_start(mac->phylink);
|
||||||
|
@ -489,7 +489,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3488,8 +3644,12 @@ static int mtk_unreg_dev(struct mtk_eth
|
@@ -3716,8 +3872,12 @@ static int mtk_unreg_dev(struct mtk_eth
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||||
|
@ -502,7 +502,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
unregister_netdev(eth->netdev[i]);
|
unregister_netdev(eth->netdev[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3705,6 +3865,23 @@ static int mtk_set_rxnfc(struct net_devi
|
@@ -3934,6 +4094,23 @@ static int mtk_set_rxnfc(struct net_devi
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
static const struct ethtool_ops mtk_ethtool_ops = {
|
static const struct ethtool_ops mtk_ethtool_ops = {
|
||||||
.get_link_ksettings = mtk_get_link_ksettings,
|
.get_link_ksettings = mtk_get_link_ksettings,
|
||||||
.set_link_ksettings = mtk_set_link_ksettings,
|
.set_link_ksettings = mtk_set_link_ksettings,
|
||||||
@@ -3740,6 +3917,7 @@ static const struct net_device_ops mtk_n
|
@@ -3969,6 +4146,7 @@ static const struct net_device_ops mtk_n
|
||||||
.ndo_setup_tc = mtk_eth_setup_tc,
|
.ndo_setup_tc = mtk_eth_setup_tc,
|
||||||
.ndo_bpf = mtk_xdp,
|
.ndo_bpf = mtk_xdp,
|
||||||
.ndo_xdp_xmit = mtk_xdp_xmit,
|
.ndo_xdp_xmit = mtk_xdp_xmit,
|
||||||
|
@ -534,7 +534,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
};
|
};
|
||||||
|
|
||||||
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
|
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
|
||||||
@@ -3749,6 +3927,7 @@ static int mtk_add_mac(struct mtk_eth *e
|
@@ -3978,6 +4156,7 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||||
struct phylink *phylink;
|
struct phylink *phylink;
|
||||||
struct mtk_mac *mac;
|
struct mtk_mac *mac;
|
||||||
int id, err;
|
int id, err;
|
||||||
|
@ -542,7 +542,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
if (!_id) {
|
if (!_id) {
|
||||||
dev_err(eth->dev, "missing mac id\n");
|
dev_err(eth->dev, "missing mac id\n");
|
||||||
@@ -3766,7 +3945,10 @@ static int mtk_add_mac(struct mtk_eth *e
|
@@ -3995,7 +4174,10 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -554,7 +554,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
if (!eth->netdev[id]) {
|
if (!eth->netdev[id]) {
|
||||||
dev_err(eth->dev, "alloc_etherdev failed\n");
|
dev_err(eth->dev, "alloc_etherdev failed\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@@ -3863,6 +4045,11 @@ static int mtk_add_mac(struct mtk_eth *e
|
@@ -4092,6 +4274,11 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||||
else
|
else
|
||||||
eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH_2K - MTK_RX_ETH_HLEN;
|
eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH_2K - MTK_RX_ETH_HLEN;
|
||||||
|
|
||||||
|
@ -576,7 +576,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
#define MTK_QDMA_PAGE_SIZE 2048
|
#define MTK_QDMA_PAGE_SIZE 2048
|
||||||
#define MTK_MAX_RX_LENGTH 1536
|
#define MTK_MAX_RX_LENGTH 1536
|
||||||
#define MTK_MAX_RX_LENGTH_2K 2048
|
#define MTK_MAX_RX_LENGTH_2K 2048
|
||||||
@@ -203,8 +204,26 @@
|
@@ -215,8 +216,26 @@
|
||||||
#define MTK_RING_MAX_AGG_CNT_H ((MTK_HW_LRO_MAX_AGG_CNT >> 6) & 0x3)
|
#define MTK_RING_MAX_AGG_CNT_H ((MTK_HW_LRO_MAX_AGG_CNT >> 6) & 0x3)
|
||||||
|
|
||||||
/* QDMA TX Queue Configuration Registers */
|
/* QDMA TX Queue Configuration Registers */
|
||||||
|
@ -603,7 +603,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
/* QDMA Global Configuration Register */
|
/* QDMA Global Configuration Register */
|
||||||
#define MTK_RX_2B_OFFSET BIT(31)
|
#define MTK_RX_2B_OFFSET BIT(31)
|
||||||
#define MTK_RX_BT_32DWORDS (3 << 11)
|
#define MTK_RX_BT_32DWORDS (3 << 11)
|
||||||
@@ -223,6 +242,7 @@
|
@@ -235,6 +254,7 @@
|
||||||
#define MTK_WCOMP_EN BIT(24)
|
#define MTK_WCOMP_EN BIT(24)
|
||||||
#define MTK_RESV_BUF (0x40 << 16)
|
#define MTK_RESV_BUF (0x40 << 16)
|
||||||
#define MTK_MUTLI_CNT (0x4 << 12)
|
#define MTK_MUTLI_CNT (0x4 << 12)
|
||||||
|
@ -611,7 +611,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
/* QDMA Flow Control Register */
|
/* QDMA Flow Control Register */
|
||||||
#define FC_THRES_DROP_MODE BIT(20)
|
#define FC_THRES_DROP_MODE BIT(20)
|
||||||
@@ -251,8 +271,6 @@
|
@@ -265,8 +285,6 @@
|
||||||
#define MTK_STAT_OFFSET 0x40
|
#define MTK_STAT_OFFSET 0x40
|
||||||
|
|
||||||
/* QDMA TX NUM */
|
/* QDMA TX NUM */
|
||||||
|
@ -620,7 +620,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
#define QID_BITS_V2(x) (((x) & 0x3f) << 16)
|
#define QID_BITS_V2(x) (((x) & 0x3f) << 16)
|
||||||
#define MTK_QDMA_GMAC2_QID 8
|
#define MTK_QDMA_GMAC2_QID 8
|
||||||
|
|
||||||
@@ -282,6 +300,7 @@
|
@@ -296,6 +314,7 @@
|
||||||
#define TX_DMA_PLEN0(x) (((x) & eth->soc->txrx.dma_max_len) << eth->soc->txrx.dma_len_offset)
|
#define TX_DMA_PLEN0(x) (((x) & eth->soc->txrx.dma_max_len) << eth->soc->txrx.dma_len_offset)
|
||||||
#define TX_DMA_PLEN1(x) ((x) & eth->soc->txrx.dma_max_len)
|
#define TX_DMA_PLEN1(x) ((x) & eth->soc->txrx.dma_max_len)
|
||||||
#define TX_DMA_SWC BIT(14)
|
#define TX_DMA_SWC BIT(14)
|
||||||
|
@ -628,7 +628,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
/* PDMA on MT7628 */
|
/* PDMA on MT7628 */
|
||||||
#define TX_DMA_DONE BIT(31)
|
#define TX_DMA_DONE BIT(31)
|
||||||
@@ -930,6 +949,7 @@ struct mtk_reg_map {
|
@@ -952,6 +971,7 @@ struct mtk_reg_map {
|
||||||
} pdma;
|
} pdma;
|
||||||
struct {
|
struct {
|
||||||
u32 qtx_cfg; /* tx queue configuration */
|
u32 qtx_cfg; /* tx queue configuration */
|
||||||
|
@ -636,7 +636,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
u32 rx_ptr; /* rx base pointer */
|
u32 rx_ptr; /* rx base pointer */
|
||||||
u32 rx_cnt_cfg; /* rx max count configuration */
|
u32 rx_cnt_cfg; /* rx max count configuration */
|
||||||
u32 qcrx_ptr; /* rx cpu pointer */
|
u32 qcrx_ptr; /* rx cpu pointer */
|
||||||
@@ -947,6 +967,7 @@ struct mtk_reg_map {
|
@@ -969,6 +989,7 @@ struct mtk_reg_map {
|
||||||
u32 fq_tail; /* fq tail pointer */
|
u32 fq_tail; /* fq tail pointer */
|
||||||
u32 fq_count; /* fq free page count */
|
u32 fq_count; /* fq free page count */
|
||||||
u32 fq_blen; /* fq free page buffer length */
|
u32 fq_blen; /* fq free page buffer length */
|
||||||
|
@ -644,7 +644,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
} qdma;
|
} qdma;
|
||||||
u32 gdm1_cnt;
|
u32 gdm1_cnt;
|
||||||
u32 gdma_to_ppe0;
|
u32 gdma_to_ppe0;
|
||||||
@@ -1139,6 +1160,7 @@ struct mtk_mac {
|
@@ -1173,6 +1194,7 @@ struct mtk_mac {
|
||||||
__be32 hwlro_ip[MTK_MAX_LRO_IP_CNT];
|
__be32 hwlro_ip[MTK_MAX_LRO_IP_CNT];
|
||||||
int hwlro_ip_cnt;
|
int hwlro_ip_cnt;
|
||||||
unsigned int syscfg0;
|
unsigned int syscfg0;
|
||||||
|
|
|
@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
#define MTK_FOE_IB2_DEST_PORT_V2 GENMASK(12, 9)
|
#define MTK_FOE_IB2_DEST_PORT_V2 GENMASK(12, 9)
|
||||||
#define MTK_FOE_IB2_MULTICAST_V2 BIT(13)
|
#define MTK_FOE_IB2_MULTICAST_V2 BIT(13)
|
||||||
#define MTK_FOE_IB2_WDMA_WINFO_V2 BIT(19)
|
#define MTK_FOE_IB2_WDMA_WINFO_V2 BIT(19)
|
||||||
@@ -369,6 +371,8 @@ int mtk_foe_entry_set_pppoe(struct mtk_e
|
@@ -370,6 +372,8 @@ int mtk_foe_entry_set_pppoe(struct mtk_e
|
||||||
int sid);
|
int sid);
|
||||||
int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry,
|
int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry,
|
||||||
int wdma_idx, int txq, int bss, int wcid);
|
int wdma_idx, int txq, int bss, int wcid);
|
||||||
|
|
|
@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
@@ -895,7 +895,13 @@ enum mkt_eth_capabilities {
|
@@ -916,7 +916,13 @@ enum mkt_eth_capabilities {
|
||||||
#define MTK_MUX_GMAC12_TO_GEPHY_SGMII \
|
#define MTK_MUX_GMAC12_TO_GEPHY_SGMII \
|
||||||
(MTK_ETH_MUX_GMAC12_TO_GEPHY_SGMII | MTK_MUX)
|
(MTK_ETH_MUX_GMAC12_TO_GEPHY_SGMII | MTK_MUX)
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
#include "mtk_eth_soc.h"
|
#include "mtk_eth_soc.h"
|
||||||
#include "mtk_wed.h"
|
#include "mtk_wed.h"
|
||||||
@@ -1967,16 +1968,22 @@ static int mtk_poll_rx(struct napi_struc
|
@@ -1973,16 +1974,22 @@ static int mtk_poll_rx(struct napi_struc
|
||||||
htons(RX_DMA_VPID(trxd.rxd4)),
|
htons(RX_DMA_VPID(trxd.rxd4)),
|
||||||
RX_DMA_VID(trxd.rxd4));
|
RX_DMA_VID(trxd.rxd4));
|
||||||
} else if (trxd.rxd2 & RX_DMA_VTAG) {
|
} else if (trxd.rxd2 & RX_DMA_VTAG) {
|
||||||
|
@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
}
|
}
|
||||||
|
|
||||||
skb_record_rx_queue(skb, 0);
|
skb_record_rx_queue(skb, 0);
|
||||||
@@ -2793,15 +2800,30 @@ static netdev_features_t mtk_fix_feature
|
@@ -2799,15 +2806,30 @@ static netdev_features_t mtk_fix_feature
|
||||||
|
|
||||||
static int mtk_set_features(struct net_device *dev, netdev_features_t features)
|
static int mtk_set_features(struct net_device *dev, netdev_features_t features)
|
||||||
{
|
{
|
||||||
|
@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
}
|
}
|
||||||
|
|
||||||
/* wait for DMA to finish whatever it is doing before we start using it again */
|
/* wait for DMA to finish whatever it is doing before we start using it again */
|
||||||
@@ -3083,11 +3105,45 @@ found:
|
@@ -3104,11 +3126,45 @@ found:
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
|
err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -3419,6 +3475,10 @@ static int mtk_hw_init(struct mtk_eth *e
|
@@ -3631,6 +3687,10 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||||
*/
|
*/
|
||||||
val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
|
val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
|
||||||
mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL);
|
mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL);
|
||||||
|
@ -146,7 +146,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
/* Enable RX VLan Offloading */
|
/* Enable RX VLan Offloading */
|
||||||
mtk_w32(eth, 1, MTK_CDMP_EG_CTRL);
|
mtk_w32(eth, 1, MTK_CDMP_EG_CTRL);
|
||||||
@@ -3636,6 +3696,12 @@ static int mtk_free_dev(struct mtk_eth *
|
@@ -3864,6 +3924,12 @@ static int mtk_free_dev(struct mtk_eth *
|
||||||
free_netdev(eth->netdev[i]);
|
free_netdev(eth->netdev[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
#define MTK_QDMA_NUM_QUEUES 16
|
#define MTK_QDMA_NUM_QUEUES 16
|
||||||
#define MTK_QDMA_PAGE_SIZE 2048
|
#define MTK_QDMA_PAGE_SIZE 2048
|
||||||
#define MTK_MAX_RX_LENGTH 1536
|
#define MTK_MAX_RX_LENGTH 1536
|
||||||
@@ -93,6 +96,9 @@
|
@@ -105,6 +108,9 @@
|
||||||
#define MTK_CDMQ_IG_CTRL 0x1400
|
#define MTK_CDMQ_IG_CTRL 0x1400
|
||||||
#define MTK_CDMQ_STAG_EN BIT(0)
|
#define MTK_CDMQ_STAG_EN BIT(0)
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
/* CDMP Ingress Control Register */
|
/* CDMP Ingress Control Register */
|
||||||
#define MTK_CDMP_IG_CTRL 0x400
|
#define MTK_CDMP_IG_CTRL 0x400
|
||||||
#define MTK_CDMP_STAG_EN BIT(0)
|
#define MTK_CDMP_STAG_EN BIT(0)
|
||||||
@@ -1140,6 +1146,8 @@ struct mtk_eth {
|
@@ -1166,6 +1172,8 @@ struct mtk_eth {
|
||||||
|
|
||||||
int ip_align;
|
int ip_align;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
@@ -1396,12 +1396,28 @@ static void mtk_wake_queue(struct mtk_et
|
@@ -1402,12 +1402,28 @@ static void mtk_wake_queue(struct mtk_et
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
bool gso = false;
|
bool gso = false;
|
||||||
int tx_num;
|
int tx_num;
|
||||||
|
|
||||||
@@ -1423,6 +1439,18 @@ static netdev_tx_t mtk_start_xmit(struct
|
@@ -1429,6 +1445,18 @@ static netdev_tx_t mtk_start_xmit(struct
|
||||||
return NETDEV_TX_BUSY;
|
return NETDEV_TX_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
/* TSO: fill MSS info in tcp checksum field */
|
/* TSO: fill MSS info in tcp checksum field */
|
||||||
if (skb_is_gso(skb)) {
|
if (skb_is_gso(skb)) {
|
||||||
if (skb_cow_head(skb, 0)) {
|
if (skb_cow_head(skb, 0)) {
|
||||||
@@ -1438,8 +1466,14 @@ static netdev_tx_t mtk_start_xmit(struct
|
@@ -1444,8 +1472,14 @@ static netdev_tx_t mtk_start_xmit(struct
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
netif_tx_stop_all_queues(dev);
|
netif_tx_stop_all_queues(dev);
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
@@ -246,7 +246,7 @@
|
@@ -258,7 +258,7 @@
|
||||||
#define MTK_CHK_DDONE_EN BIT(28)
|
#define MTK_CHK_DDONE_EN BIT(28)
|
||||||
#define MTK_DMAD_WR_WDONE BIT(26)
|
#define MTK_DMAD_WR_WDONE BIT(26)
|
||||||
#define MTK_WCOMP_EN BIT(24)
|
#define MTK_WCOMP_EN BIT(24)
|
||||||
|
|
|
@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
@@ -3533,9 +3533,12 @@ static int mtk_hw_init(struct mtk_eth *e
|
@@ -3745,9 +3745,12 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||||
mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
|
mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
|
||||||
|
|
||||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
||||||
|
@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
@@ -127,6 +127,7 @@
|
@@ -139,6 +139,7 @@
|
||||||
#define PSE_FQFC_CFG1 0x100
|
#define PSE_FQFC_CFG1 0x100
|
||||||
#define PSE_FQFC_CFG2 0x104
|
#define PSE_FQFC_CFG2 0x104
|
||||||
#define PSE_DROP_CFG 0x108
|
#define PSE_DROP_CFG 0x108
|
||||||
|
|
|
@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
@@ -1995,29 +1995,16 @@ static int mtk_poll_rx(struct napi_struc
|
@@ -2001,29 +2001,16 @@ static int mtk_poll_rx(struct napi_struc
|
||||||
if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED)
|
if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED)
|
||||||
mtk_ppe_check_skb(eth->ppe[0], skb, hash);
|
mtk_ppe_check_skb(eth->ppe[0], skb, hash);
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
}
|
}
|
||||||
|
|
||||||
skb_record_rx_queue(skb, 0);
|
skb_record_rx_queue(skb, 0);
|
||||||
@@ -2834,29 +2821,11 @@ static netdev_features_t mtk_fix_feature
|
@@ -2840,29 +2827,11 @@ static netdev_features_t mtk_fix_feature
|
||||||
|
|
||||||
static int mtk_set_features(struct net_device *dev, netdev_features_t features)
|
static int mtk_set_features(struct net_device *dev, netdev_features_t features)
|
||||||
{
|
{
|
||||||
|
@ -80,7 +80,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3155,30 +3124,6 @@ static int mtk_open(struct net_device *d
|
@@ -3176,30 +3145,6 @@ static int mtk_open(struct net_device *d
|
||||||
struct mtk_eth *eth = mac->hw;
|
struct mtk_eth *eth = mac->hw;
|
||||||
int i, err;
|
int i, err;
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
|
err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
|
||||||
if (err) {
|
if (err) {
|
||||||
netdev_err(dev, "%s: could not attach PHY: %d\n", __func__,
|
netdev_err(dev, "%s: could not attach PHY: %d\n", __func__,
|
||||||
@@ -3219,6 +3164,35 @@ static int mtk_open(struct net_device *d
|
@@ -3240,6 +3185,35 @@ static int mtk_open(struct net_device *d
|
||||||
phylink_start(mac->phylink);
|
phylink_start(mac->phylink);
|
||||||
netif_tx_start_all_queues(dev);
|
netif_tx_start_all_queues(dev);
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3512,10 +3486,9 @@ static int mtk_hw_init(struct mtk_eth *e
|
@@ -3724,10 +3698,9 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||||
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
||||||
val = mtk_r32(eth, MTK_CDMP_IG_CTRL);
|
val = mtk_r32(eth, MTK_CDMP_IG_CTRL);
|
||||||
mtk_w32(eth, val | MTK_CDMP_STAG_EN, MTK_CDMP_IG_CTRL);
|
mtk_w32(eth, val | MTK_CDMP_STAG_EN, MTK_CDMP_IG_CTRL);
|
||||||
|
@ -160,7 +160,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
/* set interrupt delays based on current Net DIM sample */
|
/* set interrupt delays based on current Net DIM sample */
|
||||||
mtk_dim_rx(ð->rx_dim.work);
|
mtk_dim_rx(ð->rx_dim.work);
|
||||||
@@ -4136,7 +4109,7 @@ static int mtk_add_mac(struct mtk_eth *e
|
@@ -4365,7 +4338,7 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||||
eth->netdev[id]->hw_features |= NETIF_F_LRO;
|
eth->netdev[id]->hw_features |= NETIF_F_LRO;
|
||||||
|
|
||||||
eth->netdev[id]->vlan_features = eth->soc->hw_features &
|
eth->netdev[id]->vlan_features = eth->soc->hw_features &
|
||||||
|
|
|
@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
@@ -1992,9 +1992,6 @@ static int mtk_poll_rx(struct napi_struc
|
@@ -1998,9 +1998,6 @@ static int mtk_poll_rx(struct napi_struc
|
||||||
skb_checksum_none_assert(skb);
|
skb_checksum_none_assert(skb);
|
||||||
skb->protocol = eth_type_trans(skb, netdev);
|
skb->protocol = eth_type_trans(skb, netdev);
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
/* When using VLAN untagging in combination with DSA, the
|
/* When using VLAN untagging in combination with DSA, the
|
||||||
* hardware treats the MTK special tag as a VLAN and untags it.
|
* hardware treats the MTK special tag as a VLAN and untags it.
|
||||||
*/
|
*/
|
||||||
@@ -2007,6 +2004,9 @@ static int mtk_poll_rx(struct napi_struc
|
@@ -2013,6 +2010,9 @@ static int mtk_poll_rx(struct napi_struc
|
||||||
skb_dst_set_noref(skb, ð->dsa_meta[port]->dst);
|
skb_dst_set_noref(skb, ð->dsa_meta[port]->dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
@@ -5041,6 +5041,10 @@ int stmmac_dvr_probe(struct device *devi
|
@@ -5046,6 +5046,10 @@ int stmmac_dvr_probe(struct device *devi
|
||||||
reset_control_reset(priv->plat->stmmac_rst);
|
reset_control_reset(priv->plat->stmmac_rst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
/* Init MAC and get the capabilities */
|
/* Init MAC and get the capabilities */
|
||||||
ret = stmmac_hw_init(priv);
|
ret = stmmac_hw_init(priv);
|
||||||
if (ret)
|
if (ret)
|
||||||
@@ -5255,6 +5259,7 @@ int stmmac_dvr_remove(struct device *dev
|
@@ -5260,6 +5264,7 @@ int stmmac_dvr_remove(struct device *dev
|
||||||
phylink_destroy(priv->phylink);
|
phylink_destroy(priv->phylink);
|
||||||
if (priv->plat->stmmac_rst)
|
if (priv->plat->stmmac_rst)
|
||||||
reset_control_assert(priv->plat->stmmac_rst);
|
reset_control_assert(priv->plat->stmmac_rst);
|
||||||
|
|
|
@ -21,7 +21,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||||
|
|
||||||
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
|
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
|
||||||
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
|
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
|
||||||
@@ -157,6 +157,7 @@ static const struct of_device_id blockli
|
@@ -159,6 +159,7 @@ static const struct of_device_id blockli
|
||||||
{ .compatible = "ti,omap3", },
|
{ .compatible = "ti,omap3", },
|
||||||
|
|
||||||
{ .compatible = "qcom,ipq8064", },
|
{ .compatible = "qcom,ipq8064", },
|
||||||
|
|
|
@ -20,7 +20,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
@@ -224,13 +224,35 @@ static int _mtk_mdio_write(struct mtk_et
|
@@ -230,13 +230,35 @@ static int _mtk_mdio_write(struct mtk_et
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
ret = mtk_mdio_busy_wait(eth);
|
ret = mtk_mdio_busy_wait(eth);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@@ -247,12 +269,33 @@ static int _mtk_mdio_read(struct mtk_eth
|
@@ -253,12 +275,33 @@ static int _mtk_mdio_read(struct mtk_eth
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
ret = mtk_mdio_busy_wait(eth);
|
ret = mtk_mdio_busy_wait(eth);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@@ -720,6 +763,7 @@ static int mtk_mdio_init(struct mtk_eth
|
@@ -726,6 +769,7 @@ static int mtk_mdio_init(struct mtk_eth
|
||||||
eth->mii_bus->name = "mdio";
|
eth->mii_bus->name = "mdio";
|
||||||
eth->mii_bus->read = mtk_mdio_read;
|
eth->mii_bus->read = mtk_mdio_read;
|
||||||
eth->mii_bus->write = mtk_mdio_write;
|
eth->mii_bus->write = mtk_mdio_write;
|
||||||
|
@ -113,7 +113,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
@@ -355,9 +355,12 @@
|
@@ -369,9 +369,12 @@
|
||||||
#define PHY_IAC_ADDR_MASK GENMASK(24, 20)
|
#define PHY_IAC_ADDR_MASK GENMASK(24, 20)
|
||||||
#define PHY_IAC_ADDR(x) FIELD_PREP(PHY_IAC_ADDR_MASK, (x))
|
#define PHY_IAC_ADDR(x) FIELD_PREP(PHY_IAC_ADDR_MASK, (x))
|
||||||
#define PHY_IAC_CMD_MASK GENMASK(19, 18)
|
#define PHY_IAC_CMD_MASK GENMASK(19, 18)
|
||||||
|
|
|
@ -32,7 +32,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
|
|
||||||
--- a/drivers/net/phy/mdio_bus.c
|
--- a/drivers/net/phy/mdio_bus.c
|
||||||
+++ b/drivers/net/phy/mdio_bus.c
|
+++ b/drivers/net/phy/mdio_bus.c
|
||||||
@@ -734,6 +734,32 @@ out:
|
@@ -739,6 +739,32 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* __mdiobus_read - Unlocked version of the mdiobus_read function
|
* __mdiobus_read - Unlocked version of the mdiobus_read function
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -749,7 +775,10 @@ int __mdiobus_read(struct mii_bus *bus,
|
@@ -754,7 +780,10 @@ int __mdiobus_read(struct mii_bus *bus,
|
||||||
|
|
||||||
WARN_ON_ONCE(!mutex_is_locked(&bus->mdio_lock));
|
WARN_ON_ONCE(!mutex_is_locked(&bus->mdio_lock));
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
|
|
||||||
trace_mdio_access(bus, 1, addr, regnum, retval, retval);
|
trace_mdio_access(bus, 1, addr, regnum, retval, retval);
|
||||||
mdiobus_stats_acct(&bus->stats[addr], true, retval);
|
mdiobus_stats_acct(&bus->stats[addr], true, retval);
|
||||||
@@ -759,6 +788,40 @@ int __mdiobus_read(struct mii_bus *bus,
|
@@ -764,6 +793,40 @@ int __mdiobus_read(struct mii_bus *bus,
|
||||||
EXPORT_SYMBOL(__mdiobus_read);
|
EXPORT_SYMBOL(__mdiobus_read);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -118,7 +118,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* __mdiobus_write - Unlocked version of the mdiobus_write function
|
* __mdiobus_write - Unlocked version of the mdiobus_write function
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -775,7 +838,10 @@ int __mdiobus_write(struct mii_bus *bus,
|
@@ -780,7 +843,10 @@ int __mdiobus_write(struct mii_bus *bus,
|
||||||
|
|
||||||
WARN_ON_ONCE(!mutex_is_locked(&bus->mdio_lock));
|
WARN_ON_ONCE(!mutex_is_locked(&bus->mdio_lock));
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
|
|
||||||
trace_mdio_access(bus, 0, addr, regnum, val, err);
|
trace_mdio_access(bus, 0, addr, regnum, val, err);
|
||||||
mdiobus_stats_acct(&bus->stats[addr], false, err);
|
mdiobus_stats_acct(&bus->stats[addr], false, err);
|
||||||
@@ -785,6 +851,39 @@ int __mdiobus_write(struct mii_bus *bus,
|
@@ -790,6 +856,39 @@ int __mdiobus_write(struct mii_bus *bus,
|
||||||
EXPORT_SYMBOL(__mdiobus_write);
|
EXPORT_SYMBOL(__mdiobus_write);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -170,7 +170,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* __mdiobus_modify_changed - Unlocked version of the mdiobus_modify function
|
* __mdiobus_modify_changed - Unlocked version of the mdiobus_modify function
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -817,6 +916,43 @@ int __mdiobus_modify_changed(struct mii_
|
@@ -822,6 +921,43 @@ int __mdiobus_modify_changed(struct mii_
|
||||||
EXPORT_SYMBOL_GPL(__mdiobus_modify_changed);
|
EXPORT_SYMBOL_GPL(__mdiobus_modify_changed);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -214,7 +214,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* mdiobus_read_nested - Nested version of the mdiobus_read function
|
* mdiobus_read_nested - Nested version of the mdiobus_read function
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -842,6 +978,79 @@ int mdiobus_read_nested(struct mii_bus *
|
@@ -847,6 +983,79 @@ int mdiobus_read_nested(struct mii_bus *
|
||||||
EXPORT_SYMBOL(mdiobus_read_nested);
|
EXPORT_SYMBOL(mdiobus_read_nested);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -294,7 +294,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* mdiobus_read - Convenience function for reading a given MII mgmt register
|
* mdiobus_read - Convenience function for reading a given MII mgmt register
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -864,6 +1073,29 @@ int mdiobus_read(struct mii_bus *bus, in
|
@@ -869,6 +1078,29 @@ int mdiobus_read(struct mii_bus *bus, in
|
||||||
EXPORT_SYMBOL(mdiobus_read);
|
EXPORT_SYMBOL(mdiobus_read);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -324,7 +324,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* mdiobus_write_nested - Nested version of the mdiobus_write function
|
* mdiobus_write_nested - Nested version of the mdiobus_write function
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -890,6 +1122,33 @@ int mdiobus_write_nested(struct mii_bus
|
@@ -895,6 +1127,33 @@ int mdiobus_write_nested(struct mii_bus
|
||||||
EXPORT_SYMBOL(mdiobus_write_nested);
|
EXPORT_SYMBOL(mdiobus_write_nested);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -358,7 +358,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* mdiobus_write - Convenience function for writing a given MII mgmt register
|
* mdiobus_write - Convenience function for writing a given MII mgmt register
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -913,6 +1172,30 @@ int mdiobus_write(struct mii_bus *bus, i
|
@@ -918,6 +1177,30 @@ int mdiobus_write(struct mii_bus *bus, i
|
||||||
EXPORT_SYMBOL(mdiobus_write);
|
EXPORT_SYMBOL(mdiobus_write);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -389,7 +389,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* mdiobus_modify - Convenience function for modifying a given mdio device
|
* mdiobus_modify - Convenience function for modifying a given mdio device
|
||||||
* register
|
* register
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
@@ -934,6 +1217,51 @@ int mdiobus_modify(struct mii_bus *bus,
|
@@ -939,6 +1222,51 @@ int mdiobus_modify(struct mii_bus *bus,
|
||||||
EXPORT_SYMBOL_GPL(mdiobus_modify);
|
EXPORT_SYMBOL_GPL(mdiobus_modify);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -32,7 +32,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
|
|
||||||
--- a/drivers/net/phy/mdio_bus.c
|
--- a/drivers/net/phy/mdio_bus.c
|
||||||
+++ b/drivers/net/phy/mdio_bus.c
|
+++ b/drivers/net/phy/mdio_bus.c
|
||||||
@@ -737,6 +737,32 @@ out:
|
@@ -742,6 +742,32 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* __mdiobus_read - Unlocked version of the mdiobus_read function
|
* __mdiobus_read - Unlocked version of the mdiobus_read function
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -752,7 +778,10 @@ int __mdiobus_read(struct mii_bus *bus,
|
@@ -757,7 +783,10 @@ int __mdiobus_read(struct mii_bus *bus,
|
||||||
|
|
||||||
lockdep_assert_held_once(&bus->mdio_lock);
|
lockdep_assert_held_once(&bus->mdio_lock);
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
|
|
||||||
trace_mdio_access(bus, 1, addr, regnum, retval, retval);
|
trace_mdio_access(bus, 1, addr, regnum, retval, retval);
|
||||||
mdiobus_stats_acct(&bus->stats[addr], true, retval);
|
mdiobus_stats_acct(&bus->stats[addr], true, retval);
|
||||||
@@ -762,6 +791,40 @@ int __mdiobus_read(struct mii_bus *bus,
|
@@ -767,6 +796,40 @@ int __mdiobus_read(struct mii_bus *bus,
|
||||||
EXPORT_SYMBOL(__mdiobus_read);
|
EXPORT_SYMBOL(__mdiobus_read);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -118,7 +118,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* __mdiobus_write - Unlocked version of the mdiobus_write function
|
* __mdiobus_write - Unlocked version of the mdiobus_write function
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -778,7 +841,10 @@ int __mdiobus_write(struct mii_bus *bus,
|
@@ -783,7 +846,10 @@ int __mdiobus_write(struct mii_bus *bus,
|
||||||
|
|
||||||
lockdep_assert_held_once(&bus->mdio_lock);
|
lockdep_assert_held_once(&bus->mdio_lock);
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
|
|
||||||
trace_mdio_access(bus, 0, addr, regnum, val, err);
|
trace_mdio_access(bus, 0, addr, regnum, val, err);
|
||||||
mdiobus_stats_acct(&bus->stats[addr], false, err);
|
mdiobus_stats_acct(&bus->stats[addr], false, err);
|
||||||
@@ -788,6 +854,39 @@ int __mdiobus_write(struct mii_bus *bus,
|
@@ -793,6 +859,39 @@ int __mdiobus_write(struct mii_bus *bus,
|
||||||
EXPORT_SYMBOL(__mdiobus_write);
|
EXPORT_SYMBOL(__mdiobus_write);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -170,7 +170,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* __mdiobus_modify_changed - Unlocked version of the mdiobus_modify function
|
* __mdiobus_modify_changed - Unlocked version of the mdiobus_modify function
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -820,6 +919,43 @@ int __mdiobus_modify_changed(struct mii_
|
@@ -825,6 +924,43 @@ int __mdiobus_modify_changed(struct mii_
|
||||||
EXPORT_SYMBOL_GPL(__mdiobus_modify_changed);
|
EXPORT_SYMBOL_GPL(__mdiobus_modify_changed);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -214,7 +214,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* mdiobus_read_nested - Nested version of the mdiobus_read function
|
* mdiobus_read_nested - Nested version of the mdiobus_read function
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -845,6 +981,79 @@ int mdiobus_read_nested(struct mii_bus *
|
@@ -850,6 +986,79 @@ int mdiobus_read_nested(struct mii_bus *
|
||||||
EXPORT_SYMBOL(mdiobus_read_nested);
|
EXPORT_SYMBOL(mdiobus_read_nested);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -294,7 +294,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* mdiobus_read - Convenience function for reading a given MII mgmt register
|
* mdiobus_read - Convenience function for reading a given MII mgmt register
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -867,6 +1076,29 @@ int mdiobus_read(struct mii_bus *bus, in
|
@@ -872,6 +1081,29 @@ int mdiobus_read(struct mii_bus *bus, in
|
||||||
EXPORT_SYMBOL(mdiobus_read);
|
EXPORT_SYMBOL(mdiobus_read);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -324,7 +324,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* mdiobus_write_nested - Nested version of the mdiobus_write function
|
* mdiobus_write_nested - Nested version of the mdiobus_write function
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -893,6 +1125,33 @@ int mdiobus_write_nested(struct mii_bus
|
@@ -898,6 +1130,33 @@ int mdiobus_write_nested(struct mii_bus
|
||||||
EXPORT_SYMBOL(mdiobus_write_nested);
|
EXPORT_SYMBOL(mdiobus_write_nested);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -358,7 +358,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* mdiobus_write - Convenience function for writing a given MII mgmt register
|
* mdiobus_write - Convenience function for writing a given MII mgmt register
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
* @addr: the phy address
|
* @addr: the phy address
|
||||||
@@ -916,6 +1175,30 @@ int mdiobus_write(struct mii_bus *bus, i
|
@@ -921,6 +1180,30 @@ int mdiobus_write(struct mii_bus *bus, i
|
||||||
EXPORT_SYMBOL(mdiobus_write);
|
EXPORT_SYMBOL(mdiobus_write);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -389,7 +389,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||||
* mdiobus_modify - Convenience function for modifying a given mdio device
|
* mdiobus_modify - Convenience function for modifying a given mdio device
|
||||||
* register
|
* register
|
||||||
* @bus: the mii_bus struct
|
* @bus: the mii_bus struct
|
||||||
@@ -937,6 +1220,51 @@ int mdiobus_modify(struct mii_bus *bus,
|
@@ -942,6 +1225,51 @@ int mdiobus_modify(struct mii_bus *bus,
|
||||||
EXPORT_SYMBOL_GPL(mdiobus_modify);
|
EXPORT_SYMBOL_GPL(mdiobus_modify);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue