[PATCH] octeon: Switch to kernel 5.10 and mark source only

2022-02-03 Thread Hauke Mehrtens
Stijn Tintel reported a memory leak in octeon with kernel 5.10. With
kernel 5.4 it worked fine. The memory leak was seen with IPsec tunnels,
VRRP IPs, conntrack syncing, full IPv6 BGP feed, etc.
See details here: https://github.com/openwrt/openwrt/pull/4610

Move this target to kernel 5.10 anyway, but mark it as source only so
the binaries will not be included in the next release. If someone fixes
the memory leak please remove the source only tag again so we can create
binary images again.

Signed-off-by: Hauke Mehrtens 
---
 target/linux/octeon/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/target/linux/octeon/Makefile b/target/linux/octeon/Makefile
index 3a6bce0e9fe8..62be0df01457 100644
--- a/target/linux/octeon/Makefile
+++ b/target/linux/octeon/Makefile
@@ -7,11 +7,10 @@ include $(TOPDIR)/rules.mk
 ARCH:=mips64
 BOARD:=octeon
 BOARDNAME:=Cavium Networks Octeon
-FEATURES:=squashfs ramdisk pci usb
+FEATURES:=squashfs ramdisk pci usb source-only
 CPU_TYPE:=octeonplus
 
-KERNEL_PATCHVER:=5.4
-KERNEL_TESTING_PATCHVER:=5.10
+KERNEL_PATCHVER:=5.10
 
 define Target/Description
Build firmware images for Cavium Networks Octeon-based boards.
-- 
2.30.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


octeontx kernel 5.10

2022-02-03 Thread Hauke Mehrtens

Hi,

We would like to switch the octeontx target to kernel 5.10. Paul created 
a pull request for that:

https://github.com/openwrt/openwrt/pull/4609

Could you please test this target and report back if it works for you 
with kernel 5.10 or if we have any regressions compared to kernel 5.4.


Please also report back when it is working fine for you.

Hauke

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


ath25 kernel 5.10

2022-02-03 Thread Hauke Mehrtens

Hi,

We would like to switch the ath25 target to kernel 5.10. Paul created a 
pull request for that:

https://github.com/openwrt/openwrt/pull/4890

Could you please test this target and report back if it works for you 
with kernel 5.10 or if we have any regressions compared to kernel 5.4.


Please also report back when it is working fine for you.

Hauke

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


bcm63xx kernel 5.10

2022-02-03 Thread Hauke Mehrtens

Hi,

We would like to switch the bcm63xx target to kernel 5.10. Paul created 
a pull request for that:

https://github.com/openwrt/openwrt/pull/4616

There is still a problem with Macronix NAND flash chips, see the 
comments from the pull request.


Could someone please have a look into this problem.

Does this change in the upstream kernel help?
https://github.com/torvalds/linux/commit/22ca05b82d3e3abc2b116a11ee41b6b692b95530

Hauke

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] tplink-safeloader: support for Archer A6 v3 JP

2022-02-03 Thread João Orui
Add the missing tp-link firmware ID for the TP-Link Archer A6 v3 (JP)

Signed-off-by: João Orui 
---
 src/tplink-safeloader.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tplink-safeloader.c b/src/tplink-safeloader.c
index 49775e4..d0d345d 100644
--- a/src/tplink-safeloader.c
+++ b/src/tplink-safeloader.c
@@ -1139,7 +1139,8 @@ static struct device_info boards[] = {
"SupportList:\n"
"{product_name:Archer 
A6,product_ver:3.0.0,special_id:4341}\n"
"{product_name:Archer 
A6,product_ver:3.0.0,special_id:5553}\n"
-   "{product_name:Archer 
A6,product_ver:3.0.0,special_id:5457}\n",
+   "{product_name:Archer 
A6,product_ver:3.0.0,special_id:5457}\n"
+   "{product_name:Archer 
A6,product_ver:3.0.0,special_id:4A50}\n",
.part_trail = 0x00,
.soft_ver = SOFT_VER_TEXT("soft_ver:1.0.5\n"),
 
-- 
2.25.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 6/6] kernel: backport MT7530 IRQ support

2022-02-03 Thread DENG Qingfang
Support MT7530 PHY link change interrupts, and enable for MT7621.

Signed-off-by: DENG Qingfang 
---
 ...net-dsa-mt7530-add-interrupt-support.patch | 428 ++
 target/linux/ramips/dts/mt7621.dtsi   |   3 +
 2 files changed, 431 insertions(+)
 create mode 100644 
target/linux/generic/backport-5.10/772-v5.14-net-dsa-mt7530-add-interrupt-support.patch

diff --git 
a/target/linux/generic/backport-5.10/772-v5.14-net-dsa-mt7530-add-interrupt-support.patch
 
b/target/linux/generic/backport-5.10/772-v5.14-net-dsa-mt7530-add-interrupt-support.patch
new file mode 100644
index 00..b0b3abf7a6
--- /dev/null
+++ 
b/target/linux/generic/backport-5.10/772-v5.14-net-dsa-mt7530-add-interrupt-support.patch
@@ -0,0 +1,428 @@
+From ba751e28d44255744a30190faad0ca09b455c44d Mon Sep 17 00:00:00 2001
+From: DENG Qingfang 
+Date: Wed, 19 May 2021 11:32:00 +0800
+Subject: [PATCH] net: dsa: mt7530: add interrupt support
+
+Add support for MT7530 interrupt controller to handle internal PHYs.
+In order to assign an IRQ number to each PHY, the registration of MDIO bus
+is also done in this driver.
+
+Signed-off-by: DENG Qingfang 
+Reviewed-by: Andrew Lunn 
+Reviewed-by: Florian Fainelli 
+Reviewed-by: Vladimir Oltean 
+Signed-off-by: David S. Miller 
+---
+ drivers/net/dsa/Kconfig  |   1 +
+ drivers/net/dsa/mt7530.c | 263 +++
+ drivers/net/dsa/mt7530.h |  21 +++-
+ 3 files changed, 256 insertions(+), 29 deletions(-)
+
+--- a/drivers/net/dsa/Kconfig
 b/drivers/net/dsa/Kconfig
