8590531048
Manually rebased: bcm4908/patches-5.15/071-v6.1-0001-net-broadcom-bcm4908_enet-handle-EPROBE_DEFER-when-g.patch bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch ipq40xx/patches-5.15/902-dts-ipq4019-ap-dk04.1.patch[*] Removed upstreamed: backport-5.15/735-v6.5-net-bgmac-postpone-turning-IRQs-off-to-avoid-SoC-han.patch[1] backport-5.15/817-v6.5-01-leds-trigger-netdev-Recheck-NETDEV_LED_MODE_LINKUP-o.patch[2] pending-5.15/143-jffs2-reduce-stack-usage-in-jffs2_build_xattr_subsys.patch[3] pending-5.15/160-workqueue-fix-enum-type-for-gcc-13.patch[4] bcm53xx/patches-5.15/036-v6.5-0003-ARM-dts-BCM5301X-Drop-clock-names-from-the-SPI-node.patch[5] bcm53xx/patches-5.15/036-v6.5-0015-ARM-dts-BCM5301X-fix-duplex-full-full-duplex.patch[6] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=02474292a44205c1eb5a03634ead155a3c9134f4 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=86b93cbfe104e99fd3d25a49748b99fb88101573 3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=79b9ab357b6f5675007f4c02ff8765cbd8dc06a2 4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=d528faa9e828b9fc46dfb684a2a9fd8c2e860ed8 5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=5899bc4058e89d5110a23797ff94439c53b77c25 6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=95afd2c7c7d26087730dc938709e025a303e5499 Build system: x86/64 Build-tested: ramips/tplink_archer-a6-v3 Run-tested: ramips/tplink_archer-a6-v3 Co-authored-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John Audia <therealgraysky@proton.me> [rebased ipq40xx/patches-5.15/902-dts-ipq4019-ap-dk04.1.patch ] Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
160 lines
4.5 KiB
Diff
160 lines
4.5 KiB
Diff
From: Felix Fietkau <nbd@nbd.name>
|
|
Date: Mon, 21 Feb 2022 15:38:20 +0100
|
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: allocate struct mtk_ppe
|
|
separately
|
|
|
|
Preparation for adding more data to it, which will increase its size.
|
|
|
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
---
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
@@ -2335,7 +2335,7 @@ static int mtk_open(struct net_device *d
|
|
return err;
|
|
}
|
|
|
|
- if (eth->soc->offload_version && mtk_ppe_start(ð->ppe) == 0)
|
|
+ if (eth->soc->offload_version && mtk_ppe_start(eth->ppe) == 0)
|
|
gdm_config = MTK_GDMA_TO_PPE;
|
|
|
|
mtk_gdm_config(eth, gdm_config);
|
|
@@ -2409,7 +2409,7 @@ static int mtk_stop(struct net_device *d
|
|
mtk_dma_free(eth);
|
|
|
|
if (eth->soc->offload_version)
|
|
- mtk_ppe_stop(ð->ppe);
|
|
+ mtk_ppe_stop(eth->ppe);
|
|
|
|
return 0;
|
|
}
|
|
@@ -3294,10 +3294,11 @@ static int mtk_probe(struct platform_dev
|
|
}
|
|
|
|
if (eth->soc->offload_version) {
|
|
- err = mtk_ppe_init(ð->ppe, eth->dev,
|
|
- eth->base + MTK_ETH_PPE_BASE, 2);
|
|
- if (err)
|
|
+ eth->ppe = mtk_ppe_init(eth->dev, eth->base + MTK_ETH_PPE_BASE, 2);
|
|
+ if (!eth->ppe) {
|
|
+ err = -ENOMEM;
|
|
goto err_free_dev;
|
|
+ }
|
|
|
|
err = mtk_eth_offload_init(eth);
|
|
if (err)
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
|
@@ -983,7 +983,7 @@ struct mtk_eth {
|
|
u32 rx_dma_l4_valid;
|
|
int ip_align;
|
|
|
|
- struct mtk_ppe ppe;
|
|
+ struct mtk_ppe *ppe;
|
|
struct rhashtable flow_table;
|
|
};
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
|
|
@@ -384,10 +384,15 @@ int mtk_foe_entry_commit(struct mtk_ppe
|
|
return hash;
|
|
}
|
|
|
|
-int mtk_ppe_init(struct mtk_ppe *ppe, struct device *dev, void __iomem *base,
|
|
+struct mtk_ppe *mtk_ppe_init(struct device *dev, void __iomem *base,
|
|
int version)
|
|
{
|
|
struct mtk_foe_entry *foe;
|
|
+ struct mtk_ppe *ppe;
|
|
+
|
|
+ ppe = devm_kzalloc(dev, sizeof(*ppe), GFP_KERNEL);
|
|
+ if (!ppe)
|
|
+ return NULL;
|
|
|
|
/* need to allocate a separate device, since it PPE DMA access is
|
|
* not coherent.
|
|
@@ -399,13 +404,13 @@ int mtk_ppe_init(struct mtk_ppe *ppe, st
|
|
foe = dmam_alloc_coherent(ppe->dev, MTK_PPE_ENTRIES * sizeof(*foe),
|
|
&ppe->foe_phys, GFP_KERNEL);
|
|
if (!foe)
|
|
- return -ENOMEM;
|
|
+ return NULL;
|
|
|
|
ppe->foe_table = foe;
|
|
|
|
mtk_ppe_debugfs_init(ppe);
|
|
|
|
- return 0;
|
|
+ return ppe;
|
|
}
|
|
|
|
static void mtk_ppe_init_foe_table(struct mtk_ppe *ppe)
|
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
|
|
@@ -246,8 +246,7 @@ struct mtk_ppe {
|
|
void *acct_table;
|
|
};
|
|
|
|
-int mtk_ppe_init(struct mtk_ppe *ppe, struct device *dev, void __iomem *base,
|
|
- int version);
|
|
+struct mtk_ppe *mtk_ppe_init(struct device *dev, void __iomem *base, int version);
|
|
int mtk_ppe_start(struct mtk_ppe *ppe);
|
|
int mtk_ppe_stop(struct mtk_ppe *ppe);
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
|
|
@@ -411,7 +411,7 @@ mtk_flow_offload_replace(struct mtk_eth
|
|
|
|
entry->cookie = f->cookie;
|
|
timestamp = mtk_eth_timestamp(eth);
|
|
- hash = mtk_foe_entry_commit(ð->ppe, &foe, timestamp);
|
|
+ hash = mtk_foe_entry_commit(eth->ppe, &foe, timestamp);
|
|
if (hash < 0) {
|
|
err = hash;
|
|
goto free;
|
|
@@ -426,7 +426,7 @@ mtk_flow_offload_replace(struct mtk_eth
|
|
|
|
return 0;
|
|
clear_flow:
|
|
- mtk_foe_entry_clear(ð->ppe, hash);
|
|
+ mtk_foe_entry_clear(eth->ppe, hash);
|
|
free:
|
|
kfree(entry);
|
|
if (wed_index >= 0)
|
|
@@ -444,7 +444,7 @@ mtk_flow_offload_destroy(struct mtk_eth
|
|
if (!entry)
|
|
return -ENOENT;
|
|
|
|
- mtk_foe_entry_clear(ð->ppe, entry->hash);
|
|
+ mtk_foe_entry_clear(eth->ppe, entry->hash);
|
|
rhashtable_remove_fast(ð->flow_table, &entry->node,
|
|
mtk_flow_ht_params);
|
|
if (entry->wed_index >= 0)
|
|
@@ -466,7 +466,7 @@ mtk_flow_offload_stats(struct mtk_eth *e
|
|
if (!entry)
|
|
return -ENOENT;
|
|
|
|
- timestamp = mtk_foe_entry_timestamp(ð->ppe, entry->hash);
|
|
+ timestamp = mtk_foe_entry_timestamp(eth->ppe, entry->hash);
|
|
if (timestamp < 0)
|
|
return -ETIMEDOUT;
|
|
|
|
@@ -522,7 +522,7 @@ mtk_eth_setup_tc_block(struct net_device
|
|
struct flow_block_cb *block_cb;
|
|
flow_setup_cb_t *cb;
|
|
|
|
- if (!eth->ppe.foe_table)
|
|
+ if (!eth->ppe || !eth->ppe->foe_table)
|
|
return -EOPNOTSUPP;
|
|
|
|
if (f->binder_type != FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS)
|
|
@@ -575,7 +575,7 @@ int mtk_eth_setup_tc(struct net_device *
|
|
|
|
int mtk_eth_offload_init(struct mtk_eth *eth)
|
|
{
|
|
- if (!eth->ppe.foe_table)
|
|
+ if (!eth->ppe || !eth->ppe->foe_table)
|
|
return 0;
|
|
|
|
return rhashtable_init(ð->flow_table, &mtk_flow_ht_params);
|