From 81527817e9fd5f710a1ff0a339c8cb67b9e0d96a Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 25 Sep 2024 13:26:19 +0200 Subject: [PATCH 1/9] tools: e2fsprogs: drop the e4defrag patch Considering that this patch to not build e4defrag was added 12 years ago because: Compilation fails on older systems due to missing syscalls I think its safe to say that enough time is passed so that whatever those older systems were are either updated or not used anymore so lets drop the patch. Link: https://github.com/openwrt/openwrt/pull/16500 Signed-off-by: Robert Marko --- tools/e2fsprogs/patches/002-dont-build-e4defrag.patch | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 tools/e2fsprogs/patches/002-dont-build-e4defrag.patch diff --git a/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch b/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch deleted file mode 100644 index f59cd317a1d339..00000000000000 --- a/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/misc/Makefile.in -+++ b/misc/Makefile.in -@@ -12,7 +12,7 @@ MKDIR_P = @MKDIR_P@ - - @MCONFIG@ - --@DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_PROG= e4defrag -+@DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_PROG= - @DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_MAN= e4defrag.8 - - @LINUX_CMT@E4CRYPT_PROG = e4crypt From da3e1ae35e948ffe75830d837c15f0137c9073a1 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 25 Sep 2024 13:31:29 +0200 Subject: [PATCH 2/9] tools: e2fsprogs: pass --with-crond-dir=no instead of patching Currently, e2fsprogs is being patched to avoid detecting host crond, but instead of doing that we can simply pass --with-crond-dir=no as an argument and drop the patch. Link: https://github.com/openwrt/openwrt/pull/16500 Signed-off-by: Robert Marko --- tools/e2fsprogs/Makefile | 3 ++- tools/e2fsprogs/patches/003-no-crond.patch | 11 ----------- 2 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 tools/e2fsprogs/patches/003-no-crond.patch diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile index 2c35adfa8f9b07..8a8a2e181f3f7b 100644 --- a/tools/e2fsprogs/Makefile +++ b/tools/e2fsprogs/Makefile @@ -30,7 +30,8 @@ HOST_CONFIGURE_ARGS += \ --disable-tls \ --disable-nls \ --enable-threads=pth \ - --disable-fuse2fs + --disable-fuse2fs \ + --with-crond-dir=no define Host/Prepare $(call Host/Prepare/Default) diff --git a/tools/e2fsprogs/patches/003-no-crond.patch b/tools/e2fsprogs/patches/003-no-crond.patch deleted file mode 100644 index 67ddd4ab0ce90f..00000000000000 --- a/tools/e2fsprogs/patches/003-no-crond.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/configure -+++ b/configure -@@ -15259,7 +15259,7 @@ then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${crond_dir}" >&5 - printf "%s\n" "${crond_dir}" >&6; } -- have_crond="yes" -+ have_crond="no"; with_crond_dir="" - - else $as_nop - From 95e4664b5efcade30d1bcec95d6571861c3ee9c7 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 25 Sep 2024 14:56:12 +0200 Subject: [PATCH 3/9] tools: e2fsprogs: drop e2fsck patch After digging in the history of the e2fsck exit code patch, it seems like there is no reason for us to carry this patch so lets drop it. Link: https://github.com/openwrt/openwrt/pull/16500 Signed-off-by: Robert Marko --- .../patches/001-exit_0_on_corrected_errors.patch | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch diff --git a/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch b/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch deleted file mode 100644 index c94c609160e0a4..00000000000000 --- a/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/e2fsck/e2fsck.h -+++ b/e2fsck/e2fsck.h -@@ -81,7 +81,7 @@ - * Exit codes used by fsck-type programs - */ - #define FSCK_OK 0 /* No errors */ --#define FSCK_NONDESTRUCT 1 /* File system errors corrected */ -+#define FSCK_NONDESTRUCT 0 /* File system errors corrected */ - #define FSCK_REBOOT 2 /* System should be rebooted */ - #define FSCK_UNCORRECTED 4 /* File system errors left uncorrected */ - #define FSCK_ERROR 8 /* Operational error */ From d3dad5b10b443eb94cf482f92ae8929a722412d6 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 17 Sep 2024 17:51:36 -0700 Subject: [PATCH 4/9] uboot-kirkwood: fix compilation with GCC14 Missing header. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16467 Signed-off-by: Hauke Mehrtens --- package/boot/uboot-kirkwood/Makefile | 2 +- package/boot/uboot-kirkwood/patches/180-netgear-stora.patch | 3 ++- package/boot/uboot-kirkwood/patches/200-openwrt-config.patch | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index 7338e5d8681169..afeee805a0be39 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_VERSION:=2020.04 -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372 diff --git a/package/boot/uboot-kirkwood/patches/180-netgear-stora.patch b/package/boot/uboot-kirkwood/patches/180-netgear-stora.patch index c6aced422173b7..bdf82ebea57fb2 100644 --- a/package/boot/uboot-kirkwood/patches/180-netgear-stora.patch +++ b/package/boot/uboot-kirkwood/patches/180-netgear-stora.patch @@ -230,7 +230,7 @@ + --- /dev/null +++ b/board/Marvell/netgear_ms2110/netgear_ms2110.c -@@ -0,0 +1,151 @@ +@@ -0,0 +1,152 @@ +/* + * Copyright (C) 2014-2017 bodhi + * @@ -264,6 +264,7 @@ +#include +#include +#include "netgear_ms2110.h" ++#include +#include + +DECLARE_GLOBAL_DATA_PTR; diff --git a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch index 4cf874b3687cac..00bc29f13e067d 100644 --- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch +++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch @@ -1,6 +1,6 @@ --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -111,4 +111,7 @@ source "board/alliedtelesis/SBx81LIFXCAT +@@ -115,4 +115,7 @@ source "board/alliedtelesis/SBx81LIFXCAT source "board/Marvell/db-88f6281-bp/Kconfig" source "board/checkpoint/l-50/Kconfig" From 1e8dde776a25f2bedaf530f13ac8c45a18d47d00 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 14 Aug 2024 18:45:55 -0700 Subject: [PATCH 5/9] ath79: gpio-latch-mikrotik: use dev_err_probe It automatically adds the error code at the end of the message. It also deals with -EPROBE_DEFER automatically (doesn't output). Simpler code. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16350 Signed-off-by: Robert Marko --- .../files/drivers/gpio/gpio-latch-mikrotik.c | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c index 8f53974e46af24..80c3cc6748b6d6 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c @@ -121,24 +121,19 @@ static int gpio_latch_probe(struct platform_device *pdev) mutex_init(&glc->latch_mutex); n = gpiod_count(dev, NULL); - if (n <= 0) { - dev_err(dev, "failed to get gpios: %d\n", n); - return n; - } else if (n != GPIO_LATCH_LINES) { - dev_err(dev, "expected %d gpios\n", GPIO_LATCH_LINES); + if (n <= 0) + return dev_err_probe(dev, n, "failed to get gpios"); + if (n != GPIO_LATCH_LINES) { + dev_err(dev, "expected %d gpios", GPIO_LATCH_LINES); return -EINVAL; } for (i = 0; i < n; i++) { glc->gpios[i] = devm_gpiod_get_index_optional(dev, NULL, i, GPIOD_OUT_LOW); - if (IS_ERR(glc->gpios[i])) { - if (PTR_ERR(glc->gpios[i]) != -EPROBE_DEFER) { - dev_err(dev, "failed to get gpio %d: %ld\n", i, - PTR_ERR(glc->gpios[i])); - } - return PTR_ERR(glc->gpios[i]); - } + if (IS_ERR(glc->gpios[i])) + return dev_err_probe(dev, PTR_ERR(glc->gpios[i]), + "failed to get gpio %d", i); } glc->le_gpio = 8; @@ -162,13 +157,7 @@ static int gpio_latch_probe(struct platform_device *pdev) platform_set_drvdata(pdev, glc); - i = gpiochip_add(&glc->gc); - if (i) { - dev_err(dev, "gpiochip_add() failed: %d\n", i); - return i; - } - - return 0; + return gpiochip_add(&glc->gc); } static int gpio_latch_remove(struct platform_device *pdev) From c4f2626694532f95d59cfd7e59a7505079846403 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 7 Sep 2024 17:08:33 -0700 Subject: [PATCH 6/9] ath79: gpio-latch-mikrotik: remove _remove Not needed with devm. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16350 Signed-off-by: Robert Marko --- .../ath79/files/drivers/gpio/gpio-latch-mikrotik.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c index 80c3cc6748b6d6..de953e0b6537dd 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c @@ -155,17 +155,7 @@ static int gpio_latch_probe(struct platform_device *pdev) gc->direction_output = gpio_latch_direction_output; gc->fwnode = fwnode; - platform_set_drvdata(pdev, glc); - - return gpiochip_add(&glc->gc); -} - -static int gpio_latch_remove(struct platform_device *pdev) -{ - struct gpio_latch_chip *glc = platform_get_drvdata(pdev); - - gpiochip_remove(&glc->gc); - return 0; + return devm_gpiochip_add_data(dev, gc, glc); } static const struct of_device_id gpio_latch_match[] = { @@ -177,7 +167,6 @@ MODULE_DEVICE_TABLE(of, gpio_latch_match); static struct platform_driver gpio_latch_driver = { .probe = gpio_latch_probe, - .remove = gpio_latch_remove, .driver = { .name = GPIO_LATCH_DRIVER_NAME, .owner = THIS_MODULE, From 65ed47545054d6a9ddb2704c433893b571682e7c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 7 Sep 2024 17:16:42 -0700 Subject: [PATCH 7/9] ath79: gpio-latch-mikrotik: remove fwnode Not needed. Can just use dev. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16350 Signed-off-by: Robert Marko --- target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c index de953e0b6537dd..70f091b79ff398 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c @@ -110,7 +110,6 @@ static int gpio_latch_probe(struct platform_device *pdev) struct gpio_latch_chip *glc; struct gpio_chip *gc; struct device *dev = &pdev->dev; - struct fwnode_handle *fwnode = dev->fwnode; int i, n; glc = devm_kzalloc(dev, sizeof(*glc), GFP_KERNEL); @@ -147,13 +146,13 @@ static int gpio_latch_probe(struct platform_device *pdev) gc = &glc->gc; gc->label = GPIO_LATCH_DRIVER_NAME; + gc->parent = dev; gc->can_sleep = true; gc->base = -1; gc->ngpio = GPIO_LATCH_LINES; gc->get = gpio_latch_get; gc->set = gpio_latch_set; gc->direction_output = gpio_latch_direction_output; - gc->fwnode = fwnode; return devm_gpiochip_add_data(dev, gc, glc); } From ba24b94e0b84840d6396d57672e1a33032ebe146 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 14 Aug 2024 17:50:20 -0700 Subject: [PATCH 8/9] ramips: use more devm in mtk_eth_soc These got added to the kernel after this driver was written. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16415 Signed-off-by: Hauke Mehrtens --- .../drivers/net/ethernet/ralink/mtk_eth_soc.c | 49 ++++++------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c index c7e074aaa5d9e2..893198d8261a12 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c @@ -1522,7 +1522,6 @@ static void fe_pending_work(struct work_struct *work) static int fe_probe(struct platform_device *pdev) { - struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); const struct of_device_id *match; struct fe_soc_data *soc; struct net_device *netdev; @@ -1542,17 +1541,14 @@ static int fe_probe(struct platform_device *pdev) else soc->reg_table = fe_reg_table; - fe_base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(fe_base)) { - err = -EADDRNOTAVAIL; - goto err_out; - } + fe_base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(fe_base)) + return PTR_ERR(fe_base); - netdev = alloc_etherdev(sizeof(*priv)); + netdev = devm_alloc_etherdev_mqs(&pdev->dev, sizeof(*priv), 4, 4); if (!netdev) { dev_err(&pdev->dev, "alloc_etherdev failed\n"); - err = -ENOMEM; - goto err_iounmap; + return -ENOMEM; } SET_NETDEV_DEV(netdev, &pdev->dev); @@ -1562,16 +1558,15 @@ static int fe_probe(struct platform_device *pdev) netdev->irq = platform_get_irq(pdev, 0); if (netdev->irq < 0) { dev_err(&pdev->dev, "no IRQ resource found\n"); - err = -ENXIO; - goto err_free_dev; + return -ENXIO; } priv = netdev_priv(netdev); spin_lock_init(&priv->page_lock); - priv->resets = devm_reset_control_array_get_exclusive(&pdev->dev); + priv->resets = devm_reset_control_array_get_optional_exclusive(&pdev->dev); if (IS_ERR(priv->resets)) { dev_err(&pdev->dev, "Failed to get resets for FE and ESW cores: %pe\n", priv->resets); - priv->resets = NULL; + return PTR_ERR(priv->resets); } if (soc->init_data) @@ -1589,11 +1584,9 @@ static int fe_probe(struct platform_device *pdev) netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; if (fe_reg_table[FE_REG_FE_COUNTER_BASE]) { - priv->hw_stats = kzalloc(sizeof(*priv->hw_stats), GFP_KERNEL); - if (!priv->hw_stats) { - err = -ENOMEM; - goto err_free_dev; - } + priv->hw_stats = devm_kzalloc(&pdev->dev, sizeof(*priv->hw_stats), GFP_KERNEL); + if (!priv->hw_stats) + return -ENOMEM; spin_lock_init(&priv->hw_stats->stats_lock); u64_stats_init(&priv->hw_stats->syncp); } @@ -1603,15 +1596,13 @@ static int fe_probe(struct platform_device *pdev) priv->sysclk = clk_get_rate(sysclk); } else if ((priv->flags & FE_FLAG_CALIBRATE_CLK)) { dev_err(&pdev->dev, "this soc needs a clk for calibration\n"); - err = -ENXIO; - goto err_free_dev; + return -ENXIO; } priv->switch_np = of_parse_phandle(pdev->dev.of_node, "mediatek,switch", 0); if ((priv->flags & FE_FLAG_HAS_SWITCH) && !priv->switch_np) { dev_err(&pdev->dev, "failed to read switch phandle\n"); - err = -ENODEV; - goto err_free_dev; + return -ENODEV; } priv->netdev = netdev; @@ -1633,10 +1624,10 @@ static int fe_probe(struct platform_device *pdev) netif_napi_add_weight(netdev, &priv->rx_napi, fe_poll, napi_weight); fe_set_ethtool_ops(netdev); - err = register_netdev(netdev); + err = devm_register_netdev(&pdev->dev, netdev); if (err) { dev_err(&pdev->dev, "error bringing up device\n"); - goto err_free_dev; + return err; } platform_set_drvdata(pdev, netdev); @@ -1645,13 +1636,6 @@ static int fe_probe(struct platform_device *pdev) netdev->base_addr, netdev->irq); return 0; - -err_free_dev: - free_netdev(netdev); -err_iounmap: - devm_iounmap(&pdev->dev, fe_base); -err_out: - return err; } static int fe_remove(struct platform_device *pdev) @@ -1660,12 +1644,9 @@ static int fe_remove(struct platform_device *pdev) struct fe_priv *priv = netdev_priv(dev); netif_napi_del(&priv->rx_napi); - kfree(priv->hw_stats); cancel_work_sync(&priv->pending_work); - unregister_netdev(dev); - free_netdev(dev); platform_set_drvdata(pdev, NULL); return 0; From 38bb47c36c473a33b054a76dcd52827ae15fb610 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Wed, 18 Sep 2024 23:10:16 +0800 Subject: [PATCH 9/9] openssl: update download mirrors New releases of openssl are only published on GitHub, and official downloads are also redirected to GitHub. So remove the old download mirrors (file 404), and replace the current address with https. Link: https://openssl-library.org/source/ Signed-off-by: Chukun Pan Link: https://github.com/openwrt/openwrt/pull/16470 Signed-off-by: Hauke Mehrtens --- package/libs/openssl/Makefile | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 554cde7a2de481..959424ce12c540 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -17,13 +17,9 @@ PKG_BUILD_PARALLEL:=1 PKG_BASE:=$(subst $(space),.,$(wordlist 1,2,$(subst .,$(space),$(PKG_VERSION)))) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:= \ - http://www.openssl.org/source/ \ - http://www.openssl.org/source/old/$(PKG_BASE)/ \ - https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/ \ - http://ftp.fi.muni.cz/pub/openssl/source/ \ - http://ftp.fi.muni.cz/pub/openssl/source/old/$(PKG_BASE)/ \ - ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \ - ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/ + https://www.openssl.org/source/ \ + https://www.openssl.org/source/old/$(PKG_BASE)/ \ + https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/ PKG_HASH:=23c666d0edf20f14249b3d8f0368acaee9ab585b09e1de82107c66e1f3ec9533 @@ -74,7 +70,7 @@ endif define Package/openssl/Default TITLE:=Open source SSL toolkit - URL:=http://www.openssl.org/ + URL:=https://www.openssl.org/ SECTION:=libs CATEGORY:=Libraries endef