diff --git a/include/image-commands.mk b/include/image-commands.mk index 161fd41089..bdfe1976c2 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -103,6 +103,16 @@ define Build/append-rootfs dd if=$(IMAGE_ROOTFS) >> $@ endef +define Build/append-squashfs-fakeroot-be + rm -rf $@.fakefs $@.fakesquashfs + mkdir $@.fakefs + $(STAGING_DIR_HOST)/bin/mksquashfs3-lzma \ + $@.fakefs $@.fakesquashfs \ + -noappend -root-owned -be -nopad -b 65536 \ + $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH)) + cat $@.fakesquashfs >> $@ +endef + define Build/append-squashfs4-fakeroot rm -rf $@.fakefs $@.fakesquashfs mkdir $@.fakefs diff --git a/package/kernel/ath10k-ct/patches/203-ath10k-ct-fix-compilation-warning-for-debug-level.patch b/package/kernel/ath10k-ct/patches/203-ath10k-ct-fix-compilation-warning-for-debug-level.patch new file mode 100644 index 0000000000..6c854923e7 --- /dev/null +++ b/package/kernel/ath10k-ct/patches/203-ath10k-ct-fix-compilation-warning-for-debug-level.patch @@ -0,0 +1,222 @@ +From 3b07c3a6e4adebd0466f5e539f318224db8cfc37 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sat, 6 May 2023 15:29:52 +0200 +Subject: [PATCH] ath10k-ct: fix compilation warning for debug level + +Rework read_debug_level function as it does exceed the stack limit for +some arch. +Fix compilation error: +/__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-malta_be/ath10k-ct-regular/ath10k-ct-2022-05-13-f808496f/ath10k-5.15/debug.c: In function 'ath10k_read_debug_level': +/__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-malta_be/ath10k-ct-regular/ath10k-ct-2022-05-13-f808496f/ath10k-5.15/debug.c:1388:1: error: the frame size of 1440 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] + 1388 | } + | ^ + +Signed-off-by: Christian Marangi +--- + ath10k-5.15/debug.c | 85 +++++++++++++++++++++++++-------------------- + ath10k-5.17/debug.c | 85 +++++++++++++++++++++++++-------------------- + 2 files changed, 96 insertions(+), 74 deletions(-) + +diff --git a/ath10k-5.15/debug.c b/ath10k-5.15/debug.c +index af84012..d0fa911 100644 +--- a/ath10k-5.15/debug.c ++++ b/ath10k-5.15/debug.c +@@ -1344,47 +1344,58 @@ static const struct file_operations fops_simulate_fw_crash = { + .llseek = default_llseek, + }; + ++static const char debug_level_buf[] = ++ "To change debug level, set value adding up desired flags:\n" ++ "PCI: 0x1\n" ++ "WMI: 0x2\n" ++ "HTC: 0x4\n" ++ "HTT: 0x8\n" ++ "MAC: 0x10\n" ++ "BOOT: 0x20\n" ++ "PCI-DUMP: 0x40\n" ++ "HTT-DUMP: 0x80\n" ++ "MGMT: 0x100\n" ++ "DATA: 0x200\n" ++ "BMI: 0x400\n" ++ "REGULATORY: 0x800\n" ++ "TESTMODE: 0x1000\n" ++ "WMI-PRINT: 0x2000\n" ++ "PCI-PS: 0x4000\n" ++ "AHB: 0x8000\n" ++ "SDIO: 0x10000\n" ++ "SDIO_DUMP: 0x20000\n" ++ "USB: 0x40000\n" ++ "USB_BULK: 0x80000\n" ++ "SNOC: 0x100000\n" ++ "QMI: 0x200000\n" ++ "BEACONS: 0x8000000\n" ++ "NO-FW-DBGLOG:0x10000000\n" ++ "MAC2: 0x20000000\n" ++ "INFO-AS-DBG: 0x40000000\n" ++ "FW: 0x80000000\n" ++ "ALL: 0xEFFFFFFF\n"; ++ ++#define READ_DEBUG_LEVEL_SIZE sizeof(debug_level_buf) + 60 ++ + static ssize_t ath10k_read_debug_level(struct file *file, + char __user *user_buf, + size_t count, loff_t *ppos) + { +- int sz; +- const char buf[] = +- "To change debug level, set value adding up desired flags:\n" +- "PCI: 0x1\n" +- "WMI: 0x2\n" +- "HTC: 0x4\n" +- "HTT: 0x8\n" +- "MAC: 0x10\n" +- "BOOT: 0x20\n" +- "PCI-DUMP: 0x40\n" +- "HTT-DUMP: 0x80\n" +- "MGMT: 0x100\n" +- "DATA: 0x200\n" +- "BMI: 0x400\n" +- "REGULATORY: 0x800\n" +- "TESTMODE: 0x1000\n" +- "WMI-PRINT: 0x2000\n" +- "PCI-PS: 0x4000\n" +- "AHB: 0x8000\n" +- "SDIO: 0x10000\n" +- "SDIO_DUMP: 0x20000\n" +- "USB: 0x40000\n" +- "USB_BULK: 0x80000\n" +- "SNOC: 0x100000\n" +- "QMI: 0x200000\n" +- "BEACONS: 0x8000000\n" +- "NO-FW-DBGLOG:0x10000000\n" +- "MAC2: 0x20000000\n" +- "INFO-AS-DBG: 0x40000000\n" +- "FW: 0x80000000\n" +- "ALL: 0xEFFFFFFF\n"; +- char wbuf[sizeof(buf) + 60]; +- sz = snprintf(wbuf, sizeof(wbuf), "Current debug level: 0x%x\n\n%s", +- ath10k_debug_mask, buf); +- wbuf[sizeof(wbuf) - 1] = 0; +- +- return simple_read_from_buffer(user_buf, count, ppos, wbuf, sz); ++ int sz, ret; ++ char *wbuf; ++ ++ wbuf = kcalloc(READ_DEBUG_LEVEL_SIZE, sizeof(char), GFP_KERNEL); ++ if (!wbuf) ++ return -ENOMEM; ++ ++ sz = snprintf(wbuf, READ_DEBUG_LEVEL_SIZE, ++ "Current debug level: 0x%x\n\n%s", ++ ath10k_debug_mask, debug_level_buf); ++ ++ ret = simple_read_from_buffer(user_buf, count, ppos, wbuf, sz); ++ kfree(wbuf); ++ ++ return ret; + } + + /* Set logging level. +diff --git a/ath10k-5.17/debug.c b/ath10k-5.17/debug.c +index af84012..d0fa911 100644 +--- a/ath10k-5.17/debug.c ++++ b/ath10k-5.17/debug.c +@@ -1344,47 +1344,58 @@ static const struct file_operations fops_simulate_fw_crash = { + .llseek = default_llseek, + }; + ++static const char debug_level_buf[] = ++ "To change debug level, set value adding up desired flags:\n" ++ "PCI: 0x1\n" ++ "WMI: 0x2\n" ++ "HTC: 0x4\n" ++ "HTT: 0x8\n" ++ "MAC: 0x10\n" ++ "BOOT: 0x20\n" ++ "PCI-DUMP: 0x40\n" ++ "HTT-DUMP: 0x80\n" ++ "MGMT: 0x100\n" ++ "DATA: 0x200\n" ++ "BMI: 0x400\n" ++ "REGULATORY: 0x800\n" ++ "TESTMODE: 0x1000\n" ++ "WMI-PRINT: 0x2000\n" ++ "PCI-PS: 0x4000\n" ++ "AHB: 0x8000\n" ++ "SDIO: 0x10000\n" ++ "SDIO_DUMP: 0x20000\n" ++ "USB: 0x40000\n" ++ "USB_BULK: 0x80000\n" ++ "SNOC: 0x100000\n" ++ "QMI: 0x200000\n" ++ "BEACONS: 0x8000000\n" ++ "NO-FW-DBGLOG:0x10000000\n" ++ "MAC2: 0x20000000\n" ++ "INFO-AS-DBG: 0x40000000\n" ++ "FW: 0x80000000\n" ++ "ALL: 0xEFFFFFFF\n"; ++ ++#define READ_DEBUG_LEVEL_SIZE sizeof(debug_level_buf) + 60 ++ + static ssize_t ath10k_read_debug_level(struct file *file, + char __user *user_buf, + size_t count, loff_t *ppos) + { +- int sz; +- const char buf[] = +- "To change debug level, set value adding up desired flags:\n" +- "PCI: 0x1\n" +- "WMI: 0x2\n" +- "HTC: 0x4\n" +- "HTT: 0x8\n" +- "MAC: 0x10\n" +- "BOOT: 0x20\n" +- "PCI-DUMP: 0x40\n" +- "HTT-DUMP: 0x80\n" +- "MGMT: 0x100\n" +- "DATA: 0x200\n" +- "BMI: 0x400\n" +- "REGULATORY: 0x800\n" +- "TESTMODE: 0x1000\n" +- "WMI-PRINT: 0x2000\n" +- "PCI-PS: 0x4000\n" +- "AHB: 0x8000\n" +- "SDIO: 0x10000\n" +- "SDIO_DUMP: 0x20000\n" +- "USB: 0x40000\n" +- "USB_BULK: 0x80000\n" +- "SNOC: 0x100000\n" +- "QMI: 0x200000\n" +- "BEACONS: 0x8000000\n" +- "NO-FW-DBGLOG:0x10000000\n" +- "MAC2: 0x20000000\n" +- "INFO-AS-DBG: 0x40000000\n" +- "FW: 0x80000000\n" +- "ALL: 0xEFFFFFFF\n"; +- char wbuf[sizeof(buf) + 60]; +- sz = snprintf(wbuf, sizeof(wbuf), "Current debug level: 0x%x\n\n%s", +- ath10k_debug_mask, buf); +- wbuf[sizeof(wbuf) - 1] = 0; +- +- return simple_read_from_buffer(user_buf, count, ppos, wbuf, sz); ++ int sz, ret; ++ char *wbuf; ++ ++ wbuf = kcalloc(READ_DEBUG_LEVEL_SIZE, sizeof(char), GFP_KERNEL); ++ if (!wbuf) ++ return -ENOMEM; ++ ++ sz = snprintf(wbuf, READ_DEBUG_LEVEL_SIZE, ++ "Current debug level: 0x%x\n\n%s", ++ ath10k_debug_mask, debug_level_buf); ++ ++ ret = simple_read_from_buffer(user_buf, count, ppos, wbuf, sz); ++ kfree(wbuf); ++ ++ return ret; + } + + /* Set logging level. +-- +2.39.2 + diff --git a/package/kernel/broadcom-wl/Makefile b/package/kernel/broadcom-wl/Makefile index fe8045d4a9..a1feacbe29 100644 --- a/package/kernel/broadcom-wl/Makefile +++ b/package/kernel/broadcom-wl/Makefile @@ -105,6 +105,15 @@ MAKE_KMOD := $(KERNEL_MAKE) \ define Build/Prepare $(call Build/Prepare/Default) + + # New kernel version changed the sysmbol exported from printk to _printk + # The object file provided by broadcom require modification to correctly + # modprobe and generate a .ko + $(TARGET_CROSS)objcopy $(PKG_BUILD_DIR)/driver/wl_apsta/wl_prebuilt.o \ + --redefine-sym printk=_printk + $(TARGET_CROSS)objcopy $(PKG_BUILD_DIR)/driver/wl_apsta_mini/wl_prebuilt.o \ + --redefine-sym printk=_printk + $(CP) $(PKG_BUILD_DIR)/driver $(PKG_BUILD_DIR)/driver-mini $(CP) ./src/glue $(PKG_BUILD_DIR)/glue endef diff --git a/package/kernel/broadcom-wl/patches/101-wl_id-fix-compilation-warning-if-does-not-guard.patch b/package/kernel/broadcom-wl/patches/101-wl_id-fix-compilation-warning-if-does-not-guard.patch new file mode 100644 index 0000000000..e5c17cb9b9 --- /dev/null +++ b/package/kernel/broadcom-wl/patches/101-wl_id-fix-compilation-warning-if-does-not-guard.patch @@ -0,0 +1,15 @@ +--- a/driver/wl_iw.c ++++ a/driver/wl_iw.c +@@ -381,9 +381,9 @@ wl_iw_set_freq( + while (fwrq->e++ < 6) + fwrq->m /= 10; + } +- /* handle 4.9GHz frequencies as Japan 4 GHz based channelization */ +- if (fwrq->m > 4000 && fwrq->m < 5000) +- sf = WF_CHAN_FACTOR_4_G; /* start factor for 4 GHz */ ++ /* handle 4.9GHz frequencies as Japan 4 GHz based channelization */ ++ if (fwrq->m > 4000 && fwrq->m < 5000) ++ sf = WF_CHAN_FACTOR_4_G; /* start factor for 4 GHz */ + + chan = wf_mhz2channel(fwrq->m, sf); + } diff --git a/package/kernel/broadcom-wl/patches/919-fix-compilation-warning-for-stack-limit.patch b/package/kernel/broadcom-wl/patches/919-fix-compilation-warning-for-stack-limit.patch new file mode 100644 index 0000000000..3149ce34b9 --- /dev/null +++ b/package/kernel/broadcom-wl/patches/919-fix-compilation-warning-for-stack-limit.patch @@ -0,0 +1,297 @@ +--- a/driver/wl_iw.c ++++ b/driver/wl_iw.c +@@ -495,9 +495,9 @@ wl_iw_get_range( + ) + { + struct iw_range *range = (struct iw_range *) extra; +- int channels[MAXCHANNEL+1]; +- wl_uint32_list_t *list = (wl_uint32_list_t *) channels; +- wl_rateset_t rateset; ++ int *channels; ++ wl_uint32_list_t *list; ++ wl_rateset_t *rateset; + int error, i; + uint sf, ch; + +@@ -506,6 +506,17 @@ wl_iw_get_range( + if (!extra) + return -EINVAL; + ++ channels = kcalloc(MAXCHANNEL+1, sizeof(*channels), GFP_KERNEL); ++ if (!channels) ++ return -ENOMEM; ++ list = (wl_uint32_list_t *) channels; ++ ++ rateset = kzalloc(sizeof(*rateset), GFP_KERNEL); ++ if (!rateset) { ++ error = -ENOMEM; ++ goto free_channels; ++ } ++ + dwrq->length = sizeof(struct iw_range); + memset(range, 0, sizeof(range)); + +@@ -514,8 +525,9 @@ wl_iw_get_range( + + /* Set available channels/frequencies */ + list->count = htod32(MAXCHANNEL); +- if ((error = dev_wlc_ioctl(dev, WLC_GET_VALID_CHANNELS, channels, sizeof(channels)))) +- return error; ++ if ((error = dev_wlc_ioctl(dev, WLC_GET_VALID_CHANNELS, channels, ++ (MAXCHANNEL+1) * sizeof(*channels)))) ++ goto free_rateset; + for (i = 0; i < dtoh32(list->count) && i < IW_MAX_FREQUENCIES; i++) { + range->freq[i].i = dtoh32(list->element[i]); + +@@ -549,19 +561,19 @@ wl_iw_get_range( + #endif /* WIRELESS_EXT > 11 */ + + /* Set available bitrates */ +- if ((error = dev_wlc_ioctl(dev, WLC_GET_CURR_RATESET, &rateset, sizeof(rateset)))) +- return error; +- rateset.count = dtoh32(rateset.count); +- range->num_bitrates = rateset.count; +- for (i = 0; i < rateset.count && i < IW_MAX_BITRATES; i++) +- range->bitrate[i] = (rateset.rates[i] & 0x7f) * 500000; /* convert to bps */ ++ if ((error = dev_wlc_ioctl(dev, WLC_GET_CURR_RATESET, rateset, sizeof(*rateset)))) ++ goto free_rateset; ++ rateset->count = dtoh32(rateset->count); ++ range->num_bitrates = rateset->count; ++ for (i = 0; i < rateset->count && i < IW_MAX_BITRATES; i++) ++ range->bitrate[i] = (rateset->rates[i] & 0x7f) * 500000; /* convert to bps */ + + /* Set an indication of the max TCP throughput + * in bit/s that we can expect using this interface. + * May be use for QoS stuff... Jean II + */ + if ((error = dev_wlc_ioctl(dev, WLC_GET_PHYTYPE, &i, sizeof(i)))) +- return error; ++ goto free_rateset; + i = dtoh32(i); + if (i == WLC_PHY_TYPE_A) + range->throughput = 24000000; /* 24 Mbits/s */ +@@ -624,7 +636,12 @@ wl_iw_get_range( + #endif + #endif /* WIRELESS_EXT > 17 */ + +- return 0; ++free_rateset: ++ kfree(rateset); ++free_channels: ++ kfree(channels); ++ ++ return error; + } + + static int +--- a/driver/bcmsrom.c ++++ b/driver/bcmsrom.c +@@ -437,20 +437,37 @@ srom_write(si_t *sih, uint bustype, void *curmap, osl_t *osh, + uint byteoff, uint nbytes, uint16 *buf) + { + uint i, nw, crc_range; +- uint16 old[SROM_MAXW], new[SROM_MAXW]; ++ uint16 *old, *new; + uint8 crc; + volatile uint32 val32; ++ int rc = 0; + + ASSERT(bustype == BUSTYPE(bustype)); + ++ old = MALLOC(osh, SROM_MAXW); ++ ASSERT(old != NULL); ++ if (!old) ++ return -2; ++ ++ new = MALLOC(osh, SROM_MAXW); ++ ASSERT(new != NULL); ++ if (!new) { ++ rc = -2; ++ goto free_old; ++ } ++ + /* check input - 16-bit access only. use byteoff 0x55aa to indicate + * srclear + */ +- if ((byteoff != 0x55aa) && ((byteoff & 1) || (nbytes & 1))) +- return 1; ++ if ((byteoff != 0x55aa) && ((byteoff & 1) || (nbytes & 1))) { ++ rc = 1; ++ goto free_new; ++ } + +- if ((byteoff != 0x55aa) && ((byteoff + nbytes) > SROM_MAX)) +- return 1; ++ if ((byteoff != 0x55aa) && ((byteoff + nbytes) > SROM_MAX)) { ++ rc = 1; ++ goto free_new; ++ } + + if (BUSTYPE(bustype) == PCMCIA_BUS) { + crc_range = SROM_MAX; +@@ -467,8 +484,10 @@ srom_write(si_t *sih, uint bustype, void *curmap, osl_t *osh, + + nw = crc_range / 2; + /* read first small number words from srom, then adjust the length, read all */ +- if (srom_read(sih, bustype, curmap, osh, 0, crc_range, old, FALSE)) +- return 1; ++ if (srom_read(sih, bustype, curmap, osh, 0, crc_range, old, FALSE)) { ++ rc = 1; ++ goto free_new; ++ } + + BS_ERROR(("%s: old[SROM4_SIGN] 0x%x, old[SROM8_SIGN] 0x%x\n", + __FUNCTION__, old[SROM4_SIGN], old[SROM8_SIGN])); +@@ -481,10 +500,13 @@ srom_write(si_t *sih, uint bustype, void *curmap, osl_t *osh, + __FUNCTION__, buf[SROM4_SIGN], buf[SROM8_SIGN])); + + /* block invalid buffer size */ +- if (nbytes < SROM4_WORDS * 2) +- return BCME_BUFTOOSHORT; +- else if (nbytes > SROM4_WORDS * 2) +- return BCME_BUFTOOLONG; ++ if (nbytes < SROM4_WORDS * 2) { ++ rc = BCME_BUFTOOSHORT; ++ goto free_new; ++ } else if (nbytes > SROM4_WORDS * 2) { ++ rc = BCME_BUFTOOLONG; ++ goto free_new; ++ } + + nw = SROM4_WORDS; + } else if (nbytes == SROM_WORDS * 2){ /* the other possible SROM format */ +@@ -493,17 +515,22 @@ srom_write(si_t *sih, uint bustype, void *curmap, osl_t *osh, + nw = SROM_WORDS; + } else { + BS_ERROR(("%s: Invalid input file signature\n", __FUNCTION__)); +- return BCME_BADARG; ++ rc = BCME_BADARG; ++ goto free_new; + } + crc_range = nw * 2; +- if (srom_read(sih, bustype, curmap, osh, 0, crc_range, old, FALSE)) +- return 1; ++ if (srom_read(sih, bustype, curmap, osh, 0, crc_range, old, FALSE)) { ++ rc = 1; ++ goto free_new; ++ } + } else if ((old[SROM4_SIGN] == SROM4_SIGNATURE) || + (old[SROM8_SIGN] == SROM4_SIGNATURE)) { + nw = SROM4_WORDS; + crc_range = nw * 2; +- if (srom_read(sih, bustype, curmap, osh, 0, crc_range, old, FALSE)) +- return 1; ++ if (srom_read(sih, bustype, curmap, osh, 0, crc_range, old, FALSE)) { ++ rc = 1; ++ goto free_new; ++ } + } else { + /* Assert that we have already read enough for sromrev 2 */ + ASSERT(crc_range >= SROM_WORDS * 2); +@@ -562,8 +589,10 @@ srom_write(si_t *sih, uint bustype, void *curmap, osl_t *osh, + } + } else if (BUSTYPE(bustype) == PCMCIA_BUS) { + /* enable writes to the SPROM */ +- if (sprom_cmd_pcmcia(osh, SROM_WEN)) +- return 1; ++ if (sprom_cmd_pcmcia(osh, SROM_WEN)) { ++ rc = 1; ++ goto free_new; ++ } + bcm_mdelay(WRITE_ENABLE_DELAY); + /* write srom */ + for (i = 0; i < nw; i++) { +@@ -573,14 +602,15 @@ srom_write(si_t *sih, uint bustype, void *curmap, osl_t *osh, + } + } + /* disable writes to the SPROM */ +- if (sprom_cmd_pcmcia(osh, SROM_WDS)) +- return 1; ++ if (sprom_cmd_pcmcia(osh, SROM_WDS)) { ++ rc = 1; ++ goto free_new; ++ } + } else if (BUSTYPE(bustype) == SI_BUS) { + #if defined(BCMUSBDEV) + if (SPROMBUS == PCMCIA_BUS) { + uint origidx; + void *regs; +- int rc; + bool wasup; + + origidx = si_coreidx(sih); +@@ -596,16 +626,24 @@ srom_write(si_t *sih, uint bustype, void *curmap, osl_t *osh, + si_core_disable(sih, 0); + + si_setcoreidx(sih, origidx); +- return rc; ++ goto free_new; + } + #endif +- return 1; ++ rc = 1; ++ goto free_new; + } else { +- return 1; ++ rc = 1; ++ goto free_new; + } + + bcm_mdelay(WRITE_ENABLE_DELAY); +- return 0; ++ rc = 0; ++ ++free_new: ++ MFREE(osh, new, SROM_MAXW); ++free_old: ++ MFREE(osh, old, SROM_MAXW); ++ return rc; + } + + #if defined(BCMUSBDEV) +--- a/driver/linux_osl.c ++++ b/driver/linux_osl.c +@@ -600,20 +600,29 @@ int + osl_printf(const char *format, ...) + { + va_list args; +- char buf[1024]; ++ char *buf; + int len; + ++ buf = kcalloc(1024, sizeof(*buf), GFP_KERNEL); ++ if (!buf) ++ return (-ENOMEM); ++ + /* sprintf into a local buffer because there *is* no "vprintk()".. */ + va_start(args, format); + len = vsnprintf(buf, 1024, format, args); + va_end(args); + +- if (len > sizeof(buf)) { ++ if (len > (sizeof(*buf) * 1024)) { + printk("osl_printf: buffer overrun\n"); +- return (0); ++ goto exit; + } + +- return (printk(buf)); ++ printk(buf); ++ ++exit: ++ kfree(buf); ++ ++ return (0); + } + + int +--- a/driver/bcmutils.c ++++ b/driver/bcmutils.c +@@ -13,6 +13,7 @@ + + #include + #include ++#define __need___va_list + #include + #include + #ifdef BCMDRIVER diff --git a/package/kernel/broadcom-wl/patches/920-aiutils-fix-wrong-misleading-if.patch b/package/kernel/broadcom-wl/patches/920-aiutils-fix-wrong-misleading-if.patch new file mode 100644 index 0000000000..c43dca9e89 --- /dev/null +++ b/package/kernel/broadcom-wl/patches/920-aiutils-fix-wrong-misleading-if.patch @@ -0,0 +1,14 @@ +--- a/driver/aiutils.c ++++ b/driver/aiutils.c +@@ -228,9 +228,10 @@ ai_scan(si_t *sih, void *regs, uint devid) + do { + asd = get_asd(sih, &eromptr, 0, j, AD_ST_SLAVE, &addrl, &addrh, + &sizel, &sizeh); +- if ((asd != 0) && (j == 1) && (sizel == SI_CORE_SIZE)) ++ if ((asd != 0) && (j == 1) && (sizel == SI_CORE_SIZE)) { + sii->coresba2[idx] = addrl; + sii->coresba2_size[idx] = sizel; ++ } + j++; + } while (asd != 0); + diff --git a/package/kernel/broadcom-wl/patches/921-fix-simple-compilation-warning.patch b/package/kernel/broadcom-wl/patches/921-fix-simple-compilation-warning.patch new file mode 100644 index 0000000000..2158dc67b8 --- /dev/null +++ b/package/kernel/broadcom-wl/patches/921-fix-simple-compilation-warning.patch @@ -0,0 +1,63 @@ +--- a/driver/hnddma.c ++++ b/driver/hnddma.c +@@ -1896,7 +1896,8 @@ dma64_txfast(dma_info_t *di, void *p0, bool commit) + if (!(flags & D64_CTRL1_EOF)) { + #if defined(linux) && defined(__mips__) + if (CHIPID(di->sih->chip) == BCM5356_CHIP_ID && di->sih->chiprev == 0) { +- uint32 ctrl1, ctrl2, addrlow, addrhigh; ++ uint32 ctrl2, addrlow, addrhigh; ++ // uint32 ctrl1; + + addrlow = R_SM((volatile uint32 *)&di->txd64[PREVTXD(txout)].addrlow); + addrhigh = R_SM((volatile uint32 *)&di->txd64[PREVTXD(txout)].addrhigh); + +--- a/driver/include/linux_osl.h ++++ b/driver/include/linux_osl.h +@@ -580,9 +580,9 @@ extern void osl_writew(uint16 v, volatile uint16 *r); + extern void osl_writel(uint32 v, volatile uint32 *r); + + /* uncached/cached virtual address */ +-#define OSL_UNCACHED(va) osl_uncached((va)) ++#define OSL_UNCACHED(va) osl_uncached((void *)(va)) + extern void *osl_uncached(void *va); +-#define OSL_CACHED(va) osl_cached((va)) ++#define OSL_CACHED(va) osl_cached((void *)(va)) + extern void *osl_cached(void *va); + + /* get processor cycle count */ +--- a/driver/siutils.c ++++ b/driver/siutils.c +@@ -495,11 +495,13 @@ BCMATTACHFN(si_doattach)(si_info_t *sii, uint devid, osl_t *osh, void *regs, + } + + sih->bustype = bustype; ++#ifdef BCMBUSTYPE + if (bustype != BUSTYPE(bustype)) { + SI_ERROR(("si_doattach: bus type %d does not match configured bus type %d\n", + bustype, BUSTYPE(bustype))); + return NULL; + } ++#endif + + /* bus/core/clk setup for register access */ + if (!si_buscore_prep(sii, bustype, devid, sdh)) { +@@ -1716,6 +1718,9 @@ si_clkctl_xtal(si_t *sih, uint what, bool on) + outen); + } + ++ return (0); ++ ++ + default: + return (-1); + } +--- a/driver/bcmsrom.c ++++ b/driver/bcmsrom.c +@@ -1005,6 +1043,7 @@ BCMNMIATTACHFN(srom_parsecis)(osl_t *osh, uint8 *pcis[], uint ciscnt, char **var + break; + } + ++ fallthrough; + case CISTPL_MANFID: FROMHOST(); + varbuf_append(&b, vstr_manfid, (cis[i + 1] << 8) + cis[i]); + varbuf_append(&b, vstr_prodid, (cis[i + 3] << 8) + cis[i + 2]); diff --git a/package/kernel/broadcom-wl/patches/930-wl_linux-set-module-license-Proprietary.patch b/package/kernel/broadcom-wl/patches/930-wl_linux-set-module-license-Proprietary.patch new file mode 100644 index 0000000000..6d0571711c --- /dev/null +++ b/package/kernel/broadcom-wl/patches/930-wl_linux-set-module-license-Proprietary.patch @@ -0,0 +1,10 @@ +--- a/driver/wl_linux.c ++++ b/driver/wl_linux.c +@@ -1109,6 +1109,7 @@ wl_module_exit(void) + + module_init(wl_module_init); + module_exit(wl_module_exit); ++MODULE_LICENSE("Proprietary"); + + /** + * This function frees the WL per-device resources. diff --git a/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c b/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c index 8f180edd33..5343d6e3a8 100644 --- a/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c +++ b/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c @@ -409,8 +409,6 @@ static int __init nct5104d_gpio_init(void) { int err; struct nct5104d_sio sio; - const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); - const char *board_name = dmi_get_system_info(DMI_BOARD_NAME); if (nct5104d_find(0x2e, &sio) && nct5104d_find(0x4e, &sio)) diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c index 2339d919b6..8ccfb443ed 100644 --- a/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c +++ b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c @@ -1620,7 +1620,9 @@ DSL_BSP_FWDownload (DSL_DEV_Device_t * pDev, const char *buf, IFX_MEI_EMSG ("Firmware size is too small!\n"); return retval; } - copy_from_user ((char *) &img_hdr_tmp, buf, sizeof (img_hdr_tmp)); + if (copy_from_user ((char *) &img_hdr_tmp, buf, sizeof (img_hdr_tmp))) + return -EFAULT; + // header of image_size and crc are not included. DSL_DEV_PRIVATE(pDev)->image_size = le32_to_cpu (img_hdr_tmp.size) + 8; @@ -1698,7 +1700,9 @@ DSL_BSP_FWDownload (DSL_DEV_Device_t * pDev, const char *buf, nCopy = SDRAM_SEGMENT_SIZE - offset; else nCopy = size - nRead; - copy_from_user (mem_ptr, buf + nRead, nCopy); + if (copy_from_user (mem_ptr, buf + nRead, nCopy)) + return -EFAULT; + for (offset = 0; offset < (nCopy / 4); offset++) { ((unsigned long *) mem_ptr)[offset] = le32_to_cpu (((unsigned long *) mem_ptr)[offset]); } diff --git a/package/kernel/lantiq/ltq-adsl/patches/201-fix-compilation-warning-fallthrough.patch b/package/kernel/lantiq/ltq-adsl/patches/201-fix-compilation-warning-fallthrough.patch new file mode 100644 index 0000000000..dfaf29f449 --- /dev/null +++ b/package/kernel/lantiq/ltq-adsl/patches/201-fix-compilation-warning-fallthrough.patch @@ -0,0 +1,36 @@ +--- a/src/pm/drv_dsl_cpe_pm_core.c ++++ b/src/pm/drv_dsl_cpe_pm_core.c +@@ -2274,16 +2274,18 @@ DSL_Error_t DSL_DRV_PM_CountersReset( + } + #endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY*/ + +- if (ResetType == DSL_PM_RESET_HISTORY) +- break; ++ if (ResetType == DSL_PM_RESET_HISTORY) ++ break; + ++ fallthrough; + case DSL_PM_RESET_TOTAL: + #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS + memset(EpData.pRecTotal, 0x0, EpData.nEpRecElementSize); + #endif /* #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS*/ +- if (ResetType == DSL_PM_RESET_TOTAL) +- break; ++ if (ResetType == DSL_PM_RESET_TOTAL) ++ break; + ++ fallthrough; + case DSL_PM_RESET_HISTORY_SHOWTIME: + #ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS + nErrCode = DSL_DRV_PM_HistoryDelete(pContext, EpData.pHistShowtime ); +--- a/src/device/drv_dsl_cpe_device_danube.c ++++ b/src/device/drv_dsl_cpe_device_danube.c +@@ -3193,7 +3193,7 @@ DSL_Error_t DSL_DRV_DEV_AutobootHandleTraining( + DSL_DEV_NUM(pContext))); + } + #endif /* INCLUDE_DSL_DELT*/ +- /* Pass through */ ++ fallthrough ; + case DSL_LINESTATE_IDLE: + #if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) + if ( (pContext->bGotFullInit == DSL_TRUE) && diff --git a/package/kernel/lantiq/ltq-adsl/patches/202-g997_danube-dynamically-allocate-hlogdata.patch b/package/kernel/lantiq/ltq-adsl/patches/202-g997_danube-dynamically-allocate-hlogdata.patch new file mode 100644 index 0000000000..c3b1047a2a --- /dev/null +++ b/package/kernel/lantiq/ltq-adsl/patches/202-g997_danube-dynamically-allocate-hlogdata.patch @@ -0,0 +1,65 @@ +--- a/src/g997/drv_dsl_cpe_api_g997_danube.c ++++ b/src/g997/drv_dsl_cpe_api_g997_danube.c +@@ -1984,41 +1984,53 @@ DSL_Error_t DSL_DRV_DEV_G997_DeltHlogGet( + { + if (nDirection == DSL_DOWNSTREAM) + { +- DSL_G997_DeltHlogData_t HlogData; ++ DSL_G997_DeltHlogData_t *HlogData; + +- memset(&HlogData, 0x0, sizeof(DSL_G997_DeltHlogData_t)); ++ HlogData = kzalloc(sizeof(*HlogData), GFP_KERNEL); ++ if (!HlogData) ++ { ++ DSL_DEBUG(DSL_DBG_ERR, ++ (pContext, "DSL[%02d]: ERROR - Alloc HlogData failed!"DSL_DRV_CRLF, ++ DSL_DEV_NUM(pContext))); ++ return DSL_ERR_MEMORY; ++ } ++ ++ memset(HlogData, 0x0, sizeof(DSL_G997_DeltHlogData_t)); + + /* Get SHOWTIME Hlog values*/ + nErrCode = DSL_DRV_DANUBE_G997_DeltHlogGet( +- pContext, nDirection, &HlogData); ++ pContext, nDirection, HlogData); + if (nErrCode != DSL_SUCCESS) + { + DSL_DEBUG(DSL_DBG_ERR, + (pContext, "DSL[%02d]: ERROR - Showtime Hlog get failed!"DSL_DRV_CRLF, + DSL_DEV_NUM(pContext))); ++ kfree(HlogData); + return nErrCode; + } + + /* if actual group size != 1, values should be spread */ +- if (HlogData.nGroupSize != 1) ++ if (HlogData->nGroupSize != 1) + { + nErrCode = DSL_DRV_DANUBE_G997_DeltValuesSpread( +- 0x1, HlogData.nGroupSize, HlogData.deltHlog.nNumData, +- HlogData.deltHlog.nNSCData, pData->deltHlog.nNSCData); ++ 0x1, HlogData->nGroupSize, HlogData->deltHlog.nNumData, ++ HlogData->deltHlog.nNSCData, pData->deltHlog.nNSCData); + + if (nErrCode == DSL_SUCCESS) + { + pData->deltHlog.nNumData = +- (DSL_uint16_t)(HlogData.deltHlog.nNumData * HlogData.nGroupSize); ++ (DSL_uint16_t)(HlogData->deltHlog.nNumData * HlogData->nGroupSize); + pData->nGroupSize = 1; +- pData->nMeasurementTime = HlogData.nMeasurementTime; ++ pData->nMeasurementTime = HlogData->nMeasurementTime; + } + } + else + { + /* No spread needed, copy data*/ +- memcpy(pData, &HlogData, sizeof(DSL_G997_DeltHlogData_t)); ++ memcpy(pData, HlogData, sizeof(DSL_G997_DeltHlogData_t)); + } ++ ++ kfree(HlogData); + } + else + { diff --git a/package/kernel/lantiq/ltq-adsl/patches/203-g997_danube-fix-compilation-warning.patch b/package/kernel/lantiq/ltq-adsl/patches/203-g997_danube-fix-compilation-warning.patch new file mode 100644 index 0000000000..c6a0e70f1f --- /dev/null +++ b/package/kernel/lantiq/ltq-adsl/patches/203-g997_danube-fix-compilation-warning.patch @@ -0,0 +1,26 @@ +--- a/src/g997/drv_dsl_cpe_api_g997_danube.c ++++ b/src/g997/drv_dsl_cpe_api_g997_danube.c +@@ -2512,6 +2524,7 @@ DSL_Error_t DSL_DRV_DEV_G997_PowerManagementStateForcedTrigger( + else + { + /* read L3 request failure reason */ ++ DSL_uint8_t nErrCodeL3; + nErrCode = DSL_DRV_DANUBE_CmvRead(pContext, DSL_CMV_GROUP_STAT, + DSL_CMV_ADDRESS_STAT_L3_FAILURE_REASON, 0, 1, &nVal); + DSL_DEBUG(DSL_DBG_MSG, +@@ -2525,11 +2538,13 @@ DSL_Error_t DSL_DRV_DEV_G997_PowerManagementStateForcedTrigger( + nErrCode = DSL_ERR_MSG_EXCHANGE; + break; + } +- if (((nVal >> 4) & 0x15) == 0x5) ++ ++ nErrCodeL3 = (nVal >> 4) & 0x15; ++ if (nErrCodeL3 == 0x5) + { + nErrCode = DSL_ERR_L3_NOT_IN_L0; + } +- else if (((nVal >> 4) & 0x15) == 0x9) ++ else if (nErrCodeL3 == 0x9) + { + nErrCode = DSL_ERR_L3_TIMED_OUT; + } diff --git a/package/kernel/lantiq/ltq-atm/patches/100-ltq_atm-fix-compillation-warning.patch b/package/kernel/lantiq/ltq-atm/patches/100-ltq_atm-fix-compillation-warning.patch new file mode 100644 index 0000000000..c74cfcb6b4 --- /dev/null +++ b/package/kernel/lantiq/ltq-atm/patches/100-ltq_atm-fix-compillation-warning.patch @@ -0,0 +1,12 @@ +--- a/ltq_atm.c ++++ b/ltq_atm.c +@@ -338,7 +338,8 @@ static int ppe_ioctl(struct atm_dev *dev + break; + + case PPE_ATM_MIB_VCC: /* VCC related MIB */ +- copy_from_user(&mib_vcc, arg, sizeof(mib_vcc)); ++ if (copy_from_user(&mib_vcc, arg, sizeof(mib_vcc))) ++ return -EFAULT; + conn = find_vpivci(mib_vcc.vpi, mib_vcc.vci); + if (conn >= 0) { + mib_vcc.mib_vcc.aal5VccCrcErrors = g_atm_priv_data.conn[conn].aal5_vcc_crc_err; diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c index c0861a503f..2aa4b09593 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c @@ -257,7 +257,7 @@ void ifx_deu_aes (void *ctx_arg, u8 *out_arg, const u8 *in_arg, { /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ volatile struct aes_t *aes = (volatile struct aes_t *) AES_START; - struct aes_ctx *ctx = (struct aes_ctx *)ctx_arg; + //struct aes_ctx *ctx = (struct aes_ctx *)ctx_arg; unsigned long flag; /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ int i = 0; @@ -699,7 +699,7 @@ void ifx_deu_aes_xts (void *ctx_arg, u8 *out_arg, const u8 *in_arg, { /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ volatile struct aes_t *aes = (volatile struct aes_t *) AES_START; - struct aes_ctx *ctx = (struct aes_ctx *)ctx_arg; + //struct aes_ctx *ctx = (struct aes_ctx *)ctx_arg; unsigned long flag; /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ u8 oldiv[16]; diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_des.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_des.c index 8c12a26070..953c3feddc 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_des.c +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_des.c @@ -205,12 +205,13 @@ void ifx_deu_des (void *ctx_arg, u8 *out_arg, const u8 *in_arg, des->K3HR = DEU_ENDIAN_SWAP(*((u32 *) key + 4)); des->K3LR = DEU_ENDIAN_SWAP(*((u32 *) key + 5)); /* no break; */ - + fallthrough; case 16: des->K2HR = DEU_ENDIAN_SWAP(*((u32 *) key + 2)); des->K2LR = DEU_ENDIAN_SWAP(*((u32 *) key + 3)); /* no break; */ + fallthrough; case 8: des->K1HR = DEU_ENDIAN_SWAP(*((u32 *) key + 0)); des->K1LR = DEU_ENDIAN_SWAP(*((u32 *) key + 1)); diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c index 51782e0b6a..ee7e486b56 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c @@ -143,7 +143,7 @@ static inline void md5_transform_helper(struct md5_ctx *ctx) static int md5_init(struct shash_desc *desc) { struct md5_ctx *mctx = shash_desc_ctx(desc); - volatile struct deu_hash_t *hash = (struct deu_hash_t *) HASH_START; + //volatile struct deu_hash_t *hash = (struct deu_hash_t *) HASH_START; mctx->byte_count = 0; mctx->started = 0; @@ -200,8 +200,8 @@ static int md5_final(struct shash_desc *desc, u8 *out) const unsigned int offset = mctx->byte_count & 0x3f; char *p = (char *)mctx->block + offset; int padding = 56 - (offset + 1); - volatile struct deu_hash_t *hashs = (struct deu_hash_t *) HASH_START; - unsigned long flag; + //volatile struct deu_hash_t *hashs = (struct deu_hash_t *) HASH_START; + //unsigned long flag; *p++ = 0x80; if (padding < 0) { diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c index 0e860b9ab5..76734917d1 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c @@ -199,8 +199,8 @@ static int sha1_final(struct shash_desc *desc, u8 *out) u64 t; u8 bits[8] = { 0, }; static const u8 padding[64] = { 0x80, }; - volatile struct deu_hash_t *hashs = (struct deu_hash_t *) HASH_START; - unsigned long flag; + //volatile struct deu_hash_t *hashs = (struct deu_hash_t *) HASH_START; + //unsigned long flag; t = sctx->count; bits[7] = 0xff & t; diff --git a/package/kernel/lantiq/ltq-ptm/patches/100-fix-compilation-warning-debugfs.patch b/package/kernel/lantiq/ltq-ptm/patches/100-fix-compilation-warning-debugfs.patch new file mode 100644 index 0000000000..283982fdef --- /dev/null +++ b/package/kernel/lantiq/ltq-ptm/patches/100-fix-compilation-warning-debugfs.patch @@ -0,0 +1,33 @@ +--- a/ifxmips_ptm_adsl.c ++++ b/ifxmips_ptm_adsl.c +@@ -175,9 +175,11 @@ static INLINE void mailbox_signal(unsign + */ + static INLINE void proc_file_create(void); + static INLINE void proc_file_delete(void); ++#if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC + static int proc_read_version(char *, char **, off_t, int, int *, void *); + static int proc_read_wanmib(char *, char **, off_t, int, int *, void *); + static int proc_write_wanmib(struct file *, const char *, unsigned long, void *); ++#endif + #if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC + static int proc_read_genconf(char *, char **, off_t, int, int *, void *); + #endif +@@ -889,6 +891,7 @@ static INLINE void proc_file_delete(void + remove_proc_entry("driver/ifx_ptm", NULL); + } + ++#if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC + static int proc_read_version(char *buf, char **start, off_t offset, int count, int *eof, void *data) + { + int len = 0; +@@ -963,8 +966,9 @@ static int proc_write_wanmib(struct file + + return count; + } ++#endif + +-#if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC ++#if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC && defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC + + static int proc_read_genconf(char *page, char **start, off_t off, int count, int *eof, void *data) + { diff --git a/package/kernel/lantiq/ltq-ptm/patches/101-fix-more-compilation-warning-debugfs.patch b/package/kernel/lantiq/ltq-ptm/patches/101-fix-more-compilation-warning-debugfs.patch new file mode 100644 index 0000000000..f854662a07 --- /dev/null +++ b/package/kernel/lantiq/ltq-ptm/patches/101-fix-more-compilation-warning-debugfs.patch @@ -0,0 +1,38 @@ +--- a/ifxmips_ptm_adsl.c ++++ b/ifxmips_ptm_adsl.c +@@ -180,7 +180,7 @@ static int proc_read_version(char *, char **, off_t, int, int *, void *); + static int proc_read_wanmib(char *, char **, off_t, int, int *, void *); + static int proc_write_wanmib(struct file *, const char *, unsigned long, void *); + #endif +-#if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC ++#if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC && defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC + static int proc_read_genconf(char *, char **, off_t, int, int *, void *); + #endif + #if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC +@@ -191,8 +191,8 @@ static int proc_write_wanmib(struct file *, const char *, unsigned long, void *) + /* + * Proc Help Functions + */ +-static INLINE int stricmp(const char *, const char *); + #if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC ++ static INLINE int stricmp(const char *, const char *); + static INLINE int strincmp(const char *, const char *, int); + #endif + static INLINE int ifx_ptm_version(char *); +@@ -1159,8 +1159,6 @@ static int proc_write_dbg(struct file *file, const char *buf, unsigned long coun + return count; + } + +-#endif // defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC +- + static INLINE int stricmp(const char *p1, const char *p2) + { + int c1, c2; +@@ -1178,7 +1176,6 @@ static INLINE int stricmp(const char *p1, const char *p2) + return *p1 - *p2; + } + +-#if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC + static INLINE int strincmp(const char *p1, const char *p2, int n) + { + int c1 = 0, c2; diff --git a/package/kernel/lantiq/ltq-tapi/patches/600-fix-compilation-warning-switch-fallthrough.patch b/package/kernel/lantiq/ltq-tapi/patches/600-fix-compilation-warning-switch-fallthrough.patch new file mode 100644 index 0000000000..bb27ff355a --- /dev/null +++ b/package/kernel/lantiq/ltq-tapi/patches/600-fix-compilation-warning-switch-fallthrough.patch @@ -0,0 +1,114 @@ +--- a/src/drv_tapi_cid.c ++++ b/src/drv_tapi_cid.c +@@ -1424,6 +1424,8 @@ static IFX_int32_t cid_lookup_transparent(TAPI_CIDTX_DATA_t *pTxData, + + cidfsk_set_tx_time (pTxData, &pConfData->TapiCidFskConf); + ++ fallthrough; ++ + case IFX_TAPI_CID_GEN_TYPE_DTMF: + memcpy (pTxData->cidBuf[IFX_TAPI_CID_GEN_TYPE_DTMF].pBuf, + pMessage[0].transparent.data, pMessage[0].transparent.len); +@@ -1497,6 +1499,7 @@ static IFX_int32_t cid_prepare_data(TAPI_CHANNEL *pChannel, + break; + case IFX_TAPI_CID_STD_KPN_DTMF: + /*lint -fallthrough*/ ++ fallthrough; + case IFX_TAPI_CID_STD_KPN_DTMF_FSK: + if (IFX_TAPI_CID_HM_ONHOOK == pTxData->txHookMode) + { +@@ -1506,6 +1509,7 @@ static IFX_int32_t cid_prepare_data(TAPI_CHANNEL *pChannel, + } + /* KPN CID Type 2 (off-hook) always using FSK */ + /*lint -fallthrough*/ ++ fallthrough; + default: + pTxData->cidGenType = IFX_TAPI_CID_GEN_TYPE_FSK; + break; +@@ -1532,6 +1536,7 @@ static IFX_int32_t cid_prepare_data(TAPI_CHANNEL *pChannel, + break; + + /*lint -fallthrough*/ ++ fallthrough; + case IFX_TAPI_CID_GEN_TYPE_FSK: + + if (IFX_TAPI_CID_STD_NTT == pConfData->nStandard) +@@ -2036,6 +2041,7 @@ static FSM_STATUS_t cid_fsm_alert_exec(TAPI_CHANNEL *pChannel) + } + pTxData->nCidSubState++; + /*lint -fallthrough*/ ++ fallthrough; + case 1: + if (pConfData->OSIoffhook && pConfData->nSAStone) + { +@@ -2052,6 +2058,7 @@ static FSM_STATUS_t cid_fsm_alert_exec(TAPI_CHANNEL *pChannel) + } + pTxData->nCidSubState++; + /*lint -fallthrough*/ ++ fallthrough; + case 2: + if (pConfData->nSAStone) + { +@@ -2069,6 +2076,7 @@ static FSM_STATUS_t cid_fsm_alert_exec(TAPI_CHANNEL *pChannel) + } + pTxData->nCidSubState++; + /*lint -fallthrough*/ ++ fallthrough; + default: + /* Play CAS tone on data channel, use unprotected function, protection + is done around cid_fsm_alert_exec */ +@@ -3458,6 +3466,7 @@ IFX_int32_t TAPI_Phone_CID_Stop_Tx(TAPI_CHANNEL *pChannel) + } + /* deliberately fall through */ + /*lint -fallthrough*/ ++ fallthrough; + case TAPI_CID_STATE_ACK: + /* deactivate the DTMF override - last two params are ignored */ + if (ptr_chk(pDrvCtx->SIG.DTMFD_Override, "")) +@@ -3469,6 +3478,7 @@ IFX_int32_t TAPI_Phone_CID_Stop_Tx(TAPI_CHANNEL *pChannel) + } + /* deliberately fall through */ + /*lint -fallthrough*/ ++ fallthrough; + case TAPI_CID_STATE_SENDING: + TAPI_Stop_Timer (pTxData->CidTimerID); + break; +@@ -4066,6 +4076,7 @@ IFX_int32_t TAPI_Phone_Get_CidRxData (TAPI_CHANNEL *pChannel, + /* If the fifo is not empty take the data from the fifo first. */ + /* deliberately fallthrough to default case */ + /*lint -fallthrough*/ ++ fallthrough; + default: + /* Allow readout of data in all other states not handled above. + When there is no data in the fifo TAPI_statusErr is returned. */ +--- a/src/drv_tapi_dial.c ++++ b/src/drv_tapi_dial.c +@@ -319,6 +319,8 @@ static IFX_void_t ifx_tapi_dial_OnTimer(Timer_ID Timer, IFX_ulong_t nArg) + /* NOTE: the "break" statement has been intentionally omitted */ + /*lint -fallthrough */ + ++ fallthrough; ++ + case TAPI_HOOK_STATE_DIAL_L_VAL: + /* digit_l_min expires: onhook has lasted long enough to be a + certain low pulse (not noise). The next state is the overlap with +--- a/src/drv_tapi_event.c ++++ b/src/drv_tapi_event.c +@@ -1545,6 +1545,7 @@ IFX_int32_t IFX_TAPI_Event_Dispatch_ProcessCtx(IFX_TAPI_EXT_EVENT_PARAM_t* + /**\todo put in device fifo */ + pEvent->ch = IFX_TAPI_DEVICE_CH_NUMBER; + /*lint -fallthrough */ ++ fallthrough; + case IFX_TAPI_ERRSRC_LL_CH: + pEvent->data.value |= IFX_TAPI_ERRSRC_LL; + break; +--- a/src/drv_tapi_ioctl.c ++++ b/src/drv_tapi_ioctl.c +@@ -1552,6 +1553,7 @@ static IFX_int32_t TAPI_IoctlCh (IFX_TAPI_DRV_CTX_t* pDrvCtx, + /* Dial Services */ + ret = TAPI_statusNotSupported; + /*lint -fallthrough*/ ++ fallthrough; + default: + bHandled = IFX_FALSE; + break; diff --git a/package/kernel/lantiq/ltq-tapi/patches/601-fix-compilation-warning-ret-not-handled.patch b/package/kernel/lantiq/ltq-tapi/patches/601-fix-compilation-warning-ret-not-handled.patch new file mode 100644 index 0000000000..b97ced30f8 --- /dev/null +++ b/package/kernel/lantiq/ltq-tapi/patches/601-fix-compilation-warning-ret-not-handled.patch @@ -0,0 +1,12 @@ +--- a/src/drv_tapi_ioctl.c ++++ b/src/drv_tapi_ioctl.c +@@ -702,7 +702,8 @@ static IFX_int32_t TAPI_IoctlDev (IFX_TAPI_DRV_CTX_t* pDrvCtx, + + if (ret == TAPI_statusOk || ret == 1) + { +- copy_to_user ((IFX_void_t*)ioarg, p_tmp, sizeof(IFX_TAPI_CAP_t)); ++ if (copy_to_user ((IFX_void_t*)ioarg, p_tmp, sizeof(IFX_TAPI_CAP_t))) ++ ret = TAPI_statusErrKernCpy; + } + } + TAPI_OS_Free (p_tmp); diff --git a/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/121-cpe-api-intern-dynamically-allocate-dump-msg.patch b/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/121-cpe-api-intern-dynamically-allocate-dump-msg.patch new file mode 100644 index 0000000000..40ba73f66b --- /dev/null +++ b/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/121-cpe-api-intern-dynamically-allocate-dump-msg.patch @@ -0,0 +1,99 @@ +--- a/src/drv_mei_cpe_api_intern.c ++++ b/src/drv_mei_cpe_api_intern.c +@@ -421,7 +421,9 @@ IFX_int32_t MEI_InternalMsgSend( + return retVal; + } + +-static IFX_void_t MEI_Internal_DumpMessage( ++#define MEI_Internal_DumpMessage_bufSize 10 ++ ++static IFX_int32_t MEI_Internal_DumpMessage( + MEI_DYN_CNTRL_T *pMeiDynCntrl, + const IFX_uint16_t nMsgId, + const IFX_uint16_t *pData, +@@ -435,15 +437,20 @@ static IFX_void_t MEI_Internal_DumpMessa + IFX_uint8_t i; + const IFX_uint32_t nCommonPayloadSize = 5*nSize/2; + const IFX_uint8_t nInfoSize = 35; +- const IFX_uint8_t nBufSize = 10; + IFX_uint32_t nMsgSize = nCommonPayloadSize + nInfoSize; + IFX_uint32_t nCharsWrittenToBuf = 0; +- char msg[nMsgSize]; +- char buf[nBufSize]; ++ char *msg; ++ char buf[MEI_Internal_DumpMessage_bufSize]; + + if((pData == IFX_NULL) || (nSize < 4)) + { +- return ; ++ return 0; ++ } ++ ++ msg = kcalloc(nMsgSize, sizeof(*msg), GFP_KERNEL); ++ if (!msg) ++ { ++ return -ENOMEM; + } + + pMsg16 = (IFX_uint16_t*)(pData+2); +@@ -464,7 +471,8 @@ static IFX_void_t MEI_Internal_DumpMessa + /* 32-bit payload elements */ + for (i=0; i<((nSize-4)/4); i++) + { +- nCharsWrittenToBuf = snprintf(buf, nBufSize, " %08X", pMsg32[i]); ++ nCharsWrittenToBuf = snprintf(buf, MEI_Internal_DumpMessage_bufSize, ++ " %08X", pMsg32[i]); + strncat(msg, buf, nMsgSize); + nMsgSize -= nCharsWrittenToBuf; + } +@@ -474,7 +482,8 @@ static IFX_void_t MEI_Internal_DumpMessa + /* 16-bit payload elements */ + for (i=0; i<((nSize-4)/2); i++) + { +- nCharsWrittenToBuf = snprintf(buf, nBufSize, " %04X", pMsg16[i]); ++ nCharsWrittenToBuf = snprintf(buf, MEI_Internal_DumpMessage_bufSize, ++ " %04X", pMsg16[i]); + strncat(msg, buf, nMsgSize); + nMsgSize -= nCharsWrittenToBuf; + } +@@ -482,6 +491,10 @@ static IFX_void_t MEI_Internal_DumpMessa + strncat(msg, MEI_DRV_CRLF, nMsgSize); + + PRN_DBG_USR_RAW(MEI_MSG_DUMP_API, dbg_level, (msg)); ++ ++ kfree(msg); ++ ++ return 0; + } + + IFX_int32_t MEI_InternalSendMessage( +@@ -503,18 +516,25 @@ IFX_int32_t MEI_InternalSendMessage( + msg.ack_msg.pPayload = (unsigned char *)pDataAck; + msg.ack_msg.paylSize_byte = nLenAck; + +- MEI_Internal_DumpMessage(pMeiDynCntrl, msg.write_msg.msgId, ++ ret = MEI_Internal_DumpMessage(pMeiDynCntrl, msg.write_msg.msgId, + (IFX_uint16_t *)msg.write_msg.pPayload, msg.write_msg.paylSize_byte, + IFX_FALSE, MEI_DRV_PRN_LEVEL_NORMAL); + ++ if (ret < 0) ++ { ++ return ret; ++ } ++ + ret = MEI_InternalMsgSend(pMeiDynCntrl, &msg); + +- if (ret >= 0) ++ if (ret < 0) + { +- MEI_Internal_DumpMessage(pMeiDynCntrl, msg.ack_msg.msgId, ++ return ret; ++ } ++ ++ ret = MEI_Internal_DumpMessage(pMeiDynCntrl, msg.ack_msg.msgId, + (IFX_uint16_t *)msg.ack_msg.pPayload, msg.ack_msg.paylSize_byte, + IFX_TRUE, MEI_DRV_PRN_LEVEL_NORMAL); +- } + + return ret; + } diff --git a/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/122-cp_linux-fix-compilation-warning.patch b/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/122-cp_linux-fix-compilation-warning.patch new file mode 100644 index 0000000000..63a530b6c5 --- /dev/null +++ b/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/122-cp_linux-fix-compilation-warning.patch @@ -0,0 +1,52 @@ +--- a/src/drv_mei_cpe_linux.c ++++ b/src/drv_mei_cpe_linux.c +@@ -1267,7 +1267,9 @@ static long MEI_Ioctl( struct file *filp, + MEI_IOCTL_RETURN: + + local_args.drv_ioctl.retCode = ret; +- copy_to_user( ((IOCTL_MEI_arg_t *)nArgument), &local_args, retSize); ++ if (copy_to_user( ((IOCTL_MEI_arg_t *)nArgument), &local_args, retSize)) ++ PRN_ERR_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_ERR, ++ ("MEI_DRV[??] Error ioctl - copy_to_user failed!" MEI_DRV_CRLF)); + + return (ret < 0) ? -1 : 0; + } +@@ -3571,9 +3573,11 @@ static int MEI_IoctlMeiDbgAccessWr_Wrap( + ret = MEI_IoctlMeiDbgAccessWr( pMeiDynCntrl, pLocalArgument); + + /* return arguments - count */ +- copy_to_user( (void *)&pUserArgument->count, ++ if (copy_to_user( (void *)&pUserArgument->count, + (void *)&pLocalArgument->count, +- sizeof(pUserArgument->count) ) ; ++ sizeof(pUserArgument->count) )) ++ PRN_ERR_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_ERR, ++ ("MEI_DRV[??] Error ioctl - copy_to_user failed!" MEI_DRV_CRLF)); + + return ret; + } +@@ -3600,16 +3604,20 @@ static int MEI_IoctlMeiDbgAccessRd_Wrap( + if ( pLocalArgument->count ) + { + /* return the buffer */ +- copy_to_user( pUserBuf, ++ if (copy_to_user( pUserBuf, + pLocalArgument->pData_32, +- pLocalArgument->count * sizeof(IFX_uint32_t) ) ; ++ pLocalArgument->count * sizeof(IFX_uint32_t) )) ++ PRN_ERR_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_ERR, ++ ("MEI_DRV[??] Error ioctl - copy_to_user failed!" MEI_DRV_CRLF)); + + } + + /* return count argument */ +- copy_to_user( (void *)&pUserArgument->count, ++ if (copy_to_user( (void *)&pUserArgument->count, + (void *)&pLocalArgument->count, +- sizeof(pUserArgument->count) ) ; ++ sizeof(pUserArgument->count) )) ++ PRN_ERR_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_ERR, ++ ("MEI_DRV[??] Error ioctl - copy_to_user failed!" MEI_DRV_CRLF)); + + return ret; + } diff --git a/package/kernel/lantiq/ltq-vdsl-vr11/patches/211-fix-compilation-warning-missing-fallthrough.patch b/package/kernel/lantiq/ltq-vdsl-vr11/patches/211-fix-compilation-warning-missing-fallthrough.patch new file mode 100644 index 0000000000..96e1ffef97 --- /dev/null +++ b/package/kernel/lantiq/ltq-vdsl-vr11/patches/211-fix-compilation-warning-missing-fallthrough.patch @@ -0,0 +1,49 @@ +--- a/src/device/drv_dsl_cpe_device_vrx.c ++++ b/src/device/drv_dsl_cpe_device_vrx.c +@@ -8885,6 +8885,9 @@ DSL_Error_t DSL_DRV_DEV_AutobootHandleTr + (pContext, SYS_DBG_MSG"DSL[%02d]: ORDERLY_SHUTDOWN state reached" + DSL_DRV_CRLF, DSL_DEV_NUM(pContext))); + /* do not use break here, continue handling */ ++ ++ fallthrough; ++ + #endif /* INCLUDE_DSL_CPE_API_VRX */ + case DSL_LINESTATE_EXCEPTION: + if (!bPreFail) +--- a/src/pm/drv_dsl_cpe_pm_core.c ++++ b/src/pm/drv_dsl_cpe_pm_core.c +@@ -2355,15 +2355,19 @@ DSL_Error_t DSL_DRV_PM_CountersReset( + } + #endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY*/ + +- if (ResetType == DSL_PM_RESET_HISTORY) +- break; ++ if (ResetType == DSL_PM_RESET_HISTORY) ++ break; ++ ++ fallthrough; + + case DSL_PM_RESET_TOTAL: + #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS + memset(EpData.pRecTotal, nFillValue, EpData.nEpRecElementSize); + #endif /* #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS*/ +- if (ResetType == DSL_PM_RESET_TOTAL) +- break; ++ if (ResetType == DSL_PM_RESET_TOTAL) ++ break; ++ ++ fallthrough; + + case DSL_PM_RESET_HISTORY_SHOWTIME: + #ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS +--- a/src/common/drv_dsl_cpe_api.c ++++ b/src/common/drv_dsl_cpe_api.c +@@ -2652,6 +2652,8 @@ DSL_Error_t DSL_DRV_AutobootControlSet( + /* no break */ + /* ... pass to restart*/ + ++ fallthrough; ++ + #if defined (DSL_VRX_DEVICE_VR11) + case DSL_AUTOBOOT_CTRL_STOP_PD: + #endif diff --git a/package/kernel/lantiq/ltq-vmmc/patches/600-fix-compilation-warning-fallthrough.patch b/package/kernel/lantiq/ltq-vmmc/patches/600-fix-compilation-warning-fallthrough.patch new file mode 100644 index 0000000000..7282bc446d --- /dev/null +++ b/package/kernel/lantiq/ltq-vmmc/patches/600-fix-compilation-warning-fallthrough.patch @@ -0,0 +1,10 @@ +--- a/src/drv_vmmc_bbd.c ++++ b/src/drv_vmmc_bbd.c +@@ -1025,6 +1025,7 @@ static IFX_int32_t vmmc_BBD_WhiteListedCmdWr(VMMC_CHANNEL *pCh, + } + } + } ++ fallthrough; + case VMMC_WL_SDD_RING_CFG: + case VMMC_WL_SDD_DCDC_CFG: + case VMMC_WL_SDD_MWI_CFG: diff --git a/package/kernel/lantiq/ltq-vmmc/patches/601-fix-compilation-warning-ret-not-handled.patch b/package/kernel/lantiq/ltq-vmmc/patches/601-fix-compilation-warning-ret-not-handled.patch new file mode 100644 index 0000000000..da7c1c8a26 --- /dev/null +++ b/package/kernel/lantiq/ltq-vmmc/patches/601-fix-compilation-warning-ret-not-handled.patch @@ -0,0 +1,16 @@ +--- a/src/drv_vmmc_ioctl.c ++++ b/src/drv_vmmc_ioctl.c +@@ -108,9 +108,11 @@ extern IFX_int32_t VMMC_ChipAccessInit ( + {\ + arg* p_arg = VMMC_OS_Malloc (sizeof(arg));\ + VMMC_ASSERT (p_arg != IFX_NULL);\ +- copy_from_user (p_arg, (IFX_uint8_t*)ioarg, sizeof(arg));\ ++ if (copy_from_user (p_arg, (IFX_uint8_t*)ioarg, sizeof(arg)))\ ++ ret = -EFAULT;\ + ret = func((pContext), p_arg);\ +- copy_to_user ((IFX_uint8_t*)ioarg, p_arg, sizeof(arg));\ ++ if (copy_to_user ((IFX_uint8_t*)ioarg, p_arg, sizeof(arg)))\ ++ ret = -EFAULT;\ + VMMC_OS_Free (p_arg);\ + }\ + break diff --git a/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch b/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch new file mode 100644 index 0000000000..bf2d82e2b5 --- /dev/null +++ b/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch @@ -0,0 +1,31 @@ +--- a/dcdp/atm_tc.c ++++ b/dcdp/atm_tc.c +@@ -746,7 +746,8 @@ static void atm_aca_init(struct atm_priv + ACA_TXOUT_EN | ACA_RXIN_EN | ACA_RXOUT_EN, 1); + } + +-static int print_datetime(char *buffer, const struct timespec64 *datetime) ++static int print_datetime(char *buffer, int buffer_size, ++ const struct timespec64 *datetime) + { + struct tm nowtm; + char tmbuf[64]; +@@ -765,7 +766,8 @@ static int print_datetime(char *buffer, + nowtm.tm_hour, + nowtm.tm_min, + nowtm.tm_sec); +- snprintf(buffer, sizeof(buffer), "%s.%06d", tmbuf, (int)datetime->tv_nsec / 1000); ++ snprintf(buffer, sizeof(tmbuf)+buffer_size, "%s.%06d", ++ tmbuf, (int)datetime->tv_nsec / 1000); + + return 0; + } +@@ -967,7 +969,7 @@ void show_atm_pvc(struct seq_file *seq, + char buf[64]; + + seq_printf(seq, "\tNet device: %s\n", pvc->dev->name); +- print_datetime(buf, &(pvc->access_time)); ++ print_datetime(buf, sizeof(buf), &(pvc->access_time)); + seq_printf(seq, "\tLast user cell: %s\n", buf); + seq_printf(seq, "\tPort: %d\n", pvc->port); + seq_printf(seq, "\tSoftware TX Queue: %u\n", pvc->sw_txq_tbl); diff --git a/package/kernel/lantiq/vrx518_tc/patches/205-dcdp-ptm_tc-dynamically-alloc-mib.patch b/package/kernel/lantiq/vrx518_tc/patches/205-dcdp-ptm_tc-dynamically-alloc-mib.patch new file mode 100644 index 0000000000..ca4c041b21 --- /dev/null +++ b/package/kernel/lantiq/vrx518_tc/patches/205-dcdp-ptm_tc-dynamically-alloc-mib.patch @@ -0,0 +1,206 @@ +--- a/dcdp/ptm_tc.c ++++ b/dcdp/ptm_tc.c +@@ -298,15 +298,19 @@ static int ptm_tc_get_stats(struct ptm_e + ) + { + struct rtnl_link_stats64 *stat; +- struct wan_rx_mib_table rx_mib; ++ struct wan_rx_mib_table *rx_mib; + unsigned int cur_cnt, last_cnt; + struct intel_tc_ptm_sl_stats *ptm_sl_stats; + struct ptm_priv *ptm_tc; ++ int ret = 0; + if (!priv || !stats) + return -EFAULT; + ptm_tc = priv->ptm_tc; + if (!ptm_tc) + return -EFAULT; ++ rx_mib = kzalloc(sizeof(*rx_mib), GFP_KERNEL); ++ if (!rx_mib) ++ return -ENOMEM; + if (bonding) + stats->tc_info = TC_PTM_BND_MODE; + else +@@ -340,11 +344,11 @@ static int ptm_tc_get_stats(struct ptm_e + ? cur_cnt - last_cnt + : cur_cnt + ((unsigned int)(-1) - last_cnt); + +- tc_mem_read(priv, &rx_mib, ++ tc_mem_read(priv, rx_mib, + fpi_addr(__RX_GIF_MIB_BASE), +- sizeof(rx_mib) ++ sizeof(*rx_mib) + ); +- ptm_sl_stats->wrx_gif_drop_pdu = rx_mib.wrx_dropdes_pdu; ++ ptm_sl_stats->wrx_gif_drop_pdu = rx_mib->wrx_dropdes_pdu; + + cur_cnt = tc_r32(GIF0_RX_CRC_ERR_CNT); + last_cnt = priv->ptm_mib.rx_crc_err_pdu[0]; +@@ -358,7 +362,7 @@ static int ptm_tc_get_stats(struct ptm_e + ? cur_cnt - last_cnt + : cur_cnt + ((unsigned int)(-1) - last_cnt); + +- ptm_sl_stats->wrx_gif_total_bytes = rx_mib.wrx_total_bytes; ++ ptm_sl_stats->wrx_gif_total_bytes = rx_mib->wrx_total_bytes; + cur_cnt = sb_r32(__US_TC_LOCAL_Q_CFG_CTXT_BASE + + offsetof(desq_cfg_ctxt_t, deq_pkt_cnt) / 4); + last_cnt = priv->ptm_mib.tx_total_pdu[0]; +@@ -376,90 +380,108 @@ static int ptm_tc_get_stats(struct ptm_e + /* For bonding information */ + if (bonding) { + int i; +- struct intel_tc_ptm_bonding_stats ptm_ds; +- struct intel_tc_ptm_bonding_stats ptm_us; ++ struct intel_tc_ptm_bonding_stats *ptm_ds; ++ struct intel_tc_ptm_bonding_stats *ptm_us; + struct intel_tc_ptm_bonding_stats *ptm_bonding_stats; ++ ++ ptm_ds = kzalloc(sizeof(*ptm_ds), GFP_KERNEL); ++ if (!ptm_ds) { ++ ret = -ENOMEM; ++ goto free_rx_mib; ++ } ++ ++ ptm_us = kzalloc(sizeof(*ptm_us), GFP_KERNEL); ++ if (!ptm_us) { ++ ret = -ENOMEM; ++ goto free_ptm_ds; ++ } ++ + priv = tc_ep_priv(0); +- ptm_tc_bond_get_stats(priv, &ptm_ds); ++ ptm_tc_bond_get_stats(priv, ptm_ds); + priv = tc_ep_priv(1); +- ptm_tc_bond_get_stats(priv, &ptm_us); ++ ptm_tc_bond_get_stats(priv, ptm_us); + ptm_bonding_stats = + &(stats->stats.ptm_tc_stats.pmt_bonding_stats); + for (i = 0; i < 8; i++) + ptm_bonding_stats->us_gif_mib[i] = +- ptm_ds.us_gif_mib[i] + ptm_us.us_gif_mib[i]; ++ ptm_ds->us_gif_mib[i] + ptm_us->us_gif_mib[i]; + for (i = 0; i < 8; i++) { + ptm_bonding_stats->ds_gif_mib[i].rx_frag_byte_cnt = +- ptm_ds.ds_gif_mib[i].rx_frag_byte_cnt +- + ptm_us.ds_gif_mib[i].rx_frag_byte_cnt; ++ ptm_ds->ds_gif_mib[i].rx_frag_byte_cnt ++ + ptm_us->ds_gif_mib[i].rx_frag_byte_cnt; + ptm_bonding_stats->ds_gif_mib[i].rx_byte_cnt = +- ptm_ds.ds_gif_mib[i].rx_byte_cnt +- + ptm_us.ds_gif_mib[i].rx_byte_cnt; ++ ptm_ds->ds_gif_mib[i].rx_byte_cnt ++ + ptm_us->ds_gif_mib[i].rx_byte_cnt; + ptm_bonding_stats->ds_gif_mib[i].rx_of_frag_byte_cnt = +- ptm_ds.ds_gif_mib[i].rx_of_frag_byte_cnt +- + ptm_us.ds_gif_mib[i].rx_of_frag_byte_cnt; ++ ptm_ds->ds_gif_mib[i].rx_of_frag_byte_cnt ++ + ptm_us->ds_gif_mib[i].rx_of_frag_byte_cnt; + ptm_bonding_stats->ds_gif_mib[i].rx_of_byte_cnt = +- ptm_ds.ds_gif_mib[i].rx_of_byte_cnt +- + ptm_us.ds_gif_mib[i].rx_of_byte_cnt; ++ ptm_ds->ds_gif_mib[i].rx_of_byte_cnt ++ + ptm_us->ds_gif_mib[i].rx_of_byte_cnt; + ptm_bonding_stats->ds_gif_mib[i].rx_oor_frag_byte_cnt = +- ptm_ds.ds_gif_mib[i].rx_oor_frag_byte_cnt +- + ptm_us.ds_gif_mib[i].rx_oor_frag_byte_cnt; ++ ptm_ds->ds_gif_mib[i].rx_oor_frag_byte_cnt ++ + ptm_us->ds_gif_mib[i].rx_oor_frag_byte_cnt; + ptm_bonding_stats->ds_gif_mib[i].rx_miss_frag_byte_cnt = +- ptm_ds.ds_gif_mib[i].rx_miss_frag_byte_cnt +- + ptm_us.ds_gif_mib[i].rx_miss_frag_byte_cnt; ++ ptm_ds->ds_gif_mib[i].rx_miss_frag_byte_cnt ++ + ptm_us->ds_gif_mib[i].rx_miss_frag_byte_cnt; + ptm_bonding_stats->ds_gif_mib[i].rx_to_frag_byte_cnt = +- ptm_ds.ds_gif_mib[i].rx_to_frag_byte_cnt +- + ptm_us.ds_gif_mib[i].rx_to_frag_byte_cnt; ++ ptm_ds->ds_gif_mib[i].rx_to_frag_byte_cnt ++ + ptm_us->ds_gif_mib[i].rx_to_frag_byte_cnt; + } + for (i = 0; i < 4; i++) { + ptm_bonding_stats->ds_bg_mib[i].conform_pkt_cnt = +- ptm_ds.ds_bg_mib[i].conform_pkt_cnt +- + ptm_us.ds_bg_mib[i].conform_pkt_cnt; ++ ptm_ds->ds_bg_mib[i].conform_pkt_cnt ++ + ptm_us->ds_bg_mib[i].conform_pkt_cnt; + ptm_bonding_stats->ds_bg_mib[i].conform_frag_cnt = +- ptm_ds.ds_bg_mib[i].conform_frag_cnt +- + ptm_us.ds_bg_mib[i].conform_frag_cnt; ++ ptm_ds->ds_bg_mib[i].conform_frag_cnt ++ + ptm_us->ds_bg_mib[i].conform_frag_cnt; + ptm_bonding_stats->ds_bg_mib[i].conform_byte_cnt = +- ptm_ds.ds_bg_mib[i].conform_byte_cnt +- + ptm_us.ds_bg_mib[i].conform_byte_cnt; ++ ptm_ds->ds_bg_mib[i].conform_byte_cnt ++ + ptm_us->ds_bg_mib[i].conform_byte_cnt; + ptm_bonding_stats->ds_bg_mib[i].no_sop_pkt_cnt = +- ptm_ds.ds_bg_mib[i].no_sop_pkt_cnt +- + ptm_us.ds_bg_mib[i].no_sop_pkt_cnt; ++ ptm_ds->ds_bg_mib[i].no_sop_pkt_cnt ++ + ptm_us->ds_bg_mib[i].no_sop_pkt_cnt; + ptm_bonding_stats->ds_bg_mib[i].no_sop_frag_cnt = +- ptm_ds.ds_bg_mib[i].no_sop_frag_cnt +- + ptm_us.ds_bg_mib[i].no_sop_frag_cnt; ++ ptm_ds->ds_bg_mib[i].no_sop_frag_cnt ++ + ptm_us->ds_bg_mib[i].no_sop_frag_cnt; + ptm_bonding_stats->ds_bg_mib[i].no_sop_byte_cnt = +- ptm_ds.ds_bg_mib[i].no_sop_byte_cnt +- + ptm_us.ds_bg_mib[i].no_sop_byte_cnt; ++ ptm_ds->ds_bg_mib[i].no_sop_byte_cnt ++ + ptm_us->ds_bg_mib[i].no_sop_byte_cnt; + ptm_bonding_stats->ds_bg_mib[i].no_eop_pkt_cnt = +- ptm_ds.ds_bg_mib[i].no_eop_pkt_cnt +- + ptm_us.ds_bg_mib[i].no_eop_pkt_cnt; ++ ptm_ds->ds_bg_mib[i].no_eop_pkt_cnt ++ + ptm_us->ds_bg_mib[i].no_eop_pkt_cnt; + ptm_bonding_stats->ds_bg_mib[i].no_eop_frag_cnt = +- ptm_ds.ds_bg_mib[i].no_eop_frag_cnt +- + ptm_us.ds_bg_mib[i].no_eop_frag_cnt; ++ ptm_ds->ds_bg_mib[i].no_eop_frag_cnt ++ + ptm_us->ds_bg_mib[i].no_eop_frag_cnt; + ptm_bonding_stats->ds_bg_mib[i].no_eop_byte_cnt = +- ptm_ds.ds_bg_mib[i].no_eop_byte_cnt +- + ptm_us.ds_bg_mib[i].no_eop_byte_cnt; ++ ptm_ds->ds_bg_mib[i].no_eop_byte_cnt ++ + ptm_us->ds_bg_mib[i].no_eop_byte_cnt; + ptm_bonding_stats->ds_bg_mib[i].oversize_pkt_cnt = +- ptm_ds.ds_bg_mib[i].oversize_pkt_cnt +- + ptm_us.ds_bg_mib[i].oversize_pkt_cnt; ++ ptm_ds->ds_bg_mib[i].oversize_pkt_cnt ++ + ptm_us->ds_bg_mib[i].oversize_pkt_cnt; + ptm_bonding_stats->ds_bg_mib[i].oversize_frag_cnt = +- ptm_ds.ds_bg_mib[i].oversize_frag_cnt +- + ptm_us.ds_bg_mib[i].oversize_frag_cnt; ++ ptm_ds->ds_bg_mib[i].oversize_frag_cnt ++ + ptm_us->ds_bg_mib[i].oversize_frag_cnt; + ptm_bonding_stats->ds_bg_mib[i].oversize_byte_cnt = +- ptm_ds.ds_bg_mib[i].oversize_byte_cnt +- + ptm_us.ds_bg_mib[i].oversize_byte_cnt; ++ ptm_ds->ds_bg_mib[i].oversize_byte_cnt ++ + ptm_us->ds_bg_mib[i].oversize_byte_cnt; + ptm_bonding_stats->ds_bg_mib[i].noncosec_pkt_cnt = +- ptm_ds.ds_bg_mib[i].noncosec_pkt_cnt +- + ptm_us.ds_bg_mib[i].noncosec_pkt_cnt; ++ ptm_ds->ds_bg_mib[i].noncosec_pkt_cnt ++ + ptm_us->ds_bg_mib[i].noncosec_pkt_cnt; + ptm_bonding_stats->ds_bg_mib[i].noncosec_frag_cnt = +- ptm_ds.ds_bg_mib[i].noncosec_frag_cnt +- + ptm_us.ds_bg_mib[i].noncosec_frag_cnt; ++ ptm_ds->ds_bg_mib[i].noncosec_frag_cnt ++ + ptm_us->ds_bg_mib[i].noncosec_frag_cnt; + ptm_bonding_stats->ds_bg_mib[i].noncosec_byte_cnt = +- ptm_ds.ds_bg_mib[i].noncosec_byte_cnt +- + ptm_us.ds_bg_mib[i].noncosec_byte_cnt; ++ ptm_ds->ds_bg_mib[i].noncosec_byte_cnt ++ + ptm_us->ds_bg_mib[i].noncosec_byte_cnt; + } ++ kfree(ptm_us); ++free_ptm_ds: ++ kfree(ptm_ds); + } +- return 0; ++free_rx_mib: ++ kfree(rx_mib); ++ return ret; + } + static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + { diff --git a/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch b/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch index e2bbb4a1b1..b97837f76d 100644 --- a/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch +++ b/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1413,6 +1413,53 @@ void ath9k_deinit_debug(struct ath_softc +@@ -1413,6 +1413,54 @@ void ath9k_deinit_debug(struct ath_softc ath9k_cmn_spectral_deinit_debug(&sc->spec_priv); } @@ -39,7 +39,8 @@ + } else { + bytes = 2; + } -+ copy_to_user(user_buf, from, bytes); ++ if (copy_to_user(user_buf, from, bytes)) ++ return -EFAULT; + user_buf += bytes; + } + return *ppos - pos; diff --git a/package/kernel/mac80211/patches/brcm/865-brcmfmac-Read-alternative-firmware-names-from-DT.patch b/package/kernel/mac80211/patches/brcm/865-brcmfmac-Read-alternative-firmware-names-from-DT.patch index 8ed81f600a..8df285f8b1 100644 --- a/package/kernel/mac80211/patches/brcm/865-brcmfmac-Read-alternative-firmware-names-from-DT.patch +++ b/package/kernel/mac80211/patches/brcm/865-brcmfmac-Read-alternative-firmware-names-from-DT.patch @@ -65,22 +65,26 @@ Signed-off-by: Phil Elwell +} --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h -@@ -5,9 +5,16 @@ +@@ -5,9 +5,20 @@ #ifdef CONFIG_OF void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, struct brcmf_mp_device *settings); ++#ifdef CPTCFG_BRCMFMAC_SDIO +struct brcmf_firmware_mapping * +brcmf_of_fwnames(struct device *dev, u32 *map_count); ++#endif #else static void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, struct brcmf_mp_device *settings) { } ++#ifdef CPTCFG_BRCMFMAC_SDIO +static struct brcmf_firmware_mapping * +brcmf_of_fwnames(struct device *dev, u32 *map_count) +{ + return NULL; +} ++#endif #endif /* CONFIG_OF */ --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c diff --git a/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch b/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch new file mode 100644 index 0000000000..8e71918cf3 --- /dev/null +++ b/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch @@ -0,0 +1,176 @@ +From ed4422e98ababf956674da3438ac42b3aa32c66e Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Wed, 10 May 2023 00:41:06 +0200 +Subject: [PATCH] Fix compilation warning with 64 bit system + +Use %zu and %zd where possible for ssize_t and size_t. +Use PTR_ERR to correctly convert to negative error. +Use universal pointer to support both 32 and 64bit systems. + +Fix compilation warning: +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/fwcmd.c: In function 'mwl_fwcmd_get_fw_core_dump': +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/fwcmd.c:3608:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] + 3608 | (const void *)((u32)pcmd + + | ^ +In file included from ./include/linux/device.h:15, + from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/device.h:3, + from ./include/linux/dma-mapping.h:7, + from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/dma-mapping.h:3, + from ./include/linux/skbuff.h:31, + from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/skbuff.h:3, + from ./include/linux/if_ether.h:19, + from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/if_ether.h:3, + from ./include/linux/etherdevice.h:20, + from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/etherdevice.h:3, + from /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:20: +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c: In function 'pcie_tx_init_ndp': +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:338:38: error: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Werror=format=] + 338 | wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +./include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap' + 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ + | ^~~ +./include/linux/dev_printk.h:144:56: note: in expansion of macro 'dev_fmt' + 144 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__) + | ^~~~~~~ +/home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211/net/cfg80211.h:8828:9: note: in expansion of macro 'dev_err' + 8828 | dev_err(&(wiphy)->dev, format, ##args) + | ^~~~~~~ +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:338:17: note: in expansion of macro 'wiphy_err' + 338 | wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", + | ^~~~~~~~~ +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:338:67: note: format string is defined here + 338 | wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", + | ~^ + | | + | int + | %ld +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:338:38: error: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Werror=format=] + 338 | wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +./include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap' + 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ + | ^~~ +./include/linux/dev_printk.h:144:56: note: in expansion of macro 'dev_fmt' + 144 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__) + | ^~~~~~~ +/home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211/net/cfg80211.h:8828:9: note: in expansion of macro 'dev_err' + 8828 | dev_err(&(wiphy)->dev, format, ##args) + | ^~~~~~~ +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:338:17: note: in expansion of macro 'wiphy_err' + 338 | wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", + | ^~~~~~~~~ +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:338:71: note: format string is defined here + 338 | wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", + | ~^ + | | + | int + | %ld + CC [M] /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/debugfs.o +In file included from ./include/linux/device.h:15, + from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/device.h:3, + from ./include/linux/dma-mapping.h:7, + from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/dma-mapping.h:3, + from ./include/linux/skbuff.h:31, + from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/skbuff.h:3, + from ./include/linux/if_ether.h:19, + from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/if_ether.h:3, + from ./include/linux/etherdevice.h:20, + from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/etherdevice.h:3, + from /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/pcie.c:19: +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/pcie.c: In function 'pcie_bf_mimo_ctrl_decode': +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/pcie.c:1325:37: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] + 1325 | filename, (unsigned int)fp_data); + | ^ +./include/linux/dev_printk.h:110:37: note: in definition of macro 'dev_printk_index_wrap' + 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ + | ^~~~~~~~~~~ +/home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211/net/cfg80211.h:8828:9: note: in expansion of macro 'dev_err' + 8828 | dev_err(&(wiphy)->dev, format, ##args) + | ^~~~~~~ +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/pcie.c:1324:17: note: in expansion of macro 'wiphy_err' + 1324 | wiphy_err(priv->hw->wiphy, "Error opening %s! %x\n", + | ^~~~~~~~~ +cc1: all warnings being treated as errors +make[4]: *** [scripts/Makefile.build:289: /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.o] Error 1 +make[4]: *** Waiting for unfinished jobs.... +cc1: all warnings being treated as errors +make[4]: *** [scripts/Makefile.build:289: /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/pcie.o] Error 1 +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/debugfs.c: In function 'mwl_debugfs_regrdwr_read': +/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/debugfs.c:1335:43: error: format '%d' expects argument of type 'int', but argument 4 has type 'ssize_t' {aka 'long int'} [-Werror=format=] + 1335 | "error: %d(%u 0x%08x 0x%08x)\n", + | ~^ + | | + | int + | %ld + 1336 | ret, priv->reg_type, priv->reg_offset, + | ~~~ + | | + | ssize_t {aka long int} +cc1: all warnings being treated as errors + +Signed-off-by: Christian Marangi +--- + debugfs.c | 2 +- + hif/fwcmd.c | 2 +- + hif/pcie/pcie.c | 4 ++-- + hif/pcie/tx_ndp.c | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/debugfs.c b/debugfs.c +index 39b09fd..42efd28 100644 +--- a/debugfs.c ++++ b/debugfs.c +@@ -1332,7 +1332,7 @@ done: + priv->reg_value); + else + len += scnprintf(p + len, size - len, +- "error: %d(%u 0x%08x 0x%08x)\n", ++ "error: %zd(%u 0x%08x 0x%08x)\n", + ret, priv->reg_type, priv->reg_offset, + priv->reg_value); + +diff --git a/hif/fwcmd.c b/hif/fwcmd.c +index 376b58f..582c8d2 100644 +--- a/hif/fwcmd.c ++++ b/hif/fwcmd.c +@@ -3604,7 +3604,7 @@ int mwl_fwcmd_get_fw_core_dump(struct ieee80211_hw *hw, + core_dump->size_kb = pcmd->cmd_data.coredump.size_kb; + core_dump->flags = pcmd->cmd_data.coredump.flags; + memcpy(buff, +- (const void *)((u32)pcmd + ++ (const void *)((uintptr_t)pcmd + + sizeof(struct hostcmd_cmd_get_fw_core_dump) - + sizeof(struct hostcmd_cmd_get_fw_core_dump_)), + MAX_CORE_DUMP_BUFFER); +diff --git a/hif/pcie/pcie.c b/hif/pcie/pcie.c +index 24453b6..5b6c633 100644 +--- a/hif/pcie/pcie.c ++++ b/hif/pcie/pcie.c +@@ -1320,8 +1320,8 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv, + &fp_data->f_pos); + filp_close(fp_data, current->files); + } else { +- wiphy_err(priv->hw->wiphy, "Error opening %s! %x\n", +- filename, (unsigned int)fp_data); ++ wiphy_err(priv->hw->wiphy, "Error opening %s! %ld\n", ++ filename, PTR_ERR(fp_data)); + } + + #if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) +diff --git a/hif/pcie/tx_ndp.c b/hif/pcie/tx_ndp.c +index 6758cde..3140a2e 100644 +--- a/hif/pcie/tx_ndp.c ++++ b/hif/pcie/tx_ndp.c +@@ -335,7 +335,7 @@ int pcie_tx_init_ndp(struct ieee80211_hw *hw) + + if (sizeof(struct pcie_tx_ctrl_ndp) > + sizeof(tx_info->status.status_driver_data)) { +- wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", ++ wiphy_err(hw->wiphy, "driver data is not enough: %zu (%zu)\n", + sizeof(struct pcie_tx_ctrl_ndp), + sizeof(tx_info->status.status_driver_data)); + return -ENOMEM; +-- +2.39.2 + diff --git a/package/kernel/nat46/Makefile b/package/kernel/nat46/Makefile index 2b131a9a70..5e5efbe101 100644 --- a/package/kernel/nat46/Makefile +++ b/package/kernel/nat46/Makefile @@ -3,11 +3,11 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=nat46 -PKG_MIRROR_HASH:=c26b8c60aa991a087011b8b6492e43a6749f0a5d9dc79ffcfd352da5fa20b78d +PKG_MIRROR_HASH:=aeff95aa278ec1e197b59700284c0210f32b92c1fb757e5c3088bd00b3b403d4 PKG_SOURCE_URL:=https://github.com/ayourtch/nat46.git -PKG_SOURCE_DATE:=2022-03-30 +PKG_SOURCE_DATE:=2022-09-19 PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=95ca1c3b99376da2d0306919f2df4a8d3c9bb78b +PKG_SOURCE_VERSION:=4c5beee236841724219598fabb1edc93d4f08ce5 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 @@ -15,7 +15,7 @@ PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk define KernelPackage/nat46 - DEPENDS:=@IPV6 + DEPENDS:=@IPV6 +kmod-nf-conntrack6 TITLE:=Stateless NAT46 translation kernel module SECTION:=kernel SUBMENU:=Network Support diff --git a/target/linux/ath79/files/drivers/gpio/gpio-latch.c b/target/linux/ath79/files/drivers/gpio/gpio-latch.c index 976e683230..68f9290b2a 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-latch.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-latch.c @@ -134,7 +134,7 @@ static int gpio_latch_probe(struct platform_device *pdev) 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: %d\n", i, + dev_err(dev, "failed to get gpio %d: %ld\n", i, PTR_ERR(glc->gpios[i])); } return PTR_ERR(glc->gpios[i]); diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c b/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c index 244fd27590..c502f4a064 100644 --- a/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c +++ b/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c @@ -286,7 +286,7 @@ static int rb91x_nand_probe(struct platform_device *pdev) gpios = gpiod_get_array(dev, NULL, GPIOD_OUT_LOW); if (IS_ERR(gpios)) { if (PTR_ERR(gpios) != -EPROBE_DEFER) { - dev_err(dev, "failed to get gpios: %d\n", + dev_err(dev, "failed to get gpios: %ld\n", PTR_ERR(gpios)); } return PTR_ERR(gpios); diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile index 02fd26bfd8..8328be7667 100644 --- a/target/linux/ath79/image/Makefile +++ b/target/linux/ath79/image/Makefile @@ -60,9 +60,6 @@ define Build/relocate-kernel rm -rf $@.relocate endef -define Build/append-squashfs-fakeroot-be - cat ./empty-squashfs-lzma >> $@ -endef define Device/Default DEVICE_DTS_DIR := ../dts diff --git a/target/linux/ath79/image/empty-squashfs-lzma b/target/linux/ath79/image/empty-squashfs-lzma deleted file mode 100755 index 803a7661a7..0000000000 Binary files a/target/linux/ath79/image/empty-squashfs-lzma and /dev/null differ diff --git a/target/linux/ath79/patches-5.15/0018-MIPS-pci-ar71xx-convert-to-OF.patch b/target/linux/ath79/patches-5.15/0018-MIPS-pci-ar71xx-convert-to-OF.patch index e600a4f0d9..9a315aed0b 100644 --- a/target/linux/ath79/patches-5.15/0018-MIPS-pci-ar71xx-convert-to-OF.patch +++ b/target/linux/ath79/patches-5.15/0018-MIPS-pci-ar71xx-convert-to-OF.patch @@ -141,7 +141,7 @@ Signed-off-by: John Crispin irq_set_chained_handler_and_data(apc->irq, ar71xx_pci_irq_handler, apc); } -@@ -325,6 +337,11 @@ static void ar71xx_pci_reset(void) +@@ -325,10 +337,14 @@ static void ar71xx_pci_reset(void) mdelay(100); } @@ -153,7 +153,11 @@ Signed-off-by: John Crispin static int ar71xx_pci_probe(struct platform_device *pdev) { struct ar71xx_pci_controller *apc; -@@ -345,26 +362,6 @@ static int ar71xx_pci_probe(struct platf +- struct resource *res; + u32 t; + + apc = devm_kzalloc(&pdev->dev, sizeof(struct ar71xx_pci_controller), +@@ -345,26 +361,6 @@ static int ar71xx_pci_probe(struct platf if (apc->irq < 0) return -EINVAL; @@ -180,7 +184,7 @@ Signed-off-by: John Crispin ar71xx_pci_reset(); /* setup COMMAND register */ -@@ -377,9 +374,11 @@ static int ar71xx_pci_probe(struct platf +@@ -377,9 +373,11 @@ static int ar71xx_pci_probe(struct platf ar71xx_pci_irq_init(apc); @@ -192,7 +196,7 @@ Signed-off-by: John Crispin register_pci_controller(&apc->pci_ctrl); -@@ -390,6 +389,7 @@ static struct platform_driver ar71xx_pci +@@ -390,6 +388,7 @@ static struct platform_driver ar71xx_pci .probe = ar71xx_pci_probe, .driver = { .name = "ar71xx-pci", diff --git a/target/linux/ath79/patches-5.15/0020-MIPS-pci-ar724x-convert-to-OF.patch b/target/linux/ath79/patches-5.15/0020-MIPS-pci-ar724x-convert-to-OF.patch index 2772c53392..7927c1cbf5 100644 --- a/target/linux/ath79/patches-5.15/0020-MIPS-pci-ar724x-convert-to-OF.patch +++ b/target/linux/ath79/patches-5.15/0020-MIPS-pci-ar724x-convert-to-OF.patch @@ -154,7 +154,15 @@ Signed-off-by: John Crispin irq_set_chained_handler_and_data(apc->irq, ar724x_pci_irq_handler, apc); } -@@ -388,29 +396,11 @@ static int ar724x_pci_probe(struct platf +@@ -360,7 +368,6 @@ static void ar724x_pci_hw_init(struct ar + static int ar724x_pci_probe(struct platform_device *pdev) + { + struct ar724x_pci_controller *apc; +- struct resource *res; + int id; + + id = pdev->id; +@@ -388,29 +395,11 @@ static int ar724x_pci_probe(struct platf if (apc->irq < 0) return -EINVAL; @@ -186,7 +194,7 @@ Signed-off-by: John Crispin /* * Do the full PCIE Root Complex Initialization Sequence if the PCIe -@@ -432,10 +422,16 @@ static int ar724x_pci_probe(struct platf +@@ -432,10 +421,16 @@ static int ar724x_pci_probe(struct platf return 0; } diff --git a/target/linux/ath79/patches-5.15/0036-MIPS-ath79-remove-irq-code-from-pci.patch b/target/linux/ath79/patches-5.15/0036-MIPS-ath79-remove-irq-code-from-pci.patch index 4732d1b2c8..01549eec68 100644 --- a/target/linux/ath79/patches-5.15/0036-MIPS-ath79-remove-irq-code-from-pci.patch +++ b/target/linux/ath79/patches-5.15/0036-MIPS-ath79-remove-irq-code-from-pci.patch @@ -127,7 +127,7 @@ Submitted-by: John Crispin static void ar71xx_pci_reset(void) { ath79_device_reset_set(AR71XX_RESET_PCI_BUS | AR71XX_RESET_PCI_CORE); -@@ -358,10 +258,6 @@ static int ar71xx_pci_probe(struct platf +@@ -357,10 +257,6 @@ static int ar71xx_pci_probe(struct platf if (IS_ERR(apc->cfg_base)) return PTR_ERR(apc->cfg_base); @@ -138,7 +138,7 @@ Submitted-by: John Crispin ar71xx_pci_reset(); /* setup COMMAND register */ -@@ -372,8 +268,6 @@ static int ar71xx_pci_probe(struct platf +@@ -371,8 +267,6 @@ static int ar71xx_pci_probe(struct platf /* clear bus errors */ ar71xx_pci_check_error(apc, 1); diff --git a/target/linux/ath79/patches-5.15/0062-MIPS-pci-ar724x-add-QCA9550-reset-sequence.patch b/target/linux/ath79/patches-5.15/0062-MIPS-pci-ar724x-add-QCA9550-reset-sequence.patch index f596ddb733..1949a9f886 100644 --- a/target/linux/ath79/patches-5.15/0062-MIPS-pci-ar724x-add-QCA9550-reset-sequence.patch +++ b/target/linux/ath79/patches-5.15/0062-MIPS-pci-ar724x-add-QCA9550-reset-sequence.patch @@ -96,7 +96,7 @@ Signed-off-by: David Bauer /* set PCIE Application Control to ready */ app = __raw_readl(apc->ctrl_base + AR724X_PCI_REG_APP); -@@ -396,6 +412,14 @@ static int ar724x_pci_probe(struct platf +@@ -395,6 +411,14 @@ static int ar724x_pci_probe(struct platf if (apc->irq < 0) return -EINVAL; @@ -111,7 +111,7 @@ Signed-off-by: David Bauer apc->np = pdev->dev.of_node; apc->pci_controller.pci_ops = &ar724x_pci_ops; apc->pci_controller.io_resource = &apc->io_res; -@@ -406,7 +430,7 @@ static int ar724x_pci_probe(struct platf +@@ -405,7 +429,7 @@ static int ar724x_pci_probe(struct platf * Do the full PCIE Root Complex Initialization Sequence if the PCIe * host controller is in reset. */ @@ -120,7 +120,7 @@ Signed-off-by: David Bauer ar724x_pci_hw_init(apc); apc->link_up = ar724x_pci_check_link(apc); -@@ -424,6 +448,7 @@ static int ar724x_pci_probe(struct platf +@@ -423,6 +447,7 @@ static int ar724x_pci_probe(struct platf static const struct of_device_id ar724x_pci_ids[] = { { .compatible = "qcom,ar7240-pci" }, diff --git a/target/linux/ath79/patches-5.15/470-MIPS-ath79-swizzle-pci-address-for-ar71xx.patch b/target/linux/ath79/patches-5.15/470-MIPS-ath79-swizzle-pci-address-for-ar71xx.patch index 3b8fee2269..1e2715b84c 100644 --- a/target/linux/ath79/patches-5.15/470-MIPS-ath79-swizzle-pci-address-for-ar71xx.patch +++ b/target/linux/ath79/patches-5.15/470-MIPS-ath79-swizzle-pci-address-for-ar71xx.patch @@ -97,7 +97,7 @@ SVN-Revision: 32639 static inline u32 ar71xx_pci_get_ble(int where, int size, int local) { u32 t; -@@ -276,6 +315,9 @@ static int ar71xx_pci_probe(struct platf +@@ -275,6 +314,9 @@ static int ar71xx_pci_probe(struct platf register_pci_controller(&apc->pci_ctrl); diff --git a/target/linux/bcm47xx/patches-5.15/940-bcm47xx-yenta.patch b/target/linux/bcm47xx/patches-5.15/940-bcm47xx-yenta.patch index 8847b0c0c7..1a5b98b8b2 100644 --- a/target/linux/bcm47xx/patches-5.15/940-bcm47xx-yenta.patch +++ b/target/linux/bcm47xx/patches-5.15/940-bcm47xx-yenta.patch @@ -1,23 +1,25 @@ --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c -@@ -932,6 +932,8 @@ static unsigned int yenta_probe_irq(stru - * Probe for usable interrupts using the force - * register to generate bogus card status events. - */ -+#ifndef CONFIG_BCM47XX -+ /* WRT54G3G does not like this */ - cb_writel(socket, CB_SOCKET_EVENT, -1); - cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK); - reg = exca_readb(socket, I365_CSCINT); -@@ -947,6 +949,7 @@ static unsigned int yenta_probe_irq(stru - } - cb_writel(socket, CB_SOCKET_MASK, 0); - exca_writeb(socket, I365_CSCINT, reg); -+#endif +@@ -923,6 +923,8 @@ static struct cardbus_type cardbus_type[ + static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mask) + { ++/* WRT54G3G does not like this */ ++#ifndef CONFIG_BCM47XX + int i; + unsigned long val; + u32 mask; +@@ -951,6 +953,9 @@ static unsigned int yenta_probe_irq(stru mask = probe_irq_mask(val) & 0xffff; -@@ -1031,6 +1034,10 @@ static void yenta_get_socket_capabilitie + return mask; ++#else ++ return 0; ++#endif + } + + +@@ -1031,6 +1036,10 @@ static void yenta_get_socket_capabilitie else socket->socket.irq_mask = 0; @@ -28,7 +30,7 @@ dev_info(&socket->dev->dev, "ISA IRQ mask 0x%04x, PCI irq %d\n", socket->socket.irq_mask, socket->cb_irq); } -@@ -1262,6 +1269,15 @@ static int yenta_probe(struct pci_dev *d +@@ -1262,6 +1271,15 @@ static int yenta_probe(struct pci_dev *d dev_info(&dev->dev, "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE)); diff --git a/target/linux/bcm4908/patches-5.15/080-v5.18-0002-pinctrl-bcm-add-driver-for-BCM4908-pinmux.patch b/target/linux/bcm4908/patches-5.15/080-v5.18-0002-pinctrl-bcm-add-driver-for-BCM4908-pinmux.patch index 7e7dccb6f6..3fd847b97e 100644 --- a/target/linux/bcm4908/patches-5.15/080-v5.18-0002-pinctrl-bcm-add-driver-for-BCM4908-pinmux.patch +++ b/target/linux/bcm4908/patches-5.15/080-v5.18-0002-pinctrl-bcm-add-driver-for-BCM4908-pinmux.patch @@ -379,50 +379,50 @@ Signed-off-by: Linus Walleij + +struct bcm4908_pinctrl_function { + const char *name; -+ const char * const *groups; ++ const char **groups; + const unsigned int num_groups; +}; + -+static const char * const led_0_groups[] = { "led_0_grp_a" }; -+static const char * const led_1_groups[] = { "led_1_grp_a" }; -+static const char * const led_2_groups[] = { "led_2_grp_a" }; -+static const char * const led_3_groups[] = { "led_3_grp_a" }; -+static const char * const led_4_groups[] = { "led_4_grp_a" }; -+static const char * const led_5_groups[] = { "led_5_grp_a" }; -+static const char * const led_6_groups[] = { "led_6_grp_a" }; -+static const char * const led_7_groups[] = { "led_7_grp_a" }; -+static const char * const led_8_groups[] = { "led_8_grp_a" }; -+static const char * const led_9_groups[] = { "led_9_grp_a" }; -+static const char * const led_10_groups[] = { "led_10_grp_a", "led_10_grp_b" }; -+static const char * const led_11_groups[] = { "led_11_grp_a", "led_11_grp_b" }; -+static const char * const led_12_groups[] = { "led_12_grp_a", "led_12_grp_b" }; -+static const char * const led_13_groups[] = { "led_13_grp_a", "led_13_grp_b" }; -+static const char * const led_14_groups[] = { "led_14_grp_a" }; -+static const char * const led_15_groups[] = { "led_15_grp_a" }; -+static const char * const led_16_groups[] = { "led_16_grp_a" }; -+static const char * const led_17_groups[] = { "led_17_grp_a" }; -+static const char * const led_18_groups[] = { "led_18_grp_a" }; -+static const char * const led_19_groups[] = { "led_19_grp_a" }; -+static const char * const led_20_groups[] = { "led_20_grp_a" }; -+static const char * const led_21_groups[] = { "led_21_grp_a" }; -+static const char * const led_22_groups[] = { "led_22_grp_a" }; -+static const char * const led_23_groups[] = { "led_23_grp_a" }; -+static const char * const led_24_groups[] = { "led_24_grp_a" }; -+static const char * const led_25_groups[] = { "led_25_grp_a" }; -+static const char * const led_26_groups[] = { "led_26_grp_a" }; -+static const char * const led_27_groups[] = { "led_27_grp_a" }; -+static const char * const led_28_groups[] = { "led_28_grp_a" }; -+static const char * const led_29_groups[] = { "led_29_grp_a" }; -+static const char * const led_30_groups[] = { "led_30_grp_a" }; -+static const char * const led_31_groups[] = { "led_31_grp_a", "led_31_grp_b" }; -+static const char * const hs_uart_groups[] = { "hs_uart_grp" }; -+static const char * const i2c_groups[] = { "i2c_grp_a", "i2c_grp_b" }; -+static const char * const i2s_groups[] = { "i2s_grp" }; -+static const char * const nand_ctrl_groups[] = { "nand_ctrl_grp" }; -+static const char * const nand_data_groups[] = { "nand_data_grp" }; -+static const char * const emmc_ctrl_groups[] = { "emmc_ctrl_grp" }; -+static const char * const usb0_pwr_groups[] = { "usb0_pwr_grp" }; -+static const char * const usb1_pwr_groups[] = { "usb1_pwr_grp" }; ++static const char *led_0_groups[] = { "led_0_grp_a" }; ++static const char *led_1_groups[] = { "led_1_grp_a" }; ++static const char *led_2_groups[] = { "led_2_grp_a" }; ++static const char *led_3_groups[] = { "led_3_grp_a" }; ++static const char *led_4_groups[] = { "led_4_grp_a" }; ++static const char *led_5_groups[] = { "led_5_grp_a" }; ++static const char *led_6_groups[] = { "led_6_grp_a" }; ++static const char *led_7_groups[] = { "led_7_grp_a" }; ++static const char *led_8_groups[] = { "led_8_grp_a" }; ++static const char *led_9_groups[] = { "led_9_grp_a" }; ++static const char *led_10_groups[] = { "led_10_grp_a", "led_10_grp_b" }; ++static const char *led_11_groups[] = { "led_11_grp_a", "led_11_grp_b" }; ++static const char *led_12_groups[] = { "led_12_grp_a", "led_12_grp_b" }; ++static const char *led_13_groups[] = { "led_13_grp_a", "led_13_grp_b" }; ++static const char *led_14_groups[] = { "led_14_grp_a" }; ++static const char *led_15_groups[] = { "led_15_grp_a" }; ++static const char *led_16_groups[] = { "led_16_grp_a" }; ++static const char *led_17_groups[] = { "led_17_grp_a" }; ++static const char *led_18_groups[] = { "led_18_grp_a" }; ++static const char *led_19_groups[] = { "led_19_grp_a" }; ++static const char *led_20_groups[] = { "led_20_grp_a" }; ++static const char *led_21_groups[] = { "led_21_grp_a" }; ++static const char *led_22_groups[] = { "led_22_grp_a" }; ++static const char *led_23_groups[] = { "led_23_grp_a" }; ++static const char *led_24_groups[] = { "led_24_grp_a" }; ++static const char *led_25_groups[] = { "led_25_grp_a" }; ++static const char *led_26_groups[] = { "led_26_grp_a" }; ++static const char *led_27_groups[] = { "led_27_grp_a" }; ++static const char *led_28_groups[] = { "led_28_grp_a" }; ++static const char *led_29_groups[] = { "led_29_grp_a" }; ++static const char *led_30_groups[] = { "led_30_grp_a" }; ++static const char *led_31_groups[] = { "led_31_grp_a", "led_31_grp_b" }; ++static const char *hs_uart_groups[] = { "hs_uart_grp" }; ++static const char *i2c_groups[] = { "i2c_grp_a", "i2c_grp_b" }; ++static const char *i2s_groups[] = { "i2s_grp" }; ++static const char *nand_ctrl_groups[] = { "nand_ctrl_grp" }; ++static const char *nand_data_groups[] = { "nand_data_grp" }; ++static const char *emmc_ctrl_groups[] = { "emmc_ctrl_grp" }; ++static const char *usb0_pwr_groups[] = { "usb0_pwr_grp" }; ++static const char *usb1_pwr_groups[] = { "usb1_pwr_grp" }; + +static const struct bcm4908_pinctrl_function bcm4908_pinctrl_functions[] = { + { "led_0", led_0_groups, ARRAY_SIZE(led_0_groups) }, diff --git a/target/linux/bcm63xx/patches-5.15/111-drivers-mtd-nand-macronix-comment-unused-function.patch b/target/linux/bcm63xx/patches-5.15/111-drivers-mtd-nand-macronix-comment-unused-function.patch new file mode 100644 index 0000000000..38f3b8bc77 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.15/111-drivers-mtd-nand-macronix-comment-unused-function.patch @@ -0,0 +1,154 @@ +From 00cf359b486a3d14c29014e9d57d92ab81972866 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Tue, 9 May 2023 14:03:08 +0200 +Subject: [PATCH] drivers: mtd: nand: macronix: comment unused function + +Comment unused function since macronix_nand_block_protection_support +cause booting problems. + +Signed-off-by: Christian Marangi +--- + drivers/mtd/nand/raw/nand_macronix.c | 132 +++++++++++++-------------- + 1 file changed, 66 insertions(+), 66 deletions(-) + +--- a/drivers/mtd/nand/raw/nand_macronix.c ++++ b/drivers/mtd/nand/raw/nand_macronix.c +@@ -179,72 +179,72 @@ static void macronix_nand_fix_broken_get + ONFI_FEATURE_ADDR_TIMING_MODE, 1); + } + +-/* +- * Macronix NAND supports Block Protection by Protectoin(PT) pin; +- * active high at power-on which protects the entire chip even the #WP is +- * disabled. Lock/unlock protection area can be partition according to +- * protection bits, i.e. upper 1/2 locked, upper 1/4 locked and so on. +- */ +-static int mxic_nand_lock(struct nand_chip *chip, loff_t ofs, uint64_t len) +-{ +- u8 feature[ONFI_SUBFEATURE_PARAM_LEN]; +- int ret; +- +- feature[0] = MXIC_BLOCK_PROTECTION_ALL_LOCK; +- nand_select_target(chip, 0); +- ret = nand_set_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION, +- feature); +- nand_deselect_target(chip); +- if (ret) +- pr_err("%s all blocks failed\n", __func__); +- +- return ret; +-} +- +-static int mxic_nand_unlock(struct nand_chip *chip, loff_t ofs, uint64_t len) +-{ +- u8 feature[ONFI_SUBFEATURE_PARAM_LEN]; +- int ret; +- +- feature[0] = MXIC_BLOCK_PROTECTION_ALL_UNLOCK; +- nand_select_target(chip, 0); +- ret = nand_set_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION, +- feature); +- nand_deselect_target(chip); +- if (ret) +- pr_err("%s all blocks failed\n", __func__); +- +- return ret; +-} +- +-static void macronix_nand_block_protection_support(struct nand_chip *chip) +-{ +- u8 feature[ONFI_SUBFEATURE_PARAM_LEN]; +- int ret; +- +- bitmap_set(chip->parameters.get_feature_list, +- ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1); +- +- feature[0] = MXIC_BLOCK_PROTECTION_ALL_UNLOCK; +- nand_select_target(chip, 0); +- ret = nand_get_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION, +- feature); +- nand_deselect_target(chip); +- if (ret || feature[0] != MXIC_BLOCK_PROTECTION_ALL_LOCK) { +- if (ret) +- pr_err("Block protection check failed\n"); +- +- bitmap_clear(chip->parameters.get_feature_list, +- ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1); +- return; +- } +- +- bitmap_set(chip->parameters.set_feature_list, +- ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1); +- +- chip->ops.lock_area = mxic_nand_lock; +- chip->ops.unlock_area = mxic_nand_unlock; +-} ++// /* ++// * Macronix NAND supports Block Protection by Protectoin(PT) pin; ++// * active high at power-on which protects the entire chip even the #WP is ++// * disabled. Lock/unlock protection area can be partition according to ++// * protection bits, i.e. upper 1/2 locked, upper 1/4 locked and so on. ++// */ ++// static int mxic_nand_lock(struct nand_chip *chip, loff_t ofs, uint64_t len) ++// { ++// u8 feature[ONFI_SUBFEATURE_PARAM_LEN]; ++// int ret; ++ ++// feature[0] = MXIC_BLOCK_PROTECTION_ALL_LOCK; ++// nand_select_target(chip, 0); ++// ret = nand_set_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION, ++// feature); ++// nand_deselect_target(chip); ++// if (ret) ++// pr_err("%s all blocks failed\n", __func__); ++ ++// return ret; ++// } ++ ++// static int mxic_nand_unlock(struct nand_chip *chip, loff_t ofs, uint64_t len) ++// { ++// u8 feature[ONFI_SUBFEATURE_PARAM_LEN]; ++// int ret; ++ ++// feature[0] = MXIC_BLOCK_PROTECTION_ALL_UNLOCK; ++// nand_select_target(chip, 0); ++// ret = nand_set_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION, ++// feature); ++// nand_deselect_target(chip); ++// if (ret) ++// pr_err("%s all blocks failed\n", __func__); ++ ++// return ret; ++// } ++ ++// static void macronix_nand_block_protection_support(struct nand_chip *chip) ++// { ++// u8 feature[ONFI_SUBFEATURE_PARAM_LEN]; ++// int ret; ++ ++// bitmap_set(chip->parameters.get_feature_list, ++// ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1); ++ ++// feature[0] = MXIC_BLOCK_PROTECTION_ALL_UNLOCK; ++// nand_select_target(chip, 0); ++// ret = nand_get_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION, ++// feature); ++// nand_deselect_target(chip); ++// if (ret || feature[0] != MXIC_BLOCK_PROTECTION_ALL_LOCK) { ++// if (ret) ++// pr_err("Block protection check failed\n"); ++ ++// bitmap_clear(chip->parameters.get_feature_list, ++// ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1); ++// return; ++// } ++ ++// bitmap_set(chip->parameters.set_feature_list, ++// ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1); ++ ++// chip->ops.lock_area = mxic_nand_lock; ++// chip->ops.unlock_area = mxic_nand_unlock; ++// } + + static int nand_power_down_op(struct nand_chip *chip) + { diff --git a/target/linux/bmips/patches-5.15/211-drivers-mtd-nand-macronix-comment-unused-function.patch b/target/linux/bmips/patches-5.15/211-drivers-mtd-nand-macronix-comment-unused-function.patch new file mode 100644 index 0000000000..38f3b8bc77 --- /dev/null +++ b/target/linux/bmips/patches-5.15/211-drivers-mtd-nand-macronix-comment-unused-function.patch @@ -0,0 +1,154 @@ +From 00cf359b486a3d14c29014e9d57d92ab81972866 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Tue, 9 May 2023 14:03:08 +0200 +Subject: [PATCH] drivers: mtd: nand: macronix: comment unused function + +Comment unused function since macronix_nand_block_protection_support +cause booting problems. + +Signed-off-by: Christian Marangi +--- + drivers/mtd/nand/raw/nand_macronix.c | 132 +++++++++++++-------------- + 1 file changed, 66 insertions(+), 66 deletions(-) + +--- a/drivers/mtd/nand/raw/nand_macronix.c ++++ b/drivers/mtd/nand/raw/nand_macronix.c +@@ -179,72 +179,72 @@ static void macronix_nand_fix_broken_get + ONFI_FEATURE_ADDR_TIMING_MODE, 1); + } + +-/* +- * Macronix NAND supports Block Protection by Protectoin(PT) pin; +- * active high at power-on which protects the entire chip even the #WP is +- * disabled. Lock/unlock protection area can be partition according to +- * protection bits, i.e. upper 1/2 locked, upper 1/4 locked and so on. +- */ +-static int mxic_nand_lock(struct nand_chip *chip, loff_t ofs, uint64_t len) +-{ +- u8 feature[ONFI_SUBFEATURE_PARAM_LEN]; +- int ret; +- +- feature[0] = MXIC_BLOCK_PROTECTION_ALL_LOCK; +- nand_select_target(chip, 0); +- ret = nand_set_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION, +- feature); +- nand_deselect_target(chip); +- if (ret) +- pr_err("%s all blocks failed\n", __func__); +- +- return ret; +-} +- +-static int mxic_nand_unlock(struct nand_chip *chip, loff_t ofs, uint64_t len) +-{ +- u8 feature[ONFI_SUBFEATURE_PARAM_LEN]; +- int ret; +- +- feature[0] = MXIC_BLOCK_PROTECTION_ALL_UNLOCK; +- nand_select_target(chip, 0); +- ret = nand_set_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION, +- feature); +- nand_deselect_target(chip); +- if (ret) +- pr_err("%s all blocks failed\n", __func__); +- +- return ret; +-} +- +-static void macronix_nand_block_protection_support(struct nand_chip *chip) +-{ +- u8 feature[ONFI_SUBFEATURE_PARAM_LEN]; +- int ret; +- +- bitmap_set(chip->parameters.get_feature_list, +- ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1); +- +- feature[0] = MXIC_BLOCK_PROTECTION_ALL_UNLOCK; +- nand_select_target(chip, 0); +- ret = nand_get_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION, +- feature); +- nand_deselect_target(chip); +- if (ret || feature[0] != MXIC_BLOCK_PROTECTION_ALL_LOCK) { +- if (ret) +- pr_err("Block protection check failed\n"); +- +- bitmap_clear(chip->parameters.get_feature_list, +- ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1); +- return; +- } +- +- bitmap_set(chip->parameters.set_feature_list, +- ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1); +- +- chip->ops.lock_area = mxic_nand_lock; +- chip->ops.unlock_area = mxic_nand_unlock; +-} ++// /* ++// * Macronix NAND supports Block Protection by Protectoin(PT) pin; ++// * active high at power-on which protects the entire chip even the #WP is ++// * disabled. Lock/unlock protection area can be partition according to ++// * protection bits, i.e. upper 1/2 locked, upper 1/4 locked and so on. ++// */ ++// static int mxic_nand_lock(struct nand_chip *chip, loff_t ofs, uint64_t len) ++// { ++// u8 feature[ONFI_SUBFEATURE_PARAM_LEN]; ++// int ret; ++ ++// feature[0] = MXIC_BLOCK_PROTECTION_ALL_LOCK; ++// nand_select_target(chip, 0); ++// ret = nand_set_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION, ++// feature); ++// nand_deselect_target(chip); ++// if (ret) ++// pr_err("%s all blocks failed\n", __func__); ++ ++// return ret; ++// } ++ ++// static int mxic_nand_unlock(struct nand_chip *chip, loff_t ofs, uint64_t len) ++// { ++// u8 feature[ONFI_SUBFEATURE_PARAM_LEN]; ++// int ret; ++ ++// feature[0] = MXIC_BLOCK_PROTECTION_ALL_UNLOCK; ++// nand_select_target(chip, 0); ++// ret = nand_set_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION, ++// feature); ++// nand_deselect_target(chip); ++// if (ret) ++// pr_err("%s all blocks failed\n", __func__); ++ ++// return ret; ++// } ++ ++// static void macronix_nand_block_protection_support(struct nand_chip *chip) ++// { ++// u8 feature[ONFI_SUBFEATURE_PARAM_LEN]; ++// int ret; ++ ++// bitmap_set(chip->parameters.get_feature_list, ++// ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1); ++ ++// feature[0] = MXIC_BLOCK_PROTECTION_ALL_UNLOCK; ++// nand_select_target(chip, 0); ++// ret = nand_get_features(chip, ONFI_FEATURE_ADDR_MXIC_PROTECTION, ++// feature); ++// nand_deselect_target(chip); ++// if (ret || feature[0] != MXIC_BLOCK_PROTECTION_ALL_LOCK) { ++// if (ret) ++// pr_err("Block protection check failed\n"); ++ ++// bitmap_clear(chip->parameters.get_feature_list, ++// ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1); ++// return; ++// } ++ ++// bitmap_set(chip->parameters.set_feature_list, ++// ONFI_FEATURE_ADDR_MXIC_PROTECTION, 1); ++ ++// chip->ops.lock_area = mxic_nand_lock; ++// chip->ops.unlock_area = mxic_nand_unlock; ++// } + + static int nand_power_down_op(struct nand_chip *chip) + { diff --git a/target/linux/generic/backport-5.15/302-v5.16-watchdog-bcm63xx_wdt-fix-fallthrough-warning.patch b/target/linux/generic/backport-5.15/302-v5.16-watchdog-bcm63xx_wdt-fix-fallthrough-warning.patch new file mode 100644 index 0000000000..84ae5a7fc7 --- /dev/null +++ b/target/linux/generic/backport-5.15/302-v5.16-watchdog-bcm63xx_wdt-fix-fallthrough-warning.patch @@ -0,0 +1,33 @@ +From ee1a0696934a8b77a6a2098f92832c46d34ec5da Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Wed, 27 Oct 2021 14:31:35 +0200 +Subject: [PATCH] watchdog: bcm63xx_wdt: fix fallthrough warning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes: +drivers/watchdog/bcm63xx_wdt.c: In function 'bcm63xx_wdt_ioctl': +drivers/watchdog/bcm63xx_wdt.c:208:17: warning: this statement may fall through [-Wimplicit-fallthrough=] + +Signed-off-by: RafaÅ‚ MiÅ‚ecki +Reviewed-by: Florian Fainelli +Reviewed-by: Guenter Roeck +Link: https://lore.kernel.org/r/20211027123135.27458-1-zajec5@gmail.com +Signed-off-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +--- + drivers/watchdog/bcm63xx_wdt.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/watchdog/bcm63xx_wdt.c ++++ b/drivers/watchdog/bcm63xx_wdt.c +@@ -207,6 +207,8 @@ static long bcm63xx_wdt_ioctl(struct fil + + bcm63xx_wdt_pet(); + ++ fallthrough; ++ + case WDIOC_GETTIMEOUT: + return put_user(wdt_time, p); + diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index 4916756e86..4f71a7b7fc 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -7483,7 +7483,7 @@ CONFIG_WATCHDOG_OPEN_TIMEOUT=0 # CONFIG_WD80x3 is not set # CONFIG_WDAT_WDT is not set # CONFIG_WDTPCI is not set -# CONFIG_WERROR is not set +CONFIG_WERROR=y # CONFIG_WEXT_CORE is not set # CONFIG_WEXT_PRIV is not set # CONFIG_WEXT_PROC is not set diff --git a/target/linux/generic/files/drivers/net/phy/psb6970.c b/target/linux/generic/files/drivers/net/phy/psb6970.c index fb6ed0e204..af64704b16 100644 --- a/target/linux/generic/files/drivers/net/phy/psb6970.c +++ b/target/linux/generic/files/drivers/net/phy/psb6970.c @@ -307,7 +307,6 @@ static const struct switch_dev_ops psb6970_ops = { static int psb6970_config_init(struct phy_device *pdev) { struct psb6970_priv *priv; - struct net_device *dev = pdev->attached_dev; struct switch_dev *swdev; int ret; diff --git a/target/linux/generic/hack-5.15/766-net-phy-mediatek-ge-add-LED-configuration-interface.patch b/target/linux/generic/hack-5.15/766-net-phy-mediatek-ge-add-LED-configuration-interface.patch new file mode 100644 index 0000000000..a69ec97ca3 --- /dev/null +++ b/target/linux/generic/hack-5.15/766-net-phy-mediatek-ge-add-LED-configuration-interface.patch @@ -0,0 +1,66 @@ +From cc225d163b5a4f7a0d1968298bf7927306646a47 Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Fri, 28 Apr 2023 01:53:01 +0200 +Subject: [PATCH] net: phy: mediatek-ge: add LED configuration interface + +This adds a small hack similar to the one used for ar8xxx switches to +read a reg:value map for configuring the LED configuration registers. + +This allows OpenWrt to write device-specific LED action as well as blink +configurations. It is unlikely to be accepted upstream, as upstream +plans on integrating their own framework for handling these LEDs. + +Signed-off-by: David Bauer +--- + drivers/net/phy/mediatek-ge.c | 33 +++++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + +--- a/drivers/net/phy/mediatek-ge.c ++++ b/drivers/net/phy/mediatek-ge.c +@@ -53,6 +53,36 @@ static int mt7530_phy_config_init(struct + return 0; + } + ++static int mt7530_led_config_of(struct phy_device *phydev) ++{ ++ struct device_node *np = phydev->mdio.dev.of_node; ++ const __be32 *paddr; ++ int len; ++ int i; ++ ++ paddr = of_get_property(np, "mediatek,led-config", &len); ++ if (!paddr) ++ return 0; ++ ++ if (len < (2 * sizeof(*paddr))) ++ return -EINVAL; ++ ++ len /= sizeof(*paddr); ++ ++ phydev_warn(phydev, "Configure LED registers (num=%d)\n", len); ++ for (i = 0; i < len - 1; i += 2) { ++ u32 reg; ++ u32 val; ++ ++ reg = be32_to_cpup(paddr + i); ++ val = be32_to_cpup(paddr + i + 1); ++ ++ phy_write_mmd(phydev, MDIO_MMD_VEND2, reg, val); ++ } ++ ++ return 0; ++} ++ + static int mt7531_phy_config_init(struct phy_device *phydev) + { + mtk_gephy_config_init(phydev); +@@ -65,6 +95,9 @@ static int mt7531_phy_config_init(struct + phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x13, 0x404); + phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x14, 0x404); + ++ /* LED Config*/ ++ mt7530_led_config_of(phydev); ++ + return 0; + } + diff --git a/target/linux/generic/pending-5.15/130-binfmt_elf-dynamically-allocate-note.data-in-parse_e.patch b/target/linux/generic/pending-5.15/130-binfmt_elf-dynamically-allocate-note.data-in-parse_e.patch new file mode 100644 index 0000000000..f04007e982 --- /dev/null +++ b/target/linux/generic/pending-5.15/130-binfmt_elf-dynamically-allocate-note.data-in-parse_e.patch @@ -0,0 +1,94 @@ +From ca71e00839fcdd26f122fb6d9e97903c9fe198f7 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sat, 6 May 2023 08:08:35 +0200 +Subject: [PATCH] binfmt_elf: dynamically allocate note.data in + parse_elf_properties + +Dynamically allocate note.data in parse_elf_properties to fix +compilation warning on some arch. + +On some arch note.data exceet the stack limit for a single function and +this cause the following compilation warning: +fs/binfmt_elf.c: In function 'parse_elf_properties.isra': +fs/binfmt_elf.c:821:1: error: the frame size of 1040 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] + 821 | } + | ^ +cc1: all warnings being treated as errors + +Fix this by dynamically allocating the array. + +Fixes: 00e19ceec80b ("ELF: Add ELF program property parsing support") +Signed-off-by: Christian Marangi +Cc: stable@vger.kernel.org # v5.8+ +--- + fs/binfmt_elf.c | 32 +++++++++++++++++++++++--------- + 1 file changed, 23 insertions(+), 9 deletions(-) + +--- a/fs/binfmt_elf.c ++++ b/fs/binfmt_elf.c +@@ -768,7 +768,7 @@ static int parse_elf_properties(struct f + { + union { + struct elf_note nhdr; +- char data[NOTE_DATA_SZ]; ++ char *data; + } note; + loff_t pos; + ssize_t n; +@@ -788,26 +788,38 @@ static int parse_elf_properties(struct f + if (phdr->p_filesz > sizeof(note)) + return -ENOEXEC; + ++ note.data = kcalloc(NOTE_DATA_SZ, sizeof(*note.data), GFP_KERNEL); ++ if (!note.data) ++ return -ENOMEM; ++ + pos = phdr->p_offset; + n = kernel_read(f, ¬e, phdr->p_filesz, &pos); + + BUILD_BUG_ON(sizeof(note) < sizeof(note.nhdr) + NOTE_NAME_SZ); +- if (n < 0 || n < sizeof(note.nhdr) + NOTE_NAME_SZ) +- return -EIO; ++ if (n < 0 || n < sizeof(note.nhdr) + NOTE_NAME_SZ) { ++ ret = -EIO; ++ goto exit; ++ } + + if (note.nhdr.n_type != NT_GNU_PROPERTY_TYPE_0 || + note.nhdr.n_namesz != NOTE_NAME_SZ || + strncmp(note.data + sizeof(note.nhdr), +- GNU_PROPERTY_TYPE_0_NAME, n - sizeof(note.nhdr))) +- return -ENOEXEC; ++ GNU_PROPERTY_TYPE_0_NAME, n - sizeof(note.nhdr))) { ++ ret = -ENOEXEC; ++ goto exit; ++ } + + off = round_up(sizeof(note.nhdr) + NOTE_NAME_SZ, + ELF_GNU_PROPERTY_ALIGN); +- if (off > n) +- return -ENOEXEC; +- +- if (note.nhdr.n_descsz > n - off) +- return -ENOEXEC; ++ if (off > n) { ++ ret = -ENOEXEC; ++ goto exit; ++ } ++ ++ if (note.nhdr.n_descsz > n - off) { ++ ret = -ENOEXEC; ++ goto exit; ++ } + datasz = off + note.nhdr.n_descsz; + + have_prev_type = false; +@@ -817,6 +829,8 @@ static int parse_elf_properties(struct f + have_prev_type = true; + } while (!ret); + ++exit: ++ kfree(note.data); + return ret == -ENOENT ? 0 : ret; + } + diff --git a/target/linux/generic/pending-5.15/143-jffs2-reduce-stack-usage-in-jffs2_build_xattr_subsys.patch b/target/linux/generic/pending-5.15/143-jffs2-reduce-stack-usage-in-jffs2_build_xattr_subsys.patch new file mode 100644 index 0000000000..e5a86dd29f --- /dev/null +++ b/target/linux/generic/pending-5.15/143-jffs2-reduce-stack-usage-in-jffs2_build_xattr_subsys.patch @@ -0,0 +1,121 @@ +From eee53f6eb7561f516b9c4bac829ce31c48096130 Mon Sep 17 00:00:00 2001 +From: Fabian Frederick +Date: Tue, 9 May 2017 22:30:03 +0200 +Subject: [PATCH] jffs2: reduce stack usage in jffs2_build_xattr_subsystem() + +Use kcalloc() for allocation/flush of 128 pointers table to +reduce stack usage. + +Function now returns -ENOMEM or 0 on success. + +stackusage +Before: +./fs/jffs2/xattr.c:775 jffs2_build_xattr_subsystem 1208 +dynamic,bounded + +After: +./fs/jffs2/xattr.c:775 jffs2_build_xattr_subsystem 192 +dynamic,bounded + +Also update definition when CONFIG_JFFS2_FS_XATTR is not enabled + +Tested with an MTD mount point and some user set/getfattr. + +Many current target on OpenWRT also suffer from a compilation warning +(that become an error with CONFIG_WERROR) with the following output: + +fs/jffs2/xattr.c: In function 'jffs2_build_xattr_subsystem': +fs/jffs2/xattr.c:887:1: error: the frame size of 1088 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] + 887 | } + | ^ + +Using dynamic allocation fix this compilation warning. + +Fixes: c9f700f840bd ("[JFFS2][XATTR] using 'delete marker' for xdatum/xref deletion") +Reported-by: Tim Gardner +Reported-by: kernel test robot +Reported-by: Ron Economos +Reported-by: Nathan Chancellor +Reviewed-by: Nick Desaulniers +Signed-off-by: Fabian Frederick +Signed-off-by: Christian Marangi +Cc: stable@vger.kernel.org +--- + fs/jffs2/build.c | 5 ++++- + fs/jffs2/xattr.c | 13 +++++++++---- + fs/jffs2/xattr.h | 4 ++-- + 3 files changed, 15 insertions(+), 7 deletions(-) + +--- a/fs/jffs2/build.c ++++ b/fs/jffs2/build.c +@@ -211,7 +211,10 @@ static int jffs2_build_filesystem(struct + ic->scan_dents = NULL; + cond_resched(); + } +- jffs2_build_xattr_subsystem(c); ++ ret = jffs2_build_xattr_subsystem(c); ++ if (ret) ++ goto exit; ++ + c->flags &= ~JFFS2_SB_FLAG_BUILDING; + + dbg_fsbuild("FS build complete\n"); +--- a/fs/jffs2/xattr.c ++++ b/fs/jffs2/xattr.c +@@ -772,10 +772,10 @@ void jffs2_clear_xattr_subsystem(struct + } + + #define XREF_TMPHASH_SIZE (128) +-void jffs2_build_xattr_subsystem(struct jffs2_sb_info *c) ++int jffs2_build_xattr_subsystem(struct jffs2_sb_info *c) + { + struct jffs2_xattr_ref *ref, *_ref; +- struct jffs2_xattr_ref *xref_tmphash[XREF_TMPHASH_SIZE]; ++ struct jffs2_xattr_ref **xref_tmphash; + struct jffs2_xattr_datum *xd, *_xd; + struct jffs2_inode_cache *ic; + struct jffs2_raw_node_ref *raw; +@@ -784,9 +784,12 @@ void jffs2_build_xattr_subsystem(struct + + BUG_ON(!(c->flags & JFFS2_SB_FLAG_BUILDING)); + ++ xref_tmphash = kcalloc(XREF_TMPHASH_SIZE, ++ sizeof(struct jffs2_xattr_ref *), GFP_KERNEL); ++ if (!xref_tmphash) ++ return -ENOMEM; ++ + /* Phase.1 : Merge same xref */ +- for (i=0; i < XREF_TMPHASH_SIZE; i++) +- xref_tmphash[i] = NULL; + for (ref=c->xref_temp; ref; ref=_ref) { + struct jffs2_xattr_ref *tmp; + +@@ -884,6 +887,8 @@ void jffs2_build_xattr_subsystem(struct + "%u of xref (%u dead, %u orphan) found.\n", + xdatum_count, xdatum_unchecked_count, xdatum_orphan_count, + xref_count, xref_dead_count, xref_orphan_count); ++ kfree(xref_tmphash); ++ return 0; + } + + struct jffs2_xattr_datum *jffs2_setup_xattr_datum(struct jffs2_sb_info *c, +--- a/fs/jffs2/xattr.h ++++ b/fs/jffs2/xattr.h +@@ -71,7 +71,7 @@ static inline int is_xattr_ref_dead(stru + #ifdef CONFIG_JFFS2_FS_XATTR + + extern void jffs2_init_xattr_subsystem(struct jffs2_sb_info *c); +-extern void jffs2_build_xattr_subsystem(struct jffs2_sb_info *c); ++extern int jffs2_build_xattr_subsystem(struct jffs2_sb_info *c); + extern void jffs2_clear_xattr_subsystem(struct jffs2_sb_info *c); + + extern struct jffs2_xattr_datum *jffs2_setup_xattr_datum(struct jffs2_sb_info *c, +@@ -103,7 +103,7 @@ extern ssize_t jffs2_listxattr(struct de + #else + + #define jffs2_init_xattr_subsystem(c) +-#define jffs2_build_xattr_subsystem(c) ++#define jffs2_build_xattr_subsystem(c) (0) + #define jffs2_clear_xattr_subsystem(c) + + #define jffs2_xattr_do_crccheck_inode(c, ic) diff --git a/target/linux/generic/pending-5.15/795-mt7530-register-OF-node-for-internal-MDIO-bus.patch b/target/linux/generic/pending-5.15/795-mt7530-register-OF-node-for-internal-MDIO-bus.patch new file mode 100644 index 0000000000..f9b88db995 --- /dev/null +++ b/target/linux/generic/pending-5.15/795-mt7530-register-OF-node-for-internal-MDIO-bus.patch @@ -0,0 +1,43 @@ +From 1d81e51d6d79d9098013b2e8cdd677bae998c5d8 Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Fri, 28 Apr 2023 02:22:59 +0200 +Subject: [PATCH 1/2] mt7530: register OF node for internal MDIO bus + +The MT753x switches provide a switch-internal MDIO bus for the embedded +PHYs. + +Register a OF sub-node on the switch OF-node for this internal MDIO bus. +This allows to configure the embedded PHYs using device-tree. + +Signed-off-by: David Bauer +--- + drivers/net/dsa/mt7530.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/net/dsa/mt7530.c ++++ b/drivers/net/dsa/mt7530.c +@@ -2081,10 +2081,13 @@ mt7530_setup_mdio(struct mt7530_priv *pr + { + struct dsa_switch *ds = priv->ds; + struct device *dev = priv->dev; ++ struct device_node *np, *mnp; + struct mii_bus *bus; + static int idx; + int ret; + ++ np = priv->dev->of_node; ++ + bus = devm_mdiobus_alloc(dev); + if (!bus) + return -ENOMEM; +@@ -2101,7 +2104,9 @@ mt7530_setup_mdio(struct mt7530_priv *pr + if (priv->irq) + mt7530_setup_mdio_irq(priv); + +- ret = devm_mdiobus_register(dev, bus); ++ mnp = of_get_child_by_name(np, "mdio"); ++ ret = devm_of_mdiobus_register(dev, bus, mnp); ++ of_node_put(mnp); + if (ret) { + dev_err(dev, "failed to register MDIO bus: %d\n", ret); + if (priv->irq) diff --git a/target/linux/ipq40xx/patches-5.15/401-mmc-sdhci-msm-comment-unused-sdhci_msm_set_clock.patch b/target/linux/ipq40xx/patches-5.15/401-mmc-sdhci-msm-comment-unused-sdhci_msm_set_clock.patch new file mode 100644 index 0000000000..b297600171 --- /dev/null +++ b/target/linux/ipq40xx/patches-5.15/401-mmc-sdhci-msm-comment-unused-sdhci_msm_set_clock.patch @@ -0,0 +1,108 @@ +From 28edd829133766eb3cefaf2e49d3ee701968061b Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Tue, 9 May 2023 01:57:17 +0200 +Subject: [PATCH] mmc: sdhci-msm: comment unused sdhci_msm_set_clock + +comment unused sdhci_msm_set_clock and __sdhci_msm_set_clock as due to some +current problem, we are forced to use sdhci_set_clock. + +Signed-off-by: Christian Marangi +--- + drivers/mmc/host/sdhci-msm.c | 86 ++++++++++++++++++------------------ + 1 file changed, 43 insertions(+), 43 deletions(-) + +--- a/drivers/mmc/host/sdhci-msm.c ++++ b/drivers/mmc/host/sdhci-msm.c +@@ -1751,49 +1751,49 @@ static unsigned int sdhci_msm_get_min_cl + return SDHCI_MSM_MIN_CLOCK; + } + +-/* +- * __sdhci_msm_set_clock - sdhci_msm clock control. +- * +- * Description: +- * MSM controller does not use internal divider and +- * instead directly control the GCC clock as per +- * HW recommendation. +- **/ +-static void __sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock) +-{ +- u16 clk; +- +- sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL); +- +- if (clock == 0) +- return; +- +- /* +- * MSM controller do not use clock divider. +- * Thus read SDHCI_CLOCK_CONTROL and only enable +- * clock with no divider value programmed. +- */ +- clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL); +- sdhci_enable_clk(host, clk); +-} +- +-/* sdhci_msm_set_clock - Called with (host->lock) spinlock held. */ +-static void sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock) +-{ +- struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); +- struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); +- +- if (!clock) { +- host->mmc->actual_clock = msm_host->clk_rate = 0; +- goto out; +- } +- +- sdhci_msm_hc_select_mode(host); +- +- msm_set_clock_rate_for_bus_mode(host, clock); +-out: +- __sdhci_msm_set_clock(host, clock); +-} ++// /* ++// * __sdhci_msm_set_clock - sdhci_msm clock control. ++// * ++// * Description: ++// * MSM controller does not use internal divider and ++// * instead directly control the GCC clock as per ++// * HW recommendation. ++// **/ ++// static void __sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock) ++// { ++// u16 clk; ++ ++// sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL); ++ ++// if (clock == 0) ++// return; ++ ++// /* ++// * MSM controller do not use clock divider. ++// * Thus read SDHCI_CLOCK_CONTROL and only enable ++// * clock with no divider value programmed. ++// */ ++// clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL); ++// sdhci_enable_clk(host, clk); ++// } ++ ++// /* sdhci_msm_set_clock - Called with (host->lock) spinlock held. */ ++// static void sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock) ++// { ++// struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); ++// struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); ++ ++// if (!clock) { ++// host->mmc->actual_clock = msm_host->clk_rate = 0; ++// goto out; ++// } ++ ++// sdhci_msm_hc_select_mode(host); ++ ++// msm_set_clock_rate_for_bus_mode(host, clock); ++// out: ++// __sdhci_msm_set_clock(host, clock); ++// } + + /*****************************************************************************\ + * * diff --git a/target/linux/ipq40xx/patches-5.15/704-net-phy-define-PSGMII-PHY-interface-mode.patch b/target/linux/ipq40xx/patches-5.15/704-net-phy-define-PSGMII-PHY-interface-mode.patch index 36d3e2738f..faac6fa145 100644 --- a/target/linux/ipq40xx/patches-5.15/704-net-phy-define-PSGMII-PHY-interface-mode.patch +++ b/target/linux/ipq40xx/patches-5.15/704-net-phy-define-PSGMII-PHY-interface-mode.patch @@ -1,4 +1,4 @@ -From 3e1825e00dafb68eec25df389b63f3ab3d905b59 Mon Sep 17 00:00:00 2001 +From 157ac9f52fd9b9a22cf12f7755a905fb34ef72f7 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Fri, 25 Dec 2020 08:02:47 +0100 Subject: [PATCH] net: phy: define PSGMII PHY interface mode @@ -16,9 +16,9 @@ of connection between the MAC and PHY. Signed-off-by: Gabor Juhos --- Documentation/devicetree/bindings/net/ethernet-controller.yaml | 1 + - drivers/net/phy/phylink.c | 1 + + drivers/net/phy/phylink.c | 2 ++ include/linux/phy.h | 3 +++ - 3 files changed, 5 insertions(+) + 3 files changed, 6 insertions(+) --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml @@ -32,7 +32,15 @@ Signed-off-by: Gabor Juhos - rev-mii --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c -@@ -629,6 +629,7 @@ static int phylink_parse_mode(struct phy +@@ -366,6 +366,7 @@ void phylink_get_linkmodes(unsigned long + case PHY_INTERFACE_MODE_RGMII_RXID: + case PHY_INTERFACE_MODE_RGMII_ID: + case PHY_INTERFACE_MODE_RGMII: ++ case PHY_INTERFACE_MODE_PSGMII: + case PHY_INTERFACE_MODE_QSGMII: + case PHY_INTERFACE_MODE_SGMII: + case PHY_INTERFACE_MODE_GMII: +@@ -629,6 +630,7 @@ static int phylink_parse_mode(struct phy switch (pl->link_config.interface) { case PHY_INTERFACE_MODE_SGMII: diff --git a/target/linux/ipq806x/patches-5.15/0065-arm-override-compiler-flags.patch b/target/linux/ipq806x/patches-5.15/0065-arm-override-compiler-flags.patch deleted file mode 100644 index a1a0371fbc..0000000000 --- a/target/linux/ipq806x/patches-5.15/0065-arm-override-compiler-flags.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 4d8e29642661397a339ac3485f212c6360445421 Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Thu, 9 Mar 2017 09:33:32 +0100 -Subject: [PATCH 65/69] arm: override compiler flags - -Signed-off-by: John Crispin ---- - arch/arm/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm/Makefile -+++ b/arch/arm/Makefile -@@ -61,7 +61,7 @@ KBUILD_CFLAGS += $(call cc-option,-fno-i - # macro, but instead defines a whole series of macros which makes - # testing for a specific architecture or later rather impossible. - arch-$(CONFIG_CPU_32v7M) =-D__LINUX_ARM_ARCH__=7 -march=armv7-m --arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 -march=armv7-a -+arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 -mcpu=cortex-a15 - arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 -march=armv6 - # Only override the compiler option if ARMv6. The ARMv6K extensions are - # always available in ARMv7 diff --git a/target/linux/ipq806x/patches-5.15/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-5.15/0067-generic-Mangle-bootloader-s-kernel-arguments.patch index 4758c25bbf..df5d4811a8 100644 --- a/target/linux/ipq806x/patches-5.15/0067-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/ipq806x/patches-5.15/0067-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -51,10 +51,52 @@ Signed-off-by: Adrian Panella #else #define do_extend_cmdline 0 #endif -@@ -69,6 +71,80 @@ static uint32_t get_cell_size(const void - return cell_size; +@@ -20,6 +22,7 @@ static int node_offset(void *fdt, const + return offset; } ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + static int setprop(void *fdt, const char *node_path, const char *property, + void *val_array, int size) + { +@@ -28,6 +31,7 @@ static int setprop(void *fdt, const char + return offset; + return fdt_setprop(fdt, offset, property, val_array, size); + } ++#endif + + static int setprop_string(void *fdt, const char *node_path, + const char *property, const char *string) +@@ -38,6 +42,7 @@ static int setprop_string(void *fdt, con + return fdt_setprop_string(fdt, offset, property, string); + } + ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + static int setprop_cell(void *fdt, const char *node_path, + const char *property, uint32_t val) + { +@@ -46,6 +51,7 @@ static int setprop_cell(void *fdt, const + return offset; + return fdt_setprop_cell(fdt, offset, property, val); + } ++#endif + + static const void *getprop(const void *fdt, const char *node_path, + const char *property, int *len) +@@ -58,6 +64,7 @@ static const void *getprop(const void *f + return fdt_getprop(fdt, offset, property, len); + } + ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + static uint32_t get_cell_size(const void *fdt) + { + int len; +@@ -68,6 +75,81 @@ static uint32_t get_cell_size(const void + cell_size = fdt32_to_cpu(*size_len); + return cell_size; + } ++#endif ++ +#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) +/** + * taken from arch/x86/boot/string.c @@ -82,13 +124,13 @@ Signed-off-by: Adrian Panella +static char *append_rootblock(char *dest, const char *str, int len, void *fdt) +{ + char *ptr, *end, *tmp; -+ char *root="root="; -+ char *find_rootblock; ++ const char *root="root="; ++ const char *find_rootblock; + int i, l; + const char *rootblock; + + find_rootblock = getprop(fdt, "/chosen", "find-rootblock", &l); -+ if(!find_rootblock) ++ if (!find_rootblock) + find_rootblock = root; + + //ARM doesn't have __HAVE_ARCH_STRSTR, so it was copied from x86 @@ -128,11 +170,10 @@ Signed-off-by: Adrian Panella + return dest; +} +#endif -+ + static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline) { - char cmdline[COMMAND_LINE_SIZE]; -@@ -88,12 +164,21 @@ static void merge_fdt_bootargs(void *fdt +@@ -88,18 +170,28 @@ static void merge_fdt_bootargs(void *fdt /* and append the ATAG_CMDLINE */ if (fdt_cmdline) { @@ -154,7 +195,36 @@ Signed-off-by: Adrian Panella } *ptr = '\0'; -@@ -168,7 +253,9 @@ int atags_to_fdt(void *atag_list, void * + setprop_string(fdt, "/chosen", "bootargs", cmdline); + } + ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + static void hex_str(char *out, uint32_t value) + { + uint32_t digit; +@@ -117,6 +209,7 @@ static void hex_str(char *out, uint32_t + } + *out = '\0'; + } ++#endif + + /* + * Convert and fold provided ATAGs into the provided FDT. +@@ -131,9 +224,11 @@ int atags_to_fdt(void *atag_list, void * + struct tag *atag = atag_list; + /* In the case of 64 bits memory size, need to reserve 2 cells for + * address and size for each bank */ ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + __be32 mem_reg_property[2 * 2 * NR_BANKS]; +- int memcount = 0; +- int ret, memsize; ++ int memsize, memcount = 0; ++#endif ++ int ret; + + /* make sure we've got an aligned pointer */ + if ((u32)atag_list & 0x3) +@@ -168,7 +263,9 @@ int atags_to_fdt(void *atag_list, void * else setprop_string(fdt, "/chosen", "bootargs", atag->u.cmdline.cmdline); @@ -165,7 +235,7 @@ Signed-off-by: Adrian Panella if (memcount >= sizeof(mem_reg_property)/4) continue; if (!atag->u.mem.size) -@@ -212,6 +299,10 @@ int atags_to_fdt(void *atag_list, void * +@@ -212,6 +309,10 @@ int atags_to_fdt(void *atag_list, void * setprop(fdt, "/memory", "reg", mem_reg_property, 4 * memcount * memsize); } diff --git a/target/linux/lantiq/image/lzma-loader/src/printf.c b/target/linux/lantiq/image/lzma-loader/src/printf.c index 7bb5a86e18..31b5e19ab1 100644 --- a/target/linux/lantiq/image/lzma-loader/src/printf.c +++ b/target/linux/lantiq/image/lzma-loader/src/printf.c @@ -11,7 +11,7 @@ #include "printf.h" -extern void board_putc(int ch); +extern void board_putc(char ch); /* this is the maximum width for a variable */ #define LP_MAX_BUF 256 diff --git a/target/linux/lantiq/patches-5.15/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch b/target/linux/lantiq/patches-5.15/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch index c80045e878..f7fbfdf9e4 100644 --- a/target/linux/lantiq/patches-5.15/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch +++ b/target/linux/lantiq/patches-5.15/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch @@ -210,7 +210,7 @@ Signed-off-by: John Crispin - memcpy(&mac, &priv->pldata->mac, sizeof(struct sockaddr)); + memcpy(&mac.sa_data, ltq_get_eth_mac(), ETH_ALEN); + -+ if (priv->mac && !is_valid_ether_addr(mac.sa_data)) ++ if (!is_valid_ether_addr(mac.sa_data)) + memcpy(&mac.sa_data, priv->mac, ETH_ALEN); + if (!is_valid_ether_addr(mac.sa_data)) { diff --git a/target/linux/lantiq/patches-5.15/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch b/target/linux/lantiq/patches-5.15/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch new file mode 100644 index 0000000000..741011039e --- /dev/null +++ b/target/linux/lantiq/patches-5.15/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch @@ -0,0 +1,62 @@ +From 118fe2c88b35482711adeee0d8758bddfe958701 Mon Sep 17 00:00:00 2001 +From: Aleksander Jan Bajkowski +Date: Sat, 6 May 2023 14:32:00 +0200 +Subject: [PATCH] mtd: cfi_cmdset_0001: Disable write buffer functions if + FORCE_WORD_WRITE is 1 + +Some write buffer functions are not used when FORCE_WORD_WRITE is set to 1. +So the compile warning messages are output if FORCE_WORD_WRITE is 1. To +resolve this disable the write buffer functions if FORCE_WORD_WRITE is 1. + +This is similar fix to: 557c759036fc3976a5358cef23e65a263853b93f. + +Signed-off-by: Aleksander Jan Bajkowski +--- + drivers/mtd/chips/cfi_cmdset_0001.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/mtd/chips/cfi_cmdset_0001.c ++++ b/drivers/mtd/chips/cfi_cmdset_0001.c +@@ -61,8 +61,10 @@ + + static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); + static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); ++#if !FORCE_WORD_WRITE + static int cfi_intelext_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); + static int cfi_intelext_writev(struct mtd_info *, const struct kvec *, unsigned long, loff_t, size_t *); ++#endif + static int cfi_intelext_erase_varsize(struct mtd_info *, struct erase_info *); + static void cfi_intelext_sync (struct mtd_info *); + static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len); +@@ -304,6 +306,7 @@ static void fixup_use_point(struct mtd_i + } + } + ++#if !FORCE_WORD_WRITE + static void fixup_use_write_buffers(struct mtd_info *mtd) + { + struct map_info *map = mtd->priv; +@@ -314,6 +317,7 @@ static void fixup_use_write_buffers(stru + mtd->_writev = cfi_intelext_writev; + } + } ++#endif /* !FORCE_WORD_WRITE */ + + /* + * Some chips power-up with all sectors locked by default. +@@ -1703,6 +1707,7 @@ static int cfi_intelext_write_words (str + } + + ++#if !FORCE_WORD_WRITE + static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, + unsigned long adr, const struct kvec **pvec, + unsigned long *pvec_seek, int len) +@@ -1931,6 +1936,7 @@ static int cfi_intelext_write_buffers (s + + return cfi_intelext_writev(mtd, &vec, 1, to, retlen); + } ++#endif /* !FORCE_WORD_WRITE */ + + static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, + unsigned long adr, int len, void *thunk) diff --git a/target/linux/layerscape/patches-5.15/701-staging-add-fsl_ppfe-driver.patch b/target/linux/layerscape/patches-5.15/701-staging-add-fsl_ppfe-driver.patch index 00c8e869be..9e60226083 100644 --- a/target/linux/layerscape/patches-5.15/701-staging-add-fsl_ppfe-driver.patch +++ b/target/linux/layerscape/patches-5.15/701-staging-add-fsl_ppfe-driver.patch @@ -2507,7 +2507,7 @@ Signed-off-by: Pawel Dembicki +{ + int ret = 0; + -+ pr_info("PFE CDEV attempt copying (%lu) size of user.\n", ++ pr_info("PFE CDEV attempt copying (%zu) size of user.\n", + sizeof(link_states)); + + pr_debug("Dump link_state on screen before copy_to_user\n"); @@ -2520,14 +2520,14 @@ Signed-off-by: Pawel Dembicki + /* Copy to user the value in buffer sized len */ + ret = copy_to_user(buf, &link_states, sizeof(link_states)); + if (ret != 0) { -+ pr_err("Failed to send (%d)bytes of (%lu) requested.\n", ++ pr_err("Failed to send (%d)bytes of (%zu) requested.\n", + ret, len); + return -EFAULT; + } + + /* offset set back to 0 as there is contextual reading offset */ + *off = 0; -+ pr_debug("Read of (%lu) bytes performed.\n", sizeof(link_states)); ++ pr_debug("Read of (%zu) bytes performed.\n", sizeof(link_states)); + + return sizeof(link_states); +} @@ -6422,7 +6422,7 @@ Signed-off-by: Pawel Dembicki +#endif /* _PFE_FIRMWARE_H_ */ --- /dev/null +++ b/drivers/staging/fsl_ppfe/pfe_hal.c -@@ -0,0 +1,1517 @@ +@@ -0,0 +1,1516 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2015-2016 Freescale Semiconductor, Inc. @@ -7030,7 +7030,6 @@ Signed-off-by: Pawel Dembicki + util_pmem_memcpy(DDR_PHYS_TO_VIRT( + DDR_PFE_TO_PHYS(addr)), + data + offset, size); -+ } +#endif + } else { + pr_err( @@ -8060,11 +8059,11 @@ Signed-off-by: Pawel Dembicki + 0x33221100, 0xa8c05544, 0x00000301, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xbe86c51f }; + -+ ddr_ptr = (void *)((u64)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL)); ++ ddr_ptr = (void *)((uintptr_t)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL)); + if (!ddr_ptr) + return; + -+ lmem_ptr = (void *)((u64)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL)); ++ lmem_ptr = (void *)((uintptr_t)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL)); + if (!lmem_ptr) + return; + @@ -8131,16 +8130,16 @@ Signed-off-by: Pawel Dembicki +void pfe_hif_desc_dump(struct pfe_hif *hif) +{ + struct hif_desc *desc; -+ unsigned long desc_p; ++ u64 desc_p; + int ii = 0; + + pr_info("%s\n", __func__); + + desc = hif->rx_base; -+ desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v + ++ desc_p = ((void *)desc - hif->descr_baseaddr_v + + hif->descr_baseaddr_p); + -+ pr_info("HIF Rx desc base %p physical %x\n", desc, (u32)desc_p); ++ pr_info("HIF Rx desc base %p physical %llx\n", desc, desc_p); + for (ii = 0; ii < hif->rx_ring_size; ii++) { + pr_info("status: %08x, ctrl: %08x, data: %08x, next: %x\n", + readl(&desc->status), readl(&desc->ctrl), @@ -8149,10 +8148,10 @@ Signed-off-by: Pawel Dembicki + } + + desc = hif->tx_base; -+ desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v + ++ desc_p = ((void *)desc - hif->descr_baseaddr_v + + hif->descr_baseaddr_p); + -+ pr_info("HIF Tx desc base %p physical %x\n", desc, (u32)desc_p); ++ pr_info("HIF Tx desc base %p physical %llx\n", desc, desc_p); + for (ii = 0; ii < hif->tx_ring_size; ii++) { + pr_info("status: %08x, ctrl: %08x, data: %08x, next: %x\n", + readl(&desc->status), readl(&desc->ctrl), @@ -11479,7 +11478,7 @@ Signed-off-by: Pawel Dembicki +static ssize_t pfe_set_util(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +{ -+ util_do_clear = kstrtoul(buf, NULL, 0); ++ util_do_clear = kstrtoul(buf, 0, 0); + return count; +} + diff --git a/target/linux/layerscape/patches-5.15/702-phy-Add-2.5G-SGMII-interface-mode.patch b/target/linux/layerscape/patches-5.15/702-phy-Add-2.5G-SGMII-interface-mode.patch index 35c11d3ef8..4a78bfe955 100644 --- a/target/linux/layerscape/patches-5.15/702-phy-Add-2.5G-SGMII-interface-mode.patch +++ b/target/linux/layerscape/patches-5.15/702-phy-Add-2.5G-SGMII-interface-mode.patch @@ -11,6 +11,27 @@ Signed-off-by: Bhaskar Upadhaya include/linux/phy.h | 3 +++ 1 file changed, 3 insertions(+) +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -393,6 +393,7 @@ void phylink_get_linkmodes(unsigned long + caps |= MAC_1000FD; + break; + ++ case PHY_INTERFACE_MODE_2500SGMII: + case PHY_INTERFACE_MODE_2500BASEX: + caps |= MAC_2500FD; + break; +@@ -646,6 +647,10 @@ static int phylink_parse_mode(struct phy + phylink_set(pl->supported, 2500baseX_Full); + break; + ++ case PHY_INTERFACE_MODE_2500SGMII: ++ phylink_set(pl->supported, 2500baseT_Full); ++ break; ++ + case PHY_INTERFACE_MODE_5GBASER: + phylink_set(pl->supported, 5000baseT_Full); + break; --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -152,6 +152,7 @@ typedef enum { diff --git a/target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200.dts b/target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200.dts index 0a2f1d1d59..bed7871d6e 100644 --- a/target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200.dts +++ b/target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200.dts @@ -129,7 +129,7 @@ reset-deassert-us = <10000>; /* LED0: CONN (WAN white) */ - mxl,led-config = <0x00f0 0x0 0x0 0x0>; + mxl,led-config = <0x03f0 0x0 0x0 0x0>; }; switch: switch@0 { @@ -267,6 +267,67 @@ }; }; }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + phy@1 { + reg = <1>; + + mediatek,led-config = < + 0x21 0x8009 /* BASIC_CTRL */ + 0x22 0x0c00 /* ON_DURATION */ + 0x23 0x1400 /* BLINK_DURATION */ + 0x24 0x8000 /* LED0_ON_CTRL */ + 0x25 0x0000 /* LED0_BLINK_CTRL */ + 0x26 0xc007 /* LED1_ON_CTRL */ + 0x27 0x003f /* LED1_BLINK_CTRL */ + >; + }; + + phy@2 { + reg = <2>; + + mediatek,led-config = < + 0x21 0x8009 /* BASIC_CTRL */ + 0x22 0x0c00 /* ON_DURATION */ + 0x23 0x1400 /* BLINK_DURATION */ + 0x24 0x8000 /* LED0_ON_CTRL */ + 0x25 0x0000 /* LED0_BLINK_CTRL */ + 0x26 0xc007 /* LED1_ON_CTRL */ + 0x27 0x003f /* LED1_BLINK_CTRL */ + >; + }; + + phy@3 { + reg = <3>; + + mediatek,led-config = < + 0x21 0x8009 /* BASIC_CTRL */ + 0x22 0x0c00 /* ON_DURATION */ + 0x23 0x1400 /* BLINK_DURATION */ + 0x24 0x8000 /* LED0_ON_CTRL */ + 0x25 0x0000 /* LED0_BLINK_CTRL */ + 0x26 0xc007 /* LED1_ON_CTRL */ + 0x27 0x003f /* LED1_BLINK_CTRL */ + >; + }; + + phy@4 { + reg = <4>; + + mediatek,led-config = < + 0x21 0x8009 /* BASIC_CTRL */ + 0x22 0x0c00 /* ON_DURATION */ + 0x23 0x1400 /* BLINK_DURATION */ + 0x24 0x8000 /* LED0_ON_CTRL */ + 0x25 0x0000 /* LED0_BLINK_CTRL */ + 0x26 0xc007 /* LED1_ON_CTRL */ + 0x27 0x003f /* LED1_BLINK_CTRL */ + >; + }; + }; }; &wmac { diff --git a/target/linux/mvebu/patches-5.15/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/mvebu/patches-5.15/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch index 90d8b05cfc..9069de1614 100644 --- a/target/linux/mvebu/patches-5.15/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/mvebu/patches-5.15/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch @@ -57,16 +57,58 @@ Signed-off-by: Michael Gray #else #define do_extend_cmdline 0 #endif -@@ -69,6 +71,72 @@ static uint32_t get_cell_size(const void +@@ -20,6 +22,7 @@ static int node_offset(void *fdt, const + return offset; + } + ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + static int setprop(void *fdt, const char *node_path, const char *property, + void *val_array, int size) + { +@@ -28,6 +31,7 @@ static int setprop(void *fdt, const char + return offset; + return fdt_setprop(fdt, offset, property, val_array, size); + } ++#endif + + static int setprop_string(void *fdt, const char *node_path, + const char *property, const char *string) +@@ -38,6 +42,7 @@ static int setprop_string(void *fdt, con + return fdt_setprop_string(fdt, offset, property, string); + } + ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + static int setprop_cell(void *fdt, const char *node_path, + const char *property, uint32_t val) + { +@@ -46,6 +51,7 @@ static int setprop_cell(void *fdt, const + return offset; + return fdt_setprop_cell(fdt, offset, property, val); + } ++#endif + + static const void *getprop(const void *fdt, const char *node_path, + const char *property, int *len) +@@ -58,6 +64,7 @@ static const void *getprop(const void *f + return fdt_getprop(fdt, offset, property, len); + } + ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + static uint32_t get_cell_size(const void *fdt) + { + int len; +@@ -69,6 +76,74 @@ static uint32_t get_cell_size(const void return cell_size; } ++#endif ++ +#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) + +static char *append_rootblock(char *dest, const char *str, int len, void *fdt) +{ -+ char *ptr, *end; -+ char *root="root="; ++ const char *ptr, *end; ++ const char *root="root="; + int i, l; + const char *rootblock; + @@ -130,7 +172,7 @@ Signed-off-by: Michael Gray static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline) { char cmdline[COMMAND_LINE_SIZE]; -@@ -88,12 +156,21 @@ static void merge_fdt_bootargs(void *fdt +@@ -88,18 +163,28 @@ static void merge_fdt_bootargs(void *fdt /* and append the ATAG_CMDLINE */ if (fdt_cmdline) { @@ -152,7 +194,36 @@ Signed-off-by: Michael Gray } *ptr = '\0'; -@@ -168,7 +245,9 @@ int atags_to_fdt(void *atag_list, void * + setprop_string(fdt, "/chosen", "bootargs", cmdline); + } + ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + static void hex_str(char *out, uint32_t value) + { + uint32_t digit; +@@ -117,6 +202,7 @@ static void hex_str(char *out, uint32_t + } + *out = '\0'; + } ++#endif + + /* + * Convert and fold provided ATAGs into the provided FDT. +@@ -131,9 +217,11 @@ int atags_to_fdt(void *atag_list, void * + struct tag *atag = atag_list; + /* In the case of 64 bits memory size, need to reserve 2 cells for + * address and size for each bank */ ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + __be32 mem_reg_property[2 * 2 * NR_BANKS]; +- int memcount = 0; +- int ret, memsize; ++ int memsize, memcount = 0; ++#endif ++ int ret; + + /* make sure we've got an aligned pointer */ + if ((u32)atag_list & 0x3) +@@ -168,7 +256,9 @@ int atags_to_fdt(void *atag_list, void * else setprop_string(fdt, "/chosen", "bootargs", atag->u.cmdline.cmdline); @@ -163,7 +234,7 @@ Signed-off-by: Michael Gray if (memcount >= sizeof(mem_reg_property)/4) continue; if (!atag->u.mem.size) -@@ -212,6 +291,10 @@ int atags_to_fdt(void *atag_list, void * +@@ -212,6 +302,10 @@ int atags_to_fdt(void *atag_list, void * setprop(fdt, "/memory", "reg", mem_reg_property, 4 * memcount * memsize); } diff --git a/target/linux/oxnas/patches-5.15/996-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/oxnas/patches-5.15/996-generic-Mangle-bootloader-s-kernel-arguments.patch index 8cf935ad12..c64c193e7e 100644 --- a/target/linux/oxnas/patches-5.15/996-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/oxnas/patches-5.15/996-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -51,16 +51,58 @@ Signed-off-by: Adrian Panella #else #define do_extend_cmdline 0 #endif -@@ -69,6 +71,59 @@ static uint32_t get_cell_size(const void +@@ -20,6 +22,7 @@ static int node_offset(void *fdt, const + return offset; + } + ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + static int setprop(void *fdt, const char *node_path, const char *property, + void *val_array, int size) + { +@@ -28,6 +31,7 @@ static int setprop(void *fdt, const char + return offset; + return fdt_setprop(fdt, offset, property, val_array, size); + } ++#endif + + static int setprop_string(void *fdt, const char *node_path, + const char *property, const char *string) +@@ -38,6 +42,7 @@ static int setprop_string(void *fdt, con + return fdt_setprop_string(fdt, offset, property, string); + } + ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + static int setprop_cell(void *fdt, const char *node_path, + const char *property, uint32_t val) + { +@@ -46,6 +51,7 @@ static int setprop_cell(void *fdt, const + return offset; + return fdt_setprop_cell(fdt, offset, property, val); + } ++#endif + + static const void *getprop(const void *fdt, const char *node_path, + const char *property, int *len) +@@ -58,6 +64,7 @@ static const void *getprop(const void *f + return fdt_getprop(fdt, offset, property, len); + } + ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + static uint32_t get_cell_size(const void *fdt) + { + int len; +@@ -69,6 +76,61 @@ static uint32_t get_cell_size(const void return cell_size; } ++#endif ++ +#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) + +static char *append_rootblock(char *dest, const char *str, int len, void *fdt) +{ -+ char *ptr, *end; -+ char *root="root="; ++ const char *ptr, *end; ++ const char *root="root="; + int i, l; + const char *rootblock; + @@ -111,7 +153,7 @@ Signed-off-by: Adrian Panella static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline) { char cmdline[COMMAND_LINE_SIZE]; -@@ -88,12 +143,21 @@ static void merge_fdt_bootargs(void *fdt +@@ -88,18 +150,28 @@ static void merge_fdt_bootargs(void *fdt /* and append the ATAG_CMDLINE */ if (fdt_cmdline) { @@ -133,7 +175,36 @@ Signed-off-by: Adrian Panella } *ptr = '\0'; -@@ -168,7 +232,9 @@ int atags_to_fdt(void *atag_list, void * + setprop_string(fdt, "/chosen", "bootargs", cmdline); + } + ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + static void hex_str(char *out, uint32_t value) + { + uint32_t digit; +@@ -117,6 +189,7 @@ static void hex_str(char *out, uint32_t + } + *out = '\0'; + } ++#endif + + /* + * Convert and fold provided ATAGs into the provided FDT. +@@ -131,9 +204,11 @@ int atags_to_fdt(void *atag_list, void * + struct tag *atag = atag_list; + /* In the case of 64 bits memory size, need to reserve 2 cells for + * address and size for each bank */ ++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE + __be32 mem_reg_property[2 * 2 * NR_BANKS]; +- int memcount = 0; +- int ret, memsize; ++ int memsize, memcount = 0; ++#endif ++ int ret; + + /* make sure we've got an aligned pointer */ + if ((u32)atag_list & 0x3) +@@ -168,7 +243,9 @@ int atags_to_fdt(void *atag_list, void * else setprop_string(fdt, "/chosen", "bootargs", atag->u.cmdline.cmdline); @@ -144,7 +215,7 @@ Signed-off-by: Adrian Panella if (memcount >= sizeof(mem_reg_property)/4) continue; if (!atag->u.mem.size) -@@ -212,6 +278,10 @@ int atags_to_fdt(void *atag_list, void * +@@ -212,6 +289,10 @@ int atags_to_fdt(void *atag_list, void * setprop(fdt, "/memory", "reg", mem_reg_property, 4 * memcount * memsize); } diff --git a/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/dbg.c b/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/dbg.c index d897b12163..fc5f1e4985 100644 --- a/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/dbg.c +++ b/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/dbg.c @@ -48,8 +48,6 @@ #include "mt6575_sd.h" #include -static char cmd_buf[256]; - /* for debug zone */ unsigned int sd_debug_zone[4] = { 0, @@ -59,6 +57,9 @@ unsigned int sd_debug_zone[4] = { }; #if defined(MT6575_SD_DEBUG) + +static char cmd_buf[256]; + /* for driver profile */ #define TICKS_ONE_MS (13000) u32 gpt_enable; diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c index fe787fe92f..47471eb197 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c @@ -766,7 +766,6 @@ static irqreturn_t esw_interrupt(int irq, void *_esw) { struct rt305x_esw *esw = (struct rt305x_esw *) _esw; u32 status; - int i; status = esw_r32(esw, RT305X_ESW_REG_ISR); if (status & RT305X_ESW_PORT_ST_CHG) { @@ -1533,7 +1532,7 @@ int rt3050_esw_init(struct fe_priv *priv) } dev_info(&pdev->dev, "mediatek esw at 0x%08lx, irq %d initialized\n", - esw->base, esw->irq); + (long unsigned int)esw->base, esw->irq); return 0; } diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c index 615544cb17..84b6e305a4 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c @@ -197,6 +197,7 @@ int mtk_gsw_init(struct fe_priv *priv) struct platform_device *pdev = of_find_device_by_node(np); struct mt7620_gsw *gsw; const __be32 *id; + int ret; u8 val; if (!pdev) @@ -233,8 +234,12 @@ int mtk_gsw_init(struct fe_priv *priv) mt7620_ephy_init(gsw); if (gsw->irq) { - request_irq(gsw->irq, gsw_interrupt_mt7620, 0, - "gsw", priv); + ret = request_irq(gsw->irq, gsw_interrupt_mt7620, 0, + "gsw", priv); + if (ret) { + dev_err(&pdev->dev, "Failed to request irq"); + return ret; + } mtk_switch_w32(gsw, ~PORT_IRQ_ST_CHG, GSW_REG_IMR); } 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 e07e5ed5a8..9876a247e3 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 @@ -1561,7 +1561,9 @@ static int fe_probe(struct platform_device *pdev) struct clk *sysclk; int err, napi_weight; - device_reset(&pdev->dev); + err = device_reset(&pdev->dev); + if (err) + dev_err(&pdev->dev, "failed to reset device\n"); match = of_match_device(of_fe_match, &pdev->dev); soc = (struct fe_soc_data *)match->data; diff --git a/target/linux/ramips/patches-5.15/109-drivers-mt7621-dma-handle-error-from-device_reset.patch b/target/linux/ramips/patches-5.15/109-drivers-mt7621-dma-handle-error-from-device_reset.patch new file mode 100644 index 0000000000..a4543337ff --- /dev/null +++ b/target/linux/ramips/patches-5.15/109-drivers-mt7621-dma-handle-error-from-device_reset.patch @@ -0,0 +1,31 @@ +From 3f6dfa25128e428acfba20792bc7506d58806baa Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sun, 7 May 2023 01:06:17 +0200 +Subject: [PATCH] drivers: mt7621-dma: handle error from device_reset + +Handle error from device reset to fix compilation warning. +Fix compilation warning: +drivers/staging/mt7621-dma/hsdma-mt7621.c: In function 'mtk_hsdma_probe': +drivers/staging/mt7621-dma/hsdma-mt7621.c:685:9: error: ignoring return value of 'device_reset' declared with attribute 'warn_unused_result' [-Werror=unused-result] + 685 | device_reset(&pdev->dev); + | ^~~~~~~~~~~~~~~~~~~~~~~~ +cc1: all warnings being treated as errors + +Signed-off-by: Christian Marangi +--- + drivers/staging/mt7621-dma/hsdma-mt7621.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/staging/mt7621-dma/hsdma-mt7621.c ++++ b/drivers/staging/mt7621-dma/hsdma-mt7621.c +@@ -682,7 +682,9 @@ static int mtk_hsdma_probe(struct platfo + return ret; + } + +- device_reset(&pdev->dev); ++ ret = device_reset(&pdev->dev); ++ if (ret) ++ dev_err(&pdev->dev, "failed to reset device\n"); + + dd = &hsdma->ddev; + dma_cap_set(DMA_MEMCPY, dd->cap_mask); diff --git a/target/linux/ramips/patches-5.15/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch b/target/linux/ramips/patches-5.15/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch index 5fb0537539..fa119ab211 100644 --- a/target/linux/ramips/patches-5.15/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch +++ b/target/linux/ramips/patches-5.15/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch @@ -41,7 +41,7 @@ Acked-by: John Crispin obj-$(CONFIG_SPI_S3C64XX) += spi-s3c64xx.o --- /dev/null +++ b/drivers/spi/spi-rt2880.c -@@ -0,0 +1,530 @@ +@@ -0,0 +1,535 @@ +/* + * spi-rt2880.c -- Ralink RT288x/RT305x SPI controller driver + * @@ -514,8 +514,13 @@ Acked-by: John Crispin + rs->base = base; + rs->clk = clk; + -+ if (atomic_inc_return(&hw_reset_count) == 1) -+ device_reset(&pdev->dev); ++ if (atomic_inc_return(&hw_reset_count) == 1) { ++ ret = device_reset(&pdev->dev); ++ if (ret) { ++ dev_err(&pdev->dev, "device_reset error.\n"); ++ goto err_master; ++ } ++ } + + ret = devm_spi_register_master(&pdev->dev, master); + if (ret < 0) { diff --git a/target/linux/ramips/patches-5.15/825-i2c-MIPS-adds-ralink-I2C-driver.patch b/target/linux/ramips/patches-5.15/825-i2c-MIPS-adds-ralink-I2C-driver.patch index 5a4491c95a..da6f8e5a1e 100644 --- a/target/linux/ramips/patches-5.15/825-i2c-MIPS-adds-ralink-I2C-driver.patch +++ b/target/linux/ramips/patches-5.15/825-i2c-MIPS-adds-ralink-I2C-driver.patch @@ -69,7 +69,7 @@ Signed-off-by: John Crispin obj-$(CONFIG_I2C_QUP) += i2c-qup.o --- /dev/null +++ b/drivers/i2c/busses/i2c-ralink.c -@@ -0,0 +1,435 @@ +@@ -0,0 +1,440 @@ +/* + * drivers/i2c/busses/i2c-ralink.c + * @@ -245,7 +245,12 @@ Signed-off-by: John Crispin + +static void rt_i2c_reset(struct rt_i2c *i2c) +{ -+ device_reset(i2c->adap.dev.parent); ++ int ret; ++ ++ ret = device_reset(i2c->adap.dev.parent); ++ if (ret) ++ dev_err(i2c->dev, "Failed to reset device"); ++ + barrier(); + rt_i2c_w32(i2c, i2c->clk_div, REG_CLKDIV_REG); +} diff --git a/target/linux/ramips/patches-5.15/835-asoc-add-mt7620-support.patch b/target/linux/ramips/patches-5.15/835-asoc-add-mt7620-support.patch index 633c5120e0..551fdd8b3c 100644 --- a/target/linux/ramips/patches-5.15/835-asoc-add-mt7620-support.patch +++ b/target/linux/ramips/patches-5.15/835-asoc-add-mt7620-support.patch @@ -60,7 +60,7 @@ Signed-off-by: John Crispin +obj-$(CONFIG_SND_RALINK_SOC_I2S) += snd-soc-ralink-i2s.o --- /dev/null +++ b/sound/soc/ralink/ralink-i2s.c -@@ -0,0 +1,966 @@ +@@ -0,0 +1,970 @@ +/* + * Copyright (C) 2010, Lars-Peter Clausen + * Copyright (C) 2016 Michael Lee @@ -945,7 +945,11 @@ Signed-off-by: John Crispin + + ralink_i2s_init_dma_data(i2s, res); + -+ device_reset(&pdev->dev); ++ ret = device_reset(&pdev->dev); ++ if (ret) { ++ dev_err(&pdev->dev, "failed to reset device\n"); ++ goto err_clk_disable; ++ } + + ret = ralink_i2s_debugfs_create(i2s); + if (ret) { diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/common.c index 3216d7eb83..4b928f248b 100644 --- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/common.c +++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/common.c @@ -527,24 +527,25 @@ int rtl83xx_lag_del(struct dsa_switch *ds, int group, int port) return 0; } -/* Allocate a 64 bit octet counter located in the LOG HW table */ -static int rtl83xx_octet_cntr_alloc(struct rtl838x_switch_priv *priv) -{ - int idx; +// Currently Unused +// /* Allocate a 64 bit octet counter located in the LOG HW table */ +// static int rtl83xx_octet_cntr_alloc(struct rtl838x_switch_priv *priv) +// { +// int idx; - mutex_lock(&priv->reg_mutex); +// mutex_lock(&priv->reg_mutex); - idx = find_first_zero_bit(priv->octet_cntr_use_bm, MAX_COUNTERS); - if (idx >= priv->n_counters) { - mutex_unlock(&priv->reg_mutex); - return -1; - } +// idx = find_first_zero_bit(priv->octet_cntr_use_bm, MAX_COUNTERS); +// if (idx >= priv->n_counters) { +// mutex_unlock(&priv->reg_mutex); +// return -1; +// } - set_bit(idx, priv->octet_cntr_use_bm); - mutex_unlock(&priv->reg_mutex); +// set_bit(idx, priv->octet_cntr_use_bm); +// mutex_unlock(&priv->reg_mutex); - return idx; -} +// return idx; +// } /* Allocate a 32-bit packet counter * 2 32-bit packet counters share the location of a 64-bit octet counter @@ -1427,7 +1428,7 @@ static int rtl83xx_fib_event(struct notifier_block *this, unsigned long event, v fib_info_hold(fib_work->fen_info.fi); } else if (info->family == AF_INET6) { - struct fib6_entry_notifier_info *fen6_info = ptr; + //struct fib6_entry_notifier_info *fen6_info = ptr; pr_warn("%s: FIB_RULE ADD/DEL for IPv6 not supported\n", __func__); kfree(fib_work); return NOTIFY_DONE; diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c index 3c67ce5adb..5b5608b9b4 100644 --- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c @@ -1991,8 +1991,6 @@ static bool rtl83xx_lag_can_offload(struct dsa_switch *ds, static int rtl83xx_port_lag_change(struct dsa_switch *ds, int port) { - struct rtl838x_switch_priv *priv = ds->priv; - pr_debug("%s: %d\n", __func__, port); /* Nothing to be done... */ diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/qos.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/qos.c index 28976412aa..d101e1c97e 100644 --- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/qos.c +++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/qos.c @@ -291,7 +291,7 @@ static void rtl839x_rate_control_init(struct rtl838x_switch_priv *priv) void rtl838x_setup_prio2queue_matrix(int *min_queues) { - u32 v; + u32 v = 0; pr_info("Current Intprio2queue setting: %08x\n", sw_r32(RTL838X_QM_INTPRI2QID_CTRL)); for (int i = 0; i < MAX_PRIOS; i++) @@ -313,7 +313,7 @@ void rtl83xx_setup_prio2queue_cpu_matrix(int *max_queues) { int reg = soc_info.family == RTL8380_FAMILY_ID ? RTL838X_QM_PKT2CPU_INTPRI_MAP : RTL839X_QM_PKT2CPU_INTPRI_MAP; - u32 v; + u32 v = 0; pr_info("QM_PKT2CPU_INTPRI_MAP: %08x\n", sw_r32(reg)); for (int i = 0; i < MAX_PRIOS; i++) diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl838x.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl838x.c index 606066aeea..0f9c3c33a4 100644 --- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl838x.c +++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl838x.c @@ -1300,15 +1300,16 @@ static void rtl838x_pie_rule_dump_raw(u32 r[]) pr_info("Sel : %08x\n", r[17]); } -static void rtl838x_pie_rule_dump(struct pie_rule *pr) -{ - pr_info("Drop: %d, fwd: %d, ovid: %d, ivid: %d, flt: %d, log: %d, rmk: %d, meter: %d tagst: %d, mir: %d, nopri: %d, cpupri: %d, otpid: %d, itpid: %d, shape: %d\n", - pr->drop, pr->fwd_sel, pr->ovid_sel, pr->ivid_sel, pr->flt_sel, pr->log_sel, pr->rmk_sel, pr->log_sel, pr->tagst_sel, pr->mir_sel, pr->nopri_sel, - pr->cpupri_sel, pr->otpid_sel, pr->itpid_sel, pr->shaper_sel); - if (pr->fwd_sel) - pr_info("FWD: %08x\n", pr->fwd_data); - pr_info("TID: %x, %x\n", pr->tid, pr->tid_m); -} +// Currently not used +// static void rtl838x_pie_rule_dump(struct pie_rule *pr) +// { +// pr_info("Drop: %d, fwd: %d, ovid: %d, ivid: %d, flt: %d, log: %d, rmk: %d, meter: %d tagst: %d, mir: %d, nopri: %d, cpupri: %d, otpid: %d, itpid: %d, shape: %d\n", +// pr->drop, pr->fwd_sel, pr->ovid_sel, pr->ivid_sel, pr->flt_sel, pr->log_sel, pr->rmk_sel, pr->log_sel, pr->tagst_sel, pr->mir_sel, pr->nopri_sel, +// pr->cpupri_sel, pr->otpid_sel, pr->itpid_sel, pr->shaper_sel); +// if (pr->fwd_sel) +// pr_info("FWD: %08x\n", pr->fwd_data); +// pr_info("TID: %x, %x\n", pr->tid, pr->tid_m); +// } static int rtl838x_pie_rule_read(struct rtl838x_switch_priv *priv, int idx, struct pie_rule *pr) { diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl930x.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl930x.c index 5a899f32ba..e65f95e9f1 100644 --- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl930x.c +++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl930x.c @@ -992,57 +992,58 @@ static u32 rtl930x_l3_hash4(u32 ip, int algorithm, bool move_dip) return hash; } -static u32 rtl930x_l3_hash6(struct in6_addr *ip6, int algorithm, bool move_dip) -{ - u32 rows[16]; - u32 hash; - u32 s0, s1, pH; +// Currently not used +// static u32 rtl930x_l3_hash6(struct in6_addr *ip6, int algorithm, bool move_dip) +// { +// u32 rows[16]; +// u32 hash; +// u32 s0, s1, pH; - rows[0] = (HASH_PICK(ip6->s6_addr[0], 6, 2) << 0); - rows[1] = (HASH_PICK(ip6->s6_addr[0], 0, 6) << 3) | HASH_PICK(ip6->s6_addr[1], 5, 3); - rows[2] = (HASH_PICK(ip6->s6_addr[1], 0, 5) << 4) | HASH_PICK(ip6->s6_addr[2], 4, 4); - rows[3] = (HASH_PICK(ip6->s6_addr[2], 0, 4) << 5) | HASH_PICK(ip6->s6_addr[3], 3, 5); - rows[4] = (HASH_PICK(ip6->s6_addr[3], 0, 3) << 6) | HASH_PICK(ip6->s6_addr[4], 2, 6); - rows[5] = (HASH_PICK(ip6->s6_addr[4], 0, 2) << 7) | HASH_PICK(ip6->s6_addr[5], 1, 7); - rows[6] = (HASH_PICK(ip6->s6_addr[5], 0, 1) << 8) | HASH_PICK(ip6->s6_addr[6], 0, 8); - rows[7] = (HASH_PICK(ip6->s6_addr[7], 0, 8) << 1) | HASH_PICK(ip6->s6_addr[8], 7, 1); - rows[8] = (HASH_PICK(ip6->s6_addr[8], 0, 7) << 2) | HASH_PICK(ip6->s6_addr[9], 6, 2); - rows[9] = (HASH_PICK(ip6->s6_addr[9], 0, 6) << 3) | HASH_PICK(ip6->s6_addr[10], 5, 3); - rows[10] = (HASH_PICK(ip6->s6_addr[10], 0, 5) << 4) | HASH_PICK(ip6->s6_addr[11], 4, 4); - if (!algorithm) { - rows[11] = (HASH_PICK(ip6->s6_addr[11], 0, 4) << 5) | - (HASH_PICK(ip6->s6_addr[12], 3, 5) << 0); - rows[12] = (HASH_PICK(ip6->s6_addr[12], 0, 3) << 6) | - (HASH_PICK(ip6->s6_addr[13], 2, 6) << 0); - rows[13] = (HASH_PICK(ip6->s6_addr[13], 0, 2) << 7) | - (HASH_PICK(ip6->s6_addr[14], 1, 7) << 0); - if (!move_dip) { - rows[14] = (HASH_PICK(ip6->s6_addr[14], 0, 1) << 8) | - (HASH_PICK(ip6->s6_addr[15], 0, 8) << 0); - } - hash = rows[0] ^ rows[1] ^ rows[2] ^ rows[3] ^ rows[4] ^ - rows[5] ^ rows[6] ^ rows[7] ^ rows[8] ^ rows[9] ^ - rows[10] ^ rows[11] ^ rows[12] ^ rows[13] ^ rows[14]; - } else { - rows[11] = (HASH_PICK(ip6->s6_addr[11], 0, 4) << 5); - rows[12] = (HASH_PICK(ip6->s6_addr[12], 3, 5) << 0); - rows[13] = (HASH_PICK(ip6->s6_addr[12], 0, 3) << 6) | - HASH_PICK(ip6->s6_addr[13], 2, 6); - rows[14] = (HASH_PICK(ip6->s6_addr[13], 0, 2) << 7) | - HASH_PICK(ip6->s6_addr[14], 1, 7); - if (!move_dip) { - rows[15] = (HASH_PICK(ip6->s6_addr[14], 0, 1) << 8) | - (HASH_PICK(ip6->s6_addr[15], 0, 8) << 0); - } - s0 = rows[12] + rows[13] + rows[14]; - s1 = (s0 & 0x1ff) + ((s0 & (0x1ff << 9)) >> 9); - pH = (s1 & 0x1ff) + ((s1 & (0x1ff << 9)) >> 9); - hash = rows[0] ^ rows[1] ^ rows[2] ^ rows[3] ^ rows[4] ^ - rows[5] ^ rows[6] ^ rows[7] ^ rows[8] ^ rows[9] ^ - rows[10] ^ rows[11] ^ pH ^ rows[15]; - } - return hash; -} +// rows[0] = (HASH_PICK(ip6->s6_addr[0], 6, 2) << 0); +// rows[1] = (HASH_PICK(ip6->s6_addr[0], 0, 6) << 3) | HASH_PICK(ip6->s6_addr[1], 5, 3); +// rows[2] = (HASH_PICK(ip6->s6_addr[1], 0, 5) << 4) | HASH_PICK(ip6->s6_addr[2], 4, 4); +// rows[3] = (HASH_PICK(ip6->s6_addr[2], 0, 4) << 5) | HASH_PICK(ip6->s6_addr[3], 3, 5); +// rows[4] = (HASH_PICK(ip6->s6_addr[3], 0, 3) << 6) | HASH_PICK(ip6->s6_addr[4], 2, 6); +// rows[5] = (HASH_PICK(ip6->s6_addr[4], 0, 2) << 7) | HASH_PICK(ip6->s6_addr[5], 1, 7); +// rows[6] = (HASH_PICK(ip6->s6_addr[5], 0, 1) << 8) | HASH_PICK(ip6->s6_addr[6], 0, 8); +// rows[7] = (HASH_PICK(ip6->s6_addr[7], 0, 8) << 1) | HASH_PICK(ip6->s6_addr[8], 7, 1); +// rows[8] = (HASH_PICK(ip6->s6_addr[8], 0, 7) << 2) | HASH_PICK(ip6->s6_addr[9], 6, 2); +// rows[9] = (HASH_PICK(ip6->s6_addr[9], 0, 6) << 3) | HASH_PICK(ip6->s6_addr[10], 5, 3); +// rows[10] = (HASH_PICK(ip6->s6_addr[10], 0, 5) << 4) | HASH_PICK(ip6->s6_addr[11], 4, 4); +// if (!algorithm) { +// rows[11] = (HASH_PICK(ip6->s6_addr[11], 0, 4) << 5) | +// (HASH_PICK(ip6->s6_addr[12], 3, 5) << 0); +// rows[12] = (HASH_PICK(ip6->s6_addr[12], 0, 3) << 6) | +// (HASH_PICK(ip6->s6_addr[13], 2, 6) << 0); +// rows[13] = (HASH_PICK(ip6->s6_addr[13], 0, 2) << 7) | +// (HASH_PICK(ip6->s6_addr[14], 1, 7) << 0); +// if (!move_dip) { +// rows[14] = (HASH_PICK(ip6->s6_addr[14], 0, 1) << 8) | +// (HASH_PICK(ip6->s6_addr[15], 0, 8) << 0); +// } +// hash = rows[0] ^ rows[1] ^ rows[2] ^ rows[3] ^ rows[4] ^ +// rows[5] ^ rows[6] ^ rows[7] ^ rows[8] ^ rows[9] ^ +// rows[10] ^ rows[11] ^ rows[12] ^ rows[13] ^ rows[14]; +// } else { +// rows[11] = (HASH_PICK(ip6->s6_addr[11], 0, 4) << 5); +// rows[12] = (HASH_PICK(ip6->s6_addr[12], 3, 5) << 0); +// rows[13] = (HASH_PICK(ip6->s6_addr[12], 0, 3) << 6) | +// HASH_PICK(ip6->s6_addr[13], 2, 6); +// rows[14] = (HASH_PICK(ip6->s6_addr[13], 0, 2) << 7) | +// HASH_PICK(ip6->s6_addr[14], 1, 7); +// if (!move_dip) { +// rows[15] = (HASH_PICK(ip6->s6_addr[14], 0, 1) << 8) | +// (HASH_PICK(ip6->s6_addr[15], 0, 8) << 0); +// } +// s0 = rows[12] + rows[13] + rows[14]; +// s1 = (s0 & 0x1ff) + ((s0 & (0x1ff << 9)) >> 9); +// pH = (s1 & 0x1ff) + ((s1 & (0x1ff << 9)) >> 9); +// hash = rows[0] ^ rows[1] ^ rows[2] ^ rows[3] ^ rows[4] ^ +// rows[5] ^ rows[6] ^ rows[7] ^ rows[8] ^ rows[9] ^ +// rows[10] ^ rows[11] ^ pH ^ rows[15]; +// } +// return hash; +// } /* Read a prefix route entry from the L3_PREFIX_ROUTE_IPUC table * We currently only support IPv4 and IPv6 unicast route @@ -1411,85 +1412,89 @@ static void rtl930x_get_l3_nexthop(int idx, u16 *dmac_id, u16 *interface) *interface = v & 0x7f; } -static int rtl930x_l3_mtu_del(struct rtl838x_switch_priv *priv, int mtu) -{ - int i; +// Currently not used +// static int rtl930x_l3_mtu_del(struct rtl838x_switch_priv *priv, int mtu) +// { +// int i; - for (i = 0; i < MAX_INTF_MTUS; i++) { - if (mtu == priv->intf_mtus[i]) - break; - } - if (i >= MAX_INTF_MTUS || !priv->intf_mtu_count[i]) { - pr_err("%s: No MTU slot found for MTU: %d\n", __func__, mtu); - return -EINVAL; - } +// for (i = 0; i < MAX_INTF_MTUS; i++) { +// if (mtu == priv->intf_mtus[i]) +// break; +// } +// if (i >= MAX_INTF_MTUS || !priv->intf_mtu_count[i]) { +// pr_err("%s: No MTU slot found for MTU: %d\n", __func__, mtu); +// return -EINVAL; +// } - priv->intf_mtu_count[i]--; -} +// priv->intf_mtu_count[i]--; +// } -static int rtl930x_l3_mtu_add(struct rtl838x_switch_priv *priv, int mtu) -{ - int i, free_mtu; - int mtu_id; +// Currently not used +// static int rtl930x_l3_mtu_add(struct rtl838x_switch_priv *priv, int mtu) +// { +// int i, free_mtu; +// int mtu_id; - /* Try to find an existing mtu-value or a free slot */ - free_mtu = MAX_INTF_MTUS; - for (i = 0; i < MAX_INTF_MTUS && priv->intf_mtus[i] != mtu; i++) { - if ((!priv->intf_mtu_count[i]) && (free_mtu == MAX_INTF_MTUS)) - free_mtu = i; - } - i = (i < MAX_INTF_MTUS) ? i : free_mtu; - if (i < MAX_INTF_MTUS) { - mtu_id = i; - } else { - pr_err("%s: No free MTU slot available!\n", __func__); - return -EINVAL; - } +// /* Try to find an existing mtu-value or a free slot */ +// free_mtu = MAX_INTF_MTUS; +// for (i = 0; i < MAX_INTF_MTUS && priv->intf_mtus[i] != mtu; i++) { +// if ((!priv->intf_mtu_count[i]) && (free_mtu == MAX_INTF_MTUS)) +// free_mtu = i; +// } +// i = (i < MAX_INTF_MTUS) ? i : free_mtu; +// if (i < MAX_INTF_MTUS) { +// mtu_id = i; +// } else { +// pr_err("%s: No free MTU slot available!\n", __func__); +// return -EINVAL; +// } - priv->intf_mtus[i] = mtu; - pr_info("Writing MTU %d to slot %d\n", priv->intf_mtus[i], i); - /* Set MTU-value of the slot TODO: distinguish between IPv4/IPv6 routes / slots */ - sw_w32_mask(0xffff << ((i % 2) * 16), priv->intf_mtus[i] << ((i % 2) * 16), - RTL930X_L3_IP_MTU_CTRL(i)); - sw_w32_mask(0xffff << ((i % 2) * 16), priv->intf_mtus[i] << ((i % 2) * 16), - RTL930X_L3_IP6_MTU_CTRL(i)); +// priv->intf_mtus[i] = mtu; +// pr_info("Writing MTU %d to slot %d\n", priv->intf_mtus[i], i); +// /* Set MTU-value of the slot TODO: distinguish between IPv4/IPv6 routes / slots */ +// sw_w32_mask(0xffff << ((i % 2) * 16), priv->intf_mtus[i] << ((i % 2) * 16), +// RTL930X_L3_IP_MTU_CTRL(i)); +// sw_w32_mask(0xffff << ((i % 2) * 16), priv->intf_mtus[i] << ((i % 2) * 16), +// RTL930X_L3_IP6_MTU_CTRL(i)); - priv->intf_mtu_count[i]++; +// priv->intf_mtu_count[i]++; - return mtu_id; -} +// return mtu_id; +// } -/* Creates an interface for a route by setting up the HW tables in the SoC */ -static int rtl930x_l3_intf_add(struct rtl838x_switch_priv *priv, struct rtl838x_l3_intf *intf) -{ - int i, intf_id, mtu_id; - /* number of MTU-values < 16384 */ - /* Use the same IPv6 mtu as the ip4 mtu for this route if unset */ - intf->ip6_mtu = intf->ip6_mtu ? intf->ip6_mtu : intf->ip4_mtu; +// Currently not used +// /* Creates an interface for a route by setting up the HW tables in the SoC +// static int rtl930x_l3_intf_add(struct rtl838x_switch_priv *priv, struct rtl838x_l3_intf *intf) +// { +// int i, intf_id, mtu_id; +// /* number of MTU-values < 16384 *\/ - mtu_id = rtl930x_l3_mtu_add(priv, intf->ip4_mtu); - pr_info("%s: added mtu %d with mtu-id %d\n", __func__, intf->ip4_mtu, mtu_id); - if (mtu_id < 0) - return -ENOSPC; - intf->ip4_mtu_id = mtu_id; - intf->ip6_mtu_id = mtu_id; +// /* Use the same IPv6 mtu as the ip4 mtu for this route if unset */ +// intf->ip6_mtu = intf->ip6_mtu ? intf->ip6_mtu : intf->ip4_mtu; - for (i = 0; i < MAX_INTERFACES; i++) { - if (!priv->interfaces[i]) - break; - } - if (i >= MAX_INTERFACES) { - pr_err("%s: cannot find free interface entry\n", __func__); - return -EINVAL; - } - intf_id = i; - priv->interfaces[i] = kzalloc(sizeof(struct rtl838x_l3_intf), GFP_KERNEL); - if (!priv->interfaces[i]) { - pr_err("%s: no memory to allocate new interface\n", __func__); - return -ENOMEM; - } -} +// mtu_id = rtl930x_l3_mtu_add(priv, intf->ip4_mtu); +// pr_info("%s: added mtu %d with mtu-id %d\n", __func__, intf->ip4_mtu, mtu_id); +// if (mtu_id < 0) +// return -ENOSPC; +// intf->ip4_mtu_id = mtu_id; +// intf->ip6_mtu_id = mtu_id; + +// for (i = 0; i < MAX_INTERFACES; i++) { +// if (!priv->interfaces[i]) +// break; +// } +// if (i >= MAX_INTERFACES) { +// pr_err("%s: cannot find free interface entry\n", __func__); +// return -EINVAL; +// } +// intf_id = i; +// priv->interfaces[i] = kzalloc(sizeof(struct rtl838x_l3_intf), GFP_KERNEL); +// if (!priv->interfaces[i]) { +// pr_err("%s: no memory to allocate new interface\n", __func__); +// return -ENOMEM; +// } +// } /* Set the destination MAC and L3 egress interface ID for a nexthop entry in the SoC's * L3_NEXTHOP table. The nexthop entry is identified by idx. @@ -1683,49 +1688,50 @@ static void rtl930x_write_pie_templated(u32 r[], struct pie_rule *pr, enum templ } } -static void rtl930x_read_pie_fixed_fields(u32 r[], struct pie_rule *pr) -{ - pr->stacking_port = r[6] & BIT(31); - pr->spn = (r[6] >> 24) & 0x7f; - pr->mgnt_vlan = r[6] & BIT(23); - if (pr->phase == PHASE_IACL) - pr->dmac_hit_sw = r[6] & BIT(22); - else - pr->content_too_deep = r[6] & BIT(22); - pr->not_first_frag = r[6] & BIT(21); - pr->frame_type_l4 = (r[6] >> 18) & 7; - pr->frame_type = (r[6] >> 16) & 3; - pr->otag_fmt = (r[6] >> 15) & 1; - pr->itag_fmt = (r[6] >> 14) & 1; - pr->otag_exist = (r[6] >> 13) & 1; - pr->itag_exist = (r[6] >> 12) & 1; - pr->frame_type_l2 = (r[6] >> 10) & 3; - pr->igr_normal_port = (r[6] >> 9) & 1; - pr->tid = (r[6] >> 8) & 1; +// Currently not used +// static void rtl930x_read_pie_fixed_fields(u32 r[], struct pie_rule *pr) +// { +// pr->stacking_port = r[6] & BIT(31); +// pr->spn = (r[6] >> 24) & 0x7f; +// pr->mgnt_vlan = r[6] & BIT(23); +// if (pr->phase == PHASE_IACL) +// pr->dmac_hit_sw = r[6] & BIT(22); +// else +// pr->content_too_deep = r[6] & BIT(22); +// pr->not_first_frag = r[6] & BIT(21); +// pr->frame_type_l4 = (r[6] >> 18) & 7; +// pr->frame_type = (r[6] >> 16) & 3; +// pr->otag_fmt = (r[6] >> 15) & 1; +// pr->itag_fmt = (r[6] >> 14) & 1; +// pr->otag_exist = (r[6] >> 13) & 1; +// pr->itag_exist = (r[6] >> 12) & 1; +// pr->frame_type_l2 = (r[6] >> 10) & 3; +// pr->igr_normal_port = (r[6] >> 9) & 1; +// pr->tid = (r[6] >> 8) & 1; - pr->stacking_port_m = r[12] & BIT(7); - pr->spn_m = r[12] & 0x7f; - pr->mgnt_vlan_m = r[13] & BIT(31); - if (pr->phase == PHASE_IACL) - pr->dmac_hit_sw_m = r[13] & BIT(30); - else - pr->content_too_deep_m = r[13] & BIT(30); - pr->not_first_frag_m = r[13] & BIT(29); - pr->frame_type_l4_m = (r[13] >> 26) & 7; - pr->frame_type_m = (r[13] >> 24) & 3; - pr->otag_fmt_m = r[13] & BIT(23); - pr->itag_fmt_m = r[13] & BIT(22); - pr->otag_exist_m = r[13] & BIT(21); - pr->itag_exist_m = r[13] & BIT (20); - pr->frame_type_l2_m = (r[13] >> 18) & 3; - pr->igr_normal_port_m = r[13] & BIT(17); - pr->tid_m = (r[13] >> 16) & 1; +// pr->stacking_port_m = r[12] & BIT(7); +// pr->spn_m = r[12] & 0x7f; +// pr->mgnt_vlan_m = r[13] & BIT(31); +// if (pr->phase == PHASE_IACL) +// pr->dmac_hit_sw_m = r[13] & BIT(30); +// else +// pr->content_too_deep_m = r[13] & BIT(30); +// pr->not_first_frag_m = r[13] & BIT(29); +// pr->frame_type_l4_m = (r[13] >> 26) & 7; +// pr->frame_type_m = (r[13] >> 24) & 3; +// pr->otag_fmt_m = r[13] & BIT(23); +// pr->itag_fmt_m = r[13] & BIT(22); +// pr->otag_exist_m = r[13] & BIT(21); +// pr->itag_exist_m = r[13] & BIT (20); +// pr->frame_type_l2_m = (r[13] >> 18) & 3; +// pr->igr_normal_port_m = r[13] & BIT(17); +// pr->tid_m = (r[13] >> 16) & 1; - pr->valid = r[13] & BIT(15); - pr->cond_not = r[13] & BIT(14); - pr->cond_and1 = r[13] & BIT(13); - pr->cond_and2 = r[13] & BIT(12); -} +// pr->valid = r[13] & BIT(15); +// pr->cond_not = r[13] & BIT(14); +// pr->cond_and1 = r[13] & BIT(13); +// pr->cond_and2 = r[13] & BIT(12); +// } static void rtl930x_write_pie_fixed_fields(u32 r[], struct pie_rule *pr) { diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl931x.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl931x.c index 92f0662223..5e1b00add5 100644 --- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl931x.c +++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl931x.c @@ -1113,45 +1113,46 @@ static void rtl931x_write_pie_templated(u32 r[], struct pie_rule *pr, enum templ } } -static void rtl931x_read_pie_fixed_fields(u32 r[], struct pie_rule *pr) -{ - pr->mgnt_vlan = r[7] & BIT(31); - if (pr->phase == PHASE_IACL) - pr->dmac_hit_sw = r[7] & BIT(30); - else /* TODO: EACL/VACL phase handling */ - pr->content_too_deep = r[7] & BIT(30); - pr->not_first_frag = r[7] & BIT(29); - pr->frame_type_l4 = (r[7] >> 26) & 7; - pr->frame_type = (r[7] >> 24) & 3; - pr->otag_fmt = (r[7] >> 23) & 1; - pr->itag_fmt = (r[7] >> 22) & 1; - pr->otag_exist = (r[7] >> 21) & 1; - pr->itag_exist = (r[7] >> 20) & 1; - pr->frame_type_l2 = (r[7] >> 18) & 3; - pr->igr_normal_port = (r[7] >> 17) & 1; - pr->tid = (r[7] >> 16) & 1; +// Currently unused +// static void rtl931x_read_pie_fixed_fields(u32 r[], struct pie_rule *pr) +// { +// pr->mgnt_vlan = r[7] & BIT(31); +// if (pr->phase == PHASE_IACL) +// pr->dmac_hit_sw = r[7] & BIT(30); +// else /* TODO: EACL/VACL phase handling */ +// pr->content_too_deep = r[7] & BIT(30); +// pr->not_first_frag = r[7] & BIT(29); +// pr->frame_type_l4 = (r[7] >> 26) & 7; +// pr->frame_type = (r[7] >> 24) & 3; +// pr->otag_fmt = (r[7] >> 23) & 1; +// pr->itag_fmt = (r[7] >> 22) & 1; +// pr->otag_exist = (r[7] >> 21) & 1; +// pr->itag_exist = (r[7] >> 20) & 1; +// pr->frame_type_l2 = (r[7] >> 18) & 3; +// pr->igr_normal_port = (r[7] >> 17) & 1; +// pr->tid = (r[7] >> 16) & 1; - pr->mgnt_vlan_m = r[14] & BIT(15); - if (pr->phase == PHASE_IACL) - pr->dmac_hit_sw_m = r[14] & BIT(14); - else - pr->content_too_deep_m = r[14] & BIT(14); - pr->not_first_frag_m = r[14] & BIT(13); - pr->frame_type_l4_m = (r[14] >> 10) & 7; - pr->frame_type_m = (r[14] >> 8) & 3; - pr->otag_fmt_m = r[14] & BIT(7); - pr->itag_fmt_m = r[14] & BIT(6); - pr->otag_exist_m = r[14] & BIT(5); - pr->itag_exist_m = r[14] & BIT (4); - pr->frame_type_l2_m = (r[14] >> 2) & 3; - pr->igr_normal_port_m = r[14] & BIT(1); - pr->tid_m = r[14] & 1; +// pr->mgnt_vlan_m = r[14] & BIT(15); +// if (pr->phase == PHASE_IACL) +// pr->dmac_hit_sw_m = r[14] & BIT(14); +// else +// pr->content_too_deep_m = r[14] & BIT(14); +// pr->not_first_frag_m = r[14] & BIT(13); +// pr->frame_type_l4_m = (r[14] >> 10) & 7; +// pr->frame_type_m = (r[14] >> 8) & 3; +// pr->otag_fmt_m = r[14] & BIT(7); +// pr->itag_fmt_m = r[14] & BIT(6); +// pr->otag_exist_m = r[14] & BIT(5); +// pr->itag_exist_m = r[14] & BIT (4); +// pr->frame_type_l2_m = (r[14] >> 2) & 3; +// pr->igr_normal_port_m = r[14] & BIT(1); +// pr->tid_m = r[14] & 1; - pr->valid = r[15] & BIT(31); - pr->cond_not = r[15] & BIT(30); - pr->cond_and1 = r[15] & BIT(29); - pr->cond_and2 = r[15] & BIT(28); -} +// pr->valid = r[15] & BIT(31); +// pr->cond_not = r[15] & BIT(30); +// pr->cond_and1 = r[15] & BIT(29); +// pr->cond_and2 = r[15] & BIT(28); +// } static void rtl931x_write_pie_fixed_fields(u32 r[], struct pie_rule *pr) { diff --git a/target/linux/realtek/files-5.15/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-5.15/drivers/net/ethernet/rtl838x_eth.c index 1b35fae09b..e9ebc7c73c 100644 --- a/target/linux/realtek/files-5.15/drivers/net/ethernet/rtl838x_eth.c +++ b/target/linux/realtek/files-5.15/drivers/net/ethernet/rtl838x_eth.c @@ -161,12 +161,13 @@ static void rtl931x_create_tx_header(struct p_hdr *h, unsigned int dest_port, in h->cpu_tag[2] = (BIT(5) | (prio & 0x1f)) << 8; } -static void rtl93xx_header_vlan_set(struct p_hdr *h, int vlan) -{ - h->cpu_tag[2] |= BIT(4); /* Enable VLAN forwarding offload */ - h->cpu_tag[2] |= (vlan >> 8) & 0xf; - h->cpu_tag[3] |= (vlan & 0xff) << 8; -} +// Currently unused +// static void rtl93xx_header_vlan_set(struct p_hdr *h, int vlan) +// { +// h->cpu_tag[2] |= BIT(4); /* Enable VLAN forwarding offload */ +// h->cpu_tag[2] |= (vlan >> 8) & 0xf; +// h->cpu_tag[3] |= (vlan & 0xff) << 8; +// } struct rtl838x_rx_q { int id; @@ -1957,7 +1958,7 @@ static int rtl930x_mdio_reset(struct mii_bus *bus) break; /* Serdes: Value = 0 */ case PHY_INTERFACE_MODE_HSGMII: private_poll_mask |= BIT(i); - /* fallthrough */ + fallthrough; case PHY_INTERFACE_MODE_USXGMII: v |= BIT(mac_type_bit[i]); uses_usxgmii = true; diff --git a/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c b/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c index 7733252763..d47ba3e013 100644 --- a/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c +++ b/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c @@ -743,9 +743,10 @@ static int rtl8380_configure_int_rtl8218b(struct phy_device *phydev) rtl838x_6275B_intPhy_perport = (void *)h + sizeof(struct fw_header) + h->parts[8].start; rtl8218b_6276B_hwEsd_perport = (void *)h + sizeof(struct fw_header) + h->parts[9].start; - if (sw_r32(RTL838X_DMY_REG31) == 0x1) { - int ipd_flag = 1; - } + // Currently not used + // if (sw_r32(RTL838X_DMY_REG31) == 0x1) { + // int ipd_flag = 1; + // } val = phy_read(phydev, 0); if (val & BIT(11)) @@ -3330,13 +3331,14 @@ static void rtl931x_sds_rx_rst(u32 sds) mdelay(50); } -static void rtl931x_sds_disable(u32 sds) -{ - u32 v = 0x1f; +// Currently not used +// static void rtl931x_sds_disable(u32 sds) +// { +// u32 v = 0x1f; - v |= BIT(7); - sw_w32(v, RTL931X_SERDES_MODE_CTRL + (sds >> 2) * 4); -} +// v |= BIT(7); +// sw_w32(v, RTL931X_SERDES_MODE_CTRL + (sds >> 2) * 4); +// } static void rtl931x_sds_mii_mode_set(u32 sds, phy_interface_t mode) { diff --git a/target/linux/realtek/patches-5.15/704-include-linux-add-phy-hsgmii-mode.patch b/target/linux/realtek/patches-5.15/704-include-linux-add-phy-hsgmii-mode.patch index 8109abd264..1dd328b34e 100644 --- a/target/linux/realtek/patches-5.15/704-include-linux-add-phy-hsgmii-mode.patch +++ b/target/linux/realtek/patches-5.15/704-include-linux-add-phy-hsgmii-mode.patch @@ -9,9 +9,28 @@ protocol. Submitted-by: Birger Koblitz --- + drivers/net/phy/phylink.c | 2 ++ include/linux/phy.h | 3 +++ - 1 file changed, 3 insertions(+) + 2 file changed, 5 insertions(+) +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -403,6 +403,7 @@ void phylink_get_linkmodes(unsigned long + + case PHY_INTERFACE_MODE_XGMII: + case PHY_INTERFACE_MODE_RXAUI: ++ case PHY_INTERFACE_MODE_HSGMII: + case PHY_INTERFACE_MODE_XAUI: + case PHY_INTERFACE_MODE_10GBASER: + case PHY_INTERFACE_MODE_10GKR: +@@ -657,6 +658,7 @@ static int phylink_parse_mode(struct phy + fallthrough; + case PHY_INTERFACE_MODE_USXGMII: + case PHY_INTERFACE_MODE_10GKR: ++ case PHY_INTERFACE_MODE_HSGMII: + case PHY_INTERFACE_MODE_10GBASER: + phylink_set(pl->supported, 10baseT_Half); + phylink_set(pl->supported, 10baseT_Full); --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -138,6 +138,7 @@ typedef enum { diff --git a/target/linux/realtek/patches-5.15/711-net-phy-add-an-MDIO-SMBus-library.patch b/target/linux/realtek/patches-5.15/711-net-phy-add-an-MDIO-SMBus-library.patch index a80482d94a..4d851d05bd 100644 --- a/target/linux/realtek/patches-5.15/711-net-phy-add-an-MDIO-SMBus-library.patch +++ b/target/linux/realtek/patches-5.15/711-net-phy-add-an-MDIO-SMBus-library.patch @@ -120,49 +120,29 @@ Signed-off-by: Antoine Tenart --- a/include/linux/mdio/mdio-i2c.h +++ b/include/linux/mdio/mdio-i2c.h -@@ -12,5 +12,21 @@ struct i2c_adapter; +@@ -12,5 +12,8 @@ struct i2c_adapter; struct mii_bus; struct mii_bus *mdio_i2c_alloc(struct device *parent, struct i2c_adapter *i2c); +struct mii_bus *mdio_smbus_alloc(struct device *parent, struct i2c_adapter *i2c); -+ -+/* -+ * I2C bus addresses 0x50 and 0x51 are normally an EEPROM, which is -+ * specified to be present in SFP modules. These correspond with PHY -+ * addresses 16 and 17. Disallow access to these "phy" addresses. -+ */ -+static bool i2c_mii_valid_phy_id(int phy_id) -+{ -+ return phy_id != 0x10 && phy_id != 0x11; -+} -+ -+static unsigned int i2c_mii_phy_addr(int phy_id) -+{ -+ return phy_id + 0x40; -+} ++bool i2c_mii_valid_phy_id(int phy_id); ++unsigned int i2c_mii_phy_addr(int phy_id); #endif --- a/drivers/net/mdio/mdio-i2c.c +++ b/drivers/net/mdio/mdio-i2c.c -@@ -13,21 +13,6 @@ - #include - #include - --/* -- * I2C bus addresses 0x50 and 0x51 are normally an EEPROM, which is -- * specified to be present in SFP modules. These correspond with PHY -- * addresses 16 and 17. Disallow access to these "phy" addresses. -- */ +@@ -18,12 +18,12 @@ + * specified to be present in SFP modules. These correspond with PHY + * addresses 16 and 17. Disallow access to these "phy" addresses. + */ -static bool i2c_mii_valid_phy_id(int phy_id) --{ -- return phy_id != 0x10 && phy_id != 0x11; --} -- --static unsigned int i2c_mii_phy_addr(int phy_id) --{ -- return phy_id + 0x40; --} -- - static int i2c_mii_read(struct mii_bus *bus, int phy_id, int reg) ++bool i2c_mii_valid_phy_id(int phy_id) { - struct i2c_adapter *i2c = bus->priv; + return phy_id != 0x10 && phy_id != 0x11; + } + +-static unsigned int i2c_mii_phy_addr(int phy_id) ++unsigned int i2c_mii_phy_addr(int phy_id) + { + return phy_id + 0x40; + } diff --git a/target/linux/rockchip/image/Makefile b/target/linux/rockchip/image/Makefile index 8e9e52d57c..9e6089d471 100644 --- a/target/linux/rockchip/image/Makefile +++ b/target/linux/rockchip/image/Makefile @@ -69,7 +69,7 @@ define Device/Default PROFILES := Default KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb IMAGES := sysupgrade.img.gz - IMAGE/sysupgrade.img.gz = boot-common | boot-script | $$(BOOT_FLOW) | gzip | append-metadata + IMAGE/sysupgrade.img.gz = boot-common | boot-script $$(BOOT_SCRIPT) | $$(BOOT_FLOW) | gzip | append-metadata DEVICE_DTS = rockchip/$$(SOC)-$(lastword $(subst _, ,$(1))) UBOOT_DEVICE_NAME = $(lastword $(subst _, ,$(1)))-$$(SOC) endef diff --git a/tools/squashfs3-lzma/patches/150-fix-unitialized-memory.patch b/tools/squashfs3-lzma/patches/150-fix-unitialized-memory.patch new file mode 100644 index 0000000000..ad3b820894 --- /dev/null +++ b/tools/squashfs3-lzma/patches/150-fix-unitialized-memory.patch @@ -0,0 +1,11 @@ +--- a/squashfs-tools/mksquashfs.c ++++ b/squashfs-tools/mksquashfs.c +@@ -1822,7 +1822,7 @@ int main(int argc, char *argv[]) + { + struct stat buf, source_buf; + int i; +- squashfs_super_block sBlk; ++ squashfs_super_block sBlk = {}; + char *b, *root_name = NULL; + int be, nopad = FALSE, keep_as_directory = FALSE, orig_be; + squashfs_inode inode;