+@@ -36,6 +36,7 @@ config NET_DSA_MT7530
+   tristate "MediaTek MT753x and MT7621 Ethernet switch support"
+   depends on NET_DSA
+   select NET_DSA_TAG_MTK
++  select MEDIATEK_GE_PHY
+   help
+ This enables support for the MediaTek MT7530, MT7531, and MT7621
+ Ethernet switch chips.
+--- a/drivers/net/dsa/mt7530.c
 b/drivers/net/dsa/mt7530.c
+@@ -10,6 +10,7 @@
+ #include 
+ #include 
+ #include 
++#include 
+ #include 
+ #include 
+ #include 
+@@ -602,18 +603,14 @@ mt7530_mib_reset(struct dsa_switch *ds)
+   mt7530_write(priv, MT7530_MIB_CCR, CCR_MIB_ACTIVATE);
+ }
+ 
+-static int mt7530_phy_read(struct dsa_switch *ds, int port, int regnum)
++static int mt7530_phy_read(struct mt7530_priv *priv, int port, int regnum)
+ {
+-  struct mt7530_priv *priv = ds->priv;
+-
+   return mdiobus_read_nested(priv->bus, port, regnum);
+ }
+ 
+-static int mt7530_phy_write(struct dsa_switch *ds, int port, int regnum,
++static int mt7530_phy_write(struct mt7530_priv *priv, int port, int regnum,
+   u16 val)
+ {
+-  struct mt7530_priv *priv = ds->priv;
+-
+   return mdiobus_write_nested(priv->bus, port, regnum, val);
+ }
+ 
+@@ -791,9 +788,8 @@ out:
+ }
+ 
+ static int
+-mt7531_ind_phy_read(struct dsa_switch *ds, int port, int regnum)
++mt7531_ind_phy_read(struct mt7530_priv *priv, int port, int regnum)
+ {
+-  struct mt7530_priv *priv = ds->priv;
+   int devad;
+   int ret;
+ 
+@@ -809,10 +805,9 @@ mt7531_ind_phy_read(struct dsa_switch *d
+ }
+ 
+ static int
+-mt7531_ind_phy_write(struct dsa_switch *ds, int port, int regnum,
++mt7531_ind_phy_write(struct mt7530_priv *priv, int port, int regnum,
+u16 data)
+ {
+-  struct mt7530_priv *priv = ds->priv;
+   int devad;
+   int ret;
+ 
+@@ -828,6 +823,22 @@ mt7531_ind_phy_write(struct dsa_switch *
+   return ret;
+ }
+ 
++static int
++mt753x_phy_read(struct mii_bus *bus, int port, int regnum)
++{
++  struct mt7530_priv *priv = bus->priv;
++
++  return priv->info->phy_read(priv, port, regnum);
++}
++
++static int
++mt753x_phy_write(struct mii_bus *bus, int port, int regnum, u16 val)
++{
++  struct mt7530_priv *priv = bus->priv;
++
++  return priv->info->phy_write(priv, port, regnum, val);
++}
++
+ static void
+ mt7530_get_strings(struct dsa_switch *ds, int port, u32 stringset,
+  uint8_t *data)
+@@ -1991,6 +2002,211 @@ mt7530_setup(struct dsa_switch *ds)
+   return 0;
+ }
+ 
++static irqreturn_t
++mt7530_irq_thread_fn(int irq, void *dev_id)
++{
++  struct mt7530_priv *priv = dev_id;
++  bool handled = false;
++  u32 val;
++  int p;
++
++  mutex_lock_nested(>bus->mdio_lock, MDIO_MUTEX_NESTED);
++  val = mt7530_mii_read(priv, MT7530_SYS_INT_STS);
++  mt7530_mii_write(priv, MT7530_SYS_INT_STS, val);
++  mutex_unlock(>bus->mdio_lock);
++
++  for (p = 0; p < MT7530_NUM_PHYS; p++) {
++  if (BIT(p) & val) {
++  unsigned int irq;
++
++  irq = irq_find_mapping(priv->irq_domain, p);
++  handle_nested_irq(irq);
++  handled = true;
++  }
++  }
++
++  return IRQ_RETVAL(handled);
++}
++
++static void
++mt7530_irq_mask(struct irq_data *d)
++{
++  struct mt7530_priv *priv = irq_data_get_irq_chip_data(d);
++
++  priv->irq_enable &= ~BIT(d->hwirq);
++}
++
++static void

[PATCH 5/6] kernel: backport MediaTek Ethernet PHY driver

2022-02-03 Thread DENG Qingfang
Add support for MediaTek Gigabit Ethernet PHYs found in MT7530.
Fix some link up/down issues.

Signed-off-by: DENG Qingfang 
---
 ...MediaTek-Gigabit-Ethernet-PHY-driver.patch | 162 ++
 target/linux/generic/config-5.10  |   1 +
 target/linux/mediatek/mt7622/config-5.10  |   1 +
 target/linux/mediatek/mt7623/config-5.10  |   1 +
 target/linux/ramips/mt7621/config-5.10|   1 +
 5 files changed, 166 insertions(+)
 create mode 100644 
target/linux/generic/backport-5.10/771-v5.14-net-phy-add-MediaTek-Gigabit-Ethernet-PHY-driver.patch

diff --git 
a/target/linux/generic/backport-5.10/771-v5.14-net-phy-add-MediaTek-Gigabit-Ethernet-PHY-driver.patch
 
b/target/linux/generic/backport-5.10/771-v5.14-net-phy-add-MediaTek-Gigabit-Ethernet-PHY-driver.patch
new file mode 100644
index 00..9e09e7ede3
--- /dev/null
+++ 
b/target/linux/generic/backport-5.10/771-v5.14-net-phy-add-MediaTek-Gigabit-Ethernet-PHY-driver.patch
@@ -0,0 +1,162 @@
+From e40d2cca01893c1941f5959b14bb0cd0d4f4d099 Mon Sep 17 00:00:00 2001
+From: DENG Qingfang 
+Date: Wed, 19 May 2021 11:31:59 +0800
+Subject: [PATCH] net: phy: add MediaTek Gigabit Ethernet PHY driver
+
+Add support for MediaTek Gigabit Ethernet PHYs found in MT7530 and
+MT7531 switches.
+The initialization procedure is from the vendor driver, but due to lack
+of documentation, the function of some register values remains unknown.
+
+Signed-off-by: DENG Qingfang 
+Signed-off-by: David S. Miller 
+---
+ drivers/net/phy/Kconfig   |   5 ++
+ drivers/net/phy/Makefile  |   1 +
+ drivers/net/phy/mediatek-ge.c | 116 ++
+ 3 files changed, 122 insertions(+)
+ create mode 100644 drivers/net/phy/mediatek-ge.c
+
+--- a/drivers/net/phy/Kconfig
 b/drivers/net/phy/Kconfig
+@@ -201,6 +201,11 @@ config MARVELL_10G_PHY
+   help
+ Support for the Marvell Alaska MV88X3310 and compatible PHYs.
+ 
++config MEDIATEK_GE_PHY
++  tristate "MediaTek PHYs"
++  help
++Supports the MediaTek switch integrated PHYs.
++
+ config MICREL_PHY
+   tristate "Micrel PHYs"
+   help
+--- a/drivers/net/phy/Makefile
 b/drivers/net/phy/Makefile
+@@ -63,6 +63,7 @@ obj-$(CONFIG_LSI_ET1011C_PHY)+= et1011c
+ obj-$(CONFIG_LXT_PHY) += lxt.o
+ obj-$(CONFIG_MARVELL_10G_PHY) += marvell10g.o
+ obj-$(CONFIG_MARVELL_PHY) += marvell.o
++obj-$(CONFIG_MEDIATEK_GE_PHY) += mediatek-ge.o
+ obj-$(CONFIG_MESON_GXL_PHY)   += meson-gxl.o
+ obj-$(CONFIG_MICREL_KS8995MA) += spi_ks8995.o
+ obj-$(CONFIG_MICREL_PHY)  += micrel.o
+--- /dev/null
 b/drivers/net/phy/mediatek-ge.c
+@@ -0,0 +1,116 @@
++// SPDX-License-Identifier: GPL-2.0+
++#include 
++#include 
++#include 
++
++#define MTK_T10_TEST_CONTROL  0x145
++#define MTK_PHY_TP_MASK   GENMASK(4, 3)
++#define MTK_PHY_TP_AUTO   0
++#define MTK_PHY_TP_MDI2
++#define MTK_PHY_TP_MDIX   3
++
++#define MTK_EXT_PAGE_ACCESS   0x1f
++#define MTK_PHY_PAGE_STANDARD 0x
++#define MTK_PHY_PAGE_EXTENDED 0x0001
++#define MTK_PHY_PAGE_EXTENDED_2   0x0002
++#define MTK_PHY_PAGE_EXTENDED_3   0x0003
++#define MTK_PHY_PAGE_EXTENDED_2A300x2a30
++#define MTK_PHY_PAGE_EXTENDED_52B50x52b5
++
++static int mtk_gephy_read_page(struct phy_device *phydev)
++{
++  return __phy_read(phydev, MTK_EXT_PAGE_ACCESS);
++}
++
++static int mtk_gephy_write_page(struct phy_device *phydev, int page)
++{
++  return __phy_write(phydev, MTK_EXT_PAGE_ACCESS, page);
++}
++
++static void mtk_gephy_config_init(struct phy_device *phydev)
++{
++  /* Disable EEE */
++  phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV, 0);
++
++  /* Enable HW auto downshift */
++  phy_modify_paged(phydev, MTK_PHY_PAGE_EXTENDED, 0x14, 0, BIT(4));
++
++  /* Increase SlvDPSready time */
++  phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_52B5);
++  __phy_write(phydev, 0x10, 0xafae);
++  __phy_write(phydev, 0x12, 0x2f);
++  __phy_write(phydev, 0x10, 0x8fae);
++  phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
++
++  /* Adjust 100_mse_threshold */
++  phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x123, 0x);
++
++  /* Disable mcc */
++  phy_write_mmd(phydev, MDIO_MMD_VEND1, 0xa6, 0x300);
++}
++
++static int mt7530_phy_config_init(struct phy_device *phydev)
++{
++  mtk_gephy_config_init(phydev);
++
++  /* Increase post_update_timer */
++  phy_write_paged(phydev, MTK_PHY_PAGE_EXTENDED_3, 0x11, 0x4b);
++
++  return 0;
++}
++
++static int mt7531_phy_config_init(struct phy_device *phydev)
++{
++  if (phydev->interface != PHY_INTERFACE_MODE_INTERNAL)
++  return -EINVAL;
++
++  mtk_gephy_config_init(phydev);
++
++  /* PHY link down power saving enable */
++  phy_set_bits(phydev, 0x17, BIT(4));
++  phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, 0xc6, 0x300);
++
++  /* 

[PATCH 4/6] kernel: backport MT7530 MDB operations

2022-02-03 Thread DENG Qingfang
Use hardware to forward multicast traffic instead of trapping to the
host.

Signed-off-by: DENG Qingfang 
---
 ...et-dsa-mt7530-support-MDB-operations.patch | 171 ++
 1 file changed, 171 insertions(+)
 create mode 100644 
target/linux/generic/backport-5.10/770-v5.15-net-dsa-mt7530-support-MDB-operations.patch

diff --git 
a/target/linux/generic/backport-5.10/770-v5.15-net-dsa-mt7530-support-MDB-operations.patch
 
b/target/linux/generic/backport-5.10/770-v5.15-net-dsa-mt7530-support-MDB-operations.patch
new file mode 100644
index 00..5d91d5a657
--- /dev/null
+++ 
b/target/linux/generic/backport-5.10/770-v5.15-net-dsa-mt7530-support-MDB-operations.patch
@@ -0,0 +1,171 @@
+From 1f11a07a33bc26997c18b633d63f088bf75d11f2 Mon Sep 17 00:00:00 2001
+From: DENG Qingfang 
+Date: Tue, 24 Aug 2021 11:37:50 +0800
+Subject: [PATCH] net: dsa: mt7530: support MDB operations
+
+This is a partial backport of commit 5a30833b9a16f8d1aa15de06636f9317ca51f9df
+("net: dsa: mt7530: support MDB and bridge flag operations") upstream.
+
+Signed-off-by: DENG Qingfang 
+---
+ drivers/net/dsa/mt7530.c | 78 ++--
+ net/dsa/tag_mtk.c| 14 +---
+ 2 files changed, 76 insertions(+), 16 deletions(-)
+
+--- a/drivers/net/dsa/mt7530.c
 b/drivers/net/dsa/mt7530.c
+@@ -1000,9 +1000,6 @@ mt753x_cpu_port_enable(struct dsa_switch
+   mt7530_write(priv, MT7530_PVC_P(port),
+PORT_SPEC_TAG);
+ 
+-  /* Unknown multicast frame forwarding to the cpu port */
+-  mt7530_rmw(priv, MT7530_MFC, UNM_FFP_MASK, UNM_FFP(BIT(port)));
+-
+   /* Set CPU port number */
+   if (priv->id == ID_MT7621)
+   mt7530_rmw(priv, MT7530_MFC, CPU_MASK, CPU_EN | CPU_PORT(port));
+@@ -1138,6 +1135,20 @@ mt7530_stp_state_set(struct dsa_switch *
+ }
+ 
+ static int
++mt7530_port_egress_floods(struct dsa_switch *ds, int port,
++bool unicast, bool multicast)
++{
++  struct mt7530_priv *priv = ds->priv;
++
++  mt7530_rmw(priv, MT7530_MFC,
++ UNU_FFP(BIT(port)) | UNM_FFP(BIT(port)),
++ (unicast ? UNU_FFP(BIT(port)) : 0) |
++ (multicast ? UNM_FFP(BIT(port)) : 0));
++
++  return 0;
++}
++
++static int
+ mt7530_port_bridge_join(struct dsa_switch *ds, int port,
+   struct net_device *bridge)
+ {
+@@ -1357,6 +1368,63 @@ err:
+ }
+ 
+ static int
++mt7530_port_mdb_prepare(struct dsa_switch *ds, int port,
++  const struct switchdev_obj_port_mdb *mdb)
++{
++  return 0;
++}
++
++static void
++mt7530_port_mdb_add(struct dsa_switch *ds, int port,
++  const struct switchdev_obj_port_mdb *mdb)
++{
++  struct mt7530_priv *priv = ds->priv;
++  const u8 *addr = mdb->addr;
++  u16 vid = mdb->vid;
++  u8 port_mask = 0;
++
++  mutex_lock(>reg_mutex);
++
++  mt7530_fdb_write(priv, vid, 0, addr, 0, STATIC_EMP);
++  if (!mt7530_fdb_cmd(priv, MT7530_FDB_READ, NULL))
++  port_mask = (mt7530_read(priv, MT7530_ATRD) >> PORT_MAP)
++  & PORT_MAP_MASK;
++
++  port_mask |= BIT(port);
++  mt7530_fdb_write(priv, vid, port_mask, addr, -1, STATIC_ENT);
++  mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, NULL);
++
++  mutex_unlock(>reg_mutex);
++}
++
++static int
++mt7530_port_mdb_del(struct dsa_switch *ds, int port,
++  const struct switchdev_obj_port_mdb *mdb)
++{
++  struct mt7530_priv *priv = ds->priv;
++  const u8 *addr = mdb->addr;
++  u16 vid = mdb->vid;
++  u8 port_mask = 0;
++  int ret;
++
++  mutex_lock(>reg_mutex);
++
++  mt7530_fdb_write(priv, vid, 0, addr, 0, STATIC_EMP);
++  if (!mt7530_fdb_cmd(priv, MT7530_FDB_READ, NULL))
++  port_mask = (mt7530_read(priv, MT7530_ATRD) >> PORT_MAP)
++  & PORT_MAP_MASK;
++
++  port_mask &= ~BIT(port);
++  mt7530_fdb_write(priv, vid, port_mask, addr, -1,
++   port_mask ? STATIC_ENT : STATIC_EMP);
++  ret = mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, NULL);
++
++  mutex_unlock(>reg_mutex);
++
++  return ret;
++}
++
++static int
+ mt7530_vlan_cmd(struct mt7530_priv *priv, enum mt7530_vlan_cmd cmd, u16 vid)
+ {
+   struct mt7530_dummy_poll p;
+@@ -2794,11 +2862,15 @@ static const struct dsa_switch_ops mt753
+   .port_change_mtu= mt7530_port_change_mtu,
+   .port_max_mtu   = mt7530_port_max_mtu,
+   .port_stp_state_set = mt7530_stp_state_set,
++  .port_egress_floods = mt7530_port_egress_floods,
+   .port_bridge_join   = mt7530_port_bridge_join,
+   .port_bridge_leave  = mt7530_port_bridge_leave,
+   .port_fdb_add   = mt7530_port_fdb_add,
+   .port_fdb_del   = mt7530_port_fdb_del,
+   .port_fdb_dump  = mt7530_port_fdb_dump,
++  .port_mdb_prepare   = mt7530_port_mdb_prepare,
++  .port_mdb_add   = 

[PATCH 3/6] kernel: backport MT7530 VLAN fix

2022-02-03 Thread DENG Qingfang
Fix FDB learning bugs when VLAN filtering is enabled.

Signed-off-by: DENG Qingfang 
---
 ...disable-learning-on-standalone-ports.patch |  65 +
 ...enable-assisted-learning-on-CPU-port.patch | 102 +++
 ...se-independent-VLAN-learning-on-VLAN.patch | 262 ++
 ...-mt7530-set-STP-state-on-filter-ID-1.patch |  40 +++
 ...lways-install-FDB-entries-with-IVL-a.patch |  54 
 5 files changed, 523 insertions(+)
 create mode 100644 
target/linux/generic/backport-5.10/765-v5.15-net-dsa-mt7530-disable-learning-on-standalone-ports.patch
 create mode 100644 
target/linux/generic/backport-5.10/766-v5.15-net-dsa-mt7530-enable-assisted-learning-on-CPU-port.patch
 create mode 100644 
target/linux/generic/backport-5.10/767-v5.15-net-dsa-mt7530-use-independent-VLAN-learning-on-VLAN.patch
 create mode 100644 
target/linux/generic/backport-5.10/768-v5.15-net-dsa-mt7530-set-STP-state-on-filter-ID-1.patch
 create mode 100644 
target/linux/generic/backport-5.10/769-v5.15-net-dsa-mt7530-always-install-FDB-entries-with-IVL-a.patch

diff --git 
a/target/linux/generic/backport-5.10/765-v5.15-net-dsa-mt7530-disable-learning-on-standalone-ports.patch
 
b/target/linux/generic/backport-5.10/765-v5.15-net-dsa-mt7530-disable-learning-on-standalone-ports.patch
new file mode 100644
index 00..a0bb7fa888
--- /dev/null
+++ 
b/target/linux/generic/backport-5.10/765-v5.15-net-dsa-mt7530-disable-learning-on-standalone-ports.patch
@@ -0,0 +1,65 @@
+From ba2203f36b981235556504fb7b62baee28512a40 Mon Sep 17 00:00:00 2001
+From: DENG Qingfang 
+Date: Tue, 24 Aug 2021 11:37:50 +0800
+Subject: [PATCH] net: dsa: mt7530: disable learning on standalone ports
+
+This is a partial backport of commit 5a30833b9a16f8d1aa15de06636f9317ca51f9df
+("net: dsa: mt7530: support MDB and bridge flag operations") upstream.
+
+Make sure that the standalone ports start up with learning disabled.
+
+Signed-off-by: DENG Qingfang 
+---
+ drivers/net/dsa/mt7530.c | 16 ++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/dsa/mt7530.c
 b/drivers/net/dsa/mt7530.c
+@@ -1163,6 +1163,8 @@ mt7530_port_bridge_join(struct dsa_switc
+  PCR_MATRIX_MASK, PCR_MATRIX(port_bitmap));
+   priv->ports[port].pm |= PCR_MATRIX(port_bitmap);
+ 
++  mt7530_clear(priv, MT7530_PSC_P(port), SA_DIS);
++
+   mutex_unlock(>reg_mutex);
+ 
+   return 0;
+@@ -1260,6 +1262,8 @@ mt7530_port_bridge_leave(struct dsa_swit
+  PCR_MATRIX(BIT(MT7530_CPU_PORT)));
+   priv->ports[port].pm = PCR_MATRIX(BIT(MT7530_CPU_PORT));
+ 
++  mt7530_set(priv, MT7530_PSC_P(port), SA_DIS);
++
+   mutex_unlock(>reg_mutex);
+ }
+ 
+@@ -1817,9 +1821,13 @@ mt7530_setup(struct dsa_switch *ds)
+   ret = mt753x_cpu_port_enable(ds, i);
+   if (ret)
+   return ret;
+-  } else
++  } else {
+   mt7530_port_disable(ds, i);
+ 
++  /* Disable learning by default on all user ports */
++  mt7530_set(priv, MT7530_PSC_P(i), SA_DIS);
++  }
++
+   /* Enable consistent egress tag */
+   mt7530_rmw(priv, MT7530_PVC_P(i), PVC_EG_TAG_MASK,
+  PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
+@@ -1979,9 +1987,13 @@ mt7531_setup(struct dsa_switch *ds)
+   ret = mt753x_cpu_port_enable(ds, i);
+   if (ret)
+   return ret;
+-  } else
++  } else {
+   mt7530_port_disable(ds, i);
+ 
++  /* Disable learning by default on all user ports */
++  mt7530_set(priv, MT7530_PSC_P(i), SA_DIS);
++  }
++
+   /* Enable consistent egress tag */
+   mt7530_rmw(priv, MT7530_PVC_P(i), PVC_EG_TAG_MASK,
+  PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
diff --git 
a/target/linux/generic/backport-5.10/766-v5.15-net-dsa-mt7530-enable-assisted-learning-on-CPU-port.patch
 
b/target/linux/generic/backport-5.10/766-v5.15-net-dsa-mt7530-enable-assisted-learning-on-CPU-port.patch
new file mode 100644
index 00..f376ff949a
--- /dev/null
+++ 
b/target/linux/generic/backport-5.10/766-v5.15-net-dsa-mt7530-enable-assisted-learning-on-CPU-port.patch
@@ -0,0 +1,102 @@
+From 59c8adbc8e2c7f6b46385f36962eadaad3ea2daa Mon Sep 17 00:00:00 2001
+From: DENG Qingfang 
+Date: Wed, 4 Aug 2021 00:04:01 +0800
+Subject: [PATCH] net: dsa: mt7530: enable assisted learning on CPU port
+
+Consider the following bridge configuration, where bond0 is not
+offloaded:
+
+ +-- br0 --+
+/ /   | \
+   / /|  \
+  /  || bond0
+ /   || /   \
+   swp0 swp1 swp2 swp3 swp4
+ ..   .
+ ..   .
+ AB   C
+
+Address learning is enabled on offloaded ports (swp0~2) and the CPU

[PATCH 2/6] kernel: backport MT7530 ageing time support

2022-02-03 Thread DENG Qingfang
Allow setting ageing time from 1 to 1,048,576 seconds.

Signed-off-by: DENG Qingfang 
---
 ...a-mt7530-support-setting-ageing-time.patch | 99 +++
 1 file changed, 99 insertions(+)
 create mode 100644 
target/linux/generic/backport-5.10/764-v5.11-net-dsa-mt7530-support-setting-ageing-time.patch

diff --git 
a/target/linux/generic/backport-5.10/764-v5.11-net-dsa-mt7530-support-setting-ageing-time.patch
 
b/target/linux/generic/backport-5.10/764-v5.11-net-dsa-mt7530-support-setting-ageing-time.patch
new file mode 100644
index 00..44fa40eabe
--- /dev/null
+++ 
b/target/linux/generic/backport-5.10/764-v5.11-net-dsa-mt7530-support-setting-ageing-time.patch
@@ -0,0 +1,99 @@
+From ea6d5c924e391872d402acac38461a5f8261e57f Mon Sep 17 00:00:00 2001
+From: DENG Qingfang 
+Date: Tue, 8 Dec 2020 15:00:28 +0800
+Subject: [PATCH] net: dsa: mt7530: support setting ageing time
+
+MT7530 has a global address age control register, so use it to set
+ageing time.
+
+The applied timer is (AGE_CNT + 1) * (AGE_UNIT + 1) seconds
+
+Signed-off-by: DENG Qingfang 
+Reviewed-by: Andrew Lunn 
+Reviewed-by: Vladimir Oltean 
+Reviewed-by: Florian Fainelli 
+Signed-off-by: David S. Miller 
+---
+ drivers/net/dsa/mt7530.c | 41 
+ drivers/net/dsa/mt7530.h | 13 +
+ 2 files changed, 54 insertions(+)
+
+--- a/drivers/net/dsa/mt7530.c
 b/drivers/net/dsa/mt7530.c
+@@ -870,6 +870,46 @@ mt7530_get_sset_count(struct dsa_switch
+   return ARRAY_SIZE(mt7530_mib);
+ }
+ 
++static int
++mt7530_set_ageing_time(struct dsa_switch *ds, unsigned int msecs)
++{
++  struct mt7530_priv *priv = ds->priv;
++  unsigned int secs = msecs / 1000;
++  unsigned int tmp_age_count;
++  unsigned int error = -1;
++  unsigned int age_count;
++  unsigned int age_unit;
++
++  /* Applied timer is (AGE_CNT + 1) * (AGE_UNIT + 1) seconds */
++  if (secs < 1 || secs > (AGE_CNT_MAX + 1) * (AGE_UNIT_MAX + 1))
++  return -ERANGE;
++
++  /* iterate through all possible age_count to find the closest pair */
++  for (tmp_age_count = 0; tmp_age_count <= AGE_CNT_MAX; ++tmp_age_count) {
++  unsigned int tmp_age_unit = secs / (tmp_age_count + 1) - 1;
++
++  if (tmp_age_unit <= AGE_UNIT_MAX) {
++  unsigned int tmp_error = secs -
++  (tmp_age_count + 1) * (tmp_age_unit + 1);
++
++  /* found a closer pair */
++  if (error > tmp_error) {
++  error = tmp_error;
++  age_count = tmp_age_count;
++  age_unit = tmp_age_unit;
++  }
++
++  /* found the exact match, so break the loop */
++  if (!error)
++  break;
++  }
++  }
++
++  mt7530_write(priv, MT7530_AAC, AGE_CNT(age_count) | AGE_UNIT(age_unit));
++
++  return 0;
++}
++
+ static void mt7530_setup_port5(struct dsa_switch *ds, phy_interface_t 
interface)
+ {
+   struct mt7530_priv *priv = ds->priv;
+@@ -2699,6 +2739,7 @@ static const struct dsa_switch_ops mt753
+   .phy_write  = mt753x_phy_write,
+   .get_ethtool_stats  = mt7530_get_ethtool_stats,
+   .get_sset_count = mt7530_get_sset_count,
++  .set_ageing_time= mt7530_set_ageing_time,
+   .port_enable= mt7530_port_enable,
+   .port_disable   = mt7530_port_disable,
+   .port_change_mtu= mt7530_port_change_mtu,
+--- a/drivers/net/dsa/mt7530.h
 b/drivers/net/dsa/mt7530.h
+@@ -161,6 +161,19 @@ enum mt7530_vlan_egress_attr {
+   MT7530_VLAN_EGRESS_STACK = 3,
+ };
+ 
++/* Register for address age control */
++#define MT7530_AAC0xa0
++/* Disable ageing */
++#define  AGE_DIS  BIT(20)
++/* Age count */
++#define  AGE_CNT_MASK GENMASK(19, 12)
++#define  AGE_CNT_MAX  0xff
++#define  AGE_CNT(x)   (AGE_CNT_MASK & ((x) << 12))
++/* Age unit */
++#define  AGE_UNIT_MASKGENMASK(11, 0)
++#define  AGE_UNIT_MAX 0xfff
++#define  AGE_UNIT(x)  (AGE_UNIT_MASK & (x))
++
+ /* Register for port STP state control */
+ #define MT7530_SSP_P(x)   (0x2000 + ((x) * 0x100))
+ #define  FID_PST(x)   ((x) & 0x3)
-- 
2.25.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/6] kernel: backport MediaTek jumbo frame support

2022-02-03 Thread DENG Qingfang
Allow MTU up to 2026 on mediatek, ramips/mt7621 targets.

Signed-off-by: DENG Qingfang 
---
 ...thernet-mediatek-support-setting-MTU.patch | 138 ++
 ...1-net-dsa-mt7530-support-setting-MTU.patch | 112 ++
 ...-dsa-mt7530-enable-MTU-normalization.patch |  36 +
 3 files changed, 286 insertions(+)
 create mode 100644 
target/linux/generic/backport-5.10/611-v5.12-net-ethernet-mediatek-support-setting-MTU.patch
 create mode 100644 
target/linux/generic/backport-5.10/762-v5.11-net-dsa-mt7530-support-setting-MTU.patch
 create mode 100644 
target/linux/generic/backport-5.10/763-v5.11-net-dsa-mt7530-enable-MTU-normalization.patch

diff --git 
a/target/linux/generic/backport-5.10/611-v5.12-net-ethernet-mediatek-support-setting-MTU.patch
 
b/target/linux/generic/backport-5.10/611-v5.12-net-ethernet-mediatek-support-setting-MTU.patch
new file mode 100644
index 00..289d140f34
--- /dev/null
+++ 
b/target/linux/generic/backport-5.10/611-v5.12-net-ethernet-mediatek-support-setting-MTU.patch
@@ -0,0 +1,138 @@
+From 4fd59792097a6b2fb949d41264386a7ecade469e Mon Sep 17 00:00:00 2001
+From: DENG Qingfang 
+Date: Mon, 25 Jan 2021 12:20:46 +0800
+Subject: [PATCH] net: ethernet: mediatek: support setting MTU
+
+MT762x HW, except for MT7628, supports frame length up to 2048
+(maximum length on GDM), so allow setting MTU up to 2030.
+
+Also set the default frame length to the hardware default 1518.
+
+Signed-off-by: DENG Qingfang 
+Reviewed-by: Andrew Lunn 
+Link: https://lore.kernel.org/r/20210125042046.5599-1-dqf...@gmail.com
+Signed-off-by: Jakub Kicinski 
+---
+ drivers/net/ethernet/mediatek/mtk_eth_soc.c | 43 ++---
+ drivers/net/ethernet/mediatek/mtk_eth_soc.h | 12 --
+ 2 files changed, 47 insertions(+), 8 deletions(-)
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+@@ -355,7 +355,7 @@ static void mtk_mac_config(struct phylin
+   /* Setup gmac */
+   mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
+   mcr_new = mcr_cur;
+-  mcr_new |= MAC_MCR_MAX_RX_1536 | MAC_MCR_IPG_CFG | MAC_MCR_FORCE_MODE |
++  mcr_new |= MAC_MCR_IPG_CFG | MAC_MCR_FORCE_MODE |
+  MAC_MCR_BACKOFF_EN | MAC_MCR_BACKPR_EN | MAC_MCR_FORCE_LINK;
+ 
+   /* Only update control register when needed! */
+@@ -782,8 +782,8 @@ static void mtk_get_stats64(struct net_d
+ static inline int mtk_max_frag_size(int mtu)
+ {
+   /* make sure buf_size will be at least MTK_MAX_RX_LENGTH */
+-  if (mtu + MTK_RX_ETH_HLEN < MTK_MAX_RX_LENGTH)
+-  mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN;
++  if (mtu + MTK_RX_ETH_HLEN < MTK_MAX_RX_LENGTH_2K)
++  mtu = MTK_MAX_RX_LENGTH_2K - MTK_RX_ETH_HLEN;
+ 
+   return SKB_DATA_ALIGN(MTK_RX_HLEN + mtu) +
+   SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
+@@ -794,7 +794,7 @@ static inline int mtk_max_buf_size(int f
+   int buf_size = frag_size - NET_SKB_PAD - NET_IP_ALIGN -
+  SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
+ 
+-  WARN_ON(buf_size < MTK_MAX_RX_LENGTH);
++  WARN_ON(buf_size < MTK_MAX_RX_LENGTH_2K);
+ 
+   return buf_size;
+ }
+@@ -2606,6 +2606,35 @@ static void mtk_uninit(struct net_device
+   mtk_rx_irq_disable(eth, ~0);
+ }
+ 
++static int mtk_change_mtu(struct net_device *dev, int new_mtu)
++{
++  int length = new_mtu + MTK_RX_ETH_HLEN;
++  struct mtk_mac *mac = netdev_priv(dev);
++  struct mtk_eth *eth = mac->hw;
++  u32 mcr_cur, mcr_new;
++
++  if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
++  mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
++  mcr_new = mcr_cur & ~MAC_MCR_MAX_RX_MASK;
++
++  if (length <= 1518)
++  mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1518);
++  else if (length <= 1536)
++  mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1536);
++  else if (length <= 1552)
++  mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1552);
++  else
++  mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_2048);
++
++  if (mcr_new != mcr_cur)
++  mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
++  }
++
++  dev->mtu = new_mtu;
++
++  return 0;
++}
++
+ static int mtk_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ {
+   struct mtk_mac *mac = netdev_priv(dev);
+@@ -2902,6 +2931,7 @@ static const struct net_device_ops mtk_n
+   .ndo_set_mac_address= mtk_set_mac_address,
+   .ndo_validate_addr  = eth_validate_addr,
+   .ndo_do_ioctl   = mtk_do_ioctl,
++  .ndo_change_mtu = mtk_change_mtu,
+   .ndo_tx_timeout = mtk_tx_timeout,
+   .ndo_get_stats64= mtk_get_stats64,
+   .ndo_fix_features   = mtk_fix_features,
+@@ -3004,7 +3034,10 @@ static int mtk_add_mac(struct mtk_eth *e
+   eth->netdev[id]->irq = 

[PATCH 0/6] backport fixes and improvements for MT7530

2022-02-03 Thread DENG Qingfang
Hi,

This series backports some patches from upstream to address the current
MT7530 DSA driver's problems.

Thanks.

DENG Qingfang (6):
  kernel: backport MediaTek jumbo frame support
  kernel: backport MT7530 ageing time support
  kernel: backport MT7530 VLAN fix
  kernel: backport MT7530 MDB operations
  kernel: backport MediaTek Ethernet PHY driver
  kernel: backport MT7530 IRQ support

 ...thernet-mediatek-support-setting-MTU.patch | 138 ++
 ...1-net-dsa-mt7530-support-setting-MTU.patch | 112 +
 ...-dsa-mt7530-enable-MTU-normalization.patch |  36 ++
 ...a-mt7530-support-setting-ageing-time.patch |  99 
 ...disable-learning-on-standalone-ports.patch |  65 +++
 ...enable-assisted-learning-on-CPU-port.patch | 102 +
 ...se-independent-VLAN-learning-on-VLAN.patch | 262 +++
 ...-mt7530-set-STP-state-on-filter-ID-1.patch |  40 ++
 ...lways-install-FDB-entries-with-IVL-a.patch |  54 +++
 ...et-dsa-mt7530-support-MDB-operations.patch | 171 +++
 ...MediaTek-Gigabit-Ethernet-PHY-driver.patch | 162 +++
 ...net-dsa-mt7530-add-interrupt-support.patch | 428 ++
 target/linux/generic/config-5.10  |   1 +
 target/linux/mediatek/mt7622/config-5.10  |   1 +
 target/linux/mediatek/mt7623/config-5.10  |   1 +
 target/linux/ramips/dts/mt7621.dtsi   |   3 +
 target/linux/ramips/mt7621/config-5.10|   1 +
 17 files changed, 1676 insertions(+)
 create mode 100644 
target/linux/generic/backport-5.10/611-v5.12-net-ethernet-mediatek-support-setting-MTU.patch
 create mode 100644 
target/linux/generic/backport-5.10/762-v5.11-net-dsa-mt7530-support-setting-MTU.patch
 create mode 100644 
target/linux/generic/backport-5.10/763-v5.11-net-dsa-mt7530-enable-MTU-normalization.patch
 create mode 100644 
target/linux/generic/backport-5.10/764-v5.11-net-dsa-mt7530-support-setting-ageing-time.patch
 create mode 100644 
target/linux/generic/backport-5.10/765-v5.15-net-dsa-mt7530-disable-learning-on-standalone-ports.patch
 create mode 100644 
target/linux/generic/backport-5.10/766-v5.15-net-dsa-mt7530-enable-assisted-learning-on-CPU-port.patch
 create mode 100644 
target/linux/generic/backport-5.10/767-v5.15-net-dsa-mt7530-use-independent-VLAN-learning-on-VLAN.patch
 create mode 100644 
target/linux/generic/backport-5.10/768-v5.15-net-dsa-mt7530-set-STP-state-on-filter-ID-1.patch
 create mode 100644 
target/linux/generic/backport-5.10/769-v5.15-net-dsa-mt7530-always-install-FDB-entries-with-IVL-a.patch
 create mode 100644 
target/linux/generic/backport-5.10/770-v5.15-net-dsa-mt7530-support-MDB-operations.patch
 create mode 100644 
target/linux/generic/backport-5.10/771-v5.14-net-phy-add-MediaTek-Gigabit-Ethernet-PHY-driver.patch
 create mode 100644 
target/linux/generic/backport-5.10/772-v5.14-net-dsa-mt7530-add-interrupt-support.patch

-- 
2.25.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ramips: move KERNEL_LOADADDR into Device/Default

2022-02-03 Thread Sungbo Eo
Commit f4a79148f8cb ("ramips: add support for ipTIME AX2004M") was
reverted due to KERNEL_LOADADDR leakage, and it seems the problem can be
mitigated by moving the variable definition into Device/Default. By this,
KERNEL_LOADADDR redefined in a device recipe will not be leaked into the
subsequent device recipes anymore and thus will remain as a per-device
variable.

Ref: cd6a6e3030ff ("Revert "ramips: add support for ipTIME AX2004M"")
Signed-off-by: Sungbo Eo 
---
I have not tested this on actual devices (yet), but I've successfully reproduced
(bit-for-bit identical) device images in all mt7621 and mt7620 subtargets
with this patch and the offending device recipe in f4a79148f8cb applied.
(...except for humax,e10 factory image, which I try to solve in [1])

[1] https://github.com/openwrt/openwrt/pull/5026
---
 target/linux/ramips/image/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/image/Makefile 
b/target/linux/ramips/image/Makefile
index 241b620941..f481e6e447 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -22,7 +22,6 @@ ldrplatform-$(CONFIG_TARGET_ramips_mt7621) := mt7621
 ldrflashstart-y := 0x1c00
 ldrflashstart-$(CONFIG_TARGET_ramips_mt7621) := 0x1fc0
 
-KERNEL_LOADADDR := $(loadaddr-y)
 LOADER_PLATFORM := $(ldrplatform-y)
 LOADER_FLASH_START := $(ldrflashstart-y)
 
@@ -176,6 +175,7 @@ endef
 define Device/Default
   PROFILES = Default
   KERNEL := $(KERNEL_DTB) | uImage lzma
+  KERNEL_LOADADDR := $(loadaddr-y)
   SOC := $(DEFAULT_SOC)
   DEVICE_DTS_DIR := ../dts
   DEVICE_DTS = $$(SOC)_$(1)
-- 
2.25.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/1] cache: fix AVL tree traversal in cache_record_find() and cache_host_is_known()

2022-02-03 Thread mroeder
From: Martin Röder 

The AVL tree traversal in both functions systematically misses the last
AVL tree element. This can lead to duplicate cache entries and lookup failures.

The fix duplicates the correct AVL tree traversal approach of 
cache_dump_recursive().

Signed-off-by: Martin Röder 
---
 cache.c | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/cache.c b/cache.c
index ea6a4c8..d1816df 100644
--- a/cache.c
+++ b/cache.c
@@ -191,13 +191,10 @@ cache_record_find(char *record, int type, int port, int 
rdlength, uint8_t *rdata
 {
struct cache_record *l = avl_find_element(, record, l, avl);
 
-   if (!l)
-   return NULL;
-
-   while (l && !avl_is_last(, >avl) && !strcmp(l->record, 
record)) {
+   while (l && !strcmp(l->record, record)) {
struct cache_record *r = l;
 
-   l = avl_next_element(l, avl);
+   l = !avl_is_last(, >avl) ? avl_next_element(l, avl) 
: NULL;
if (r->type != type)
continue;
 
@@ -227,13 +224,10 @@ cache_host_is_known(char *record)
 {
struct cache_record *l = avl_find_element(, record, l, avl);
 
-   if (!l)
-   return 0;
-
-   while (l && !avl_is_last(, >avl) && !strcmp(l->record, 
record)) {
+   while (l && !strcmp(l->record, record)) {
struct cache_record *r = l;
 
-   l = avl_next_element(l, avl);
+   l = !avl_is_last(, >avl) ? avl_next_element(l, avl) 
: NULL;
if ((r->type != TYPE_A) && (r->type != TYPE_))
continue;
return 1;
-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 0/1] Bugfix for OpenWrt package umdns

2022-02-03 Thread mroeder
From: Martin Röder 

Hi Daniel,

thank you for pointing me to git-send-email. That allows me to bypass the whole 
Notes mess
and I hope it will lead to an acceptable patch.

Best,
  Martin


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH 6/7] lantiq: add image handling for x490 Fritzboxes

2022-02-03 Thread Torsten Duwe
On Thu, 3 Feb 2022 07:12:40 +0100
Andreas Böhler  wrote:

> > +  DEVICE_PACKAGES := kmod-usb3 fritz-tffs wasp_uploader
> > +endef
> > +
> Is wasp_uploader really in an official package feed?

I don't know. As mentioned, I mostly ignored the secondary system for
now, and -master, with exactly these 7 patches, compiled and ran fine
here. I have not used any additional feeds. I'd really like to leave
those "loose ends", so it is clear where the WIFI system, once
provided, should hook in (see gswip port, reset etc. in the DTs).

Torsten

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel