Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Commit

Permalink
[bot] AutoMerging: merge all upstream's changes:
Browse files Browse the repository at this point in the history
* https://github.com/coolsnowwolf/lede:
  Revert "uboot-rockchip:doornet2 detaches from evb rk (coolsnowwolf#9812)"
  uboot-rockchip:doornet2 detaches from evb rk (coolsnowwolf#9812)
  generic: fix swconfig_leds.c in 5.18
  kernel: bump 5.10 to 5.10.131 (coolsnowwolf#9807)
  kernel: backport upstream mtk_eth_soc patches (coolsnowwolf#9809)
  • Loading branch information
github-actions[bot] committed Jul 21, 2022
2 parents 9450921 + 7af074f commit f8c9e68
Show file tree
Hide file tree
Showing 44 changed files with 3,241 additions and 53 deletions.
4 changes: 2 additions & 2 deletions include/kernel-5.10
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LINUX_VERSION-5.10 = .127
LINUX_KERNEL_HASH-5.10.127 = 419233ee0b1ee1dc2be8abf1b241545d10dad19d95f237180d6ccdc0cd221580
LINUX_VERSION-5.10 = .131
LINUX_KERNEL_HASH-5.10.131 = 8bc441442c16c330a7148fe3cca9edcd98bc0fc9f68304633c7eb641770d21ce
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Signed-off-by: Pablo Neira Ayuso <[email protected]>
nft_trans_table_update(trans) = true;
list_add_tail(&trans->list, &ctx->net->nft.commit_list);
return 0;
@@ -7916,11 +7920,10 @@ static int nf_tables_commit(struct net *
@@ -7923,11 +7927,10 @@ static int nf_tables_commit(struct net *
switch (trans->msg_type) {
case NFT_MSG_NEWTABLE:
if (nft_trans_table_update(trans)) {
Expand All @@ -86,7 +86,7 @@ Signed-off-by: Pablo Neira Ayuso <[email protected]>
} else {
nft_clear(net, trans->ctx.table);
}
@@ -8133,11 +8136,9 @@ static int __nf_tables_abort(struct net
@@ -8140,11 +8143,9 @@ static int __nf_tables_abort(struct net
switch (trans->msg_type) {
case NFT_MSG_NEWTABLE:
if (nft_trans_table_update(trans)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
u16 addr_type = 0;
u32 timestamp;
u8 l4proto = 0;
@@ -329,10 +372,14 @@ mtk_flow_offload_replace(struct mtk_eth
@@ -326,10 +369,14 @@ mtk_flow_offload_replace(struct mtk_eth
if (data.pppoe.num == 1)
mtk_foe_entry_set_pppoe(&foe, data.pppoe.sid);

Expand All @@ -182,15 +182,15 @@ Signed-off-by: Felix Fietkau <[email protected]>
entry = kzalloc(sizeof(*entry), GFP_KERNEL);
if (!entry)
return -ENOMEM;
@@ -346,6 +393,7 @@ mtk_flow_offload_replace(struct mtk_eth
@@ -343,6 +390,7 @@ mtk_flow_offload_replace(struct mtk_eth
}

entry->hash = hash;
+ entry->wed_index = wed_index;
err = rhashtable_insert_fast(&eth->flow_table, &entry->node,
mtk_flow_ht_params);
if (err < 0)
@@ -356,6 +404,8 @@ clear_flow:
@@ -353,6 +401,8 @@ clear_flow:
mtk_foe_entry_clear(&eth->ppe, hash);
free:
kfree(entry);
Expand All @@ -199,7 +199,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
return err;
}

@@ -372,6 +422,8 @@ mtk_flow_offload_destroy(struct mtk_eth
@@ -369,6 +419,8 @@ mtk_flow_offload_destroy(struct mtk_eth
mtk_foe_entry_clear(&eth->ppe, entry->hash);
rhashtable_remove_fast(&eth->flow_table, &entry->node,
mtk_flow_ht_params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
static void
mtk_flow_offload_mangle_eth(const struct flow_action_entry *act, void *eth)
{
@@ -299,6 +313,9 @@ mtk_flow_offload_replace(struct mtk_eth
@@ -296,6 +310,9 @@ mtk_flow_offload_replace(struct mtk_eth
case FLOW_DISSECTOR_KEY_IPV4_ADDRS:
offload_type = MTK_PPE_PKT_TYPE_IPV4_HNAPT;
break;
Expand All @@ -59,7 +59,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
default:
return -EOPNOTSUPP;
}
@@ -334,6 +351,17 @@ mtk_flow_offload_replace(struct mtk_eth
@@ -331,6 +348,17 @@ mtk_flow_offload_replace(struct mtk_eth
mtk_flow_set_ipv4_addr(&foe, &data, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <[email protected]>

--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
@@ -566,10 +566,13 @@ mtk_eth_setup_tc_block(struct net_device
@@ -563,10 +563,13 @@ mtk_eth_setup_tc_block(struct net_device
int mtk_eth_setup_tc(struct net_device *dev, enum tc_setup_type type,
void *type_data)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Signed-off-by: Felix Fietkau <[email protected]>

--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
@@ -414,7 +414,7 @@ mtk_flow_offload_replace(struct mtk_eth
@@ -411,7 +411,7 @@ mtk_flow_offload_replace(struct mtk_eth

entry->cookie = f->cookie;
timestamp = mtk_eth_timestamp(eth);
Expand All @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
if (hash < 0) {
err = hash;
goto free;
@@ -429,7 +429,7 @@ mtk_flow_offload_replace(struct mtk_eth
@@ -426,7 +426,7 @@ mtk_flow_offload_replace(struct mtk_eth

return 0;
clear_flow:
Expand All @@ -121,7 +121,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
free:
kfree(entry);
if (wed_index >= 0)
@@ -447,7 +447,7 @@ mtk_flow_offload_destroy(struct mtk_eth
@@ -444,7 +444,7 @@ mtk_flow_offload_destroy(struct mtk_eth
if (!entry)
return -ENOENT;

Expand All @@ -130,7 +130,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
rhashtable_remove_fast(&eth->flow_table, &entry->node,
mtk_flow_ht_params);
if (entry->wed_index >= 0)
@@ -469,7 +469,7 @@ mtk_flow_offload_stats(struct mtk_eth *e
@@ -466,7 +466,7 @@ mtk_flow_offload_stats(struct mtk_eth *e
if (!entry)
return -ENOENT;

Expand All @@ -139,7 +139,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
if (timestamp < 0)
return -ETIMEDOUT;

@@ -525,7 +525,7 @@ mtk_eth_setup_tc_block(struct net_device
@@ -522,7 +522,7 @@ mtk_eth_setup_tc_block(struct net_device
struct flow_block_cb *block_cb;
flow_setup_cb_t *cb;

Expand All @@ -148,7 +148,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
return -EOPNOTSUPP;

if (f->binder_type != FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS)
@@ -577,7 +577,7 @@ int mtk_eth_setup_tc(struct net_device *
@@ -574,7 +574,7 @@ int mtk_eth_setup_tc(struct net_device *

int mtk_eth_offload_init(struct mtk_eth *eth)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
int i;

if (rhashtable_lookup(&eth->flow_table, &f->cookie, mtk_flow_ht_params))
@@ -413,23 +398,21 @@ mtk_flow_offload_replace(struct mtk_eth
@@ -410,23 +395,21 @@ mtk_flow_offload_replace(struct mtk_eth
return -ENOMEM;

entry->cookie = f->cookie;
Expand Down Expand Up @@ -392,7 +392,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
free:
kfree(entry);
if (wed_index >= 0)
@@ -447,7 +430,7 @@ mtk_flow_offload_destroy(struct mtk_eth
@@ -444,7 +427,7 @@ mtk_flow_offload_destroy(struct mtk_eth
if (!entry)
return -ENOENT;

Expand All @@ -401,15 +401,15 @@ Signed-off-by: Felix Fietkau <[email protected]>
rhashtable_remove_fast(&eth->flow_table, &entry->node,
mtk_flow_ht_params);
if (entry->wed_index >= 0)
@@ -461,7 +444,6 @@ static int
@@ -458,7 +441,6 @@ static int
mtk_flow_offload_stats(struct mtk_eth *eth, struct flow_cls_offload *f)
{
struct mtk_flow_entry *entry;
- int timestamp;
u32 idle;

entry = rhashtable_lookup(&eth->flow_table, &f->cookie,
@@ -469,11 +451,7 @@ mtk_flow_offload_stats(struct mtk_eth *e
@@ -466,11 +448,7 @@ mtk_flow_offload_stats(struct mtk_eth *e
if (!entry)
return -ENOENT;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
struct {
u16 id;
__be16 proto;
@@ -260,9 +262,45 @@ mtk_flow_offload_replace(struct mtk_eth
@@ -257,9 +259,45 @@ mtk_flow_offload_replace(struct mtk_eth
return -EOPNOTSUPP;
}

Expand Down Expand Up @@ -498,7 +498,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
if (act->mangle.htype == FLOW_ACT_MANGLE_HDR_TYPE_ETH)
mtk_flow_offload_mangle_eth(act, &data.eth);
break;
@@ -294,17 +332,6 @@ mtk_flow_offload_replace(struct mtk_eth
@@ -291,17 +329,6 @@ mtk_flow_offload_replace(struct mtk_eth
}
}

Expand All @@ -516,7 +516,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
if (!is_valid_ether_addr(data.eth.h_source) ||
!is_valid_ether_addr(data.eth.h_dest))
return -EINVAL;
@@ -318,10 +345,13 @@ mtk_flow_offload_replace(struct mtk_eth
@@ -315,10 +342,13 @@ mtk_flow_offload_replace(struct mtk_eth
if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_PORTS)) {
struct flow_match_ports ports;

Expand All @@ -531,7 +531,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
return -EOPNOTSUPP;
}

@@ -351,6 +381,9 @@ mtk_flow_offload_replace(struct mtk_eth
@@ -348,6 +378,9 @@ mtk_flow_offload_replace(struct mtk_eth
if (act->id != FLOW_ACTION_MANGLE)
continue;

Expand All @@ -541,7 +541,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
switch (act->mangle.htype) {
case FLOW_ACT_MANGLE_HDR_TYPE_TCP:
case FLOW_ACT_MANGLE_HDR_TYPE_UDP:
@@ -376,6 +409,9 @@ mtk_flow_offload_replace(struct mtk_eth
@@ -373,6 +406,9 @@ mtk_flow_offload_replace(struct mtk_eth
return err;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
From: Felix Fietkau <[email protected]>
Date: Fri, 8 Apr 2022 10:59:45 +0200
Subject: [PATCH] net: ethernet: mtk_eth_soc/wed: fix sparse endian warnings

Descriptor fields are little-endian

Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
---

--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -144,16 +144,17 @@ mtk_wed_buffer_alloc(struct mtk_wed_devi

for (s = 0; s < MTK_WED_BUF_PER_PAGE; s++) {
u32 txd_size;
+ u32 ctrl;

txd_size = dev->wlan.init_buf(buf, buf_phys, token++);

- desc->buf0 = buf_phys;
- desc->buf1 = buf_phys + txd_size;
- desc->ctrl = FIELD_PREP(MTK_WDMA_DESC_CTRL_LEN0,
- txd_size) |
- FIELD_PREP(MTK_WDMA_DESC_CTRL_LEN1,
- MTK_WED_BUF_SIZE - txd_size) |
- MTK_WDMA_DESC_CTRL_LAST_SEG1;
+ desc->buf0 = cpu_to_le32(buf_phys);
+ desc->buf1 = cpu_to_le32(buf_phys + txd_size);
+ ctrl = FIELD_PREP(MTK_WDMA_DESC_CTRL_LEN0, txd_size) |
+ FIELD_PREP(MTK_WDMA_DESC_CTRL_LEN1,
+ MTK_WED_BUF_SIZE - txd_size) |
+ MTK_WDMA_DESC_CTRL_LAST_SEG1;
+ desc->ctrl = cpu_to_le32(ctrl);
desc->info = 0;
desc++;

@@ -184,12 +185,14 @@ mtk_wed_free_buffer(struct mtk_wed_devic

for (i = 0, page_idx = 0; i < dev->buf_ring.size; i += MTK_WED_BUF_PER_PAGE) {
void *page = page_list[page_idx++];
+ dma_addr_t buf_addr;

if (!page)
break;

- dma_unmap_page(dev->hw->dev, desc[i].buf0,
- PAGE_SIZE, DMA_BIDIRECTIONAL);
+ buf_addr = le32_to_cpu(desc[i].buf0);
+ dma_unmap_page(dev->hw->dev, buf_addr, PAGE_SIZE,
+ DMA_BIDIRECTIONAL);
__free_page(page);
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From: Yang Yingliang <[email protected]>
Date: Fri, 8 Apr 2022 11:22:46 +0800
Subject: [PATCH] net: ethernet: mtk_eth_soc: fix return value check in
mtk_wed_add_hw()

If syscon_regmap_lookup_by_phandle() fails, it never return NULL pointer,
change the check to IS_ERR().

Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Yang Yingliang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
---

--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -816,7 +816,7 @@ void mtk_wed_add_hw(struct device_node *
return;

regs = syscon_regmap_lookup_by_phandle(np, NULL);
- if (!regs)
+ if (IS_ERR(regs))
return;

rcu_assign_pointer(mtk_soc_wed_ops, &wed_ops);
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From: Lorenzo Bianconi <[email protected]>
Date: Mon, 11 Apr 2022 12:13:25 +0200
Subject: [PATCH] net: ethernet: mtk_eth_soc: use standard property for
cci-control-port

Rely on standard cci-control-port property to identify CCI port
reference.
Update mt7622 dts binding.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
---

--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
@@ -962,7 +962,7 @@
power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>;
mediatek,ethsys = <&ethsys>;
mediatek,sgmiisys = <&sgmiisys>;
- mediatek,cci-control = <&cci_control2>;
+ cci-control-port = <&cci_control2>;
mediatek,wed = <&wed0>, <&wed1>;
mediatek,pcie-mirror = <&pcie_mirror>;
mediatek,hifsys = <&hifsys>;
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3185,7 +3185,7 @@ static int mtk_probe(struct platform_dev
struct regmap *cci;

cci = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
- "mediatek,cci-control");
+ "cci-control-port");
/* enable CPU/bus coherency */
if (!IS_ERR(cci))
regmap_write(cci, 0, 3);
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From: Dan Carpenter <[email protected]>
Date: Tue, 12 Apr 2022 12:24:19 +0300
Subject: [PATCH] net: ethernet: mtk_eth_soc: use after free in
__mtk_ppe_check_skb()

The __mtk_foe_entry_clear() function frees "entry" so we have to use
the _safe() version of hlist_for_each_entry() to prevent a use after
free.

Fixes: 33fc42de3327 ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
---

--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -600,6 +600,7 @@ void __mtk_ppe_check_skb(struct mtk_ppe
struct mtk_foe_entry *hwe = &ppe->foe_table[hash];
struct mtk_flow_entry *entry;
struct mtk_foe_bridge key = {};
+ struct hlist_node *n;
struct ethhdr *eh;
bool found = false;
u8 *tag;
@@ -609,7 +610,7 @@ void __mtk_ppe_check_skb(struct mtk_ppe
if (FIELD_GET(MTK_FOE_IB1_STATE, hwe->ib1) == MTK_FOE_STATE_BIND)
goto out;

- hlist_for_each_entry(entry, head, list) {
+ hlist_for_each_entry_safe(entry, n, head, list) {
if (entry->type == MTK_FLOW_TYPE_L2_SUBFLOW) {
if (unlikely(FIELD_GET(MTK_FOE_IB1_STATE, hwe->ib1) ==
MTK_FOE_STATE_BIND))
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From: Dan Carpenter <[email protected]>
Date: Thu, 21 Apr 2022 18:49:02 +0300
Subject: [PATCH] net: ethernet: mtk_eth_soc: add check for allocation failure

Check if the kzalloc() failed.

Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
---

--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -827,6 +827,8 @@ void mtk_wed_add_hw(struct device_node *
goto unlock;

hw = kzalloc(sizeof(*hw), GFP_KERNEL);
+ if (!hw)
+ goto unlock;
hw->node = np;
hw->regs = regs;
hw->eth = eth;
Loading

0 comments on commit f8c9e68

Please sign in to comment.