From 5ef783c1b26bef0b6cdbf44401ff6fb487e4d2f5 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 4 Mar 2023 17:57:46 +0100 Subject: [PATCH 01/26] kernel: move accepted mtk_eth_soc patches to generic-backport Signed-off-by: Felix Fietkau --- ...eth_soc-account-for-vlan-in-rx-head.patch} | 0 ...eth_soc-increase-tx-ring-side-for-Q.patch} | 0 ...eth_soc-avoid-port_mg-assignment-on.patch} | 8 ++--- ...eth_soc-implement-multi-queue-suppo.patch} | 2 +- ...-dsa-tag_mtk-assign-per-port-queues.patch} | 6 ++-- ...atek-ppe-assign-per-port-queues-for.patch} | 6 ++-- ...eth_soc-compile-out-netsys-v2-code-.patch} | 0 ...rt-for-DSA-rx-offloading-via-metada.patch} | 0 ...eth_soc-fix-VLAN-rx-hardware-accele.patch} | 2 +- ...eth_soc-drop-packets-to-WDMA-if-the.patch} | 4 +-- ...eth_soc-fix-flow_offload-related-re.patch} | 4 +-- ..._eth_soc-Avoid-truncating-allocation.patch | 4 +-- ...ii-ensure-the-SGMII-PHY-is-powered-d.patch | 2 +- ...iatek-sgmii-fix-duplex-configuration.patch | 2 +- ...net-mtk_eth_soc-enable-threaded-NAPI.patch | 6 ++-- ...a-tag_mtk-add-padding-for-tx-packets.patch | 6 ++-- ...iatek-ppe-add-support-for-flow-accou.patch | 32 +++++++++---------- ...eth_soc-drop-generic-vlan-rx-offloa.patch} | 16 +++++----- ...eth_soc-work-around-issue-with-send.patch} | 0 ...net-mtk_eth_soc-set-NETIF_F_ALL_TSO.patch} | 4 +-- 20 files changed, 52 insertions(+), 52 deletions(-) rename target/linux/generic/{pending-5.15/732-01-net-ethernet-mtk_eth_soc-account-for-vlan-in-rx-head.patch => backport-5.15/730-01-v6.3-net-ethernet-mtk_eth_soc-account-for-vlan-in-rx-head.patch} (100%) rename target/linux/generic/{pending-5.15/732-02-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch => backport-5.15/730-02-v6.3-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch} (100%) rename target/linux/generic/{pending-5.15/732-03-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch => backport-5.15/730-03-v6.3-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch} (87%) rename target/linux/generic/{pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch => backport-5.15/730-04-v6.3-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch} (99%) rename target/linux/generic/{pending-5.15/732-05-net-dsa-tag_mtk-assign-per-port-queues.patch => backport-5.15/730-05-v6.3-net-dsa-tag_mtk-assign-per-port-queues.patch} (85%) rename target/linux/generic/{pending-5.15/732-06-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch => backport-5.15/730-06-v6.3-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch} (95%) rename target/linux/generic/{pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch => backport-5.15/730-07-v6.3-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch} (100%) rename target/linux/generic/{pending-5.15/732-08-net-dsa-add-support-for-DSA-rx-offloading-via-metada.patch => backport-5.15/730-08-v6.3-net-dsa-add-support-for-DSA-rx-offloading-via-metada.patch} (100%) rename target/linux/generic/{pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch => backport-5.15/730-09-v6.3-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch} (99%) rename target/linux/generic/{pending-5.15/732-12-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch => backport-5.15/730-10-v6.3-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch} (93%) rename target/linux/generic/{pending-5.15/732-13-net-ethernet-mtk_eth_soc-fix-flow_offload-related-re.patch => backport-5.15/730-11-v6.3-net-ethernet-mtk_eth_soc-fix-flow_offload-related-re.patch} (92%) rename target/linux/generic/pending-5.15/{732-14-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch => 732-00-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch} (92%) rename target/linux/generic/pending-5.15/{732-10-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch => 732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch} (100%) rename target/linux/generic/pending-5.15/{732-11-net-ethernet-mtk_eth_soc-set-NETIF_F_ALL_TSO.patch => 732-02-net-ethernet-mtk_eth_soc-set-NETIF_F_ALL_TSO.patch} (90%) diff --git a/target/linux/generic/pending-5.15/732-01-net-ethernet-mtk_eth_soc-account-for-vlan-in-rx-head.patch b/target/linux/generic/backport-5.15/730-01-v6.3-net-ethernet-mtk_eth_soc-account-for-vlan-in-rx-head.patch similarity index 100% rename from target/linux/generic/pending-5.15/732-01-net-ethernet-mtk_eth_soc-account-for-vlan-in-rx-head.patch rename to target/linux/generic/backport-5.15/730-01-v6.3-net-ethernet-mtk_eth_soc-account-for-vlan-in-rx-head.patch diff --git a/target/linux/generic/pending-5.15/732-02-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch b/target/linux/generic/backport-5.15/730-02-v6.3-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch similarity index 100% rename from target/linux/generic/pending-5.15/732-02-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch rename to target/linux/generic/backport-5.15/730-02-v6.3-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch diff --git a/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch b/target/linux/generic/backport-5.15/730-03-v6.3-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch similarity index 87% rename from target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch rename to target/linux/generic/backport-5.15/730-03-v6.3-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch index 8c425bc8c42..67b389490b2 100644 --- a/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch +++ b/target/linux/generic/backport-5.15/730-03-v6.3-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4431,7 +4431,7 @@ static const struct mtk_soc_data mt7621_ +@@ -4427,7 +4427,7 @@ static const struct mtk_soc_data mt7621_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7621_CLKS_BITMAP, .required_pctl = false, @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau .hash_offset = 2, .foe_entry_size = sizeof(struct mtk_foe_entry) - 16, .txrx = { -@@ -4471,7 +4471,7 @@ static const struct mtk_soc_data mt7623_ +@@ -4466,7 +4466,7 @@ static const struct mtk_soc_data mt7623_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau .txrx = { --- a/drivers/net/ethernet/mediatek/mtk_ppe.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe.c -@@ -215,6 +215,8 @@ int mtk_foe_entry_prepare(struct mtk_eth +@@ -175,6 +175,8 @@ int mtk_foe_entry_prepare(struct mtk_eth val = FIELD_PREP(MTK_FOE_IB2_DEST_PORT_V2, pse_port) | FIELD_PREP(MTK_FOE_IB2_PORT_AG_V2, 0xf); } else { @@ -41,7 +41,7 @@ Signed-off-by: Felix Fietkau val = FIELD_PREP(MTK_FOE_IB1_STATE, MTK_FOE_STATE_BIND) | FIELD_PREP(MTK_FOE_IB1_PACKET_TYPE, type) | FIELD_PREP(MTK_FOE_IB1_UDP, l4proto == IPPROTO_UDP) | -@@ -222,7 +224,7 @@ int mtk_foe_entry_prepare(struct mtk_eth +@@ -182,7 +184,7 @@ int mtk_foe_entry_prepare(struct mtk_eth entry->ib1 = val; val = FIELD_PREP(MTK_FOE_IB2_DEST_PORT, pse_port) | diff --git a/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch b/target/linux/generic/backport-5.15/730-04-v6.3-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch similarity index 99% rename from target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch rename to target/linux/generic/backport-5.15/730-04-v6.3-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch index cfe03781a2a..79f2d0a38ab 100644 --- a/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch +++ b/target/linux/generic/backport-5.15/730-04-v6.3-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch @@ -644,7 +644,7 @@ Signed-off-by: Felix Fietkau } qdma; u32 gdm1_cnt; u32 gdma_to_ppe0; -@@ -1175,6 +1196,7 @@ struct mtk_mac { +@@ -1172,6 +1193,7 @@ struct mtk_mac { __be32 hwlro_ip[MTK_MAX_LRO_IP_CNT]; int hwlro_ip_cnt; unsigned int syscfg0; diff --git a/target/linux/generic/pending-5.15/732-05-net-dsa-tag_mtk-assign-per-port-queues.patch b/target/linux/generic/backport-5.15/730-05-v6.3-net-dsa-tag_mtk-assign-per-port-queues.patch similarity index 85% rename from target/linux/generic/pending-5.15/732-05-net-dsa-tag_mtk-assign-per-port-queues.patch rename to target/linux/generic/backport-5.15/730-05-v6.3-net-dsa-tag_mtk-assign-per-port-queues.patch index e8c9631819e..186df4bdc92 100644 --- a/target/linux/generic/pending-5.15/732-05-net-dsa-tag_mtk-assign-per-port-queues.patch +++ b/target/linux/generic/backport-5.15/730-05-v6.3-net-dsa-tag_mtk-assign-per-port-queues.patch @@ -9,9 +9,9 @@ Signed-off-by: Felix Fietkau --- a/net/dsa/tag_mtk.c +++ b/net/dsa/tag_mtk.c -@@ -32,6 +32,8 @@ static struct sk_buff *mtk_tag_xmit(stru - */ - eth_skb_pad(skb); +@@ -25,6 +25,8 @@ static struct sk_buff *mtk_tag_xmit(stru + u8 xmit_tpid; + u8 *mtk_tag; + skb_set_queue_mapping(skb, dp->index); + diff --git a/target/linux/generic/pending-5.15/732-06-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch b/target/linux/generic/backport-5.15/730-06-v6.3-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch similarity index 95% rename from target/linux/generic/pending-5.15/732-06-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch rename to target/linux/generic/backport-5.15/730-06-v6.3-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch index 05161c34795..8935eb673ae 100644 --- a/target/linux/generic/pending-5.15/732-06-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch +++ b/target/linux/generic/backport-5.15/730-06-v6.3-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_ppe.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe.c -@@ -445,6 +445,24 @@ static inline bool mtk_foe_entry_usable( +@@ -405,6 +405,24 @@ static inline bool mtk_foe_entry_usable( FIELD_GET(MTK_FOE_IB1_STATE, entry->ib1) != MTK_FOE_STATE_BIND; } @@ -37,7 +37,7 @@ Signed-off-by: Felix Fietkau struct mtk_foe_entry *data) --- a/drivers/net/ethernet/mediatek/mtk_ppe.h +++ b/drivers/net/ethernet/mediatek/mtk_ppe.h -@@ -69,7 +69,9 @@ enum { +@@ -68,7 +68,9 @@ enum { #define MTK_FOE_IB2_DSCP GENMASK(31, 24) /* CONFIG_MEDIATEK_NETSYS_V2 */ @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau #define MTK_FOE_IB2_DEST_PORT_V2 GENMASK(12, 9) #define MTK_FOE_IB2_MULTICAST_V2 BIT(13) #define MTK_FOE_IB2_WDMA_WINFO_V2 BIT(19) -@@ -369,6 +371,8 @@ int mtk_foe_entry_set_pppoe(struct mtk_e +@@ -351,6 +353,8 @@ int mtk_foe_entry_set_pppoe(struct mtk_e int sid); int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry, int wdma_idx, int txq, int bss, int wcid); diff --git a/target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch b/target/linux/generic/backport-5.15/730-07-v6.3-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch similarity index 100% rename from target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch rename to target/linux/generic/backport-5.15/730-07-v6.3-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch diff --git a/target/linux/generic/pending-5.15/732-08-net-dsa-add-support-for-DSA-rx-offloading-via-metada.patch b/target/linux/generic/backport-5.15/730-08-v6.3-net-dsa-add-support-for-DSA-rx-offloading-via-metada.patch similarity index 100% rename from target/linux/generic/pending-5.15/732-08-net-dsa-add-support-for-DSA-rx-offloading-via-metada.patch rename to target/linux/generic/backport-5.15/730-08-v6.3-net-dsa-add-support-for-DSA-rx-offloading-via-metada.patch diff --git a/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch b/target/linux/generic/backport-5.15/730-09-v6.3-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch similarity index 99% rename from target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch rename to target/linux/generic/backport-5.15/730-09-v6.3-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch index d9d6f5c3569..a87a8101b76 100644 --- a/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch +++ b/target/linux/generic/backport-5.15/730-09-v6.3-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch @@ -181,7 +181,7 @@ Signed-off-by: Felix Fietkau /* CDMP Ingress Control Register */ #define MTK_CDMP_IG_CTRL 0x400 #define MTK_CDMP_STAG_EN BIT(0) -@@ -1168,6 +1174,8 @@ struct mtk_eth { +@@ -1165,6 +1171,8 @@ struct mtk_eth { int ip_align; diff --git a/target/linux/generic/pending-5.15/732-12-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch b/target/linux/generic/backport-5.15/730-10-v6.3-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch similarity index 93% rename from target/linux/generic/pending-5.15/732-12-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch rename to target/linux/generic/backport-5.15/730-10-v6.3-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch index 6c81d880f96..d6b3c28ccc5 100644 --- a/target/linux/generic/pending-5.15/732-12-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch +++ b/target/linux/generic/backport-5.15/730-10-v6.3-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3745,9 +3745,12 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3711,9 +3711,12 @@ static int mtk_hw_init(struct mtk_eth *e mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -139,6 +139,7 @@ +@@ -140,6 +140,7 @@ #define PSE_FQFC_CFG1 0x100 #define PSE_FQFC_CFG2 0x104 #define PSE_DROP_CFG 0x108 diff --git a/target/linux/generic/pending-5.15/732-13-net-ethernet-mtk_eth_soc-fix-flow_offload-related-re.patch b/target/linux/generic/backport-5.15/730-11-v6.3-net-ethernet-mtk_eth_soc-fix-flow_offload-related-re.patch similarity index 92% rename from target/linux/generic/pending-5.15/732-13-net-ethernet-mtk_eth_soc-fix-flow_offload-related-re.patch rename to target/linux/generic/backport-5.15/730-11-v6.3-net-ethernet-mtk_eth_soc-fix-flow_offload-related-re.patch index 0664e0106fa..54e48df4446 100644 --- a/target/linux/generic/pending-5.15/732-13-net-ethernet-mtk_eth_soc-fix-flow_offload-related-re.patch +++ b/target/linux/generic/backport-5.15/730-11-v6.3-net-ethernet-mtk_eth_soc-fix-flow_offload-related-re.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c -@@ -561,6 +561,7 @@ mtk_eth_setup_tc_block(struct net_device +@@ -554,6 +554,7 @@ mtk_eth_setup_tc_block(struct net_device struct mtk_eth *eth = mac->hw; static LIST_HEAD(block_cb_list); struct flow_block_cb *block_cb; @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau flow_setup_cb_t *cb; if (!eth->soc->offload_version) -@@ -575,16 +576,20 @@ mtk_eth_setup_tc_block(struct net_device +@@ -568,16 +569,20 @@ mtk_eth_setup_tc_block(struct net_device switch (f->command) { case FLOW_BLOCK_BIND: block_cb = flow_block_cb_lookup(f->block, cb, dev); diff --git a/target/linux/generic/backport-5.15/733-v6.2-01-net-ethernet-mtk_eth_soc-Avoid-truncating-allocation.patch b/target/linux/generic/backport-5.15/733-v6.2-01-net-ethernet-mtk_eth_soc-Avoid-truncating-allocation.patch index 2165a824ec4..460c5c23178 100644 --- a/target/linux/generic/backport-5.15/733-v6.2-01-net-ethernet-mtk_eth_soc-Avoid-truncating-allocation.patch +++ b/target/linux/generic/backport-5.15/733-v6.2-01-net-ethernet-mtk_eth_soc-Avoid-truncating-allocation.patch @@ -38,7 +38,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/mediatek/mtk_ppe.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe.c -@@ -601,8 +601,7 @@ mtk_foe_entry_commit_subflow(struct mtk_ +@@ -621,8 +621,7 @@ mtk_foe_entry_commit_subflow(struct mtk_ u32 ib1_mask = mtk_get_ib1_pkt_type_mask(ppe->eth) | MTK_FOE_IB1_UDP; int type; @@ -50,7 +50,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/mediatek/mtk_ppe.h +++ b/drivers/net/ethernet/mediatek/mtk_ppe.h -@@ -277,7 +277,6 @@ struct mtk_flow_entry { +@@ -279,7 +279,6 @@ struct mtk_flow_entry { struct { struct mtk_flow_entry *base_flow; struct hlist_node list; diff --git a/target/linux/generic/backport-5.15/733-v6.2-02-net-mediatek-sgmii-ensure-the-SGMII-PHY-is-powered-d.patch b/target/linux/generic/backport-5.15/733-v6.2-02-net-mediatek-sgmii-ensure-the-SGMII-PHY-is-powered-d.patch index b79afccd4c8..49ec12293ad 100644 --- a/target/linux/generic/backport-5.15/733-v6.2-02-net-mediatek-sgmii-ensure-the-SGMII-PHY-is-powered-d.patch +++ b/target/linux/generic/backport-5.15/733-v6.2-02-net-mediatek-sgmii-ensure-the-SGMII-PHY-is-powered-d.patch @@ -34,7 +34,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -1027,11 +1027,13 @@ struct mtk_soc_data { +@@ -1062,11 +1062,13 @@ struct mtk_soc_data { * @regmap: The register map pointing at the range used to setup * SGMII modes * @ana_rgc3: The offset refers to register ANA_RGC3 related to regmap diff --git a/target/linux/generic/backport-5.15/733-v6.2-03-net-mediatek-sgmii-fix-duplex-configuration.patch b/target/linux/generic/backport-5.15/733-v6.2-03-net-mediatek-sgmii-fix-duplex-configuration.patch index 007cbb51380..9fac86da72e 100644 --- a/target/linux/generic/backport-5.15/733-v6.2-03-net-mediatek-sgmii-fix-duplex-configuration.patch +++ b/target/linux/generic/backport-5.15/733-v6.2-03-net-mediatek-sgmii-fix-duplex-configuration.patch @@ -24,7 +24,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -496,7 +496,7 @@ +@@ -523,7 +523,7 @@ #define SGMII_SPEED_10 FIELD_PREP(SGMII_SPEED_MASK, 0) #define SGMII_SPEED_100 FIELD_PREP(SGMII_SPEED_MASK, 1) #define SGMII_SPEED_1000 FIELD_PREP(SGMII_SPEED_MASK, 2) diff --git a/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch b/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch index b046c3eb5f3..8718777af38 100644 --- a/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch +++ b/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2823,8 +2823,8 @@ static irqreturn_t mtk_handle_irq_rx(int +@@ -2967,8 +2967,8 @@ static irqreturn_t mtk_handle_irq_rx(int eth->rx_events++; if (likely(napi_schedule_prep(ð->rx_napi))) { @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau } return IRQ_HANDLED; -@@ -2836,8 +2836,8 @@ static irqreturn_t mtk_handle_irq_tx(int +@@ -2980,8 +2980,8 @@ static irqreturn_t mtk_handle_irq_tx(int eth->tx_events++; if (likely(napi_schedule_prep(ð->tx_napi))) { @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau } return IRQ_HANDLED; -@@ -4350,6 +4350,8 @@ static int mtk_probe(struct platform_dev +@@ -4612,6 +4612,8 @@ static int mtk_probe(struct platform_dev * for NAPI to work */ init_dummy_netdev(ð->dummy_dev); diff --git a/target/linux/generic/pending-5.15/705-net-dsa-tag_mtk-add-padding-for-tx-packets.patch b/target/linux/generic/pending-5.15/705-net-dsa-tag_mtk-add-padding-for-tx-packets.patch index 4f3af6c6b0e..d444b2027cb 100644 --- a/target/linux/generic/pending-5.15/705-net-dsa-tag_mtk-add-padding-for-tx-packets.patch +++ b/target/linux/generic/pending-5.15/705-net-dsa-tag_mtk-add-padding-for-tx-packets.patch @@ -12,9 +12,9 @@ Signed-off-by: Felix Fietkau --- a/net/dsa/tag_mtk.c +++ b/net/dsa/tag_mtk.c -@@ -25,6 +25,13 @@ static struct sk_buff *mtk_tag_xmit(stru - u8 xmit_tpid; - u8 *mtk_tag; +@@ -27,6 +27,13 @@ static struct sk_buff *mtk_tag_xmit(stru + + skb_set_queue_mapping(skb, dp->index); + /* The Ethernet switch we are interfaced with needs packets to be at + * least 64 bytes (including FCS) otherwise their padding might be diff --git a/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch b/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch index c7b5a989c2e..36e3f01e54b 100644 --- a/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch +++ b/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch @@ -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 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4320,7 +4320,9 @@ static int mtk_probe(struct platform_dev +@@ -4582,7 +4582,9 @@ static int mtk_probe(struct platform_dev u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400; 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]) { err = -ENOMEM; goto err_free_dev; -@@ -4445,6 +4447,7 @@ static const struct mtk_soc_data mt7622_ +@@ -4707,6 +4709,7 @@ static const struct mtk_soc_data mt7622_ .required_pctl = false, .offload_version = 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, .txrx = { .txd_size = sizeof(struct mtk_tx_dma), -@@ -4482,6 +4485,7 @@ static const struct mtk_soc_data mt7629_ +@@ -4744,6 +4747,7 @@ static const struct mtk_soc_data mt7629_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7629_CLKS_BITMAP, .required_pctl = false, @@ -80,7 +80,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4502,6 +4506,7 @@ static const struct mtk_soc_data mt7986_ +@@ -4764,6 +4768,7 @@ static const struct mtk_soc_data mt7986_ .offload_version = 2, .hash_offset = 4, .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), --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -1007,6 +1007,7 @@ struct mtk_soc_data { +@@ -1042,6 +1042,7 @@ struct mtk_soc_data { u8 hash_offset; u16 foe_entry_size; netdev_features_t hw_features; @@ -147,7 +147,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov static void mtk_ppe_cache_clear(struct mtk_ppe *ppe) { ppe_set(ppe, MTK_PPE_CACHE_CTL, MTK_PPE_CACHE_CTL_CLEAR); -@@ -444,6 +484,13 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp +@@ -464,6 +504,13 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp hwe->ib1 &= ~MTK_FOE_IB1_STATE; hwe->ib1 |= FIELD_PREP(MTK_FOE_IB1_STATE, MTK_FOE_STATE_INVALID); dma_wmb(); @@ -161,7 +161,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov } entry->hash = 0xffff; -@@ -551,6 +598,9 @@ __mtk_foe_entry_commit(struct mtk_ppe *p +@@ -571,6 +618,9 @@ __mtk_foe_entry_commit(struct mtk_ppe *p wmb(); hwe->ib1 = entry->ib1; @@ -171,7 +171,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov dma_wmb(); mtk_ppe_cache_clear(ppe); -@@ -742,14 +792,42 @@ int mtk_ppe_prepare_reset(struct mtk_ppe +@@ -762,14 +812,42 @@ int mtk_ppe_prepare_reset(struct mtk_ppe return mtk_ppe_wait_busy(ppe); } @@ -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); if (!ppe) -@@ -764,6 +842,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_ +@@ -784,6 +862,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_ ppe->eth = eth; ppe->dev = dev; 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, MTK_PPE_ENTRIES * soc->foe_entry_size, -@@ -779,6 +858,25 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_ +@@ -799,6 +878,25 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_ if (!ppe->foe_flow) 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); return ppe; -@@ -893,6 +991,16 @@ void mtk_ppe_start(struct mtk_ppe *ppe) +@@ -913,6 +1011,16 @@ void mtk_ppe_start(struct mtk_ppe *ppe) ppe_w32(ppe, MTK_PPE_DEFAULT_CPU_PORT1, 0xcb777); ppe_w32(ppe, MTK_PPE_SBW_CTRL, 0x7f); } @@ -276,7 +276,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov #define MTK_FOE_IB2_WDMA_DEVIDX BIT(16) #define MTK_FOE_IB2_WDMA_WINFO BIT(17) -@@ -283,16 +284,34 @@ struct mtk_flow_entry { +@@ -285,16 +286,34 @@ struct mtk_flow_entry { unsigned long cookie; }; @@ -311,7 +311,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov u16 foe_check_time[MTK_PPE_ENTRIES]; struct hlist_head *foe_flow; -@@ -302,7 +321,7 @@ struct mtk_ppe { +@@ -304,7 +323,7 @@ struct mtk_ppe { }; struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, @@ -320,7 +320,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov 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); -@@ -354,5 +373,7 @@ int mtk_foe_entry_commit(struct mtk_ppe +@@ -358,5 +377,7 @@ int mtk_foe_entry_commit(struct mtk_ppe 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_ppe_debugfs_init(struct mtk_ppe *ppe, int index); @@ -363,7 +363,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov return 0; --- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c -@@ -491,6 +491,7 @@ static int +@@ -497,6 +497,7 @@ static int mtk_flow_offload_stats(struct mtk_eth *eth, struct flow_cls_offload *f) { struct mtk_flow_entry *entry; @@ -371,7 +371,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov u32 idle; entry = rhashtable_lookup(ð->flow_table, &f->cookie, -@@ -501,6 +502,12 @@ mtk_flow_offload_stats(struct mtk_eth *e +@@ -507,6 +508,12 @@ mtk_flow_offload_stats(struct mtk_eth *e idle = mtk_foe_entry_idle_time(eth->ppe[entry->ppe_index], entry); f->stats.lastused = jiffies - idle * HZ; diff --git a/target/linux/generic/pending-5.15/732-14-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch b/target/linux/generic/pending-5.15/732-00-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch similarity index 92% rename from target/linux/generic/pending-5.15/732-14-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch rename to target/linux/generic/pending-5.15/732-00-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch index 128501f38c7..9fc2bc4bef4 100644 --- a/target/linux/generic/pending-5.15/732-14-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch +++ b/target/linux/generic/pending-5.15/732-00-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2001,29 +2001,16 @@ static int mtk_poll_rx(struct napi_struc +@@ -1967,29 +1967,16 @@ static int mtk_poll_rx(struct napi_struc if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED) mtk_ppe_check_skb(eth->ppe[0], skb, hash); @@ -50,7 +50,7 @@ Signed-off-by: Felix Fietkau } skb_record_rx_queue(skb, 0); -@@ -2840,29 +2827,11 @@ static netdev_features_t mtk_fix_feature +@@ -2806,29 +2793,11 @@ static netdev_features_t mtk_fix_feature static int mtk_set_features(struct net_device *dev, netdev_features_t features) { @@ -80,7 +80,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -3176,30 +3145,6 @@ static int mtk_open(struct net_device *d +@@ -3142,30 +3111,6 @@ static int mtk_open(struct net_device *d struct mtk_eth *eth = mac->hw; int i, err; @@ -111,7 +111,7 @@ Signed-off-by: Felix Fietkau err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0); if (err) { netdev_err(dev, "%s: could not attach PHY: %d\n", __func__, -@@ -3240,6 +3185,35 @@ static int mtk_open(struct net_device *d +@@ -3206,6 +3151,35 @@ static int mtk_open(struct net_device *d phylink_start(mac->phylink); netif_tx_start_all_queues(dev); @@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -3724,10 +3698,9 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3690,10 +3664,9 @@ static int mtk_hw_init(struct mtk_eth *e if (!MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { val = mtk_r32(eth, 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 /* set interrupt delays based on current Net DIM sample */ mtk_dim_rx(ð->rx_dim.work); -@@ -4365,7 +4338,7 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4331,7 +4304,7 @@ static int mtk_add_mac(struct mtk_eth *e eth->netdev[id]->hw_features |= NETIF_F_LRO; eth->netdev[id]->vlan_features = eth->soc->hw_features & @@ -176,6 +176,6 @@ Signed-off-by: Felix Fietkau NETIF_F_RXCSUM | \ NETIF_F_HW_VLAN_CTAG_TX | \ - NETIF_F_HW_VLAN_CTAG_RX | \ - NETIF_F_SG | NETIF_F_ALL_TSO | \ + NETIF_F_SG | NETIF_F_TSO | \ + NETIF_F_TSO6 | \ NETIF_F_IPV6_CSUM |\ - NETIF_F_HW_TC) diff --git a/target/linux/generic/pending-5.15/732-10-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch b/target/linux/generic/pending-5.15/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch similarity index 100% rename from target/linux/generic/pending-5.15/732-10-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch rename to target/linux/generic/pending-5.15/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch diff --git a/target/linux/generic/pending-5.15/732-11-net-ethernet-mtk_eth_soc-set-NETIF_F_ALL_TSO.patch b/target/linux/generic/pending-5.15/732-02-net-ethernet-mtk_eth_soc-set-NETIF_F_ALL_TSO.patch similarity index 90% rename from target/linux/generic/pending-5.15/732-11-net-ethernet-mtk_eth_soc-set-NETIF_F_ALL_TSO.patch rename to target/linux/generic/pending-5.15/732-02-net-ethernet-mtk_eth_soc-set-NETIF_F_ALL_TSO.patch index f89ad6adb1c..3c6359ee419 100644 --- a/target/linux/generic/pending-5.15/732-11-net-ethernet-mtk_eth_soc-set-NETIF_F_ALL_TSO.patch +++ b/target/linux/generic/pending-5.15/732-02-net-ethernet-mtk_eth_soc-set-NETIF_F_ALL_TSO.patch @@ -9,10 +9,10 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -49,8 +49,7 @@ +@@ -48,8 +48,7 @@ + #define MTK_HW_FEATURES (NETIF_F_IP_CSUM | \ NETIF_F_RXCSUM | \ NETIF_F_HW_VLAN_CTAG_TX | \ - NETIF_F_HW_VLAN_CTAG_RX | \ - NETIF_F_SG | NETIF_F_TSO | \ - NETIF_F_TSO6 | \ + NETIF_F_SG | NETIF_F_ALL_TSO | \ From daaf708b8c433cfedc7860eab30a9e585490b3c6 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 4 Mar 2023 19:11:37 +0100 Subject: [PATCH 02/26] kernel: backport upstream mtk_eth_soc fixes Signed-off-by: Felix Fietkau --- ..._eth_soc-disable-hardware-DSA-untagg.patch | 42 ++++++ ..._eth_soc-enable-special-tag-when-any.patch | 54 ++++++++ ..._eth_soc-fix-DSA-TX-tag-hwaccel-for-.patch | 129 ++++++++++++++++++ ..._wed-No-need-to-clear-memory-after-a.patch | 26 ++++ ...net-mtk_eth_soc-enable-threaded-NAPI.patch | 6 +- ...iatek-ppe-add-support-for-flow-accou.patch | 8 +- ..._eth_soc-drop-generic-vlan-rx-offloa.patch | 56 +++++--- ..._eth_soc-ppe-fix-L2-offloading-with-.patch | 22 --- 8 files changed, 296 insertions(+), 47 deletions(-) create mode 100644 target/linux/generic/backport-5.15/730-12-v6.3-net-ethernet-mtk_eth_soc-disable-hardware-DSA-untagg.patch create mode 100644 target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch create mode 100644 target/linux/generic/backport-5.15/730-14-v6.3-net-ethernet-mtk_eth_soc-fix-DSA-TX-tag-hwaccel-for-.patch create mode 100644 target/linux/generic/backport-5.15/730-15-v6.3-net-ethernet-mtk_wed-No-need-to-clear-memory-after-a.patch diff --git a/target/linux/generic/backport-5.15/730-12-v6.3-net-ethernet-mtk_eth_soc-disable-hardware-DSA-untagg.patch b/target/linux/generic/backport-5.15/730-12-v6.3-net-ethernet-mtk_eth_soc-disable-hardware-DSA-untagg.patch new file mode 100644 index 00000000000..caffe890038 --- /dev/null +++ b/target/linux/generic/backport-5.15/730-12-v6.3-net-ethernet-mtk_eth_soc-disable-hardware-DSA-untagg.patch @@ -0,0 +1,42 @@ +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Sat, 28 Jan 2023 12:42:32 +0300 +Subject: [PATCH] net: ethernet: mtk_eth_soc: disable hardware DSA untagging + for second MAC +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +According to my tests on MT7621AT and MT7623NI SoCs, hardware DSA untagging +won't work on the second MAC. Therefore, disable this feature when the +second MAC of the MT7621 and MT7623 SoCs is being used. + +Fixes: 2d7605a72906 ("net: ethernet: mtk_eth_soc: enable hardware DSA untagging") +Link: https://lore.kernel.org/netdev/6249fc14-b38a-c770-36b4-5af6d41c21d3@arinc9.com/ +Tested-by: Arınç ÜNAL +Signed-off-by: Arınç ÜNAL +Link: https://lore.kernel.org/r/20230128094232.2451947-1-arinc.unal@arinc9.com +Signed-off-by: Jakub Kicinski +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -3142,7 +3142,8 @@ static int mtk_open(struct net_device *d + struct mtk_eth *eth = mac->hw; + int i, err; + +- if (mtk_uses_dsa(dev) && !eth->prog) { ++ if ((mtk_uses_dsa(dev) && !eth->prog) && ++ !(mac->id == 1 && MTK_HAS_CAPS(eth->soc->caps, MTK_GMAC1_TRGMII))) { + for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) { + struct metadata_dst *md_dst = eth->dsa_meta[i]; + +@@ -3159,7 +3160,8 @@ static int mtk_open(struct net_device *d + } + } else { + /* Hardware special tag parsing needs to be disabled if at least +- * one MAC does not use DSA. ++ * one MAC does not use DSA, or the second MAC of the MT7621 and ++ * MT7623 SoCs is being used. + */ + u32 val = mtk_r32(eth, MTK_CDMP_IG_CTRL); + val &= ~MTK_CDMP_STAG_EN; diff --git a/target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch b/target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch new file mode 100644 index 00000000000..14abdcd8763 --- /dev/null +++ b/target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch @@ -0,0 +1,54 @@ +From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= +Date: Sun, 5 Feb 2023 20:53:31 +0300 +Subject: [PATCH] net: ethernet: mtk_eth_soc: enable special tag when any MAC + uses DSA +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The special tag is only enabled when the first MAC uses DSA. However, it +must be enabled when any MAC uses DSA. Change the check accordingly. + +This fixes hardware DSA untagging not working on the second MAC of the +MT7621 and MT7623 SoCs, and likely other SoCs too. Therefore, remove the +check that disables hardware DSA untagging for the second MAC of the MT7621 +and MT7623 SoCs. + +Fixes: a1f47752fd62 ("net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC") +Co-developed-by: Richard van Schagen +Signed-off-by: Richard van Schagen +Signed-off-by: Arınç ÜNAL +Signed-off-by: David S. Miller +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -3077,7 +3077,7 @@ static void mtk_gdm_config(struct mtk_et + + val |= config; + +- if (!i && eth->netdev[0] && netdev_uses_dsa(eth->netdev[0])) ++ if (eth->netdev[i] && netdev_uses_dsa(eth->netdev[i])) + val |= MTK_GDMA_SPECIAL_TAG; + + mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i)); +@@ -3142,8 +3142,7 @@ static int mtk_open(struct net_device *d + struct mtk_eth *eth = mac->hw; + int i, err; + +- if ((mtk_uses_dsa(dev) && !eth->prog) && +- !(mac->id == 1 && MTK_HAS_CAPS(eth->soc->caps, MTK_GMAC1_TRGMII))) { ++ if (mtk_uses_dsa(dev) && !eth->prog) { + for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) { + struct metadata_dst *md_dst = eth->dsa_meta[i]; + +@@ -3160,8 +3159,7 @@ static int mtk_open(struct net_device *d + } + } else { + /* Hardware special tag parsing needs to be disabled if at least +- * one MAC does not use DSA, or the second MAC of the MT7621 and +- * MT7623 SoCs is being used. ++ * one MAC does not use DSA. + */ + u32 val = mtk_r32(eth, MTK_CDMP_IG_CTRL); + val &= ~MTK_CDMP_STAG_EN; diff --git a/target/linux/generic/backport-5.15/730-14-v6.3-net-ethernet-mtk_eth_soc-fix-DSA-TX-tag-hwaccel-for-.patch b/target/linux/generic/backport-5.15/730-14-v6.3-net-ethernet-mtk_eth_soc-fix-DSA-TX-tag-hwaccel-for-.patch new file mode 100644 index 00000000000..e75459696b6 --- /dev/null +++ b/target/linux/generic/backport-5.15/730-14-v6.3-net-ethernet-mtk_eth_soc-fix-DSA-TX-tag-hwaccel-for-.patch @@ -0,0 +1,129 @@ +From: Vladimir Oltean +Date: Tue, 7 Feb 2023 12:30:27 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: fix DSA TX tag hwaccel for switch + port 0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Arınç reports that on his MT7621AT Unielec U7621-06 board and MT7623NI +Bananapi BPI-R2, packets received by the CPU over mt7530 switch port 0 +(of which this driver acts as the DSA master) are not processed +correctly by software. More precisely, they arrive without a DSA tag +(in packet or in the hwaccel area - skb_metadata_dst()), so DSA cannot +demux them towards the switch's interface for port 0. Traffic from other +ports receives a skb_metadata_dst() with the correct port and is demuxed +properly. + +Looking at mtk_poll_rx(), it becomes apparent that this driver uses the +skb vlan hwaccel area: + + union { + u32 vlan_all; + struct { + __be16 vlan_proto; + __u16 vlan_tci; + }; + }; + +as a temporary storage for the VLAN hwaccel tag, or the DSA hwaccel tag. +If this is a DSA master it's a DSA hwaccel tag, and finally clears up +the skb VLAN hwaccel header. + +I'm guessing that the problem is the (mis)use of API. +skb_vlan_tag_present() looks like this: + + #define skb_vlan_tag_present(__skb) (!!(__skb)->vlan_all) + +So if both vlan_proto and vlan_tci are zeroes, skb_vlan_tag_present() +returns precisely false. I don't know for sure what is the format of the +DSA hwaccel tag, but I surely know that lowermost 3 bits of vlan_proto +are 0 when receiving from port 0: + + unsigned int port = vlan_proto & GENMASK(2, 0); + +If the RX descriptor has no other bits set to non-zero values in +RX_DMA_VTAG, then the call to __vlan_hwaccel_put_tag() will not, in +fact, make the subsequent skb_vlan_tag_present() return true, because +it's implemented like this: + +static inline void __vlan_hwaccel_put_tag(struct sk_buff *skb, + __be16 vlan_proto, u16 vlan_tci) +{ + skb->vlan_proto = vlan_proto; + skb->vlan_tci = vlan_tci; +} + +What we need to do to fix this problem (assuming this is the problem) is +to stop using skb->vlan_all as temporary storage for driver affairs, and +just create some local variables that serve the same purpose, but +hopefully better. Instead of calling skb_vlan_tag_present(), let's look +at a boolean has_hwaccel_tag which we set to true when the RX DMA +descriptors have something. Disambiguate based on netdev_uses_dsa() +whether this is a VLAN or DSA hwaccel tag, and only call +__vlan_hwaccel_put_tag() if we're certain it's a VLAN tag. + +Arınç confirms that the treatment works, so this validates the +assumption. + +Link: https://lore.kernel.org/netdev/704f3a72-fc9e-714a-db54-272e17612637@arinc9.com/ +Fixes: 2d7605a72906 ("net: ethernet: mtk_eth_soc: enable hardware DSA untagging") +Reported-by: Arınç ÜNAL +Tested-by: Arınç ÜNAL +Signed-off-by: Vladimir Oltean +Reviewed-by: Felix Fietkau +Signed-off-by: David S. Miller +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -1829,7 +1829,9 @@ static int mtk_poll_rx(struct napi_struc + + while (done < budget) { + unsigned int pktlen, *rxdcsum; ++ bool has_hwaccel_tag = false; + struct net_device *netdev; ++ u16 vlan_proto, vlan_tci; + dma_addr_t dma_addr; + u32 hash, reason; + int mac = 0; +@@ -1969,27 +1971,29 @@ static int mtk_poll_rx(struct napi_struc + + if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) { + if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { +- if (trxd.rxd3 & RX_DMA_VTAG_V2) +- __vlan_hwaccel_put_tag(skb, +- htons(RX_DMA_VPID(trxd.rxd4)), +- RX_DMA_VID(trxd.rxd4)); ++ if (trxd.rxd3 & RX_DMA_VTAG_V2) { ++ vlan_proto = RX_DMA_VPID(trxd.rxd4); ++ vlan_tci = RX_DMA_VID(trxd.rxd4); ++ has_hwaccel_tag = true; ++ } + } else if (trxd.rxd2 & RX_DMA_VTAG) { +- __vlan_hwaccel_put_tag(skb, htons(RX_DMA_VPID(trxd.rxd3)), +- RX_DMA_VID(trxd.rxd3)); ++ vlan_proto = RX_DMA_VPID(trxd.rxd3); ++ vlan_tci = RX_DMA_VID(trxd.rxd3); ++ has_hwaccel_tag = true; + } + } + + /* When using VLAN untagging in combination with DSA, the + * hardware treats the MTK special tag as a VLAN and untags it. + */ +- if (skb_vlan_tag_present(skb) && netdev_uses_dsa(netdev)) { +- unsigned int port = ntohs(skb->vlan_proto) & GENMASK(2, 0); ++ if (has_hwaccel_tag && netdev_uses_dsa(netdev)) { ++ unsigned int port = vlan_proto & GENMASK(2, 0); + + if (port < ARRAY_SIZE(eth->dsa_meta) && + eth->dsa_meta[port]) + skb_dst_set_noref(skb, ð->dsa_meta[port]->dst); +- +- __vlan_hwaccel_clear_tag(skb); ++ } else if (has_hwaccel_tag) { ++ __vlan_hwaccel_put_tag(skb, htons(vlan_proto), vlan_tci); + } + + skb_record_rx_queue(skb, 0); diff --git a/target/linux/generic/backport-5.15/730-15-v6.3-net-ethernet-mtk_wed-No-need-to-clear-memory-after-a.patch b/target/linux/generic/backport-5.15/730-15-v6.3-net-ethernet-mtk_wed-No-need-to-clear-memory-after-a.patch new file mode 100644 index 00000000000..74a77ddaca2 --- /dev/null +++ b/target/linux/generic/backport-5.15/730-15-v6.3-net-ethernet-mtk_wed-No-need-to-clear-memory-after-a.patch @@ -0,0 +1,26 @@ +From: Christophe JAILLET +Date: Sun, 12 Feb 2023 07:51:51 +0100 +Subject: [PATCH] net: ethernet: mtk_wed: No need to clear memory after a + dma_alloc_coherent() call + +dma_alloc_coherent() already clears the allocated memory, there is no need +to explicitly call memset(). + +Moreover, it is likely that the size in the memset() is incorrect and +should be "size * sizeof(*ring->desc)". + +Signed-off-by: Christophe JAILLET +Link: https://lore.kernel.org/r/d5acce7dd108887832c9719f62c7201b4c83b3fb.1676184599.git.christophe.jaillet@wanadoo.fr +Signed-off-by: Jakub Kicinski +--- + +--- a/drivers/net/ethernet/mediatek/mtk_wed.c ++++ b/drivers/net/ethernet/mediatek/mtk_wed.c +@@ -786,7 +786,6 @@ mtk_wed_rro_ring_alloc(struct mtk_wed_de + + ring->desc_size = sizeof(*ring->desc); + ring->size = size; +- memset(ring->desc, 0, size); + + return 0; + } diff --git a/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch b/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch index 8718777af38..99cfa04db0f 100644 --- a/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch +++ b/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2967,8 +2967,8 @@ static irqreturn_t mtk_handle_irq_rx(int +@@ -2971,8 +2971,8 @@ static irqreturn_t mtk_handle_irq_rx(int eth->rx_events++; if (likely(napi_schedule_prep(ð->rx_napi))) { @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau } return IRQ_HANDLED; -@@ -2980,8 +2980,8 @@ static irqreturn_t mtk_handle_irq_tx(int +@@ -2984,8 +2984,8 @@ static irqreturn_t mtk_handle_irq_tx(int eth->tx_events++; if (likely(napi_schedule_prep(ð->tx_napi))) { @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau } return IRQ_HANDLED; -@@ -4612,6 +4612,8 @@ static int mtk_probe(struct platform_dev +@@ -4616,6 +4616,8 @@ static int mtk_probe(struct platform_dev * for NAPI to work */ init_dummy_netdev(ð->dummy_dev); diff --git a/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch b/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch index 36e3f01e54b..9c169fe357c 100644 --- a/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch +++ b/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch @@ -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 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4582,7 +4582,9 @@ static int mtk_probe(struct platform_dev +@@ -4586,7 +4586,9 @@ static int mtk_probe(struct platform_dev u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400; 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]) { err = -ENOMEM; goto err_free_dev; -@@ -4707,6 +4709,7 @@ static const struct mtk_soc_data mt7622_ +@@ -4711,6 +4713,7 @@ static const struct mtk_soc_data mt7622_ .required_pctl = false, .offload_version = 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, .txrx = { .txd_size = sizeof(struct mtk_tx_dma), -@@ -4744,6 +4747,7 @@ static const struct mtk_soc_data mt7629_ +@@ -4748,6 +4751,7 @@ static const struct mtk_soc_data mt7629_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7629_CLKS_BITMAP, .required_pctl = false, @@ -80,7 +80,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4764,6 +4768,7 @@ static const struct mtk_soc_data mt7986_ +@@ -4768,6 +4772,7 @@ static const struct mtk_soc_data mt7986_ .offload_version = 2, .hash_offset = 4, .foe_entry_size = sizeof(struct mtk_foe_entry), diff --git a/target/linux/generic/pending-5.15/732-00-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch b/target/linux/generic/pending-5.15/732-00-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch index 9fc2bc4bef4..cb20b97c285 100644 --- a/target/linux/generic/pending-5.15/732-00-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch +++ b/target/linux/generic/pending-5.15/732-00-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch @@ -17,27 +17,42 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1967,29 +1967,16 @@ static int mtk_poll_rx(struct napi_struc - if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED) - mtk_ppe_check_skb(eth->ppe[0], skb, hash); +@@ -1829,9 +1829,7 @@ static int mtk_poll_rx(struct napi_struc + while (done < budget) { + unsigned int pktlen, *rxdcsum; +- bool has_hwaccel_tag = false; + struct net_device *netdev; +- u16 vlan_proto, vlan_tci; + dma_addr_t dma_addr; + u32 hash, reason; + int mac = 0; +@@ -1966,36 +1964,21 @@ static int mtk_poll_rx(struct napi_struc + skb_checksum_none_assert(skb); + skb->protocol = eth_type_trans(skb, netdev); + +- if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED) +- mtk_ppe_check_skb(eth->ppe[0], skb, hash); +- - if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) { - if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { -- if (trxd.rxd3 & RX_DMA_VTAG_V2) -- __vlan_hwaccel_put_tag(skb, -- htons(RX_DMA_VPID(trxd.rxd4)), -- RX_DMA_VID(trxd.rxd4)); +- if (trxd.rxd3 & RX_DMA_VTAG_V2) { +- vlan_proto = RX_DMA_VPID(trxd.rxd4); +- vlan_tci = RX_DMA_VID(trxd.rxd4); +- has_hwaccel_tag = true; +- } - } else if (trxd.rxd2 & RX_DMA_VTAG) { -- __vlan_hwaccel_put_tag(skb, htons(RX_DMA_VPID(trxd.rxd3)), -- RX_DMA_VID(trxd.rxd3)); +- vlan_proto = RX_DMA_VPID(trxd.rxd3); +- vlan_tci = RX_DMA_VID(trxd.rxd3); +- has_hwaccel_tag = true; - } - } - /* When using VLAN untagging in combination with DSA, the * hardware treats the MTK special tag as a VLAN and untags it. */ -- if (skb_vlan_tag_present(skb) && netdev_uses_dsa(netdev)) { -- unsigned int port = ntohs(skb->vlan_proto) & GENMASK(2, 0); +- if (has_hwaccel_tag && netdev_uses_dsa(netdev)) { +- unsigned int port = vlan_proto & GENMASK(2, 0); + if (!MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2) && + (trxd.rxd2 & RX_DMA_VTAG) && netdev_uses_dsa(netdev)) { + unsigned int port = RX_DMA_VPID(trxd.rxd3) & GENMASK(2, 0); @@ -45,12 +60,17 @@ Signed-off-by: Felix Fietkau if (port < ARRAY_SIZE(eth->dsa_meta) && eth->dsa_meta[port]) skb_dst_set_noref(skb, ð->dsa_meta[port]->dst); -- -- __vlan_hwaccel_clear_tag(skb); +- } else if (has_hwaccel_tag) { +- __vlan_hwaccel_put_tag(skb, htons(vlan_proto), vlan_tci); } ++ if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED) ++ mtk_ppe_check_skb(eth->ppe[0], skb, hash); ++ skb_record_rx_queue(skb, 0); -@@ -2806,29 +2793,11 @@ static netdev_features_t mtk_fix_feature + napi_gro_receive(napi, skb); + +@@ -2810,29 +2793,11 @@ static netdev_features_t mtk_fix_feature static int mtk_set_features(struct net_device *dev, netdev_features_t features) { @@ -80,7 +100,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -3142,30 +3111,6 @@ static int mtk_open(struct net_device *d +@@ -3146,30 +3111,6 @@ static int mtk_open(struct net_device *d struct mtk_eth *eth = mac->hw; int i, err; @@ -111,7 +131,7 @@ Signed-off-by: Felix Fietkau err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0); if (err) { netdev_err(dev, "%s: could not attach PHY: %d\n", __func__, -@@ -3206,6 +3151,35 @@ static int mtk_open(struct net_device *d +@@ -3210,6 +3151,35 @@ static int mtk_open(struct net_device *d phylink_start(mac->phylink); netif_tx_start_all_queues(dev); @@ -147,7 +167,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -3690,10 +3664,9 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3694,10 +3664,9 @@ static int mtk_hw_init(struct mtk_eth *e if (!MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { val = mtk_r32(eth, MTK_CDMP_IG_CTRL); mtk_w32(eth, val | MTK_CDMP_STAG_EN, MTK_CDMP_IG_CTRL); @@ -160,7 +180,7 @@ Signed-off-by: Felix Fietkau /* set interrupt delays based on current Net DIM sample */ mtk_dim_rx(ð->rx_dim.work); -@@ -4331,7 +4304,7 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4335,7 +4304,7 @@ static int mtk_add_mac(struct mtk_eth *e eth->netdev[id]->hw_features |= NETIF_F_LRO; eth->netdev[id]->vlan_features = eth->soc->hw_features & diff --git a/target/linux/generic/pending-5.15/734-net-ethernet-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch b/target/linux/generic/pending-5.15/734-net-ethernet-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch index 94bb6a6a8f4..3fdee298d94 100644 --- a/target/linux/generic/pending-5.15/734-net-ethernet-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch +++ b/target/linux/generic/pending-5.15/734-net-ethernet-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch @@ -10,28 +10,6 @@ Fixes: 2d7605a72906 ("net: ethernet: mtk_eth_soc: enable hardware DSA untagging" Signed-off-by: Felix Fietkau --- ---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c -+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1998,9 +1998,6 @@ static int mtk_poll_rx(struct napi_struc - skb_checksum_none_assert(skb); - skb->protocol = eth_type_trans(skb, netdev); - -- if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED) -- mtk_ppe_check_skb(eth->ppe[0], skb, hash); -- - /* When using VLAN untagging in combination with DSA, the - * hardware treats the MTK special tag as a VLAN and untags it. - */ -@@ -2013,6 +2010,9 @@ static int mtk_poll_rx(struct napi_struc - skb_dst_set_noref(skb, ð->dsa_meta[port]->dst); - } - -+ if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED) -+ mtk_ppe_check_skb(eth->ppe[0], skb, hash); -+ - skb_record_rx_queue(skb, 0); - napi_gro_receive(napi, skb); - --- a/drivers/net/ethernet/mediatek/mtk_ppe.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe.c @@ -8,6 +8,7 @@ From 9f6d25551e71b4fdb9c198606eb2389f85ae2edd Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 5 Mar 2023 09:58:40 +0100 Subject: [PATCH 03/26] mediatek: add missing DTS entries for WED on MT7986 Needed to support WLAN offloading Signed-off-by: Felix Fietkau --- .../arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a.dtsi index 060b88f9dd3..86090f8ebed 100644 --- a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -86,6 +86,46 @@ no-map; reg = <0 0x4fc00000 0 0x00100000>; }; + + wo_emi0: wo-emi@4fd00000 { + reg = <0 0x4fd00000 0 0x40000>; + no-map; + }; + + wo_emi1: wo-emi@4fd40000 { + reg = <0 0x4fd40000 0 0x40000>; + no-map; + }; + + wo_ilm0: wo-ilm@151e0000 { + reg = <0 0x151e0000 0 0x8000>; + no-map; + }; + + wo_ilm1: wo-ilm@151f0000 { + reg = <0 0x151f0000 0 0x8000>; + no-map; + }; + + wo_data: wo-data@4fd80000 { + reg = <0 0x4fd80000 0 0x240000>; + no-map; + }; + + wo_dlm0: wo-dlm@151e8000 { + reg = <0 0x151e8000 0 0x2000>; + no-map; + }; + + wo_dlm1: wo-dlm@151f8000 { + reg = <0 0x151f8000 0 0x2000>; + no-map; + }; + + wo_boot: wo-boot@15194000 { + reg = <0 0x15194000 0 0x1000>; + no-map; + }; }; timer { @@ -577,12 +617,18 @@ reg = <0 0x10003000 0 0x10>; }; + wed0: wed@15010000 { compatible = "mediatek,mt7986-wed", "syscon"; reg = <0 0x15010000 0 0x1000>; interrupt-parent = <&gic>; interrupts = ; + memory-region = <&wo_emi0>, <&wo_ilm0>, <&wo_dlm0>, + <&wo_data>, <&wo_boot>; + memory-region-names = "wo-emi", "wo-ilm", "wo-dlm", + "wo-data", "wo-boot"; + mediatek,wo-ccif = <&wo_ccif0>; }; wed1: wed@15011000 { @@ -591,6 +637,25 @@ reg = <0 0x15011000 0 0x1000>; interrupt-parent = <&gic>; interrupts = ; + memory-region = <&wo_emi1>, <&wo_ilm1>, <&wo_dlm1>, + <&wo_data>, <&wo_boot>; + memory-region-names = "wo-emi", "wo-ilm", "wo-dlm", + "wo-data", "wo-boot"; + mediatek,wo-ccif = <&wo_ccif1>; + }; + + wo_ccif0: syscon@151a5000 { + compatible = "mediatek,mt7986-wo-ccif", "syscon"; + reg = <0 0x151a5000 0 0x1000>; + interrupt-parent = <&gic>; + interrupts = ; + }; + + wo_ccif1: syscon@151ad000 { + compatible = "mediatek,mt7986-wo-ccif", "syscon"; + reg = <0 0x151ad000 0 0x1000>; + interrupt-parent = <&gic>; + interrupts = ; }; eth: ethernet@15100000 { From 2f8e90739a51063d250c1ebf5adc63b6f444a688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sun, 5 Mar 2023 11:51:46 +0100 Subject: [PATCH 04/26] Revert "bmips: add missing switch cpu label" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dc0de05e10a9c6e1ef66ca2934e8a0ff0d488943. As pointed out by @BKPepe and @arinc9 this was removed by 9df035b since it isn't needed. Signed-off-by: Álvaro Fernández Rojas --- target/linux/bmips/dts/bcm6318.dtsi | 1 - target/linux/bmips/dts/bcm63268.dtsi | 1 - target/linux/bmips/dts/bcm6328.dtsi | 1 - target/linux/bmips/dts/bcm6362.dtsi | 1 - target/linux/bmips/dts/bcm6368.dtsi | 1 - 5 files changed, 5 deletions(-) diff --git a/target/linux/bmips/dts/bcm6318.dtsi b/target/linux/bmips/dts/bcm6318.dtsi index 9f613ad47ac..13e1bf11441 100644 --- a/target/linux/bmips/dts/bcm6318.dtsi +++ b/target/linux/bmips/dts/bcm6318.dtsi @@ -400,7 +400,6 @@ port@8 { reg = <8>; - label = "cpu"; phy-mode = "internal"; ethernet = <ðernet>; diff --git a/target/linux/bmips/dts/bcm63268.dtsi b/target/linux/bmips/dts/bcm63268.dtsi index 2ab14e5a335..2bc86d26f97 100644 --- a/target/linux/bmips/dts/bcm63268.dtsi +++ b/target/linux/bmips/dts/bcm63268.dtsi @@ -521,7 +521,6 @@ port@8 { reg = <8>; - label = "cpu"; phy-mode = "internal"; ethernet = <ðernet>; diff --git a/target/linux/bmips/dts/bcm6328.dtsi b/target/linux/bmips/dts/bcm6328.dtsi index c8e9138ccbd..dfd603b7c6e 100644 --- a/target/linux/bmips/dts/bcm6328.dtsi +++ b/target/linux/bmips/dts/bcm6328.dtsi @@ -418,7 +418,6 @@ port@8 { reg = <8>; - label = "cpu"; phy-mode = "internal"; ethernet = <ðernet>; diff --git a/target/linux/bmips/dts/bcm6362.dtsi b/target/linux/bmips/dts/bcm6362.dtsi index 77473c22bb1..d66a602df7a 100644 --- a/target/linux/bmips/dts/bcm6362.dtsi +++ b/target/linux/bmips/dts/bcm6362.dtsi @@ -515,7 +515,6 @@ port@8 { reg = <8>; - label = "cpu"; phy-mode = "internal"; ethernet = <ðernet>; diff --git a/target/linux/bmips/dts/bcm6368.dtsi b/target/linux/bmips/dts/bcm6368.dtsi index b50a572fd00..5ba90921936 100644 --- a/target/linux/bmips/dts/bcm6368.dtsi +++ b/target/linux/bmips/dts/bcm6368.dtsi @@ -529,7 +529,6 @@ port@8 { reg = <8>; - label = "cpu"; phy-mode = "internal"; ethernet = <ðernet>; From 11822d8be2dffb249b4d09a641ffcf0b884203a7 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 5 Mar 2023 16:39:24 +0100 Subject: [PATCH 05/26] uci: update to git HEAD 5de3871 cli: drop redundant uci_add_delta_path() call for -P f49a2fd delta: simplify uci_load_delta() by using a helper 9b6605e uci: fix use-after-free uci_set on update option b7ceda9 uci: maintain option position in uci_set 7e01d66 uci: optimize update option in uci_set 47697e6 uci: fix use-after-free uci_add_list 74f2797 uci: fix atomicity of uci_add_list b2f3417 uci: maintain option position in uci_add_list 16e8a3b uci: fix memory leak uci_set on update section ae61e1c uci: optimize update section in uci_set 04d0c46 uci: macro uci_alloc_element not in uci.h Signed-off-by: Hauke Mehrtens --- package/system/uci/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile index 48e5bcc4da5..30152607613 100644 --- a/package/system/uci/Makefile +++ b/package/system/uci/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uci -PKG_RELEASE:=6 +PKG_RELEASE:=1 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE=2021-10-22 -PKG_SOURCE_VERSION:=f84f49f00fb70364f58b4cce72f1796a7190d370 -PKG_MIRROR_HASH:=9f4747a029976b43fcea9919643ce71e587e515edc21b280163f7262360d847f +PKG_SOURCE_DATE=2023-03-05 +PKG_SOURCE_VERSION:=04d0c46cfe30f557da0c603516636830cab4a08a +PKG_MIRROR_HASH:=5402091db0645d19a60c3ec51850062138af8fb9eda6764091819637d84f1036 PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:= From 8298270b6003ba852d15dc35e3abe9ed46d6879f Mon Sep 17 00:00:00 2001 From: Tim Harvey Date: Mon, 27 Feb 2023 16:13:07 -0800 Subject: [PATCH 06/26] kernel: add kmod-hwmon-max6642 support Add package for Maxim MAX6642 i2c based temperature sensor. Signed-off-by: Tim Harvey --- package/kernel/linux/modules/hwmon.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/kernel/linux/modules/hwmon.mk b/package/kernel/linux/modules/hwmon.mk index 79df0471ed5..29392548d40 100644 --- a/package/kernel/linux/modules/hwmon.mk +++ b/package/kernel/linux/modules/hwmon.mk @@ -354,6 +354,21 @@ endef $(eval $(call KernelPackage,hwmon-ltc4151)) +define KernelPackage/hwmon-max6642 + TITLE:=MAX6642 monitoring support + KCONFIG:=CONFIG_SENSORS_MAX6642 + FILES:=$(LINUX_DIR)/drivers/hwmon/max6642.ko + AUTOLOAD:=$(call AutoLoad,60,max6642 max6642) + $(call AddDepends/hwmon,+kmod-i2c-core) +endef + +define KernelPackage/hwmon-max6642/description + Kernel module for Maxim MAX6642 temperature monitor +endef + +$(eval $(call KernelPackage,hwmon-max6642)) + + define KernelPackage/hwmon-mcp3021 TITLE:=MCP3021/3221 monitoring support KCONFIG:=CONFIG_SENSORS_MCP3021 From 4c1d7787d460cd0798eb01a42c6a8a7fc96e2999 Mon Sep 17 00:00:00 2001 From: Alan Luck Date: Sat, 25 Feb 2023 22:17:37 -0800 Subject: [PATCH 07/26] ipq806x: Add buttons to OnHub These are the factory reset button (external) and "developer mode" button (hidden inside the case (ASUS) or under a screw in the base (TP-Link)) found on the TP-Link and ASUS OnHub devices. Signed-off-by: Alan Luck [Brian: add description; factor out for both ASUS and TP-Link; use existing pinmux definitions; add keycode for dev button] Signed-off-by: Brian Norris --- .../arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi index 25ba71da00e..549c4620261 100644 --- a/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi +++ b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi @@ -5,6 +5,7 @@ #include "qcom-ipq8064-smb208.dtsi" #include +#include #include / { @@ -30,6 +31,28 @@ }; }; + keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + reset { + label = "reset"; + gpios = <&qcom_pinmux 16 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + wakeup-source; + }; + + dev { + label = "dev"; + gpios = <&qcom_pinmux 15 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + wakeup-source; + }; + }; + mdio: mdio { compatible = "virtual,mdio-gpio"; #address-cells = <1>; @@ -227,12 +250,17 @@ pins = "gpio17"; output-low; }; + }; + + button_pins: button_pins { recovery { pins = "gpio16"; + function = "gpio"; bias-none; }; developer { pins = "gpio15"; + function = "gpio"; bias-none; }; }; From 26b8739b6839e80c836cff0172fb6005c407a520 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 5 Mar 2023 17:25:34 +0100 Subject: [PATCH 08/26] mediatek: backport more WED upstream fixes Fixes hang if the WO firmware can't be loaded Signed-off-by: Felix Fietkau --- ..._wed-fix-some-possible-NULL-pointer-.patch | 61 +++++++++++++++++++ ..._wed-fix-possible-deadlock-if-mtk_we.patch | 58 ++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 target/linux/generic/backport-5.15/730-16-v6.3-net-ethernet-mtk_wed-fix-some-possible-NULL-pointer-.patch create mode 100644 target/linux/generic/backport-5.15/730-17-v6.3-net-ethernet-mtk_wed-fix-possible-deadlock-if-mtk_we.patch diff --git a/target/linux/generic/backport-5.15/730-16-v6.3-net-ethernet-mtk_wed-fix-some-possible-NULL-pointer-.patch b/target/linux/generic/backport-5.15/730-16-v6.3-net-ethernet-mtk_wed-fix-some-possible-NULL-pointer-.patch new file mode 100644 index 00000000000..e043a681da4 --- /dev/null +++ b/target/linux/generic/backport-5.15/730-16-v6.3-net-ethernet-mtk_wed-fix-some-possible-NULL-pointer-.patch @@ -0,0 +1,61 @@ +From: Lorenzo Bianconi +Date: Wed, 7 Dec 2022 15:04:54 +0100 +Subject: [PATCH] net: ethernet: mtk_wed: fix some possible NULL pointer + dereferences + +Fix possible NULL pointer dereference in mtk_wed_detach routine checking +wo pointer is properly allocated before running mtk_wed_wo_reset() and +mtk_wed_wo_deinit(). +Even if it is just a theoretical issue at the moment check wo pointer is +not NULL in mtk_wed_mcu_msg_update. +Moreover, honor mtk_wed_mcu_send_msg return value in mtk_wed_wo_reset() + +Fixes: 799684448e3e ("net: ethernet: mtk_wed: introduce wed wo support") +Fixes: 4c5de09eb0d0 ("net: ethernet: mtk_wed: add configure wed wo support") +Signed-off-by: Lorenzo Bianconi +Reviewed-by: Leon Romanovsky +Signed-off-by: Jakub Kicinski +--- + +--- a/drivers/net/ethernet/mediatek/mtk_wed.c ++++ b/drivers/net/ethernet/mediatek/mtk_wed.c +@@ -174,9 +174,10 @@ mtk_wed_wo_reset(struct mtk_wed_device * + mtk_wdma_tx_reset(dev); + mtk_wed_reset(dev, MTK_WED_RESET_WED); + +- mtk_wed_mcu_send_msg(wo, MTK_WED_MODULE_ID_WO, +- MTK_WED_WO_CMD_CHANGE_STATE, &state, +- sizeof(state), false); ++ if (mtk_wed_mcu_send_msg(wo, MTK_WED_MODULE_ID_WO, ++ MTK_WED_WO_CMD_CHANGE_STATE, &state, ++ sizeof(state), false)) ++ return; + + if (readx_poll_timeout(mtk_wed_wo_read_status, dev, val, + val == MTK_WED_WOIF_DISABLE_DONE, +@@ -632,9 +633,11 @@ mtk_wed_detach(struct mtk_wed_device *de + mtk_wed_free_tx_rings(dev); + + if (mtk_wed_get_rx_capa(dev)) { +- mtk_wed_wo_reset(dev); ++ if (hw->wed_wo) ++ mtk_wed_wo_reset(dev); + mtk_wed_free_rx_rings(dev); +- mtk_wed_wo_deinit(hw); ++ if (hw->wed_wo) ++ mtk_wed_wo_deinit(hw); + } + + if (dev->wlan.bus_type == MTK_WED_BUS_PCIE) { +--- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c ++++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c +@@ -207,6 +207,9 @@ int mtk_wed_mcu_msg_update(struct mtk_we + if (dev->hw->version == 1) + return 0; + ++ if (WARN_ON(!wo)) ++ return -ENODEV; ++ + return mtk_wed_mcu_send_msg(wo, MTK_WED_MODULE_ID_WO, id, data, len, + true); + } diff --git a/target/linux/generic/backport-5.15/730-17-v6.3-net-ethernet-mtk_wed-fix-possible-deadlock-if-mtk_we.patch b/target/linux/generic/backport-5.15/730-17-v6.3-net-ethernet-mtk_wed-fix-possible-deadlock-if-mtk_we.patch new file mode 100644 index 00000000000..d1c5fb6656d --- /dev/null +++ b/target/linux/generic/backport-5.15/730-17-v6.3-net-ethernet-mtk_wed-fix-possible-deadlock-if-mtk_we.patch @@ -0,0 +1,58 @@ +From: Lorenzo Bianconi +Date: Wed, 7 Dec 2022 15:04:55 +0100 +Subject: [PATCH] net: ethernet: mtk_wed: fix possible deadlock if + mtk_wed_wo_init fails + +Introduce __mtk_wed_detach() in order to avoid a deadlock in +mtk_wed_attach routine if mtk_wed_wo_init fails since both +mtk_wed_attach and mtk_wed_detach run holding hw_lock mutex. + +Fixes: 4c5de09eb0d0 ("net: ethernet: mtk_wed: add configure wed wo support") +Signed-off-by: Lorenzo Bianconi +Reviewed-by: Leon Romanovsky +Signed-off-by: Jakub Kicinski +--- + +--- a/drivers/net/ethernet/mediatek/mtk_wed.c ++++ b/drivers/net/ethernet/mediatek/mtk_wed.c +@@ -619,12 +619,10 @@ mtk_wed_deinit(struct mtk_wed_device *de + } + + static void +-mtk_wed_detach(struct mtk_wed_device *dev) ++__mtk_wed_detach(struct mtk_wed_device *dev) + { + struct mtk_wed_hw *hw = dev->hw; + +- mutex_lock(&hw_lock); +- + mtk_wed_deinit(dev); + + mtk_wdma_rx_reset(dev); +@@ -657,6 +655,13 @@ mtk_wed_detach(struct mtk_wed_device *de + module_put(THIS_MODULE); + + hw->wed_dev = NULL; ++} ++ ++static void ++mtk_wed_detach(struct mtk_wed_device *dev) ++{ ++ mutex_lock(&hw_lock); ++ __mtk_wed_detach(dev); + mutex_unlock(&hw_lock); + } + +@@ -1545,8 +1550,10 @@ mtk_wed_attach(struct mtk_wed_device *de + ret = mtk_wed_wo_init(hw); + } + out: +- if (ret) +- mtk_wed_detach(dev); ++ if (ret) { ++ dev_err(dev->hw->dev, "failed to attach wed device\n"); ++ __mtk_wed_detach(dev); ++ } + unlock: + mutex_unlock(&hw_lock); + From 4448b27930526e700d2fcb882bad2fd10aa17918 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Mon, 20 Feb 2023 16:00:54 +0200 Subject: [PATCH 09/26] kernel: set default for KERNEL_BPF_KPROBE_OVERRIDE Without the default value this still causes a missing symbol. Disable by default as it depends on FUNCTION_ERROR_INJECTION, which is disabled in the generic config and we don't have a build symbol to enable that. Fixes: 500c37c56ff6 ("kernel: add missing symbol") Signed-off-by: Stijn Tintel --- config/Config-kernel.in | 1 + 1 file changed, 1 insertion(+) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 258163984e7..ad23b214796 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -461,6 +461,7 @@ config KERNEL_BPF_EVENTS config KERNEL_BPF_KPROBE_OVERRIDE bool depends on KERNEL_KPROBES + default n config KERNEL_AIO bool "Compile the kernel with asynchronous IO support" From 5a1eb3bb2c27ede3046bb2977008c74a04681db9 Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Fri, 20 Jan 2023 18:25:13 +0300 Subject: [PATCH 10/26] Remove ccache wrappers These wrappers are not needed as CC doesn't need to be a single word. a53b084e497a9f1629a2caada833ebe14a6838b7 which introduced the wrappers doesn't explain why they were really needed and why only for the target and not for the host. Moreover, name of the wrappers breaks a ccache assumption: since v4.0-3-g6a92b4cd3a67 it has special handling for "chained" invocation such as "ccache ccache gcc" where it skips all the "ccache*" names in the middle and proceeds to run as if it was started as "ccache gcc"[1][2]. This becomes important when a build system sees ccache in the PATH and automatically enables it by prepending to CC. An example of such a system would be autosetup as used by jimtcl. With the wrappers it breaks as the command line ends up being just "ccache -Os..." because "ccache_cc" gets skipped as it starts with "ccache". [1] https://github.com/ccache/ccache/blob/master/src/ccache.cpp#L2105 [2] https://github.com/ccache/ccache/blob/master/src/Util.cpp#L802 Reported-by: Karl Palsson Signed-off-by: Paul Fertser --- rules.mk | 4 ++-- tools/ccache/Makefile | 10 ---------- tools/ccache/files/ccache_cc | 2 -- tools/ccache/files/ccache_cxx | 2 -- 4 files changed, 2 insertions(+), 16 deletions(-) delete mode 100755 tools/ccache/files/ccache_cc delete mode 100755 tools/ccache/files/ccache_cxx diff --git a/rules.mk b/rules.mk index 3d151338af1..a2f5bcca4b0 100644 --- a/rules.mk +++ b/rules.mk @@ -283,8 +283,8 @@ export HOSTCC_NOCACHE export HOSTCXX_NOCACHE ifneq ($(CONFIG_CCACHE),) - TARGET_CC:= ccache_cc - TARGET_CXX:= ccache_cxx + TARGET_CC:= ccache $(TARGET_CC) + TARGET_CXX:= ccache $(TARGET_CXX) HOSTCC:= ccache $(HOSTCC) HOSTCXX:= ccache $(HOSTCXX) export CCACHE_BASEDIR:=$(TOPDIR) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 25ab4a46eab..6824dbddfd4 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -28,14 +28,4 @@ ifneq (docs-$(CONFIG_BUILD_DOCUMENTATION),docs-y) CMAKE_HOST_OPTIONS += -DENABLE_DOCUMENTATION=OFF endif -define Host/Install/ccache - $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ - $(CP) ./files/* $(STAGING_DIR_HOST)/bin/ -endef - -define Host/Install - $(call Host/Install/Default) - $(call Host/Install/ccache) -endef - $(eval $(call HostBuild)) diff --git a/tools/ccache/files/ccache_cc b/tools/ccache/files/ccache_cc deleted file mode 100755 index 01c4ad42a21..00000000000 --- a/tools/ccache/files/ccache_cc +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec ccache "${TARGET_CC_NOCACHE}" "$@" diff --git a/tools/ccache/files/ccache_cxx b/tools/ccache/files/ccache_cxx deleted file mode 100755 index cc60eb3a13c..00000000000 --- a/tools/ccache/files/ccache_cxx +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec ccache "${TARGET_CXX_NOCACHE}" "$@" From 477ff0821a5e532adc0861d4093029967f5e1178 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Fri, 17 Feb 2023 14:21:01 +0100 Subject: [PATCH 11/26] sdk: expose PATENTED an NLS build options Some packages offer functionalities guarded by these options and it'll be impossible to reach them without changing Config-build.in. So allow to toggle these in more friendly way, by exposing them in configuration menu. Signed-off-by: Tomasz Maciej Nowak --- target/sdk/files/Config.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/target/sdk/files/Config.in b/target/sdk/files/Config.in index 7926e124265..a14c17fe955 100644 --- a/target/sdk/files/Config.in +++ b/target/sdk/files/Config.in @@ -18,6 +18,23 @@ menu "Global build settings" bool "Cryptographically sign package lists" default y + comment "General build options" + + config BUILD_PATENTED + default n + bool "Compile with support for patented functionality" + help + When this option is disabled, software which provides patented functionality + will not be built. In case software provides optional support for patented + functionality, this optional support will get disabled for this package. + + config BUILD_NLS + default n + bool "Compile with full language support" + help + When this option is enabled, packages are built with the full versions of + iconv and GNU gettext instead of the default OpenWrt stubs. + comment "Package build options" config DEBUG From a7e05caaf3e215981dde82881259465c682df039 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 5 Mar 2023 18:42:49 +0100 Subject: [PATCH 12/26] bcm47xx: Refresh patches The kernel patches did not apply cleanly any more, refresh them automatically. Fixes: 26bc8f68767e ("generic: MIPS: Add barriers between dcache & icache flushes") Signed-off-by: Hauke Mehrtens --- target/linux/bcm47xx/patches-5.10/159-cpu_fixes.patch | 6 +++--- target/linux/bcm47xx/patches-5.10/160-kmap_coherent.patch | 4 ++-- target/linux/bcm47xx/patches-5.15/159-cpu_fixes.patch | 6 +++--- target/linux/bcm47xx/patches-5.15/160-kmap_coherent.patch | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/target/linux/bcm47xx/patches-5.10/159-cpu_fixes.patch b/target/linux/bcm47xx/patches-5.10/159-cpu_fixes.patch index 0c9a9d6490e..eb4c0e6ac8f 100644 --- a/target/linux/bcm47xx/patches-5.10/159-cpu_fixes.patch +++ b/target/linux/bcm47xx/patches-5.10/159-cpu_fixes.patch @@ -389,7 +389,7 @@ if (dc_lsize == 0) r4k_blast_dcache = (void *)cache_noop; else if (dc_lsize == 16) -@@ -1818,6 +1830,17 @@ static void coherency_setup(void) +@@ -1827,6 +1839,17 @@ static void coherency_setup(void) * silly idea of putting something else there ... */ switch (current_cpu_type()) { @@ -407,7 +407,7 @@ case CPU_R4000PC: case CPU_R4000SC: case CPU_R4000MC: -@@ -1864,6 +1887,15 @@ void r4k_cache_init(void) +@@ -1873,6 +1896,15 @@ void r4k_cache_init(void) extern void build_copy_page(void); struct cpuinfo_mips *c = ¤t_cpu_data; @@ -423,7 +423,7 @@ probe_pcache(); probe_vcache(); setup_scache(); -@@ -1940,7 +1972,15 @@ void r4k_cache_init(void) +@@ -1949,7 +1981,15 @@ void r4k_cache_init(void) */ local_r4k___flush_cache_all(NULL); diff --git a/target/linux/bcm47xx/patches-5.10/160-kmap_coherent.patch b/target/linux/bcm47xx/patches-5.10/160-kmap_coherent.patch index caa3d9816bf..c85fa0be4cf 100644 --- a/target/linux/bcm47xx/patches-5.10/160-kmap_coherent.patch +++ b/target/linux/bcm47xx/patches-5.10/160-kmap_coherent.patch @@ -29,7 +29,7 @@ This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485 #endif /* __ASM_MACH_BCM47XX_CPU_FEATURE_OVERRIDES_H */ --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c -@@ -699,7 +699,7 @@ static inline void local_r4k_flush_cache +@@ -702,7 +702,7 @@ static inline void local_r4k_flush_cache map_coherent = (cpu_has_dc_aliases && page_mapcount(page) && !Page_dcache_dirty(page)); @@ -38,7 +38,7 @@ This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485 vaddr = kmap_coherent(page, addr); else vaddr = kmap_atomic(page); -@@ -721,7 +721,7 @@ static inline void local_r4k_flush_cache +@@ -729,7 +729,7 @@ static inline void local_r4k_flush_cache } if (vaddr) { diff --git a/target/linux/bcm47xx/patches-5.15/159-cpu_fixes.patch b/target/linux/bcm47xx/patches-5.15/159-cpu_fixes.patch index 88f2b9c684b..fe7eff19113 100644 --- a/target/linux/bcm47xx/patches-5.15/159-cpu_fixes.patch +++ b/target/linux/bcm47xx/patches-5.15/159-cpu_fixes.patch @@ -380,7 +380,7 @@ if (dc_lsize == 0) r4k_blast_dcache = (void *)cache_noop; else if (dc_lsize == 16) -@@ -1817,6 +1829,17 @@ static void coherency_setup(void) +@@ -1826,6 +1838,17 @@ static void coherency_setup(void) * silly idea of putting something else there ... */ switch (current_cpu_type()) { @@ -398,7 +398,7 @@ case CPU_R4000PC: case CPU_R4000SC: case CPU_R4000MC: -@@ -1863,6 +1886,15 @@ void r4k_cache_init(void) +@@ -1872,6 +1895,15 @@ void r4k_cache_init(void) extern void build_copy_page(void); struct cpuinfo_mips *c = ¤t_cpu_data; @@ -414,7 +414,7 @@ probe_pcache(); probe_vcache(); setup_scache(); -@@ -1935,7 +1967,15 @@ void r4k_cache_init(void) +@@ -1944,7 +1976,15 @@ void r4k_cache_init(void) */ local_r4k___flush_cache_all(NULL); diff --git a/target/linux/bcm47xx/patches-5.15/160-kmap_coherent.patch b/target/linux/bcm47xx/patches-5.15/160-kmap_coherent.patch index b716f0cbc8e..aedf6afa246 100644 --- a/target/linux/bcm47xx/patches-5.15/160-kmap_coherent.patch +++ b/target/linux/bcm47xx/patches-5.15/160-kmap_coherent.patch @@ -29,7 +29,7 @@ This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485 #endif /* __ASM_MACH_BCM47XX_CPU_FEATURE_OVERRIDES_H */ --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c -@@ -699,7 +699,7 @@ static inline void local_r4k_flush_cache +@@ -702,7 +702,7 @@ static inline void local_r4k_flush_cache map_coherent = (cpu_has_dc_aliases && page_mapcount(page) && !Page_dcache_dirty(page)); @@ -38,7 +38,7 @@ This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485 vaddr = kmap_coherent(page, addr); else vaddr = kmap_atomic(page); -@@ -721,7 +721,7 @@ static inline void local_r4k_flush_cache +@@ -729,7 +729,7 @@ static inline void local_r4k_flush_cache } if (vaddr) { From 44c24b3ac5d4523c0f9f55691d28387508e93de5 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 1 Feb 2023 14:50:22 -0800 Subject: [PATCH 13/26] ksmbd: update to 3.4.7 Remove upstreamed patches. Switch to normal tarballs. Codeload recently had a reproducibility issue. Signed-off-by: Rosen Penev --- package/kernel/ksmbd/Makefile | 8 +-- ...en-to-be-at-least-CIFS_ENCPWD_SIZE-i.patch | 36 ----------- ...nite-loop-in-ksmbd_conn_handler_loop.patch | 63 ------------------- 3 files changed, 4 insertions(+), 103 deletions(-) delete mode 100644 package/kernel/ksmbd/patches/10-ksmbd-check-nt_len-to-be-at-least-CIFS_ENCPWD_SIZE-i.patch delete mode 100644 package/kernel/ksmbd/patches/11-ksmbd-fix-infinite-loop-in-ksmbd_conn_handler_loop.patch diff --git a/package/kernel/ksmbd/Makefile b/package/kernel/ksmbd/Makefile index 8a0ebc54f89..feeace9340c 100644 --- a/package/kernel/ksmbd/Makefile +++ b/package/kernel/ksmbd/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ksmbd -PKG_VERSION:=3.4.6 -PKG_RELEASE:=2 +PKG_VERSION:=3.4.7 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/cifsd-team/cifsd/tar.gz/$(PKG_VERSION)? -PKG_HASH:=d742992692dbe164060d2a0ea668895ed2b86252f10427db3d3a002df44c445b +PKG_SOURCE_URL:=https://github.com/cifsd-team/ksmbd/releases/download/$(PKG_VERSION) +PKG_HASH:=ed9ecb2232046054bf0c1fef41690890f99d93b1d72b7e7d158746ac9be18c7f PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING diff --git a/package/kernel/ksmbd/patches/10-ksmbd-check-nt_len-to-be-at-least-CIFS_ENCPWD_SIZE-i.patch b/package/kernel/ksmbd/patches/10-ksmbd-check-nt_len-to-be-at-least-CIFS_ENCPWD_SIZE-i.patch deleted file mode 100644 index 198e7521061..00000000000 --- a/package/kernel/ksmbd/patches/10-ksmbd-check-nt_len-to-be-at-least-CIFS_ENCPWD_SIZE-i.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 8824b7af409f51f1316e92e9887c2fd48c0b26d6 Mon Sep 17 00:00:00 2001 -From: William Liu -Date: Fri, 30 Dec 2022 09:13:35 +0900 -Subject: ksmbd: check nt_len to be at least CIFS_ENCPWD_SIZE in - ksmbd_decode_ntlmssp_auth_blob -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -"nt_len - CIFS_ENCPWD_SIZE" is passed directly from -ksmbd_decode_ntlmssp_auth_blob to ksmbd_auth_ntlmv2. Malicious requests -can set nt_len to less than CIFS_ENCPWD_SIZE, which results in a negative -number (or large unsigned value) used for a subsequent memcpy in -ksmbd_auth_ntlvm2 and can cause a panic. - -Fixes: e2f3448 ("cifsd: add server-side procedures for SMB3") -Cc: stable@vger.kernel.org -Signed-off-by: William Liu -Signed-off-by: Hrvoje Mišetić -Signed-off-by: Namjae Jeon ---- - auth.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/auth.c -+++ b/auth.c -@@ -583,7 +583,8 @@ int ksmbd_decode_ntlmssp_auth_blob(struc - dn_off = le32_to_cpu(authblob->DomainName.BufferOffset); - dn_len = le16_to_cpu(authblob->DomainName.Length); - -- if (blob_len < (u64)dn_off + dn_len || blob_len < (u64)nt_off + nt_len) -+ if (blob_len < (u64)dn_off + dn_len || blob_len < (u64)nt_off + nt_len || -+ nt_len < CIFS_ENCPWD_SIZE) - return -EINVAL; - - #ifdef CONFIG_SMB_INSECURE_SERVER diff --git a/package/kernel/ksmbd/patches/11-ksmbd-fix-infinite-loop-in-ksmbd_conn_handler_loop.patch b/package/kernel/ksmbd/patches/11-ksmbd-fix-infinite-loop-in-ksmbd_conn_handler_loop.patch deleted file mode 100644 index 1b3c5c1aaba..00000000000 --- a/package/kernel/ksmbd/patches/11-ksmbd-fix-infinite-loop-in-ksmbd_conn_handler_loop.patch +++ /dev/null @@ -1,63 +0,0 @@ -From cc4f3b5a6ab4693aba94a45cc073188df4d67175 Mon Sep 17 00:00:00 2001 -From: Namjae Jeon -Date: Mon, 26 Dec 2022 01:28:52 +0900 -Subject: ksmbd: fix infinite loop in ksmbd_conn_handler_loop() - -If kernel_recvmsg() return -EAGAIN in ksmbd_tcp_readv() and go round -again, It will cause infinite loop issue. And all threads from next -connections would be doing that. This patch add max retry count(2) to -avoid it. kernel_recvmsg() will wait during 7sec timeout and try to -retry two time if -EAGAIN is returned. And add flags of kvmalloc to -__GFP_NOWARN and __GFP_NORETRY to disconnect immediately without -retrying on memory alloation failure. - -Fixes: 0626e66 ("cifsd: add server handler for central processing and tranport layers") -Cc: stable@vger.kernel.org -Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-18259 -Reviewed-by: Sergey Senozhatsky -Signed-off-by: Namjae Jeon ---- - connection.c | 7 +++++-- - transport_tcp.c | 5 ++++- - 2 files changed, 9 insertions(+), 3 deletions(-) - ---- a/connection.c -+++ b/connection.c -@@ -337,9 +337,12 @@ int ksmbd_conn_handler_loop(void *p) - - /* 4 for rfc1002 length field */ - size = pdu_size + 4; -- conn->request_buf = kvmalloc(size, GFP_KERNEL); -+ conn->request_buf = kvmalloc(size, -+ GFP_KERNEL | -+ __GFP_NOWARN | -+ __GFP_NORETRY); - if (!conn->request_buf) -- continue; -+ break; - - memcpy(conn->request_buf, hdr_buf, sizeof(hdr_buf)); - if (!ksmbd_smb_request(conn)) ---- a/transport_tcp.c -+++ b/transport_tcp.c -@@ -323,6 +323,7 @@ static int ksmbd_tcp_readv(struct tcp_tr - struct msghdr ksmbd_msg; - struct kvec *iov; - struct ksmbd_conn *conn = KSMBD_TRANS(t)->conn; -+ int max_retry = 2; - - iov = get_conn_iovec(t, nr_segs); - if (!iov) -@@ -349,9 +350,11 @@ static int ksmbd_tcp_readv(struct tcp_tr - } else if (conn->status == KSMBD_SESS_NEED_RECONNECT) { - total_read = -EAGAIN; - break; -- } else if (length == -ERESTARTSYS || length == -EAGAIN) { -+ } else if ((length == -ERESTARTSYS || length == -EAGAIN) && -+ max_retry) { - usleep_range(1000, 2000); - length = 0; -+ max_retry--; - continue; - } else if (length <= 0) { - total_read = -EAGAIN; From d650ca9247d84b23d84ece38a3aa3114af6f0577 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 14 Feb 2023 19:31:03 -0800 Subject: [PATCH 14/26] mac80211: enable ATH9K_HWRNG in kernel 5.17, fcd09c90c3c5254b18ef34e30c57c65d34290a84 integrated it better with thee random framework. Gives boot time randomness on supported devices. Signed-off-by: Rosen Penev --- package/kernel/mac80211/ath.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/kernel/mac80211/ath.mk b/package/kernel/mac80211/ath.mk index 4f14fec8e26..dc08df4f6fe 100644 --- a/package/kernel/mac80211/ath.mk +++ b/package/kernel/mac80211/ath.mk @@ -225,7 +225,7 @@ define KernelPackage/ath9k/config bool "Add wireless noise as source of randomness to kernel entropy pool" depends on PACKAGE_kmod-ath9k select PACKAGE_kmod-random-core - default n + default y config ATH9K_SUPPORT_PCOEM bool "Support chips used in PC OEM cards" @@ -377,7 +377,7 @@ endef define KernelPackage/ar5523 $(call KernelPackage/mac80211/Default) TITLE:=Driver for Atheros AR5523 USB sticks - DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core + DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ar5523/ar5523.ko AUTOLOAD:=$(call AutoProbe,ar5523) endef From 26a65e852c5bd8e586205ce8dff582de623cb566 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 25 Feb 2023 22:21:15 +0100 Subject: [PATCH 15/26] bpftool: Update to version 7.1.0 bpftool changelog: https://github.com/libbpf/bpftool/releases libbpf changelog: https://github.com/libbpf/libbpf/releases This updates the bfptool to version 7.1.0. This also includes an update of the libbpf to version 1.1. This also adds some new feature options and removes some old ones which were also removed form the source code. zlib for example is now mandatory. Add -flto also to LD flags to make it really work. Before this change bpftool was on a git commit between version 6.7 and 6.8 and libbpf was on a commit between version 0.7 and 0.8. Signed-off-by: Hauke Mehrtens --- package/network/utils/bpftools/Makefile | 14 +++++++------- .../utils/bpftools/patches/001-cflags.patch | 6 +++--- .../utils/bpftools/patches/002-includes.patch | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package/network/utils/bpftools/Makefile b/package/network/utils/bpftools/Makefile index 56422e79026..7adda2edafc 100644 --- a/package/network/utils/bpftools/Makefile +++ b/package/network/utils/bpftools/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/libbpf/bpftool PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2022-03-08 -PKG_SOURCE_VERSION:=04c465fd1f561f67796dc68bbfe1aa7cfa956c3c -PKG_MIRROR_HASH:=e22a954cd186f43228a96586bbdc120b11e6c87360ab88ae96ba37afb9c7cb58 +PKG_SOURCE_DATE:=7.1.0 +PKG_SOURCE_VERSION:=b01941c8f7890489f09713348a7d89567538504b +PKG_MIRROR_HASH:=641fb337342e25ae784a3efe72c71d8c88600a326300d8d5834e26be21547015 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) PKG_MAINTAINER:=Tony Ambardar @@ -82,7 +82,7 @@ endef # LTO not compatible with DSO using PIC ifneq ($(BUILD_VARIANT),lib) TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto - TARGET_LDFLAGS += -Wl,--gc-sections + TARGET_LDFLAGS += -Wl,--gc-sections -flto endif ifeq ($(BUILD_VARIANT),full) @@ -102,11 +102,11 @@ MAKE_FLAGS += \ LIBSUBDIR=lib \ check_feat=0 \ feature-clang-bpf-co-re=0 \ - feature-reallocarray=1 \ - feature-zlib=1 \ feature-libbfd=$(full) \ + feature-llvm=0 \ feature-libcap=0 \ - feature-disassembler-four-args=$(full) + feature-disassembler-four-args=1 \ + feature-disassembler-init-styled=0 ifeq ($(BUILD_VARIANT),lib) MAKE_PATH = libbpf/src diff --git a/package/network/utils/bpftools/patches/001-cflags.patch b/package/network/utils/bpftools/patches/001-cflags.patch index 48617e302bd..b06842a0be7 100644 --- a/package/network/utils/bpftools/patches/001-cflags.patch +++ b/package/network/utils/bpftools/patches/001-cflags.patch @@ -1,10 +1,10 @@ --- a/libbpf/src/Makefile +++ b/libbpf/src/Makefile -@@ -25,6 +25,7 @@ ALL_CFLAGS := $(INCLUDES) +@@ -34,6 +34,7 @@ ALL_CFLAGS := $(INCLUDES) SHARED_CFLAGS += -fPIC -fvisibility=hidden -DSHARED +CFLAGS = $(EXTRA_CFLAGS) CFLAGS ?= -g -O2 -Werror -Wall -std=gnu89 - ALL_CFLAGS += $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 - ALL_LDFLAGS += $(LDFLAGS) + ALL_CFLAGS += $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $(EXTRA_CFLAGS) + ALL_LDFLAGS += $(LDFLAGS) $(EXTRA_LDFLAGS) diff --git a/package/network/utils/bpftools/patches/002-includes.patch b/package/network/utils/bpftools/patches/002-includes.patch index 589d71c31e7..ac1b5fcc228 100644 --- a/package/network/utils/bpftools/patches/002-includes.patch +++ b/package/network/utils/bpftools/patches/002-includes.patch @@ -14,7 +14,7 @@ @@ -73,10 +73,10 @@ CFLAGS += -W -Wall -Wextra -Wno-unused-p CFLAGS += $(filter-out -Wswitch-enum -Wnested-externs,$(EXTRA_WARNINGS)) CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \ - -I$(if $(OUTPUT),$(OUTPUT),.) \ + -I$(or $(OUTPUT),.) \ - -I$(LIBBPF_INCLUDE) \ -I$(srctree)/src/kernel/bpf/ \ -I$(srctree)/include \ From a03076cc392b67c8342aac2017f8ac903c983e59 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 26 Feb 2023 15:47:09 +0100 Subject: [PATCH 16/26] binutils: Update to version 2.40 binutils 2.39: https://lists.gnu.org/archive/html/info-gnu/2022-08/msg00002.html binutils 2.40: https://lists.gnu.org/archive/html/info-gnu/2023-01/msg00003.html This version includes a new libsframe.so library, pack it into the libbfd package as it is used by this library. Also deactivate some optional configuration options for now. An extra patch to fix compile problem in AARCH64 is added. gprofng needs a C++ standard library, deactivate it for now. Activate feature-disassembler-init-styled in bpftools too to fix compilation with the updated binutils. An bpftool version 7.0 or later is needed for binutils 2.39 and later. Signed-off-by: Hauke Mehrtens --- package/devel/binutils/Makefile | 12 ++- .../patches/001-replace-attribute_const.patch | 88 +++++++++++++++++++ package/network/utils/bpftools/Makefile | 2 +- 3 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 package/devel/binutils/patches/001-replace-attribute_const.patch diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile index 75fdd320cdb..95939f2dcd9 100644 --- a/package/devel/binutils/Makefile +++ b/package/devel/binutils/Makefile @@ -8,16 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=binutils -PKG_VERSION:=2.38 +PKG_VERSION:=2.40 PKG_RELEASE:=1 PKG_SOURCE_URL:=@GNU/binutils PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_VERSION:=$(PKG_VERSION) -PKG_HASH:=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024 +PKG_HASH:=0f8a4c272d7f17f369ded10a4aca28b8e304828e95526da482b0ccc4dfc9d8e1 PKG_FIXUP:=patch-libtool -PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl +PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof gprofng binutils ld libiberty gold intl libctf libsframe PKG_REMOVE_FILES:=libtool.m4 PKG_INSTALL:=1 @@ -87,7 +87,10 @@ CONFIGURE_ARGS += \ --enable-shared \ --enable-install-libiberty \ --enable-install-libbfd \ - --enable-install-libctf + --enable-install-libctf \ + --with-system-zlib \ + --without-zstd \ + --disable-gprofng define Build/Install $(call Build/Install/Default) @@ -105,6 +108,7 @@ endef define Package/libbfd/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsframe*.so* $(1)/usr/lib/ endef define Package/libctf/install diff --git a/package/devel/binutils/patches/001-replace-attribute_const.patch b/package/devel/binutils/patches/001-replace-attribute_const.patch new file mode 100644 index 00000000000..5fd855efd16 --- /dev/null +++ b/package/devel/binutils/patches/001-replace-attribute_const.patch @@ -0,0 +1,88 @@ +Fix this compile error: +---------------------- +./../common/cpuid.c:27:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__get_cpuid' + 27 | __get_cpuid (unsigned int op ATTRIBUTE_UNUSED, unsigned int *eax, + | ^~~~~~~~~~~ +---------------------- + +and this error: +---------------------- +unwind.c: In function '__collector_ext_return_address': +unwind.c:236:34: error: '__u64' undeclared (first use in this function) + 236 | context->uc_mcontext.sp = (__u64) __builtin_frame_address(0); \ + | ^~~~~ +unwind.c:490:3: note: in expansion of macro 'FILL_CONTEXT' + 490 | FILL_CONTEXT ((&context)); + +---------------------- +--- a/gprofng/common/cpuid.c ++++ b/gprofng/common/cpuid.c +@@ -23,7 +23,7 @@ + #elif defined(__aarch64__) + #define ATTRIBUTE_UNUSED __attribute__((unused)) + +-static inline uint_t __attribute_const__ ++static inline uint_t __attribute__((__const__)) + __get_cpuid (unsigned int op ATTRIBUTE_UNUSED, unsigned int *eax, + unsigned int *ebx ATTRIBUTE_UNUSED, + unsigned int *ecx ATTRIBUTE_UNUSED, unsigned int *edx ATTRIBUTE_UNUSED) +--- a/gprofng/libcollector/unwind.c ++++ b/gprofng/libcollector/unwind.c +@@ -233,7 +233,7 @@ memory_error_func (int status ATTRIBUTE_ + #elif ARCH(Aarch64) + #define FILL_CONTEXT(context) \ + { CALL_UTIL (getcontext) (context); \ +- context->uc_mcontext.sp = (__u64) __builtin_frame_address(0); \ ++ context->uc_mcontext.sp = (uint64_t) __builtin_frame_address(0); \ + } + + #endif /* ARCH() */ +@@ -4579,11 +4579,11 @@ stack_unwind (char *buf, int size, void + if (buf && bptr && eptr && context && size + mode > 0) + getByteInstruction ((unsigned char *) eptr); + int ind = 0; +- __u64 *lbuf = (void *) buf; +- int lsize = size / sizeof (__u64); +- __u64 pc = context->uc_mcontext.pc; +- __u64 sp = context->uc_mcontext.sp; +- __u64 stack_base; ++ uint64_t *lbuf = (void *) buf; ++ int lsize = size / sizeof (uint64_t); ++ uint64_t pc = context->uc_mcontext.pc; ++ uint64_t sp = context->uc_mcontext.sp; ++ uint64_t stack_base; + unsigned long tbgn = 0; + unsigned long tend = 0; + +@@ -4594,7 +4594,7 @@ stack_unwind (char *buf, int size, void + { + stack_base = sp + 0x100000; + if (stack_base < sp) // overflow +- stack_base = (__u64) -1; ++ stack_base = (uint64_t) -1; + } + DprintfT (SP_DUMP_UNWIND, + "unwind.c:%d stack_unwind %2d pc=0x%llx sp=0x%llx stack_base=0x%llx\n", +@@ -4625,17 +4625,17 @@ stack_unwind (char *buf, int size, void + __LINE__, (unsigned long) sp); + break; + } +- pc = ((__u64 *) sp)[1]; +- __u64 old_sp = sp; +- sp = ((__u64 *) sp)[0]; ++ pc = ((uint64_t *) sp)[1]; ++ uint64_t old_sp = sp; ++ sp = ((uint64_t *) sp)[0]; + if (sp < old_sp) + break; + } + if (ind >= lsize) + { + ind = lsize - 1; +- lbuf[ind++] = (__u64) SP_TRUNC_STACK_MARKER; ++ lbuf[ind++] = (uint64_t) SP_TRUNC_STACK_MARKER; + } +- return ind * sizeof (__u64); ++ return ind * sizeof (uint64_t); + } + #endif /* ARCH() */ diff --git a/package/network/utils/bpftools/Makefile b/package/network/utils/bpftools/Makefile index 7adda2edafc..a1ae22b93f5 100644 --- a/package/network/utils/bpftools/Makefile +++ b/package/network/utils/bpftools/Makefile @@ -106,7 +106,7 @@ MAKE_FLAGS += \ feature-llvm=0 \ feature-libcap=0 \ feature-disassembler-four-args=1 \ - feature-disassembler-init-styled=0 + feature-disassembler-init-styled=1 ifeq ($(BUILD_VARIANT),lib) MAKE_PATH = libbpf/src From 387c2df15cbd7bfa3917209541e1cd94ddc885d0 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Mon, 6 Mar 2023 11:58:56 -0300 Subject: [PATCH 17/26] openssl: fix sysupgrade failure with devcrypto The bump to 3.0.8 inadvertently removed patches that are needed here, but were not adopted upstream. The most important one changes the default value of the DIGESTS setting from ALL to NONE. The absence of this patch causes a sysupgrade failure while the engine is in use with digests enabled. When this happens, the system fails to boot with a kernel panic. Also, explicitly set DIGESTS to NONE in the provided config file, and change the default ciphers setting to disable ECB, which has been recommended for a long time and may cause trouble with some apps. The config file change by itself is not enough because the config file may be preserved during sysupgrade. For people affected by this bug: You can either: 1. remove, the libopenssl-devcrypto package 2. disable the engine in /etc/config/openssl; 3. change /etc/ssl/engines.cnf.d/devcrypto.cnf to set DIGESTS=NONE; 4. update libopenssl-devcrypto to >=3.0.8-3 However, after doing any of the above, **you must reboot the device before running sysupgrade** to ensure no running application is using the engine. Running `/etc/init.d/openssl restart` is not enough. Fixes: 7e7e76afca "openssl: bump to 3.0.8" Signed-off-by: Eneas U de Queiroz --- package/libs/openssl/Makefile | 2 +- package/libs/openssl/files/devcrypto.cnf | 11 +++-- ...default-to-not-use-digests-in-engine.patch | 41 +++++++++++++++++++ ...to-ignore-error-when-closing-session.patch | 24 +++++++++++ 4 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 package/libs/openssl/patches/500-e_devcrypto-default-to-not-use-digests-in-engine.patch create mode 100644 package/libs/openssl/patches/510-e_devcrypto-ignore-error-when-closing-session.patch diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 153d14a4469..90aaafd31fb 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl PKG_VERSION:=3.0.8 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_USE_MIPS16:=0 PKG_BUILD_PARALLEL:=1 diff --git a/package/libs/openssl/files/devcrypto.cnf b/package/libs/openssl/files/devcrypto.cnf index 549275600d1..8afd9b1b004 100644 --- a/package/libs/openssl/files/devcrypto.cnf +++ b/package/libs/openssl/files/devcrypto.cnf @@ -17,8 +17,9 @@ default_algorithms = ALL # It is recommended to disable the ECB ciphers; in most cases, it will # only be used for PRNG, in small blocks, where performance is poor, # and there may be problems with apps forking with open crypto -# contexts, leading to failures. The CBC ciphers work well: -#CIPHERS=DES-CBC, DES-EDE3-CBC, AES-128-CBC, AES-192-CBC, AES-256-CBC +# contexts, leading to failures. The CBC ciphers work well. +CIPHERS=DES-CBC, DES-EDE3-CBC, AES-128-CBC, AES-192-CBC, AES-256-CBC, \ + AES-128-CTR, AES-192-CTR, AES-256-CTR # DIGESTS: either ALL, NONE, or a comma-separated list of digests to # enable [default=NONE] @@ -26,6 +27,8 @@ default_algorithms = ALL # is poor, and there are many cases in which they will not work, # especially when calling fork with open crypto contexts. Openssh, # for example, does this, and you may not be able to login. -#DIGESTS = NONE - +# Sysupgrade will fail as well. If you're adventurous enough to change +# this, you should change it back to NONE, and reboot before running +# sysupgrade! +DIGESTS = NONE diff --git a/package/libs/openssl/patches/500-e_devcrypto-default-to-not-use-digests-in-engine.patch b/package/libs/openssl/patches/500-e_devcrypto-default-to-not-use-digests-in-engine.patch new file mode 100644 index 00000000000..f1832638586 --- /dev/null +++ b/package/libs/openssl/patches/500-e_devcrypto-default-to-not-use-digests-in-engine.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz +Date: Mon, 11 Mar 2019 09:29:13 -0300 +Subject: e_devcrypto: default to not use digests in engine + +Digests are almost always slower when using /dev/crypto because of the +cost of the context switches. Only for large blocks it is worth it. + +Also, when forking, the open context structures are duplicated, but the +internal kernel sessions are still shared between forks, which means an +update/close operation in one fork affects all processes using that +session. + +This affects digests, especially for HMAC, where the session with the +key hash is used as a source for subsequent operations. At least one +popular application does this across a fork. Disabling digests by +default will mitigate the problem, while still allowing the user to +turn them on if it is safe and fast enough. + +Signed-off-by: Eneas U de Queiroz + +--- a/engines/e_devcrypto.c ++++ b/engines/e_devcrypto.c +@@ -905,7 +905,7 @@ static void prepare_digest_methods(void) + for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data); + i++) { + +- selected_digests[i] = 1; ++ selected_digests[i] = 0; + + /* + * Check that the digest is usable +@@ -1119,7 +1119,7 @@ static const ENGINE_CMD_DEFN devcrypto_c + #ifdef IMPLEMENT_DIGEST + {DEVCRYPTO_CMD_DIGESTS, + "DIGESTS", +- "either ALL, NONE, or a comma-separated list of digests to enable [default=ALL]", ++ "either ALL, NONE, or a comma-separated list of digests to enable [default=NONE]", + ENGINE_CMD_FLAG_STRING}, + #endif + diff --git a/package/libs/openssl/patches/510-e_devcrypto-ignore-error-when-closing-session.patch b/package/libs/openssl/patches/510-e_devcrypto-ignore-error-when-closing-session.patch new file mode 100644 index 00000000000..40b1dc78d31 --- /dev/null +++ b/package/libs/openssl/patches/510-e_devcrypto-ignore-error-when-closing-session.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz +Date: Mon, 11 Mar 2019 10:15:14 -0300 +Subject: e_devcrypto: ignore error when closing session + +In cipher_init, ignore an eventual error when closing the previous +session. It may have been closed by another process after a fork. + +Signed-off-by: Eneas U de Queiroz + +--- a/engines/e_devcrypto.c ++++ b/engines/e_devcrypto.c +@@ -211,9 +211,8 @@ static int cipher_init(EVP_CIPHER_CTX *c + int ret; + + /* cleanup a previous session */ +- if (cipher_ctx->sess.ses != 0 && +- clean_devcrypto_session(&cipher_ctx->sess) == 0) +- return 0; ++ if (cipher_ctx->sess.ses != 0) ++ clean_devcrypto_session(&cipher_ctx->sess); + + cipher_ctx->sess.cipher = cipher_d->devcryptoid; + cipher_ctx->sess.keylen = cipher_d->keylen; From c75cd5f6028da6ceb1fb3438da93e2305cd720b1 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Mon, 6 Mar 2023 11:58:56 -0300 Subject: [PATCH 18/26] openssl: fix variable reference in conffiles Fix the trivial abscence of $() when assigning engine config files to the main libopenssl-config package even if the corresponding engines were not built into the main library. This is mostly cosmetic, since scripts/ipkg-build tests the file's presence before it is actually included in the package's conffiles. Fixes: 30b0351039 "openssl: configure engine packages during install" Signed-off-by: Eneas U de Queiroz --- package/libs/openssl/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 90aaafd31fb..57ff056e902 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl PKG_VERSION:=3.0.8 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_USE_MIPS16:=0 PKG_BUILD_PARALLEL:=1 @@ -128,8 +128,8 @@ endef define Package/libopenssl-conf/conffiles /etc/ssl/openssl.cnf -$(if CONFIG_OPENSSL_ENGINE_BUILTIN_DEVCRYPTO,/etc/ssl/engines.cnf.d/devcrypto.cnf) -$(if CONFIG_OPENSSL_ENGINE_BUILTIN_PADLOCK,/etc/ssl/engines.cnf.d/padlock.cnf) +$(if $(CONFIG_OPENSSL_ENGINE_BUILTIN_DEVCRYPTO),/etc/ssl/engines.cnf.d/devcrypto.cnf) +$(if $(CONFIG_OPENSSL_ENGINE_BUILTIN_PADLOCK),/etc/ssl/engines.cnf.d/padlock.cnf) endef define Package/libopenssl-conf/description From b88955aa2294c61f21bdf7014e10d8ea29d0c346 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sat, 25 Feb 2023 16:20:28 -0500 Subject: [PATCH 19/26] kernel: bump 5.10 to 5.10.169 Manually rebased: backport-5.10/811-v6.1-0001-nvmem-core-Fix-memleak-in-nvmem_register.patch Removed upstreamed: backport-5.10/811-v6.1-0003-nvmem-core-add-error-handling-for-dev_set_name.patch[1] patches-5.10/070-net-bgmac-fix-BCM5358-support-by-setting-correct-fla.patch[2] Add fix: target/linux/generic/backport-5.10/804-0001-net-Remove-WARN_ON_ONCE-sk-sk_forward_alloc-from-sk_.patch[3] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.169&id=a19a0f67dbb89ad2bfc466f2003841acba645884 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.169&id=a5c51e0c3202820192db3f3809e072f3ca2b1177 3. https://lore.kernel.org/stable/20230227211548.13923-1-kuniyu@amazon.com Signed-off-by: John Audia --- include/kernel-5.10 | 4 +- .../910-unaligned_access_hacks.patch | 2 +- ...M5358-support-by-setting-correct-fla.patch | 46 --------- ...the-dst-buffer-to-of_get_mac_address.patch | 2 +- ...core-Add-support-for-keepout-regions.patch | 12 +-- ...unctions-to-make-number-reading-easy.patch | 2 +- ...x-unintentional-sign-extension-issue.patch | 2 +- ...ON_ONCE-sk-sk_forward_alloc-from-sk_.patch | 98 +++++++++++++++++++ ...-nvmem-core-allow-specifying-of_node.patch | 2 +- ...ify-nvmem_cell_read_variable_common-.patch | 6 +- ...rror-handling-while-validating-keepo.patch | 2 +- ...-rework-nvmem-cell-instance-creation.patch | 28 +++--- ...-nvmem-cell-post-processing-callback.patch | 4 +- ...-Remove-unused-devm_nvmem_unregister.patch | 6 +- ...em-core-Use-devm_add_action_or_reset.patch | 4 +- ...-input-parameter-for-NULL-in-nvmem_u.patch | 2 +- ...m-core-Fix-memleak-in-nvmem_register.patch | 29 +++--- ...-add-error-handling-for-dev_set_name.patch | 47 --------- ...mem-core-fix-device-node-refcounting.patch | 2 +- ...e-add-an-index-parameter-to-the-cell.patch | 18 ++-- ...05-nvmem-core-add-nvmem_add_one_cell.patch | 4 +- ...c-explicitly-deassert-gmac-ahb-reset.patch | 4 +- 22 files changed, 166 insertions(+), 160 deletions(-) delete mode 100644 target/linux/bcm47xx/patches-5.10/070-net-bgmac-fix-BCM5358-support-by-setting-correct-fla.patch create mode 100644 target/linux/generic/backport-5.10/804-0001-net-Remove-WARN_ON_ONCE-sk-sk_forward_alloc-from-sk_.patch delete mode 100644 target/linux/generic/backport-5.10/811-v6.1-0003-nvmem-core-add-error-handling-for-dev_set_name.patch diff --git a/include/kernel-5.10 b/include/kernel-5.10 index e0bdccaf43d..b2548dac887 100644 --- a/include/kernel-5.10 +++ b/include/kernel-5.10 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.10 = .168 -LINUX_KERNEL_HASH-5.10.168 = b67d2596ba8d30510f743f31899c94c43eaf006a254ff44d7fc6ea26e7ab359c +LINUX_VERSION-5.10 = .169 +LINUX_KERNEL_HASH-5.10.169 = d9754f6eb55e88214c7aaa7c4831c215f88b48da1d9b40f871b055ff56ebafcf diff --git a/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch index 0de433914da..e1c5c59c14a 100644 --- a/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch @@ -258,7 +258,7 @@ SVN-Revision: 35130 #include #include #include -@@ -926,10 +927,10 @@ static void tcp_v6_send_response(const s +@@ -927,10 +928,10 @@ static void tcp_v6_send_response(const s topt = (__be32 *)(t1 + 1); if (tsecr) { diff --git a/target/linux/bcm47xx/patches-5.10/070-net-bgmac-fix-BCM5358-support-by-setting-correct-fla.patch b/target/linux/bcm47xx/patches-5.10/070-net-bgmac-fix-BCM5358-support-by-setting-correct-fla.patch deleted file mode 100644 index f93fc0cd8d0..00000000000 --- a/target/linux/bcm47xx/patches-5.10/070-net-bgmac-fix-BCM5358-support-by-setting-correct-fla.patch +++ /dev/null @@ -1,46 +0,0 @@ -From d61615c366a489646a1bfe5b33455f916762d5f4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Wed, 8 Feb 2023 10:16:37 +0100 -Subject: [PATCH] net: bgmac: fix BCM5358 support by setting correct flags -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Code blocks handling BCMA_CHIP_ID_BCM5357 and BCMA_CHIP_ID_BCM53572 were -incorrectly unified. Chip package values are not unique and cannot be -checked independently. They are meaningful only in a context of a given -chip. - -Packages BCM5358 and BCM47188 share the same value but then belong to -different chips. Code unification resulted in treating BCM5358 as -BCM47188 and broke its initialization. - -Link: https://github.com/openwrt/openwrt/issues/8278 -Fixes: cb1b0f90acfe ("net: ethernet: bgmac: unify code of the same family") -Cc: Jon Mason -Signed-off-by: Rafał Miłecki -Reviewed-by: Florian Fainelli -Link: https://lore.kernel.org/r/20230208091637.16291-1-zajec5@gmail.com -Signed-off-by: Jakub Kicinski ---- - drivers/net/ethernet/broadcom/bgmac-bcma.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/drivers/net/ethernet/broadcom/bgmac-bcma.c -+++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c -@@ -240,12 +240,12 @@ static int bgmac_probe(struct bcma_devic - bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST; - bgmac->feature_flags |= BGMAC_FEAT_FLW_CTRL1; - bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_PHY; -- if (ci->pkg == BCMA_PKG_ID_BCM47188 || -- ci->pkg == BCMA_PKG_ID_BCM47186) { -+ if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM47186) || -+ (ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg == BCMA_PKG_ID_BCM47188)) { - bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_RGMII; - bgmac->feature_flags |= BGMAC_FEAT_IOST_ATTACHED; - } -- if (ci->pkg == BCMA_PKG_ID_BCM5358) -+ if (ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM5358) - bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_EPHYRMII; - break; - case BCMA_CHIP_ID_BCM53573: diff --git a/target/linux/generic/backport-5.10/732-v5.13-0008-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch b/target/linux/generic/backport-5.10/732-v5.13-0008-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch index 787d2cdf727..47abbd0f189 100644 --- a/target/linux/generic/backport-5.10/732-v5.13-0008-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch +++ b/target/linux/generic/backport-5.10/732-v5.13-0008-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch @@ -1360,7 +1360,7 @@ Signed-off-by: David S. Miller int irq; --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -5013,7 +5013,7 @@ int stmmac_dvr_probe(struct device *devi +@@ -5014,7 +5014,7 @@ int stmmac_dvr_probe(struct device *devi priv->wol_irq = res->wol_irq; priv->lpi_irq = res->lpi_irq; diff --git a/target/linux/generic/backport-5.10/801-v5.11-0001-nvmem-core-Add-support-for-keepout-regions.patch b/target/linux/generic/backport-5.10/801-v5.11-0001-nvmem-core-Add-support-for-keepout-regions.patch index 23879d40af5..a0f8c4715e4 100644 --- a/target/linux/generic/backport-5.10/801-v5.11-0001-nvmem-core-Add-support-for-keepout-regions.patch +++ b/target/linux/generic/backport-5.10/801-v5.11-0001-nvmem-core-Add-support-for-keepout-regions.patch @@ -212,9 +212,9 @@ Signed-off-by: Greg Kroah-Hartman if (!config->no_of_node) nvmem->dev.of_node = config->dev->of_node; -@@ -680,6 +819,12 @@ struct nvmem_device *nvmem_register(cons - nvmem->dev.groups = nvmem_dev_groups; - #endif +@@ -703,6 +842,12 @@ struct nvmem_device *nvmem_register(cons + if (rval) + goto err_remove_cells; + if (nvmem->nkeepout) { + rval = nvmem_validate_keepouts(nvmem); @@ -224,7 +224,7 @@ Signed-off-by: Greg Kroah-Hartman + dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name); - rval = device_register(&nvmem->dev); + rval = device_add(&nvmem->dev); --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -31,6 +31,19 @@ enum nvmem_type { @@ -256,8 +256,8 @@ Signed-off-by: Greg Kroah-Hartman * @type: Type of the nvmem storage * @read_only: Device is read-only. * @root_only: Device is accessibly to root only. -@@ -67,6 +82,8 @@ struct nvmem_config { - struct gpio_desc *wp_gpio; +@@ -65,6 +80,8 @@ struct nvmem_config { + struct module *owner; const struct nvmem_cell_info *cells; int ncells; + const struct nvmem_keepout *keepout; diff --git a/target/linux/generic/backport-5.10/803-v5.13-0004-nvmem-core-Add-functions-to-make-number-reading-easy.patch b/target/linux/generic/backport-5.10/803-v5.13-0004-nvmem-core-Add-functions-to-make-number-reading-easy.patch index ff2456722f9..f791aea8ae8 100644 --- a/target/linux/generic/backport-5.10/803-v5.13-0004-nvmem-core-Add-functions-to-make-number-reading-easy.patch +++ b/target/linux/generic/backport-5.10/803-v5.13-0004-nvmem-core-Add-functions-to-make-number-reading-easy.patch @@ -57,7 +57,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -1612,6 +1612,101 @@ int nvmem_cell_read_u64(struct device *d +@@ -1613,6 +1613,101 @@ int nvmem_cell_read_u64(struct device *d } EXPORT_SYMBOL_GPL(nvmem_cell_read_u64); diff --git a/target/linux/generic/backport-5.10/803-v5.13-0005-nvmem-core-Fix-unintentional-sign-extension-issue.patch b/target/linux/generic/backport-5.10/803-v5.13-0005-nvmem-core-Fix-unintentional-sign-extension-issue.patch index 72133d3a350..958dc65073f 100644 --- a/target/linux/generic/backport-5.10/803-v5.13-0005-nvmem-core-Fix-unintentional-sign-extension-issue.patch +++ b/target/linux/generic/backport-5.10/803-v5.13-0005-nvmem-core-Fix-unintentional-sign-extension-issue.patch @@ -23,7 +23,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -1699,7 +1699,7 @@ int nvmem_cell_read_variable_le_u64(stru +@@ -1700,7 +1700,7 @@ int nvmem_cell_read_variable_le_u64(stru /* Copy w/ implicit endian conversion */ *val = 0; for (i = 0; i < len; i++) diff --git a/target/linux/generic/backport-5.10/804-0001-net-Remove-WARN_ON_ONCE-sk-sk_forward_alloc-from-sk_.patch b/target/linux/generic/backport-5.10/804-0001-net-Remove-WARN_ON_ONCE-sk-sk_forward_alloc-from-sk_.patch new file mode 100644 index 00000000000..74c01ec5a51 --- /dev/null +++ b/target/linux/generic/backport-5.10/804-0001-net-Remove-WARN_ON_ONCE-sk-sk_forward_alloc-from-sk_.patch @@ -0,0 +1,98 @@ +From 35cd2598c910ad6a1cc8bd3f731429b1901abc63 Mon Sep 17 00:00:00 2001 +From: Kuniyuki Iwashima +Date: Mon, 27 Feb 2023 13:15:48 -0800 +Subject: [PATCH] net: Remove WARN_ON_ONCE(sk->sk_forward_alloc) from + sk_stream_kill_queues(). + +commit 62ec33b44e0f7168ff2886520fec6fb62d03b5a3 upstream. + +Christoph Paasch reported that commit b5fc29233d28 ("inet6: Remove +inet6_destroy_sock() in sk->sk_prot->destroy().") started triggering +WARN_ON_ONCE(sk->sk_forward_alloc) in sk_stream_kill_queues(). [0 - 2] +Also, we can reproduce it by a program in [3]. + +In the commit, we delay freeing ipv6_pinfo.pktoptions from sk->destroy() +to sk->sk_destruct(), so sk->sk_forward_alloc is no longer zero in +inet_csk_destroy_sock(). + +The same check has been in inet_sock_destruct() from at least v2.6, +we can just remove the WARN_ON_ONCE(). However, among the users of +sk_stream_kill_queues(), only CAIF is not calling inet_sock_destruct(). +Thus, we add the same WARN_ON_ONCE() to caif_sock_destructor(). + +[0]: https://lore.kernel.org/netdev/39725AB4-88F1-41B3-B07F-949C5CAEFF4F@icloud.com/ +[1]: https://github.com/multipath-tcp/mptcp_net-next/issues/341 +[2]: +WARNING: CPU: 0 PID: 3232 at net/core/stream.c:212 sk_stream_kill_queues+0x2f9/0x3e0 +Modules linked in: +CPU: 0 PID: 3232 Comm: syz-executor.0 Not tainted 6.2.0-rc5ab24eb4698afbe147b424149c529e2a43ec24eb5 #2 +Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 +RIP: 0010:sk_stream_kill_queues+0x2f9/0x3e0 +Code: 03 0f b6 04 02 84 c0 74 08 3c 03 0f 8e ec 00 00 00 8b ab 08 01 00 00 e9 60 ff ff ff e8 d0 5f b6 fe 0f 0b eb 97 e8 c7 5f b6 fe <0f> 0b eb a0 e8 be 5f b6 fe 0f 0b e9 6a fe ff ff e8 02 07 e3 fe e9 +RSP: 0018:ffff88810570fc68 EFLAGS: 00010293 +RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 +RDX: ffff888101f38f40 RSI: ffffffff8285e529 RDI: 0000000000000005 +RBP: 0000000000000ce0 R08: 0000000000000005 R09: 0000000000000000 +R10: 0000000000000ce0 R11: 0000000000000001 R12: ffff8881009e9488 +R13: ffffffff84af2cc0 R14: 0000000000000000 R15: ffff8881009e9458 +FS: 00007f7fdfbd5800(0000) GS:ffff88811b600000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 0000001b32923000 CR3: 00000001062fc006 CR4: 0000000000170ef0 +Call Trace: + + inet_csk_destroy_sock+0x1a1/0x320 + __tcp_close+0xab6/0xe90 + tcp_close+0x30/0xc0 + inet_release+0xe9/0x1f0 + inet6_release+0x4c/0x70 + __sock_release+0xd2/0x280 + sock_close+0x15/0x20 + __fput+0x252/0xa20 + task_work_run+0x169/0x250 + exit_to_user_mode_prepare+0x113/0x120 + syscall_exit_to_user_mode+0x1d/0x40 + do_syscall_64+0x48/0x90 + entry_SYSCALL_64_after_hwframe+0x72/0xdc +RIP: 0033:0x7f7fdf7ae28d +Code: c1 20 00 00 75 10 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 ee fb ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 37 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 +RSP: 002b:00000000007dfbb0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 +RAX: 0000000000000000 RBX: 0000000000000004 RCX: 00007f7fdf7ae28d +RDX: 0000000000000000 RSI: ffffffffffffffff RDI: 0000000000000003 +RBP: 0000000000000000 R08: 000000007f338e0f R09: 0000000000000e0f +R10: 000000007f338e13 R11: 0000000000000293 R12: 00007f7fdefff000 +R13: 00007f7fdefffcd8 R14: 00007f7fdefffce0 R15: 00007f7fdefffcd8 + + +[3]: https://lore.kernel.org/netdev/20230208004245.83497-1-kuniyu@amazon.com/ + +Fixes: b5fc29233d28 ("inet6: Remove inet6_destroy_sock() in sk->sk_prot->destroy().") +Reported-by: syzbot +Reported-by: Christoph Paasch +Signed-off-by: Kuniyuki Iwashima +Reviewed-by: Eric Dumazet +Signed-off-by: Jakub Kicinski +--- + net/caif/caif_socket.c | 1 + + net/core/stream.c | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + +--- a/net/caif/caif_socket.c ++++ b/net/caif/caif_socket.c +@@ -1020,6 +1020,7 @@ static void caif_sock_destructor(struct + return; + } + sk_stream_kill_queues(&cf_sk->sk); ++ WARN_ON(sk->sk_forward_alloc); + caif_free_client(&cf_sk->layer); + } + +--- a/net/core/stream.c ++++ b/net/core/stream.c +@@ -209,7 +209,6 @@ void sk_stream_kill_queues(struct sock * + sk_mem_reclaim(sk); + + WARN_ON(sk->sk_wmem_queued); +- WARN_ON(sk->sk_forward_alloc); + + /* It is _impossible_ for the backlog to contain anything + * when we get here. All user references to this socket diff --git a/target/linux/generic/backport-5.10/804-v5.14-0001-nvmem-core-allow-specifying-of_node.patch b/target/linux/generic/backport-5.10/804-v5.14-0001-nvmem-core-allow-specifying-of_node.patch index 5889e619106..f3debe84f38 100644 --- a/target/linux/generic/backport-5.10/804-v5.14-0001-nvmem-core-allow-specifying-of_node.patch +++ b/target/linux/generic/backport-5.10/804-v5.14-0001-nvmem-core-allow-specifying-of_node.patch @@ -70,7 +70,7 @@ Link: https://lore.kernel.org/linux-mtd/20210424110608.15748-2-michael@walle.cc * @no_of_node: Device should not use the parent's of_node even if it's !NULL. * @reg_read: Callback to read data. * @reg_write: Callback to write data. -@@ -87,6 +88,7 @@ struct nvmem_config { +@@ -85,6 +86,7 @@ struct nvmem_config { enum nvmem_type type; bool read_only; bool root_only; diff --git a/target/linux/generic/backport-5.10/804-v5.14-0005-nvmem-core-constify-nvmem_cell_read_variable_common-.patch b/target/linux/generic/backport-5.10/804-v5.14-0005-nvmem-core-constify-nvmem_cell_read_variable_common-.patch index 55c3c5d6fe7..3162a5362e5 100644 --- a/target/linux/generic/backport-5.10/804-v5.14-0005-nvmem-core-constify-nvmem_cell_read_variable_common-.patch +++ b/target/linux/generic/backport-5.10/804-v5.14-0005-nvmem-core-constify-nvmem_cell_read_variable_common-.patch @@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -1614,9 +1614,9 @@ int nvmem_cell_read_u64(struct device *d +@@ -1615,9 +1615,9 @@ int nvmem_cell_read_u64(struct device *d } EXPORT_SYMBOL_GPL(nvmem_cell_read_u64); @@ -32,7 +32,7 @@ Signed-off-by: Greg Kroah-Hartman { struct nvmem_cell *cell; int nbits; -@@ -1660,7 +1660,7 @@ int nvmem_cell_read_variable_le_u32(stru +@@ -1661,7 +1661,7 @@ int nvmem_cell_read_variable_le_u32(stru u32 *val) { size_t len; @@ -41,7 +41,7 @@ Signed-off-by: Greg Kroah-Hartman int i; buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len); -@@ -1691,7 +1691,7 @@ int nvmem_cell_read_variable_le_u64(stru +@@ -1692,7 +1692,7 @@ int nvmem_cell_read_variable_le_u64(stru u64 *val) { size_t len; diff --git a/target/linux/generic/backport-5.10/805-v5.15-0003-nvmem-core-fix-error-handling-while-validating-keepo.patch b/target/linux/generic/backport-5.10/805-v5.15-0003-nvmem-core-fix-error-handling-while-validating-keepo.patch index e5342e79d3c..7951cc73004 100644 --- a/target/linux/generic/backport-5.10/805-v5.15-0003-nvmem-core-fix-error-handling-while-validating-keepo.patch +++ b/target/linux/generic/backport-5.10/805-v5.15-0003-nvmem-core-fix-error-handling-while-validating-keepo.patch @@ -20,7 +20,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -827,8 +827,11 @@ struct nvmem_device *nvmem_register(cons +@@ -850,8 +850,11 @@ struct nvmem_device *nvmem_register(cons if (nvmem->nkeepout) { rval = nvmem_validate_keepouts(nvmem); diff --git a/target/linux/generic/backport-5.10/806-v5.16-0001-nvmem-core-rework-nvmem-cell-instance-creation.patch b/target/linux/generic/backport-5.10/806-v5.16-0001-nvmem-core-rework-nvmem-cell-instance-creation.patch index fca7c5f848c..0b87172b2d6 100644 --- a/target/linux/generic/backport-5.10/806-v5.16-0001-nvmem-core-rework-nvmem-cell-instance-creation.patch +++ b/target/linux/generic/backport-5.10/806-v5.16-0001-nvmem-core-rework-nvmem-cell-instance-creation.patch @@ -206,7 +206,7 @@ Signed-off-by: Greg Kroah-Hartman } return 0; -@@ -1144,9 +1146,33 @@ struct nvmem_device *devm_nvmem_device_g +@@ -1145,9 +1147,33 @@ struct nvmem_device *devm_nvmem_device_g } EXPORT_SYMBOL_GPL(devm_nvmem_device_get); @@ -240,7 +240,7 @@ Signed-off-by: Greg Kroah-Hartman struct nvmem_cell *cell = ERR_PTR(-ENOENT); struct nvmem_cell_lookup *lookup; struct nvmem_device *nvmem; -@@ -1171,11 +1197,15 @@ nvmem_cell_get_from_lookup(struct device +@@ -1172,11 +1198,15 @@ nvmem_cell_get_from_lookup(struct device break; } @@ -259,7 +259,7 @@ Signed-off-by: Greg Kroah-Hartman } break; } -@@ -1186,10 +1216,10 @@ nvmem_cell_get_from_lookup(struct device +@@ -1187,10 +1217,10 @@ nvmem_cell_get_from_lookup(struct device } #if IS_ENABLED(CONFIG_OF) @@ -273,7 +273,7 @@ Signed-off-by: Greg Kroah-Hartman mutex_lock(&nvmem_mutex); list_for_each_entry(iter, &nvmem->cells, node) { -@@ -1219,6 +1249,7 @@ struct nvmem_cell *of_nvmem_cell_get(str +@@ -1220,6 +1250,7 @@ struct nvmem_cell *of_nvmem_cell_get(str { struct device_node *cell_np, *nvmem_np; struct nvmem_device *nvmem; @@ -281,7 +281,7 @@ Signed-off-by: Greg Kroah-Hartman struct nvmem_cell *cell; int index = 0; -@@ -1239,12 +1270,16 @@ struct nvmem_cell *of_nvmem_cell_get(str +@@ -1240,12 +1271,16 @@ struct nvmem_cell *of_nvmem_cell_get(str if (IS_ERR(nvmem)) return ERR_CAST(nvmem); @@ -300,7 +300,7 @@ Signed-off-by: Greg Kroah-Hartman return cell; } EXPORT_SYMBOL_GPL(of_nvmem_cell_get); -@@ -1350,13 +1385,17 @@ EXPORT_SYMBOL(devm_nvmem_cell_put); +@@ -1351,13 +1386,17 @@ EXPORT_SYMBOL(devm_nvmem_cell_put); */ void nvmem_cell_put(struct nvmem_cell *cell) { @@ -320,7 +320,7 @@ Signed-off-by: Greg Kroah-Hartman { u8 *p, *b; int i, extra, bit_offset = cell->bit_offset; -@@ -1390,8 +1429,8 @@ static void nvmem_shift_read_buffer_in_p +@@ -1391,8 +1430,8 @@ static void nvmem_shift_read_buffer_in_p } static int __nvmem_cell_read(struct nvmem_device *nvmem, @@ -331,7 +331,7 @@ Signed-off-by: Greg Kroah-Hartman { int rc; -@@ -1422,18 +1461,18 @@ static int __nvmem_cell_read(struct nvme +@@ -1423,18 +1462,18 @@ static int __nvmem_cell_read(struct nvme */ void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) { @@ -353,7 +353,7 @@ Signed-off-by: Greg Kroah-Hartman if (rc) { kfree(buf); return ERR_PTR(rc); -@@ -1443,7 +1482,7 @@ void *nvmem_cell_read(struct nvmem_cell +@@ -1444,7 +1483,7 @@ void *nvmem_cell_read(struct nvmem_cell } EXPORT_SYMBOL_GPL(nvmem_cell_read); @@ -362,7 +362,7 @@ Signed-off-by: Greg Kroah-Hartman u8 *_buf, int len) { struct nvmem_device *nvmem = cell->nvmem; -@@ -1496,16 +1535,7 @@ err: +@@ -1497,16 +1536,7 @@ err: return ERR_PTR(rc); } @@ -380,7 +380,7 @@ Signed-off-by: Greg Kroah-Hartman { struct nvmem_device *nvmem = cell->nvmem; int rc; -@@ -1531,6 +1561,21 @@ int nvmem_cell_write(struct nvmem_cell * +@@ -1532,6 +1562,21 @@ int nvmem_cell_write(struct nvmem_cell * return len; } @@ -402,7 +402,7 @@ Signed-off-by: Greg Kroah-Hartman EXPORT_SYMBOL_GPL(nvmem_cell_write); static int nvmem_cell_read_common(struct device *dev, const char *cell_id, -@@ -1633,7 +1678,7 @@ static const void *nvmem_cell_read_varia +@@ -1634,7 +1679,7 @@ static const void *nvmem_cell_read_varia if (IS_ERR(cell)) return cell; @@ -411,7 +411,7 @@ Signed-off-by: Greg Kroah-Hartman buf = nvmem_cell_read(cell, len); nvmem_cell_put(cell); if (IS_ERR(buf)) -@@ -1729,18 +1774,18 @@ EXPORT_SYMBOL_GPL(nvmem_cell_read_variab +@@ -1730,18 +1775,18 @@ EXPORT_SYMBOL_GPL(nvmem_cell_read_variab ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem, struct nvmem_cell_info *info, void *buf) { @@ -433,7 +433,7 @@ Signed-off-by: Greg Kroah-Hartman if (rc) return rc; -@@ -1760,17 +1805,17 @@ EXPORT_SYMBOL_GPL(nvmem_device_cell_read +@@ -1761,17 +1806,17 @@ EXPORT_SYMBOL_GPL(nvmem_device_cell_read int nvmem_device_cell_write(struct nvmem_device *nvmem, struct nvmem_cell_info *info, void *buf) { diff --git a/target/linux/generic/backport-5.10/806-v5.16-0002-nvmem-core-add-nvmem-cell-post-processing-callback.patch b/target/linux/generic/backport-5.10/806-v5.16-0002-nvmem-core-add-nvmem-cell-post-processing-callback.patch index a5d4ace4e53..16eb07147ea 100644 --- a/target/linux/generic/backport-5.10/806-v5.16-0002-nvmem-core-add-nvmem-cell-post-processing-callback.patch +++ b/target/linux/generic/backport-5.10/806-v5.16-0002-nvmem-core-add-nvmem-cell-post-processing-callback.patch @@ -38,7 +38,7 @@ Signed-off-by: Greg Kroah-Hartman nvmem->keepout = config->keepout; nvmem->nkeepout = config->nkeepout; if (config->of_node) -@@ -1443,6 +1445,13 @@ static int __nvmem_cell_read(struct nvme +@@ -1444,6 +1446,13 @@ static int __nvmem_cell_read(struct nvme if (cell->bit_offset || cell->nbits) nvmem_shift_read_buffer_in_place(cell, buf); @@ -72,7 +72,7 @@ Signed-off-by: Greg Kroah-Hartman * @size: Device size. * @word_size: Minimum read/write access granularity. * @stride: Minimum read/write access stride. -@@ -94,6 +98,7 @@ struct nvmem_config { +@@ -92,6 +96,7 @@ struct nvmem_config { bool no_of_node; nvmem_reg_read_t reg_read; nvmem_reg_write_t reg_write; diff --git a/target/linux/generic/backport-5.10/808-v5.18-0001-nvmem-core-Remove-unused-devm_nvmem_unregister.patch b/target/linux/generic/backport-5.10/808-v5.18-0001-nvmem-core-Remove-unused-devm_nvmem_unregister.patch index 2005493dc06..3fc5393fa94 100644 --- a/target/linux/generic/backport-5.10/808-v5.18-0001-nvmem-core-Remove-unused-devm_nvmem_unregister.patch +++ b/target/linux/generic/backport-5.10/808-v5.18-0001-nvmem-core-Remove-unused-devm_nvmem_unregister.patch @@ -17,7 +17,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -945,28 +945,6 @@ struct nvmem_device *devm_nvmem_register +@@ -946,28 +946,6 @@ struct nvmem_device *devm_nvmem_register } EXPORT_SYMBOL_GPL(devm_nvmem_register); @@ -48,7 +48,7 @@ Signed-off-by: Greg Kroah-Hartman { --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h -@@ -135,8 +135,6 @@ void nvmem_unregister(struct nvmem_devic +@@ -133,8 +133,6 @@ void nvmem_unregister(struct nvmem_devic struct nvmem_device *devm_nvmem_register(struct device *dev, const struct nvmem_config *cfg); @@ -57,7 +57,7 @@ Signed-off-by: Greg Kroah-Hartman void nvmem_add_cell_table(struct nvmem_cell_table *table); void nvmem_del_cell_table(struct nvmem_cell_table *table); -@@ -155,12 +153,6 @@ devm_nvmem_register(struct device *dev, +@@ -153,12 +151,6 @@ devm_nvmem_register(struct device *dev, return nvmem_register(c); } diff --git a/target/linux/generic/backport-5.10/808-v5.18-0002-nvmem-core-Use-devm_add_action_or_reset.patch b/target/linux/generic/backport-5.10/808-v5.18-0002-nvmem-core-Use-devm_add_action_or_reset.patch index 01a1cdb2b34..39c05258324 100644 --- a/target/linux/generic/backport-5.10/808-v5.18-0002-nvmem-core-Use-devm_add_action_or_reset.patch +++ b/target/linux/generic/backport-5.10/808-v5.18-0002-nvmem-core-Use-devm_add_action_or_reset.patch @@ -16,7 +16,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -907,9 +907,9 @@ void nvmem_unregister(struct nvmem_devic +@@ -908,9 +908,9 @@ void nvmem_unregister(struct nvmem_devic } EXPORT_SYMBOL_GPL(nvmem_unregister); @@ -28,7 +28,7 @@ Signed-off-by: Greg Kroah-Hartman } /** -@@ -926,20 +926,16 @@ static void devm_nvmem_release(struct de +@@ -927,20 +927,16 @@ static void devm_nvmem_release(struct de struct nvmem_device *devm_nvmem_register(struct device *dev, const struct nvmem_config *config) { diff --git a/target/linux/generic/backport-5.10/808-v5.18-0003-nvmem-core-Check-input-parameter-for-NULL-in-nvmem_u.patch b/target/linux/generic/backport-5.10/808-v5.18-0003-nvmem-core-Check-input-parameter-for-NULL-in-nvmem_u.patch index 3a806fe6223..01170d3d099 100644 --- a/target/linux/generic/backport-5.10/808-v5.18-0003-nvmem-core-Check-input-parameter-for-NULL-in-nvmem_u.patch +++ b/target/linux/generic/backport-5.10/808-v5.18-0003-nvmem-core-Check-input-parameter-for-NULL-in-nvmem_u.patch @@ -18,7 +18,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -903,7 +903,8 @@ static void nvmem_device_release(struct +@@ -904,7 +904,8 @@ static void nvmem_device_release(struct */ void nvmem_unregister(struct nvmem_device *nvmem) { diff --git a/target/linux/generic/backport-5.10/811-v6.1-0001-nvmem-core-Fix-memleak-in-nvmem_register.patch b/target/linux/generic/backport-5.10/811-v6.1-0001-nvmem-core-Fix-memleak-in-nvmem_register.patch index 698e737973b..561af918934 100644 --- a/target/linux/generic/backport-5.10/811-v6.1-0001-nvmem-core-Fix-memleak-in-nvmem_register.patch +++ b/target/linux/generic/backport-5.10/811-v6.1-0001-nvmem-core-Fix-memleak-in-nvmem_register.patch @@ -22,10 +22,23 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -830,21 +830,18 @@ struct nvmem_device *nvmem_register(cons +@@ -833,6 +833,12 @@ struct nvmem_device *nvmem_register(cons nvmem->dev.groups = nvmem_dev_groups; #endif ++ if (nvmem->nkeepout) { ++ rval = nvmem_validate_keepouts(nvmem); ++ if (rval) ++ goto err_put_device; ++ } ++ + if (config->compat) { + rval = nvmem_sysfs_setup_compat(nvmem, config); + if (rval) +@@ -853,15 +859,6 @@ struct nvmem_device *nvmem_register(cons + if (rval) + goto err_remove_cells; + - if (nvmem->nkeepout) { - rval = nvmem_validate_keepouts(nvmem); - if (rval) { @@ -37,16 +50,4 @@ Signed-off-by: Greg Kroah-Hartman - dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name); - rval = device_register(&nvmem->dev); - if (rval) - goto err_put_device; - -+ if (nvmem->nkeepout) { -+ rval = nvmem_validate_keepouts(nvmem); -+ if (rval) -+ goto err_device_del; -+ } -+ - if (config->compat) { - rval = nvmem_sysfs_setup_compat(nvmem, config); - if (rval) + rval = device_add(&nvmem->dev); diff --git a/target/linux/generic/backport-5.10/811-v6.1-0003-nvmem-core-add-error-handling-for-dev_set_name.patch b/target/linux/generic/backport-5.10/811-v6.1-0003-nvmem-core-add-error-handling-for-dev_set_name.patch deleted file mode 100644 index 322a1f6b55b..00000000000 --- a/target/linux/generic/backport-5.10/811-v6.1-0003-nvmem-core-add-error-handling-for-dev_set_name.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 5544e90c81261e82e02bbf7c6015a4b9c8c825ef Mon Sep 17 00:00:00 2001 -From: Gaosheng Cui -Date: Fri, 16 Sep 2022 13:20:50 +0100 -Subject: [PATCH] nvmem: core: add error handling for dev_set_name - -The type of return value of dev_set_name is int, which may return -wrong result, so we add error handling for it to reclaim memory -of nvmem resource, and return early when an error occurs. - -Signed-off-by: Gaosheng Cui -Signed-off-by: Srinivas Kandagatla -Link: https://lore.kernel.org/r/20220916122100.170016-4-srinivas.kandagatla@linaro.org -Signed-off-by: Greg Kroah-Hartman ---- - drivers/nvmem/core.c | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - ---- a/drivers/nvmem/core.c -+++ b/drivers/nvmem/core.c -@@ -811,18 +811,24 @@ struct nvmem_device *nvmem_register(cons - - switch (config->id) { - case NVMEM_DEVID_NONE: -- dev_set_name(&nvmem->dev, "%s", config->name); -+ rval = dev_set_name(&nvmem->dev, "%s", config->name); - break; - case NVMEM_DEVID_AUTO: -- dev_set_name(&nvmem->dev, "%s%d", config->name, nvmem->id); -+ rval = dev_set_name(&nvmem->dev, "%s%d", config->name, nvmem->id); - break; - default: -- dev_set_name(&nvmem->dev, "%s%d", -+ rval = dev_set_name(&nvmem->dev, "%s%d", - config->name ? : "nvmem", - config->name ? config->id : nvmem->id); - break; - } - -+ if (rval) { -+ ida_free(&nvmem_ida, nvmem->id); -+ kfree(nvmem); -+ return ERR_PTR(rval); -+ } -+ - nvmem->read_only = device_property_present(config->dev, "read-only") || - config->read_only || !nvmem->reg_write; - diff --git a/target/linux/generic/backport-5.10/812-v6.2-0013-nvmem-core-fix-device-node-refcounting.patch b/target/linux/generic/backport-5.10/812-v6.2-0013-nvmem-core-fix-device-node-refcounting.patch index 53a8fed7ada..a229c303ad0 100644 --- a/target/linux/generic/backport-5.10/812-v6.2-0013-nvmem-core-fix-device-node-refcounting.patch +++ b/target/linux/generic/backport-5.10/812-v6.2-0013-nvmem-core-fix-device-node-refcounting.patch @@ -21,7 +21,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -1242,16 +1242,21 @@ struct nvmem_cell *of_nvmem_cell_get(str +@@ -1237,16 +1237,21 @@ struct nvmem_cell *of_nvmem_cell_get(str if (!cell_np) return ERR_PTR(-ENOENT); diff --git a/target/linux/generic/backport-5.10/813-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch b/target/linux/generic/backport-5.10/813-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch index b5120855984..454d3bf0ed1 100644 --- a/target/linux/generic/backport-5.10/813-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch +++ b/target/linux/generic/backport-5.10/813-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch @@ -47,7 +47,7 @@ Signed-off-by: Greg Kroah-Hartman }; static DEFINE_MUTEX(nvmem_mutex); -@@ -1127,7 +1128,8 @@ struct nvmem_device *devm_nvmem_device_g +@@ -1122,7 +1123,8 @@ struct nvmem_device *devm_nvmem_device_g } EXPORT_SYMBOL_GPL(devm_nvmem_device_get); @@ -57,7 +57,7 @@ Signed-off-by: Greg Kroah-Hartman { struct nvmem_cell *cell; const char *name = NULL; -@@ -1146,6 +1148,7 @@ static struct nvmem_cell *nvmem_create_c +@@ -1141,6 +1143,7 @@ static struct nvmem_cell *nvmem_create_c cell->id = name; cell->entry = entry; @@ -65,7 +65,7 @@ Signed-off-by: Greg Kroah-Hartman return cell; } -@@ -1184,7 +1187,7 @@ nvmem_cell_get_from_lookup(struct device +@@ -1179,7 +1182,7 @@ nvmem_cell_get_from_lookup(struct device __nvmem_device_put(nvmem); cell = ERR_PTR(-ENOENT); } else { @@ -74,7 +74,7 @@ Signed-off-by: Greg Kroah-Hartman if (IS_ERR(cell)) __nvmem_device_put(nvmem); } -@@ -1232,15 +1235,27 @@ struct nvmem_cell *of_nvmem_cell_get(str +@@ -1227,15 +1230,27 @@ struct nvmem_cell *of_nvmem_cell_get(str struct nvmem_device *nvmem; struct nvmem_cell_entry *cell_entry; struct nvmem_cell *cell; @@ -105,7 +105,7 @@ Signed-off-by: Greg Kroah-Hartman nvmem_np = of_get_parent(cell_np); if (!nvmem_np) { -@@ -1262,7 +1277,7 @@ struct nvmem_cell *of_nvmem_cell_get(str +@@ -1257,7 +1272,7 @@ struct nvmem_cell *of_nvmem_cell_get(str return ERR_PTR(-ENOENT); } @@ -114,7 +114,7 @@ Signed-off-by: Greg Kroah-Hartman if (IS_ERR(cell)) __nvmem_device_put(nvmem); -@@ -1415,8 +1430,8 @@ static void nvmem_shift_read_buffer_in_p +@@ -1410,8 +1425,8 @@ static void nvmem_shift_read_buffer_in_p } static int __nvmem_cell_read(struct nvmem_device *nvmem, @@ -125,7 +125,7 @@ Signed-off-by: Greg Kroah-Hartman { int rc; -@@ -1430,7 +1445,7 @@ static int __nvmem_cell_read(struct nvme +@@ -1425,7 +1440,7 @@ static int __nvmem_cell_read(struct nvme nvmem_shift_read_buffer_in_place(cell, buf); if (nvmem->cell_post_process) { @@ -134,7 +134,7 @@ Signed-off-by: Greg Kroah-Hartman cell->offset, buf, cell->bytes); if (rc) return rc; -@@ -1465,7 +1480,7 @@ void *nvmem_cell_read(struct nvmem_cell +@@ -1460,7 +1475,7 @@ void *nvmem_cell_read(struct nvmem_cell if (!buf) return ERR_PTR(-ENOMEM); @@ -143,7 +143,7 @@ Signed-off-by: Greg Kroah-Hartman if (rc) { kfree(buf); return ERR_PTR(rc); -@@ -1778,7 +1793,7 @@ ssize_t nvmem_device_cell_read(struct nv +@@ -1773,7 +1788,7 @@ ssize_t nvmem_device_cell_read(struct nv if (rc) return rc; diff --git a/target/linux/generic/backport-5.10/813-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch b/target/linux/generic/backport-5.10/813-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch index 2f3d5bb1f2c..711ce229b2c 100644 --- a/target/linux/generic/backport-5.10/813-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch +++ b/target/linux/generic/backport-5.10/813-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch @@ -98,7 +98,7 @@ Signed-off-by: Greg Kroah-Hartman /** --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h -@@ -155,6 +155,9 @@ struct nvmem_device *devm_nvmem_register +@@ -153,6 +153,9 @@ struct nvmem_device *devm_nvmem_register void nvmem_add_cell_table(struct nvmem_cell_table *table); void nvmem_del_cell_table(struct nvmem_cell_table *table); @@ -108,7 +108,7 @@ Signed-off-by: Greg Kroah-Hartman #else static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c) -@@ -172,6 +175,11 @@ devm_nvmem_register(struct device *dev, +@@ -170,6 +173,11 @@ devm_nvmem_register(struct device *dev, static inline void nvmem_add_cell_table(struct nvmem_cell_table *table) {} static inline void nvmem_del_cell_table(struct nvmem_cell_table *table) {} diff --git a/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch b/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch index 907fcf832b0..896dddc14b8 100644 --- a/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch +++ b/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch @@ -29,7 +29,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -5046,6 +5046,10 @@ int stmmac_dvr_probe(struct device *devi +@@ -5047,6 +5047,10 @@ int stmmac_dvr_probe(struct device *devi reset_control_reset(priv->plat->stmmac_rst); } @@ -40,7 +40,7 @@ Signed-off-by: David S. Miller /* Init MAC and get the capabilities */ ret = stmmac_hw_init(priv); if (ret) -@@ -5260,6 +5264,7 @@ int stmmac_dvr_remove(struct device *dev +@@ -5261,6 +5265,7 @@ int stmmac_dvr_remove(struct device *dev phylink_destroy(priv->phylink); if (priv->plat->stmmac_rst) reset_control_assert(priv->plat->stmmac_rst); From a14cc979a2a081c31763b994219ae0d0ddebd9f2 Mon Sep 17 00:00:00 2001 From: John Audia Date: Mon, 27 Feb 2023 17:58:42 -0500 Subject: [PATCH 20/26] kernel: bump 5.10 to 5.10.170 No patches modified for this bump Signed-off-by: John Audia --- include/kernel-5.10 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/kernel-5.10 b/include/kernel-5.10 index b2548dac887..5e51b0d6342 100644 --- a/include/kernel-5.10 +++ b/include/kernel-5.10 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.10 = .169 -LINUX_KERNEL_HASH-5.10.169 = d9754f6eb55e88214c7aaa7c4831c215f88b48da1d9b40f871b055ff56ebafcf +LINUX_VERSION-5.10 = .170 +LINUX_KERNEL_HASH-5.10.170 = a2b51876befb8cc35724ed62820845f2b387d471a6cf46e8eedd0b6cb595825f From 50cb897d251133752ea2cd338153a6dcb011ea98 Mon Sep 17 00:00:00 2001 From: John Audia Date: Fri, 3 Mar 2023 13:37:30 -0500 Subject: [PATCH 21/26] kernel: bump 5.10 to 5.10.172 Removed upstreamed: backport-5.10/804-0001-net-Remove-WARN_ON_ONCE-sk-sk_forward_alloc-from-sk_.patch[1] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.171&id=3e4bbd1f38a8d35bd2d3aaffdb5f6ada546b669a Signed-off-by: John Audia --- include/kernel-5.10 | 4 +- ...ON_ONCE-sk-sk_forward_alloc-from-sk_.patch | 98 ------------------- .../780-usb-net-MeigLink_modem_support.patch | 2 +- 3 files changed, 3 insertions(+), 101 deletions(-) delete mode 100644 target/linux/generic/backport-5.10/804-0001-net-Remove-WARN_ON_ONCE-sk-sk_forward_alloc-from-sk_.patch diff --git a/include/kernel-5.10 b/include/kernel-5.10 index 5e51b0d6342..dd93f107f64 100644 --- a/include/kernel-5.10 +++ b/include/kernel-5.10 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.10 = .170 -LINUX_KERNEL_HASH-5.10.170 = a2b51876befb8cc35724ed62820845f2b387d471a6cf46e8eedd0b6cb595825f +LINUX_VERSION-5.10 = .172 +LINUX_KERNEL_HASH-5.10.172 = f20dbae344df1c33cad617f7670c5e061557f592f422c842d3b30155df2927b1 diff --git a/target/linux/generic/backport-5.10/804-0001-net-Remove-WARN_ON_ONCE-sk-sk_forward_alloc-from-sk_.patch b/target/linux/generic/backport-5.10/804-0001-net-Remove-WARN_ON_ONCE-sk-sk_forward_alloc-from-sk_.patch deleted file mode 100644 index 74c01ec5a51..00000000000 --- a/target/linux/generic/backport-5.10/804-0001-net-Remove-WARN_ON_ONCE-sk-sk_forward_alloc-from-sk_.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 35cd2598c910ad6a1cc8bd3f731429b1901abc63 Mon Sep 17 00:00:00 2001 -From: Kuniyuki Iwashima -Date: Mon, 27 Feb 2023 13:15:48 -0800 -Subject: [PATCH] net: Remove WARN_ON_ONCE(sk->sk_forward_alloc) from - sk_stream_kill_queues(). - -commit 62ec33b44e0f7168ff2886520fec6fb62d03b5a3 upstream. - -Christoph Paasch reported that commit b5fc29233d28 ("inet6: Remove -inet6_destroy_sock() in sk->sk_prot->destroy().") started triggering -WARN_ON_ONCE(sk->sk_forward_alloc) in sk_stream_kill_queues(). [0 - 2] -Also, we can reproduce it by a program in [3]. - -In the commit, we delay freeing ipv6_pinfo.pktoptions from sk->destroy() -to sk->sk_destruct(), so sk->sk_forward_alloc is no longer zero in -inet_csk_destroy_sock(). - -The same check has been in inet_sock_destruct() from at least v2.6, -we can just remove the WARN_ON_ONCE(). However, among the users of -sk_stream_kill_queues(), only CAIF is not calling inet_sock_destruct(). -Thus, we add the same WARN_ON_ONCE() to caif_sock_destructor(). - -[0]: https://lore.kernel.org/netdev/39725AB4-88F1-41B3-B07F-949C5CAEFF4F@icloud.com/ -[1]: https://github.com/multipath-tcp/mptcp_net-next/issues/341 -[2]: -WARNING: CPU: 0 PID: 3232 at net/core/stream.c:212 sk_stream_kill_queues+0x2f9/0x3e0 -Modules linked in: -CPU: 0 PID: 3232 Comm: syz-executor.0 Not tainted 6.2.0-rc5ab24eb4698afbe147b424149c529e2a43ec24eb5 #2 -Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 -RIP: 0010:sk_stream_kill_queues+0x2f9/0x3e0 -Code: 03 0f b6 04 02 84 c0 74 08 3c 03 0f 8e ec 00 00 00 8b ab 08 01 00 00 e9 60 ff ff ff e8 d0 5f b6 fe 0f 0b eb 97 e8 c7 5f b6 fe <0f> 0b eb a0 e8 be 5f b6 fe 0f 0b e9 6a fe ff ff e8 02 07 e3 fe e9 -RSP: 0018:ffff88810570fc68 EFLAGS: 00010293 -RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 -RDX: ffff888101f38f40 RSI: ffffffff8285e529 RDI: 0000000000000005 -RBP: 0000000000000ce0 R08: 0000000000000005 R09: 0000000000000000 -R10: 0000000000000ce0 R11: 0000000000000001 R12: ffff8881009e9488 -R13: ffffffff84af2cc0 R14: 0000000000000000 R15: ffff8881009e9458 -FS: 00007f7fdfbd5800(0000) GS:ffff88811b600000(0000) knlGS:0000000000000000 -CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 -CR2: 0000001b32923000 CR3: 00000001062fc006 CR4: 0000000000170ef0 -Call Trace: - - inet_csk_destroy_sock+0x1a1/0x320 - __tcp_close+0xab6/0xe90 - tcp_close+0x30/0xc0 - inet_release+0xe9/0x1f0 - inet6_release+0x4c/0x70 - __sock_release+0xd2/0x280 - sock_close+0x15/0x20 - __fput+0x252/0xa20 - task_work_run+0x169/0x250 - exit_to_user_mode_prepare+0x113/0x120 - syscall_exit_to_user_mode+0x1d/0x40 - do_syscall_64+0x48/0x90 - entry_SYSCALL_64_after_hwframe+0x72/0xdc -RIP: 0033:0x7f7fdf7ae28d -Code: c1 20 00 00 75 10 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 ee fb ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 37 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 -RSP: 002b:00000000007dfbb0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 -RAX: 0000000000000000 RBX: 0000000000000004 RCX: 00007f7fdf7ae28d -RDX: 0000000000000000 RSI: ffffffffffffffff RDI: 0000000000000003 -RBP: 0000000000000000 R08: 000000007f338e0f R09: 0000000000000e0f -R10: 000000007f338e13 R11: 0000000000000293 R12: 00007f7fdefff000 -R13: 00007f7fdefffcd8 R14: 00007f7fdefffce0 R15: 00007f7fdefffcd8 - - -[3]: https://lore.kernel.org/netdev/20230208004245.83497-1-kuniyu@amazon.com/ - -Fixes: b5fc29233d28 ("inet6: Remove inet6_destroy_sock() in sk->sk_prot->destroy().") -Reported-by: syzbot -Reported-by: Christoph Paasch -Signed-off-by: Kuniyuki Iwashima -Reviewed-by: Eric Dumazet -Signed-off-by: Jakub Kicinski ---- - net/caif/caif_socket.c | 1 + - net/core/stream.c | 1 - - 2 files changed, 1 insertion(+), 1 deletion(-) - ---- a/net/caif/caif_socket.c -+++ b/net/caif/caif_socket.c -@@ -1020,6 +1020,7 @@ static void caif_sock_destructor(struct - return; - } - sk_stream_kill_queues(&cf_sk->sk); -+ WARN_ON(sk->sk_forward_alloc); - caif_free_client(&cf_sk->layer); - } - ---- a/net/core/stream.c -+++ b/net/core/stream.c -@@ -209,7 +209,6 @@ void sk_stream_kill_queues(struct sock * - sk_mem_reclaim(sk); - - WARN_ON(sk->sk_wmem_queued); -- WARN_ON(sk->sk_forward_alloc); - - /* It is _impossible_ for the backlog to contain anything - * when we get here. All user references to this socket diff --git a/target/linux/generic/hack-5.10/780-usb-net-MeigLink_modem_support.patch b/target/linux/generic/hack-5.10/780-usb-net-MeigLink_modem_support.patch index e006221a977..3b8655fa6e9 100644 --- a/target/linux/generic/hack-5.10/780-usb-net-MeigLink_modem_support.patch +++ b/target/linux/generic/hack-5.10/780-usb-net-MeigLink_modem_support.patch @@ -33,7 +33,7 @@ Submitted-by: Daniel Golle #define QUECTEL_VENDOR_ID 0x2c7c /* These Quectel products use Quectel's vendor ID */ -@@ -1162,6 +1164,11 @@ static const struct usb_device_id option +@@ -1164,6 +1166,11 @@ static const struct usb_device_id option .driver_info = ZLP }, { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), .driver_info = RSVD(4) }, From acb189179c5ca364e45fa2d704cc29f32ca9333e Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Wed, 22 Feb 2023 19:40:20 +0100 Subject: [PATCH 22/26] at91: switch to Kernel 5.15 by default Getting ready for the next release. Claudiu said: > I tested v5.15 on all targets I have access to previously, when > updating OpenWrt kernel for v5.15 and when preparing this PR. (#11918) Signed-off-by: Paul Spooren Reviewed-by: Claudiu Beznea --- target/linux/at91/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/at91/Makefile b/target/linux/at91/Makefile index 20dc43cb9e8..7867290b7ea 100644 --- a/target/linux/at91/Makefile +++ b/target/linux/at91/Makefile @@ -10,8 +10,7 @@ BOARDNAME:=Microchip (Atmel AT91) FEATURES:=ext4 squashfs targz usbgadget ubifs SUBTARGETS:=sama7 sama5 sam9x -KERNEL_PATCHVER:=5.10 -KERNEL_TESTING_PATCHVER:=5.15 +KERNEL_PATCHVER:=5.15 include $(INCLUDE_DIR)/target.mk From d10e1b4a71bff8411d734444cc8c9aa0b0ba57a4 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 2 Mar 2023 12:49:10 +0100 Subject: [PATCH 23/26] hostapd: add support for defining multiple acct/auth servers This allows adding backup servers, in case the primary ones fail. Assume that port and shared secret are going to be the same. Signed-off-by: Felix Fietkau --- .../network/services/hostapd/files/hostapd.sh | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 8c233a4e60b..28bd210623b 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -265,11 +265,11 @@ hostapd_common_add_bss_config() { config_add_int ieee80211w config_add_int eapol_version - config_add_string 'auth_server:host' 'server:host' + config_add_array auth_server acct_server + config_add_string 'server:host' config_add_string auth_secret key config_add_int 'auth_port:port' 'port:port' - config_add_string acct_server config_add_string acct_secret config_add_int acct_port config_add_int acct_interval @@ -524,6 +524,20 @@ append_airtime_sta_weight() { [ -n "$1" ] && append bss_conf "airtime_sta_weight=$1" "$N" } +append_auth_server() { + [ -n "$1" ] || return + append bss_conf "auth_server_addr=$1" "$N" + append bss_conf "auth_server_port=$auth_port" "$N" + [ -n "$auth_secret" ] && append bss_conf "auth_server_shared_secret=$auth_secret" "$N" +} + +append_acct_server() { + [ -n "$1" ] || return + append bss_conf "acct_server_addr=$1" "$N" + append bss_conf "acct_server_port=$acct_port" "$N" + [ -n "$acct_secret" ] && append bss_conf "acct_server_shared_secret=$acct_secret" "$N" +} + hostapd_set_bss_options() { local var="$1" local phy="$2" @@ -542,7 +556,7 @@ hostapd_set_bss_options() { wps_independent wps_device_type wps_device_name wps_manufacturer wps_pin \ macfilter ssid utf8_ssid wmm uapsd hidden short_preamble rsn_preauth \ iapp_interface eapol_version dynamic_vlan ieee80211w nasid \ - acct_server acct_secret acct_port acct_interval \ + acct_secret acct_port acct_interval \ bss_load_update_period chan_util_avg_period sae_require_mfp sae_pwe \ multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key skip_inactivity_poll \ ppsk airtime_bss_weight airtime_bss_limit airtime_sta_weight \ @@ -614,15 +628,10 @@ hostapd_set_bss_options() { set_default nasid "${macaddr//\:}" append bss_conf "nas_identifier=$nasid" "$N" - [ -n "$acct_server" ] && { - append bss_conf "acct_server_addr=$acct_server" "$N" - append bss_conf "acct_server_port=$acct_port" "$N" - [ -n "$acct_secret" ] && \ - append bss_conf "acct_server_shared_secret=$acct_secret" "$N" - [ -n "$acct_interval" ] && \ - append bss_conf "radius_acct_interim_interval=$acct_interval" "$N" - json_for_each_item append_radius_acct_req_attr radius_acct_req_attr - } + [ -n "$acct_interval" ] && \ + append bss_conf "radius_acct_interim_interval=$acct_interval" "$N" + json_for_each_item append_acct_server acct_server + json_for_each_item append_radius_acct_req_attr radius_acct_req_attr [ -n "$ocv" ] && append bss_conf "ocv=$ocv" "$N" @@ -659,11 +668,9 @@ hostapd_set_bss_options() { psk|sae|psk-sae) json_get_vars key wpa_psk_file if [ "$auth_type" = "psk" ] && [ "$ppsk" -ne 0 ] ; then - json_get_vars auth_server auth_secret auth_port + json_get_vars auth_secret auth_port set_default auth_port 1812 - append bss_conf "auth_server_addr=$auth_server" "$N" - append bss_conf "auth_server_port=$auth_port" "$N" - append bss_conf "auth_server_shared_secret=$auth_secret" "$N" + json_for_each_item append_auth_server auth_server append bss_conf "macaddr_acl=2" "$N" append bss_conf "wpa_psk_radius=2" "$N" elif [ ${#key} -eq 64 ]; then @@ -732,12 +739,7 @@ hostapd_set_bss_options() { set_default dae_port 3799 set_default request_cui 0 - [ "$eap_server" -eq 0 ] && { - append bss_conf "auth_server_addr=$auth_server" "$N" - append bss_conf "auth_server_port=$auth_port" "$N" - append bss_conf "auth_server_shared_secret=$auth_secret" "$N" - } - + [ "$eap_server" -eq 0 ] && json_for_each_item append_auth_server auth_server [ "$request_cui" -gt 0 ] && append bss_conf "radius_request_cui=$request_cui" "$N" [ -n "$eap_reauth_period" ] && append bss_conf "eap_reauth_period=$eap_reauth_period" "$N" @@ -777,9 +779,7 @@ hostapd_set_bss_options() { [ -n "$auth_server" ] && { set_default auth_port 1812 - append bss_conf "auth_server_addr=$auth_server" "$N" - append bss_conf "auth_server_port=$auth_port" "$N" - [ -n "$auth_secret" ] && append bss_conf "auth_server_shared_secret=$auth_secret" "$N" + json_for_each_item append_auth_server auth_server [ -n "$ownip" ] && append bss_conf "own_ip_addr=$ownip" "$N" [ -n "$radius_client_addr" ] && append bss_conf "radius_client_addr=$radius_client_addr" "$N" append bss_conf "macaddr_acl=2" "$N" From cf992ca862f271936f61367236378378f0d91b6d Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 7 Mar 2023 10:23:17 +0100 Subject: [PATCH 24/26] hostapd: add missing return code for the bss_mgmt_enable ubus method Fixes bogus errors on ubus calls Signed-off-by: Felix Fietkau --- package/network/services/hostapd/src/src/ap/ubus.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index 50012252e4f..ddd86447eb1 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -1084,6 +1084,8 @@ hostapd_bss_mgmt_enable(struct ubus_context *ctx, struct ubus_object *obj, } __hostapd_bss_mgmt_enable(hapd, flags); + + return 0; } From 635d177ac95e0ba21fc0b4f26dcc9c7bcd516cca Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 7 Mar 2023 10:23:38 +0100 Subject: [PATCH 25/26] hostapd: enable radius server support This is useful in combination with the built-in eap server support Signed-off-by: Felix Fietkau --- package/network/services/hostapd/files/hostapd-full.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index b92f9a25b86..9076ebc44f9 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -142,7 +142,7 @@ CONFIG_PKCS12=y # RADIUS authentication server. This provides access to the integrated EAP # server from external hosts using RADIUS. -#CONFIG_RADIUS_SERVER=y +CONFIG_RADIUS_SERVER=y # Build IPv6 support for RADIUS operations CONFIG_IPV6=y From 35f6d795134e9b089c4e763a7f58cba7d4e15e42 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sat, 18 Feb 2023 02:06:54 +0100 Subject: [PATCH 26/26] mpc85xx: add support for Watchguard Firebox T10 Hardware -------- SoC: Freescale P1010 RAM: 512MB FLASH: 1 MB SPI-NOR 512 MB NAND ETH: 3x Gigabite Ethernet (Atheros AR8033) SERIAL: Cisco RJ-45 (115200 8N1) RTC: Battery-Backed RTC (I2C) Installation ------------ 1. Patch U-Boot by dumping the content of the SPI-Flash using a SPI programmer. The SHA1 hash for the U-Boot password is currently unknown. A tool for patching U-Boot is available at https://github.com/blocktrron/t10-uboot-patcher/ You can also patch the unknown password yourself. The SHA1 hash is E597301A1D89FF3F6D318DBF4DBA0A5ABC5ECBEA 2. Interrupt the bootmenu by pressing CTRL+C. A password prompt appears. The patched password is '1234' (without quotation marks) 3. Download the OpenWrt initramfs image. Copy it to a TFTP server reachable at 10.0.1.13/24 and rename it to uImage. 4. Connect the TFTP server to ethernet port 0 of the Watchguard T10. 5. Download and boot the initramfs image by entering "tftpboot; bootm;" in U-Boot. 6. After OpenWrt booted, create a UBI volume on the old data partition. The "ubi" mtd partition should be mtd7, check this using $ cat /proc/mtd Create a UBI partition by executing $ ubiformat /dev/mtd7 -y 7. Increase the loadable kernel-size of U-Boot by executing $ fw_setenv SysAKernSize 800000 8. Transfer the OpenWrt sysupgrade image to the Watchguard T10 using scp. Install the image by using sysupgrade: $ sysupgrade -n Note: The LAN ports of the T10 are 1 & 2 while 0 is WAN. You might have to change the ethernet-port. 9. OpenWrt should now boot from the internal NAND. Enjoy. Signed-off-by: David Bauer --- package/boot/uboot-envtools/files/mpc85xx | 3 + .../mpc85xx/base-files/etc/board.d/02_network | 3 + .../base-files/lib/preinit/10_fix_eth_mac.sh | 5 + .../base-files/lib/upgrade/platform.sh | 3 +- target/linux/mpc85xx/config-5.10 | 1 + target/linux/mpc85xx/config-5.15 | 1 + .../arch/powerpc/boot/dts/firebox-t10.dts | 268 ++++++++++++++++++ .../arch/powerpc/platforms/85xx/firebox_t10.c | 87 ++++++ target/linux/mpc85xx/image/p1010.mk | 10 + target/linux/mpc85xx/p1010/config-default | 2 + ...werpc-85xx-firebox-t10-support.patch.patch | 29 ++ ...werpc-85xx-firebox-t10-support.patch.patch | 29 ++ 12 files changed, 440 insertions(+), 1 deletion(-) create mode 100644 target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts create mode 100644 target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t10.c create mode 100644 target/linux/mpc85xx/patches-5.10/108-powerpc-85xx-firebox-t10-support.patch.patch create mode 100644 target/linux/mpc85xx/patches-5.15/108-powerpc-85xx-firebox-t10-support.patch.patch diff --git a/package/boot/uboot-envtools/files/mpc85xx b/package/boot/uboot-envtools/files/mpc85xx index 36d9f753a11..6d389c5b574 100644 --- a/package/boot/uboot-envtools/files/mpc85xx +++ b/package/boot/uboot-envtools/files/mpc85xx @@ -16,6 +16,9 @@ ocedo,panda) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x20000" "0x20000" ;; +watchguard,firebox-t10) + ubootenv_add_uci_config "$(find_mtd_part 'u-boot-env')" "0x0" "0x2000" "0x10000" + ;; aerohive,hiveap-330) ubootenv_add_uci_config "$(find_mtd_part 'u-boot-env')" "0x0" "0x20000" "0x10000" ;; diff --git a/target/linux/mpc85xx/base-files/etc/board.d/02_network b/target/linux/mpc85xx/base-files/etc/board.d/02_network index 7a677ee96f6..77e208c7faa 100644 --- a/target/linux/mpc85xx/base-files/etc/board.d/02_network +++ b/target/linux/mpc85xx/base-files/etc/board.d/02_network @@ -21,6 +21,9 @@ tplink,tl-wdr4900-v1) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ucidef_set_interface_macaddr "wan" "$(macaddr_add $(mtd_get_mac_binary u-boot 0x4fc00) 1)" ;; +watchguard,firebox-t10) + ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0" + ;; *) ucidef_set_interfaces_lan_wan "eth0" "eth1" ;; diff --git a/target/linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh index d94eba688c8..d84ab5f186b 100644 --- a/target/linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/mpc85xx/base-files/lib/preinit/10_fix_eth_mac.sh @@ -6,6 +6,11 @@ preinit_set_mac_address() { ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr) ip link set dev eth1 address $(mtd_get_mac_ascii cfg1 eth1addr) ;; + watchguard,firebox-t10) + ip link set dev eth0 address "$(mtd_get_mac_text "device_id" 0x1830)" + ip link set dev eth1 address "$(mtd_get_mac_text "device_id" 0x1844)" + ip link set dev eth2 address "$(mtd_get_mac_text "device_id" 0x1858)" + ;; esac } diff --git a/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh b/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh index 064eeb35bc9..226b40a9062 100755 --- a/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh @@ -14,7 +14,8 @@ platform_do_upgrade() { case "$board" in ocedo,panda|\ - sophos,red-15w-rev1) + sophos,red-15w-rev1|\ + watchguard,firebox-t10) nand_do_upgrade "$1" ;; *) diff --git a/target/linux/mpc85xx/config-5.10 b/target/linux/mpc85xx/config-5.10 index 909cd53092e..1885a961fed 100644 --- a/target/linux/mpc85xx/config-5.10 +++ b/target/linux/mpc85xx/config-5.10 @@ -247,6 +247,7 @@ CONFIG_THREAD_SHIFT=13 CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TINY_SRCU=y # CONFIG_TL_WDR4900_V1 is not set +# CONFIG_FIREBOX_T10 is not set # CONFIG_TOOLCHAIN_DEFAULT_CPU is not set # CONFIG_TQM8540 is not set # CONFIG_TQM8541 is not set diff --git a/target/linux/mpc85xx/config-5.15 b/target/linux/mpc85xx/config-5.15 index 5700a247de6..ab2eef94cdc 100644 --- a/target/linux/mpc85xx/config-5.15 +++ b/target/linux/mpc85xx/config-5.15 @@ -266,3 +266,4 @@ CONFIG_WATCHDOG_CORE=y # CONFIG_XES_MPC85xx is not set CONFIG_XZ_DEC_BCJ=y CONFIG_XZ_DEC_POWERPC=y +# CONFIG_FIREBOX_T10 is not set diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts new file mode 100644 index 00000000000..607706a2d43 --- /dev/null +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts @@ -0,0 +1,268 @@ +// SPDX-License-Identifier: GPL-2.0-or-later or MIT + +#include +#include + +/include/ "fsl/p1010si-pre.dtsi" + +/ { + model = "Watchguard Firebox T10"; + compatible = "watchguard,firebox-t10"; + + chosen { + bootargs = "console=ttyS0,115200"; + bootargs-override = "console=ttyS0,115200"; + }; + + aliases { + spi0 = &spi0; + led-boot = &led_mode; + led-failsafe = &led_failover; + led-running = &led_mode; + led-upgrade = &led_attention; + }; + + memory { + device_type = "memory"; + }; + + leds { + compatible = "gpio-leds"; + + led_attention: attention_orange { + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + label = "orange:attention"; + }; + + status_red { + gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; + label = "red:status"; + }; + + led_mode: mode_green { + gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + label = "green:mode"; + }; + + led_failover: failover_green { + gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; + label = "green:failover"; + }; + }; + + buttons { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + + soc: soc@ffe00000 { + ranges = <0x0 0x0 0xffe00000 0x100000>; + + i2c@3000 { + rtc@30 { + compatible = "sii,s35390a"; + reg = <0x30>; + }; + }; + + spi0: spi@7000 { + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + reg = <0x0 0x90000>; + label = "u-boot"; + read-only; + }; + + partition@90000 { + reg = <0x90000 0x10000>; + label = "u-boot-env"; + }; + + partition@a0000 { + reg = <0xa0000 0x20000>; + label = "cfgxxx"; + read-only; + }; + + partition@c0000 { + reg = <0xc0000 0x40000>; + label = "device_id"; + read-only; + }; + }; + }; + }; + + gpio0: gpio-controller@fc00 { + }; + + usb@22000 { + phy_type = "utmi"; + dr_mode = "host"; + }; + + mdio@24000 { + phy1: ethernet-phy@1 { + reg = <0x1>; + }; + + phy2: ethernet-phy@2 { + reg = <0x2>; + }; + + phy3: ethernet-phy@3 { + reg = <0x3>; + }; + }; + + mdio@25000 { + tbi_phy1: tbi-phy@11 { + reg = <0x11>; + device_type = "tbi-phy"; + }; + }; + + mdio@26000 { + tbi_phy2: tbi-phy@11 { + reg = <0x11>; + device_type = "tbi-phy"; + }; + }; + + enet0: ethernet@b0000 { + phy-handle = <&phy1>; + phy-connection-type = "rgmii-id"; + }; + + enet1: ethernet@b1000 { + tbi-handle = <&tbi_phy1>; + phy-handle = <&phy2>; + phy-connection-type = "sgmii"; + }; + + enet2: ethernet@b2000 { + tbi-handle = <&tbi_phy2>; + phy-handle = <&phy3>; + phy-connection-type = "sgmii"; + }; + + sdhc@2e000 { + status = "disabled"; + }; + + serial1: serial@4600 { + status = "disabled"; + }; + + can0: can@1c000 { + status = "disabled"; + }; + + can1: can@1d000 { + status = "disabled"; + }; + }; + + pci0: pcie@ffe09000 { + status = "disabled"; + }; + + pci1: pcie@ffe0a000 { + status = "disabled"; + }; + + ifc: ifc@ffe1e000 { + reg = <0x0 0xffe1e000 0 0x2000>; + + /* NOR, NAND Flashes and CPLD on board */ + ranges = <0x0 0x0 0x0 0xee000000 0x02000000 + 0x1 0x0 0x0 0xff800000 0x00010000 + 0x3 0x0 0x0 0xffb00000 0x00000020>; + + nand@1,0 { + compatible = "fsl,ifc-nand"; + reg = <0x1 0x0 0x10000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* + * Original partition layout: + * 0x000000000000-0x000000020000 : "NAND (RW) WG DTB Image" + * 0x000000020000-0x000000520000 : "NAND (RW) WG SYSA Kernel" + * 0x000000520000-0x000007f00000 : "NAND (RW) WG SYSA_CODE" + * 0x000007f00000-0x000008400000 : "NAND (RW) WG SYSB Kernel" + * 0x000008400000-0x000009c00000 : "NAND (RW) WG SYSB_CODE" + * 0x000009c00000-0x00000a100000 : "NAND (RW) WG SYSA2 Kernel" + * 0x00000a100000-0x000011ae0000 : "NAND (RW) WG SYSA_CODE2" + * 0x000011ae0000-0x000020000000 : "NAND (RW) WG SYSA_DATA" + */ + + partition@0 { + reg = <0x0 0x20000>; + label = "wg-dtb"; + read-only; + }; + + partition@20000 { + reg = <0x20000 0x500000>; + label = "kernel"; + }; + + partition@520000 { + reg = <0x520000 0x79e0000>; + label = "wg-sysa-rootfs"; + read-only; + }; + + partition@7f00000 { + reg = <0x7f00000 0x500000>; + label = "wg-sysb-kernel"; + read-only; + }; + + partition@8400000 { + reg = <0x8400000 0x1800000>; + label = "wg-sysb-rootfs"; + read-only; + }; + + partition@9c00000 { + reg = <0x9c00000 0x500000>; + label = "wg-sysa2-kernel"; + read-only; + }; + + partition@a100000 { + reg = <0xa100000 0x79e0000>; + label = "wg-sysa2-rootfs"; + read-only; + }; + + partition@11ae0000 { + reg = <0x11ae0000 0xe520000>; + label = "ubi"; + }; + }; + }; + }; +}; + +/include/ "fsl/p1010si-post.dtsi" diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t10.c b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t10.c new file mode 100644 index 00000000000..422bde69032 --- /dev/null +++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/firebox_t10.c @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +/* + * Watchguard Firebox T10 Board Setup + * + * Copyright (C) 2023 David Bauer + * + * Based on: + * p1010rdb.c: + * P1010 RDB Board Setup + * Copyright 2011 Freescale Semiconductor Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "mpc85xx.h" + +void __init firebox_t10_pic_init(void) +{ + struct mpic *mpic; + + mpic = mpic_alloc(NULL, 0, + MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU, + 0, 256, " OpenPIC "); + + BUG_ON(mpic == NULL); + mpic_init(mpic); +} + +/* + * Setup the architecture + */ +static void __init firebox_t10_setup_arch(void) +{ + if (ppc_md.progress) + ppc_md.progress("firebox_t10_setup_arch()", 0); + + fsl_pci_assign_primary(); + + pr_info("Firebox T10 from Watchguard\n"); +} + +machine_arch_initcall(firebox_t10, mpc85xx_common_publish_devices); + +/* + * Called very early, device-tree isn't unflattened + */ +static int __init firebox_t10_probe(void) +{ + if (of_machine_is_compatible("watchguard,firebox-t10")) + return 1; + return 0; +} + +define_machine(firebox_t10) { + .name = "P1010 RDB", + .probe = firebox_t10_probe, + .setup_arch = firebox_t10_setup_arch, + .init_IRQ = firebox_t10_pic_init, +#ifdef CONFIG_PCI + .pcibios_fixup_bus = fsl_pcibios_fixup_bus, + .pcibios_fixup_phb = fsl_pcibios_fixup_phb, +#endif + .get_irq = mpic_get_irq, + .calibrate_decr = generic_calibrate_decr, + .progress = udbg_progress, +}; diff --git a/target/linux/mpc85xx/image/p1010.mk b/target/linux/mpc85xx/image/p1010.mk index 92cad3d0358..90ef46d7097 100644 --- a/target/linux/mpc85xx/image/p1010.mk +++ b/target/linux/mpc85xx/image/p1010.mk @@ -40,6 +40,16 @@ define Device/tplink_tl-wdr4900-v1 endef TARGET_DEVICES += tplink_tl-wdr4900-v1 +define Device/watchguard_firebox-t10 + DEVICE_VENDOR := Watchguard + DEVICE_MODEL := Firebox T10 + DEVICE_PACKAGES := kmod-rtc-s35390a kmod-eeprom-at24 + KERNEL = kernel-bin | gzip | fit gzip $(KDIR)/image-$$(DEVICE_DTS).dtb + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += watchguard_firebox-t10 + define Device/sophos_red-15w-rev1 DEVICE_VENDOR := Sophos DEVICE_MODEL := RED 15w diff --git a/target/linux/mpc85xx/p1010/config-default b/target/linux/mpc85xx/p1010/config-default index 5ca65812d70..53e077b6c2e 100644 --- a/target/linux/mpc85xx/p1010/config-default +++ b/target/linux/mpc85xx/p1010/config-default @@ -1,4 +1,5 @@ CONFIG_AT803X_PHY=y +CONFIG_CMDLINE_OVERRIDE=y # CONFIG_FSL_CORENET_CF is not set CONFIG_MTD_NAND_FSL_IFC=y CONFIG_MTD_SPLIT_FIRMWARE=y @@ -19,3 +20,4 @@ CONFIG_REGMAP=y CONFIG_REGULATOR=y CONFIG_TL_WDR4900_V1=y CONFIG_UBIFS_FS=y +CONFIG_FIREBOX_T10=y \ No newline at end of file diff --git a/target/linux/mpc85xx/patches-5.10/108-powerpc-85xx-firebox-t10-support.patch.patch b/target/linux/mpc85xx/patches-5.10/108-powerpc-85xx-firebox-t10-support.patch.patch new file mode 100644 index 00000000000..b074113eaa5 --- /dev/null +++ b/target/linux/mpc85xx/patches-5.10/108-powerpc-85xx-firebox-t10-support.patch.patch @@ -0,0 +1,29 @@ +--- a/arch/powerpc/platforms/85xx/Kconfig ++++ b/arch/powerpc/platforms/85xx/Kconfig +@@ -92,6 +92,16 @@ config WS_AP3825I + This board is a Concurrent Dual-Band wireless access point with a + Freescale P1020 SoC. + ++config FIREBOX_T10 ++ bool "Watchguard Firebox T10" ++ select DEFAULT_UIMAGE ++ select ARCH_REQUIRE_GPIOLIB ++ select GPIO_MPC8XXX ++ help ++ This option enables support for the Watchguard Firebox T10 board. ++ This board is a VPN Gateway-Router with a ++ Freescale P1010 SoC. ++ + config MPC8540_ADS + bool "Freescale MPC8540 ADS" + select DEFAULT_UIMAGE +--- a/arch/powerpc/platforms/85xx/Makefile ++++ b/arch/powerpc/platforms/85xx/Makefile +@@ -28,6 +28,7 @@ obj-$(CONFIG_PANDA) += panda.o + obj-$(CONFIG_TWR_P102x) += twr_p102x.o + obj-$(CONFIG_WS_AP3710I) += ws-ap3710i.o + obj-$(CONFIG_WS_AP3825I) += ws-ap3825i.o ++obj-$(CONFIG_FIREBOX_T10) += firebox_t10.o + obj-$(CONFIG_CORENET_GENERIC) += corenet_generic.o + obj-$(CONFIG_FB_FSL_DIU) += t1042rdb_diu.o + obj-$(CONFIG_RED_15W_REV1) += red15w_rev1.o diff --git a/target/linux/mpc85xx/patches-5.15/108-powerpc-85xx-firebox-t10-support.patch.patch b/target/linux/mpc85xx/patches-5.15/108-powerpc-85xx-firebox-t10-support.patch.patch new file mode 100644 index 00000000000..b074113eaa5 --- /dev/null +++ b/target/linux/mpc85xx/patches-5.15/108-powerpc-85xx-firebox-t10-support.patch.patch @@ -0,0 +1,29 @@ +--- a/arch/powerpc/platforms/85xx/Kconfig ++++ b/arch/powerpc/platforms/85xx/Kconfig +@@ -92,6 +92,16 @@ config WS_AP3825I + This board is a Concurrent Dual-Band wireless access point with a + Freescale P1020 SoC. + ++config FIREBOX_T10 ++ bool "Watchguard Firebox T10" ++ select DEFAULT_UIMAGE ++ select ARCH_REQUIRE_GPIOLIB ++ select GPIO_MPC8XXX ++ help ++ This option enables support for the Watchguard Firebox T10 board. ++ This board is a VPN Gateway-Router with a ++ Freescale P1010 SoC. ++ + config MPC8540_ADS + bool "Freescale MPC8540 ADS" + select DEFAULT_UIMAGE +--- a/arch/powerpc/platforms/85xx/Makefile ++++ b/arch/powerpc/platforms/85xx/Makefile +@@ -28,6 +28,7 @@ obj-$(CONFIG_PANDA) += panda.o + obj-$(CONFIG_TWR_P102x) += twr_p102x.o + obj-$(CONFIG_WS_AP3710I) += ws-ap3710i.o + obj-$(CONFIG_WS_AP3825I) += ws-ap3825i.o ++obj-$(CONFIG_FIREBOX_T10) += firebox_t10.o + obj-$(CONFIG_CORENET_GENERIC) += corenet_generic.o + obj-$(CONFIG_FB_FSL_DIU) += t1042rdb_diu.o + obj-$(CONFIG_RED_15W_REV1) += red15w_rev1.o