mediatek: fix NETDEV WATCHDOG: eth0 (mtk_SOC_eth): Transmit queue 0 timed out
Use flow control or BQL maybe lead to bug. Iperf3 was usedfor 24 hours, Transmit Queue 0 timed out may occur. example: Server: iperf3 -s Client: iperf3 -c 172.16.10.20 Signed-off-by: daxiong --- ...iatek-ethernet-transmit-queue-timeout-bug.patch | 109 + 1 file changed, 109 insertions(+) create mode 100644 target/linux/ramips/patches-5.4/500-mediatek-ethernet-transmit-queue-timeout-bug.patch diff --git a/target/linux/ramips/patches-5.4/500-mediatek-ethernet-transmit-queue-timeout-bug.patch b/target/linux/ramips/patches-5.4/500-mediatek-ethernet-transmit-queue-timeout-bug.patch new file mode 100644 index 000..d5da9e4 --- /dev/null +++ b/target/linux/ramips/patches-5.4/500-mediatek-ethernet-transmit-queue-timeout-bug.patch @@ -0,0 +1,109 @@ +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c 2021-10-03 18:46:25.065801660 +0800 b/drivers/net/ethernet/mediatek/mtk_eth_soc.c 2021-10-03 19:13:24.931017393 +0800 +@@ -26,6 +26,11 @@ + + #include "mtk_eth_soc.h" + ++//Bug info: NETDEV WATCHDOG: eth0 (mtk_soc_eth): transmit queue 0 timed out ++//Bug fixed: BQL and FC maybe QUEUE to be stopped forever ++#define DISABLE_MTK_BQL //disable Byte Queue Limit ++#define DISABLE_MTK_FC //disable Flow Control ++ + static int mtk_msg_level = -1; + module_param_named(msg_level, mtk_msg_level, int, 0); + MODULE_PARM_DESC(msg_level, "Message level (-1=defaults,0=none,...,16=all)"); +@@ -380,6 +385,10 @@ static void mtk_mac_config(struct phylin + mcr_new |= MAC_MCR_FORCE_RX_FC; + } + ++ #ifdef DISABLE_MTK_FC ++ mcr_new &= ~(MAC_MCR_FORCE_RX_FC | MAC_MCR_FORCE_TX_FC); ++ #endif ++ + /* Only update control register when needed! */ + if (mcr_new != mcr_cur) + mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id)); +@@ -535,8 +544,10 @@ static void mtk_validate(struct phylink_ + } + } + ++ #ifndef DISABLE_MTK_FC + phylink_set(mask, Pause); + phylink_set(mask, Asym_Pause); ++ #endif + + linkmode_and(supported, supported, mask); + linkmode_and(state->advertising, state->advertising, mask); +@@ -1071,8 +1082,10 @@ static int mtk_tx_map(struct sk_buff *sk + txd_pdma->txd2 |= TX_DMA_LS1; + } + ++ #ifndef DISABLE_MTK_BQL + netdev_sent_queue(dev, skb->len); + skb_tx_timestamp(skb); ++ #endif + + ring->next_free = mtk_qdma_phys_to_virt(ring, txd->txd2); + atomic_sub(n_desc, &ring->free_count); +@@ -1496,7 +1509,9 @@ static int mtk_poll_tx(struct mtk_eth *e + for (i = 0; i < MTK_MAC_COUNT; i++) { + if (!eth->netdev[i] || !done[i]) + continue; ++ #ifndef DISABLE_MTK_BQL + netdev_completed_queue(eth->netdev[i], done[i], bytes[i]); ++ #endif + total += done[i]; + eth->tx_packets += done[i]; + eth->tx_bytes += bytes[i]; +--- a/drivers/net/dsa/mt7530.c 2021-10-03 18:47:00.077800119 +0800 b/drivers/net/dsa/mt7530.c 2021-10-03 19:13:37.807016826 +0800 +@@ -22,6 +22,8 @@ + + #include "mt7530.h" + ++#define DISABLE_MTK_FC //disable Flow Control ++ + /* String, offset, and register size in bytes if different from 4 bytes */ + static const struct mt7530_mib_desc mt7530_mib[] = { + MIB_DESC(1, 0x00, "TxDrop"), +@@ -1281,6 +1283,18 @@ mt7530_setup(struct dsa_switch *ds) + val |= MHWTRAP_MANUAL; + mt7530_write(priv, MT7530_MHWTRAP, val); + ++#ifdef DISABLE_MTK_FC ++ usleep_range(10, 20); ++ ++ val = mt7530_read(priv, 0x1FE0); ++ val &= ~BIT(31); ++ mt7530_write(priv, 0x1FE0, val); ++ ++ mt7530_write(priv, MT7530_PMCR_P(5), 0x5e30b); ++ mt7530_write(priv, MT7530_PMCR_P(6), 0x5e30b); ++ usleep_range(10, 20); ++#endif ++ + priv->p6_interface = PHY_INTERFACE_MODE_NA; + + /* Enable and reset MIB counters */ +@@ -1427,6 +1441,10 @@ static void mt7530_phylink_mac_config(st + mcr_new |= PMCR_RX_FC_EN; + } + ++ #ifdef DISABLE_MTK_FC ++ mcr_new &= ~(PMCR_TX_FC_EN | PMCR_RX_FC_EN); ++ #endif ++ + if (mcr_new != mcr_cur) + mt7530_write(priv, MT7530_PMCR_P(port), mcr_new); + } +@@ -1505,8 +1523,10 @@ unsupported: + } + } + ++ #ifndef DISABLE_MTK_FC + phylink_set(mask, Pause); + phylink_set(mask, Asym_Pause); ++ #endif + + linkmode_and(supported, supported, mask); + linkmode_and(state->advertising, state->advertising, mask); -- 1.9.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[PATCH-21.02] fix bug: NETDEV WATCHDOG: eth0 (mtk_SOC_eth): Transmit Queue 0 timed out Use flow control or BQL maybe lead to bug. Iperf3 was used for 24 hours, Transmit Queue 0 timed out may occur. ex
Signed-off-by: daxiong --- ...iatek-ethernet-transmit-queue-timeout-bug.patch | 113 + 1 file changed, 113 insertions(+) create mode 100644 target/linux/ramips/patches-5.4/500-mediatek-ethernet-transmit-queue-timeout-bug.patch diff --git a/target/linux/ramips/patches-5.4/500-mediatek-ethernet-transmit-queue-timeout-bug.patch b/target/linux/ramips/patches-5.4/500-mediatek-ethernet-transmit-queue-timeout-bug.patch new file mode 100644 index 000..cec27c6 --- /dev/null +++ b/target/linux/ramips/patches-5.4/500-mediatek-ethernet-transmit-queue-timeout-bug.patch @@ -0,0 +1,113 @@ +--- a/drivers/net/dsa/mt7530.c 2021-10-03 18:47:00.077800119 +0800 b/drivers/net/dsa/mt7530.c 2021-10-03 18:47:33.353798655 +0800 +@@ -22,6 +22,10 @@ + + #include "mt7530.h" + ++#ifdef CONFIG_SUPPORT_IKUAI_CODE ++#define DISABLE_MTK_FC //disable Flow Control ++#endif ++ + /* String, offset, and register size in bytes if different from 4 bytes */ + static const struct mt7530_mib_desc mt7530_mib[] = { + MIB_DESC(1, 0x00, "TxDrop"), +@@ -1281,6 +1285,18 @@ mt7530_setup(struct dsa_switch *ds) + val |= MHWTRAP_MANUAL; + mt7530_write(priv, MT7530_MHWTRAP, val); + ++#ifdef DISABLE_MTK_FC ++ usleep_range(10, 20); ++ ++ val = mt7530_read(priv, 0x1FE0); ++ val &= ~BIT(31); ++ mt7530_write(priv, 0x1FE0, val); ++ ++ mt7530_write(priv, MT7530_PMCR_P(5), 0x5e30b); ++ mt7530_write(priv, MT7530_PMCR_P(6), 0x5e30b); ++ usleep_range(10, 20); ++#endif ++ + priv->p6_interface = PHY_INTERFACE_MODE_NA; + + /* Enable and reset MIB counters */ +@@ -1427,6 +1443,10 @@ static void mt7530_phylink_mac_config(st + mcr_new |= PMCR_RX_FC_EN; + } + ++ #ifdef DISABLE_MTK_FC ++ mcr_new &= ~(PMCR_TX_FC_EN | PMCR_RX_FC_EN); ++ #endif ++ + if (mcr_new != mcr_cur) + mt7530_write(priv, MT7530_PMCR_P(port), mcr_new); + } +@@ -1505,8 +1525,10 @@ unsupported: + } + } + ++ #ifndef DISABLE_MTK_FC + phylink_set(mask, Pause); + phylink_set(mask, Asym_Pause); ++ #endif + + linkmode_and(supported, supported, mask); + linkmode_and(state->advertising, state->advertising, mask); +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c 2021-10-03 18:46:25.065801660 +0800 b/drivers/net/ethernet/mediatek/mtk_eth_soc.c 2021-10-03 18:47:33.353798655 +0800 +@@ -26,6 +26,13 @@ + + #include "mtk_eth_soc.h" + ++#ifdef CONFIG_SUPPORT_IKUAI_CODE ++//Bug info: NETDEV WATCHDOG: eth0 (mtk_soc_eth): transmit queue 0 timed out ++//Bug fixed: BQL and FC maybe QUEUE to be stopped forever ++#define DISABLE_MTK_BQL //disable Byte Queue Limit ++#define DISABLE_MTK_FC //disable Flow Control ++#endif ++ + static int mtk_msg_level = -1; + module_param_named(msg_level, mtk_msg_level, int, 0); + MODULE_PARM_DESC(msg_level, "Message level (-1=defaults,0=none,...,16=all)"); +@@ -380,6 +387,10 @@ static void mtk_mac_config(struct phylin + mcr_new |= MAC_MCR_FORCE_RX_FC; + } + ++ #ifdef DISABLE_MTK_FC ++ mcr_new &= ~(MAC_MCR_FORCE_RX_FC | MAC_MCR_FORCE_TX_FC); ++ #endif ++ + /* Only update control register when needed! */ + if (mcr_new != mcr_cur) + mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id)); +@@ -535,8 +546,10 @@ static void mtk_validate(struct phylink_ + } + } + ++ #ifndef DISABLE_MTK_FC + phylink_set(mask, Pause); + phylink_set(mask, Asym_Pause); ++ #endif + + linkmode_and(supported, supported, mask); + linkmode_and(state->advertising, state->advertising, mask); +@@ -1071,8 +1084,10 @@ static int mtk_tx_map(struct sk_buff *sk + txd_pdma->txd2 |= TX_DMA_LS1; + } + ++ #ifndef DISABLE_MTK_BQL + netdev_sent_queue(dev, skb->len); + skb_tx_timestamp(skb); ++ #endif + + ring->next_free = mtk_qdma_phys_to_virt(ring, txd->txd2); + atomic_sub(n_desc, &ring->free_count); +@@ -1496,7 +1511,9 @@ static int mtk_poll_tx(struct mtk_eth *e + for (i = 0; i < MTK_MAC_COUNT; i++) { + if (!eth->netdev[i] || !done[i]) + continue; ++ #ifndef DISABLE_MTK_BQL + netdev_completed_queue(eth->netdev[i], done[i], bytes[i]); ++ #endif + total += done[i]; + eth->tx_packets += done[i]; + eth->tx_bytes += bytes[i]; -- 1.9.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] busybox: support output new-linux model for arp
Compatible with the output of net-tools. Using new-linux model by default. arp -n: Address HWtype HWaddress Flags Mask Iface 192.168.1.1 ether 00:11:22:33:44:55 C eth1 arp -an: ? (192.168.1.1) at 00:11:22:33:44:55 [ether] on eth1 Signed-off-by: daxiong --- .../patches/540-arpshow-support-new-linux.patch| 94 ++ 1 file changed, 94 insertions(+) create mode 100644 package/utils/busybox/patches/540-arpshow-support-new-linux.patch diff --git a/package/utils/busybox/patches/540-arpshow-support-new-linux.patch b/package/utils/busybox/patches/540-arpshow-support-new-linux.patch new file mode 100644 index 000..1bb6629 --- /dev/null +++ b/package/utils/busybox/patches/540-arpshow-support-new-linux.patch @@ -0,0 +1,94 @@ +--- a/networking/arp.c 2019-11-04 15:42:52.171010629 +0800 b/networking/arp.c 2019-11-04 16:39:46.455539779 +0800 +@@ -353,6 +353,56 @@ static int arp_set(char **args) + + + /* Print the contents of an ARP request block. */ ++static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mask, char *dev) ++{ ++static int title = 0; ++const struct hwtype *xhw; ++char flags[10]; ++ ++xhw = get_hwntype(type); ++if (xhw == NULL) ++ xhw = get_hwtype(DFLT_HW); ++ ++if (title++ == 0) { ++ printf("Address HWtype HWaddress Flags Mask Iface\n"); ++} ++/* Setup the flags. */ ++flags[0] = '\0'; ++if (arp_flags & ATF_COM) ++ strcat(flags, "C"); ++if (arp_flags & ATF_PERM) ++ strcat(flags, "M"); ++if (arp_flags & ATF_PUBL) ++ strcat(flags, "P"); ++#ifdef HAVE_ATF_MAGIC ++if (arp_flags & ATF_MAGIC) ++ strcat(flags, "A"); ++#endif ++#ifdef HAVE_ATF_DONTPUB ++if (arp_flags & ATF_DONTPUB) ++ strcat(flags, "!"); ++#endif ++if (arp_flags & ATF_USETRAILERS) ++ strcat(flags, "T"); ++ ++if (!(arp_flags & ATF_NETMASK)) ++ mask = (char *)""; ++ ++printf("%-23.23s ", name); ++ ++if (!(arp_flags & ATF_COM)) { ++ if (arp_flags & ATF_PUBL) ++ printf("%-8.8s%-20.20s", "*", "*"); ++ else ++ printf("%-8.8s%-20.20s", "", "(incomplete)"); ++} else { ++ printf("%-8.8s%-20.20s", xhw->name, hwa); ++} ++ ++printf("%-6.6s%-15.15s %s\n", flags, mask, dev); ++} ++ ++/* Print the contents of an ARP request block. */ + static void + arp_disp(const char *name, char *ip, int type, int arp_flags, + char *hwa, char *mask, char *dev) +@@ -457,18 +507,25 @@ static int arp_show(char *name) + + shown++; + /* This IS ugly but it works -be */ +- hostname = "?"; +- if (!(option_mask32 & ARP_OPT_n)) { +- if (ap->input(ip, &sa) < 0) +- hostname = ip; +- else +- hostname = ap->sprint(&sa, (option_mask32 & ARP_OPT_n) | 0x8000); +- if (strcmp(hostname, ip) == 0) +- hostname = "?"; ++ if (option_mask32 & ARP_OPT_n) { ++ hostname = "?"; ++ } else { ++ if (!(option_mask32 & ARP_OPT_n)) { ++ if (ap->input(ip, &sa) < 0) ++ hostname = ip; ++ else ++ hostname = ap->sprint(&sa, (option_mask32 & ARP_OPT_n) | 0x8000); ++ if (strcmp(hostname, ip) == 0) ++ hostname = "?"; ++ } + } + +- arp_disp(hostname, ip, type, flags, hwa, mask, dev); ++ if (option_mask32 & ARP_OPT_a) ++ arp_disp(hostname, ip, type, flags, hwa, mask, dev); ++ else ++ arp_disp_2((char *)(hostname[0] == '?' ? ip : hostname), type, flags, hwa, mask, dev); + } ++ + if (option_mask32 & ARP_OPT_v) + printf("Entries: %u\tSkipped: %u\tFound: %u\n", + entries, entries - shown, shown); -- 1.9.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid
Current modpost cannot reduce the module size. Use $(STRIP) command to replace the modpost patch, I think to be compatibility will be better. Signed-off-by: daxiong --- .../linux/generic/hack-4.14/204-module_strip.patch | 216 +++-- 1 file changed, 24 insertions(+), 192 deletions(-) diff --git a/target/linux/generic/hack-4.14/204-module_strip.patch b/target/linux/generic/hack-4.14/204-module_strip.patch index d847adf..c22a507 100644 --- a/target/linux/generic/hack-4.14/204-module_strip.patch +++ b/target/linux/generic/hack-4.14/204-module_strip.patch @@ -1,104 +1,8 @@ -From a779a482fb9b9f8fcdf8b2519c789b4b9bb5dd05 Mon Sep 17 00:00:00 2001 -From: Felix Fietkau -Date: Fri, 7 Jul 2017 16:56:48 +0200 -Subject: build: add a hack for removing non-essential module info - -Signed-off-by: Felix Fietkau - include/linux/module.h | 13 - - include/linux/moduleparam.h | 15 --- - init/Kconfig| 7 +++ - kernel/module.c | 5 - - scripts/mod/modpost.c | 12 - 5 files changed, 43 insertions(+), 9 deletions(-) - a/include/linux/module.h -+++ b/include/linux/module.h -@@ -158,6 +158,7 @@ extern void cleanup_module(void); - - /* Generic info of form tag = "info" */ - #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) -+#define MODULE_INFO_STRIP(tag, info) __MODULE_INFO_STRIP(tag, tag, info) - - /* For userspace: you can also call me... */ - #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) -@@ -201,12 +202,12 @@ extern void cleanup_module(void); - * Author(s), use "Name " or just "Name", for multiple - * authors use multiple MODULE_AUTHOR() statements/lines. - */ --#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) -+#define MODULE_AUTHOR(_author) MODULE_INFO_STRIP(author, _author) - - /* What your module does. */ --#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) -+#define MODULE_DESCRIPTION(_description) MODULE_INFO_STRIP(description, _description) - --#ifdef MODULE -+#if defined(MODULE) && !defined(CONFIG_MODULE_STRIPPED) - /* Creates an alias so file2alias.c can find device table. */ - #define MODULE_DEVICE_TABLE(type, name) \ - extern typeof(name) __mod_##type##__##name##_device_table \ -@@ -233,7 +234,9 @@ extern typeof(name) __mod_##type##__##na - */ - - #if defined(MODULE) || !defined(CONFIG_SYSFS) --#define MODULE_VERSION(_version) MODULE_INFO(version, _version) -+#define MODULE_VERSION(_version) MODULE_INFO_STRIP(version, _version) -+#elif defined(CONFIG_MODULE_STRIPPED) -+#define MODULE_VERSION(_version) __MODULE_INFO_DISABLED(version) - #else - #define MODULE_VERSION(_version) \ - static struct module_version_attribute ___modver_attr = { \ -@@ -255,7 +258,7 @@ extern typeof(name) __mod_##type##__##na - /* Optional firmware file (or files) needed by the module - * format is simply firmware file name. Multiple firmware - * files require multiple MODULE_FIRMWARE() specifiers */ --#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware) -+#define MODULE_FIRMWARE(_firmware) MODULE_INFO_STRIP(firmware, _firmware) - - struct notifier_block; - a/include/linux/moduleparam.h -+++ b/include/linux/moduleparam.h -@@ -17,6 +17,16 @@ - /* Chosen so that structs with an unsigned long line up. */ - #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) - -+/* This struct is here for syntactic coherency, it is not used */ -+#define __MODULE_INFO_DISABLED(name)\ -+ struct __UNIQUE_ID(name) {} -+ -+#ifdef CONFIG_MODULE_STRIPPED -+#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO_DISABLED(name) -+#else -+#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO(tag, name, info) -+#endif -+ - #ifdef MODULE - #define __MODULE_INFO(tag, name, info) \ - static const char __UNIQUE_ID(name)[] \ -@@ -24,8 +34,7 @@ static const char __UNIQUE_ID(name)[] - = __stringify(tag) "=" info - #else /* !MODULE */ - /* This struct is here for syntactic coherency, it is not used */ --#define __MODULE_INFO(tag, name, info) \ -- struct __UNIQUE_ID(name) {} -+#define __MODULE_INFO(tag, name, info) __MODULE_INFO_DISABLED(name) - #endif - #define __MODULE_PARM_TYPE(name, _type) \ - __MODULE_INFO(parmtype, name##type, #name ":" _type) -@@ -33,7 +42,7 @@ static const char __UNIQUE_ID(name)[] - /* One for each parameter, describing how to use it. Some files do -multiple of these per line, so can't just use MODULE_INFO. */ - #define MODULE_PARM_DESC(_parm, desc) \ -- __MODULE_INFO(parm, _parm, #_parm ":" desc) -+ __MODULE_INFO_STRIP(parm, _parm, #_parm ":"
[OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid
Current modpost cannot reduce the module size. Use $(STRIP) command to replace the modpost patch, I think to be compatibility will be better. Signed-off-by: daxiong --- .../linux/generic/hack-4.14/204-module_strip.patch | 220 +++-- 1 file changed, 28 insertions(+), 192 deletions(-) diff --git a/target/linux/generic/hack-4.14/204-module_strip.patch b/target/linux/generic/hack-4.14/204-module_strip.patch index d847adf..20ac949 100644 --- a/target/linux/generic/hack-4.14/204-module_strip.patch +++ b/target/linux/generic/hack-4.14/204-module_strip.patch @@ -1,104 +1,8 @@ -From a779a482fb9b9f8fcdf8b2519c789b4b9bb5dd05 Mon Sep 17 00:00:00 2001 -From: Felix Fietkau -Date: Fri, 7 Jul 2017 16:56:48 +0200 -Subject: build: add a hack for removing non-essential module info - -Signed-off-by: Felix Fietkau - include/linux/module.h | 13 - - include/linux/moduleparam.h | 15 --- - init/Kconfig| 7 +++ - kernel/module.c | 5 - - scripts/mod/modpost.c | 12 - 5 files changed, 43 insertions(+), 9 deletions(-) - a/include/linux/module.h -+++ b/include/linux/module.h -@@ -158,6 +158,7 @@ extern void cleanup_module(void); - - /* Generic info of form tag = "info" */ - #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) -+#define MODULE_INFO_STRIP(tag, info) __MODULE_INFO_STRIP(tag, tag, info) - - /* For userspace: you can also call me... */ - #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) -@@ -201,12 +202,12 @@ extern void cleanup_module(void); - * Author(s), use "Name " or just "Name", for multiple - * authors use multiple MODULE_AUTHOR() statements/lines. - */ --#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) -+#define MODULE_AUTHOR(_author) MODULE_INFO_STRIP(author, _author) - - /* What your module does. */ --#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) -+#define MODULE_DESCRIPTION(_description) MODULE_INFO_STRIP(description, _description) - --#ifdef MODULE -+#if defined(MODULE) && !defined(CONFIG_MODULE_STRIPPED) - /* Creates an alias so file2alias.c can find device table. */ - #define MODULE_DEVICE_TABLE(type, name) \ - extern typeof(name) __mod_##type##__##name##_device_table \ -@@ -233,7 +234,9 @@ extern typeof(name) __mod_##type##__##na - */ - - #if defined(MODULE) || !defined(CONFIG_SYSFS) --#define MODULE_VERSION(_version) MODULE_INFO(version, _version) -+#define MODULE_VERSION(_version) MODULE_INFO_STRIP(version, _version) -+#elif defined(CONFIG_MODULE_STRIPPED) -+#define MODULE_VERSION(_version) __MODULE_INFO_DISABLED(version) - #else - #define MODULE_VERSION(_version) \ - static struct module_version_attribute ___modver_attr = { \ -@@ -255,7 +258,7 @@ extern typeof(name) __mod_##type##__##na - /* Optional firmware file (or files) needed by the module - * format is simply firmware file name. Multiple firmware - * files require multiple MODULE_FIRMWARE() specifiers */ --#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware) -+#define MODULE_FIRMWARE(_firmware) MODULE_INFO_STRIP(firmware, _firmware) - - struct notifier_block; - a/include/linux/moduleparam.h -+++ b/include/linux/moduleparam.h -@@ -17,6 +17,16 @@ - /* Chosen so that structs with an unsigned long line up. */ - #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) - -+/* This struct is here for syntactic coherency, it is not used */ -+#define __MODULE_INFO_DISABLED(name)\ -+ struct __UNIQUE_ID(name) {} -+ -+#ifdef CONFIG_MODULE_STRIPPED -+#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO_DISABLED(name) -+#else -+#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO(tag, name, info) -+#endif -+ - #ifdef MODULE - #define __MODULE_INFO(tag, name, info) \ - static const char __UNIQUE_ID(name)[] \ -@@ -24,8 +34,7 @@ static const char __UNIQUE_ID(name)[] - = __stringify(tag) "=" info - #else /* !MODULE */ - /* This struct is here for syntactic coherency, it is not used */ --#define __MODULE_INFO(tag, name, info) \ -- struct __UNIQUE_ID(name) {} -+#define __MODULE_INFO(tag, name, info) __MODULE_INFO_DISABLED(name) - #endif - #define __MODULE_PARM_TYPE(name, _type) \ - __MODULE_INFO(parmtype, name##type, #name ":" _type) -@@ -33,7 +42,7 @@ static const char __UNIQUE_ID(name)[] - /* One for each parameter, describing how to use it. Some files do -multiple of these per line, so can't just use MODULE_INFO. */ - #define MODULE_PARM_DESC(_parm, desc) \ -- __MODULE_INFO(parm, _parm, #_parm ":" desc) -+ __MODULE_INFO_STRIP(parm, _parm, #_parm ":"
[OpenWrt-Devel] [PATCH 1/1] build: fix select uClibc
Signed-off-by: daxiong --- toolchain/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/Config.in b/toolchain/Config.in index 95087b7..0d288aa 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -252,7 +252,7 @@ choice select USE_UCLIBC bool "Use uClibc" depends on !(aarch64 || aarch64_be || powerpc64) - depends on BROKEN || !(arm || armeb || i386 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc) + depends on BROKEN || (arm || armeb || i386 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc) config LIBC_USE_MUSL select USE_MUSL -- 1.9.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel