openwrt/target/linux
Lech Perczak c55aaa7c9a ath79: generic: disable SPI-NOR write protect unconditionally
Kernel 5.15 introduced a significant change to spi-nor subsystem [1],
which would the SPI-NOR core to no longer unprotect the Flash chips if
their protection bits are non-volatile, which is the case for MX25L6405D
and MX25L12805D, used in Ubiquiti XW and WA lines of devices [2].

However, their bootloader forcibly enables this protection before
continuing to boot, making the kernel not unprotect the flash upon boot,
causing JFFS2 to be unable write to the filesystem. Because sysupgrade
seems to unlock the flash explicitly, the upgrade will work, but the
system will be unable to save configrationm showing the following symptom
in the kernel log:

[   86.168016] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   86.192344] jffs2_build_filesystem(): unlocking the mtd device...
[   86.192443] done.
[   86.200669] jffs2_build_filesystem(): erasing all blocks after the end marker...
[   86.220646] jffs2: Newly-erased block contained word 0x19852003 at offset 0x001e0000
[   86.292388] jffs2: Newly-erased block contained word 0x19852003 at offset 0x001d0000
[   86.324867] jffs2: Newly-erased block contained word 0x19852003 at offset 0x001c0000
[   86.355316] jffs2: Newly-erased block contained word 0x19852003 at offset 0x001b0000
[   86.402855] jffs2: Newly-erased block contained word 0x19852003 at offset 0x001a0000

Disable the write protection unconditionally for ath79/generic subtarget,
so the XW and WA devices can function again. However, this is only a
stopgap solution - it probably should be investigated if there is a way
to selectively unlock the area used by rootfs_data - but given the lock
granularity, this seems unlikely.

With this patch in place, rootfs_data partition on my Nanostation Loco
M5 XW is writable again.

Fixes: #12882
Fixes: #13750
Fixes: 579703f38c ("ath79: switch to 5.15 as default kernel")
Link: http://www.infradead.org/pipermail/linux-mtd/2020-October/082805.html
Link: https://forum.openwrt.org/t/powerbeam-m5-xw-configuration-loss-after-reboot/141925
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>

(cherry picked from commit f024f4b1b0)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2024-01-25 19:16:15 +01:00
..
airoha kernel: bump 5.15 to 5.15.125 2023-08-10 21:07:50 +02:00
apm821xx apm821xx: WNDR4700: fix broken sysupgrade, factory images 2023-10-21 16:42:26 +02:00
archs38 treewide: remove files for building 5.10 kernel 2023-05-12 13:02:43 +02:00
armsr armsr: preserve configuration during sysupgrade 2023-10-20 00:41:41 +02:00
at91 treewide: remove files for building 5.10 kernel 2023-05-12 13:02:43 +02:00
ath25 kernel: bump 5.15 to 5.15.131 2023-09-25 23:04:37 +02:00
ath79 ath79: generic: disable SPI-NOR write protect unconditionally 2024-01-25 19:16:15 +01:00
bcm27xx kernel: bump 5.15 to 5.15.147 2024-01-21 12:51:29 +01:00
bcm47xx kernel: bump 5.15 to 5.15.146 2024-01-08 23:15:35 +01:00
bcm53xx bcm53xx: add the latest fix version of brcm_nvram 2023-11-02 09:45:16 +01:00
bcm63xx kernel: bump 5.15 to 5.15.125 2023-08-10 21:07:50 +02:00
bcm4908 kernel: bump 5.15 to 5.15.137 2023-10-29 13:00:28 +01:00
bmips kernel: bump 5.15 to 5.15.125 2023-08-10 21:07:50 +02:00
gemini kernel: bump 5.15 to 5.15.146 2024-01-08 23:15:35 +01:00
generic kernel: bump 5.15 to 5.15.147 2024-01-21 12:51:29 +01:00
imx kernel: backport NVMEM patches queued for the v6.5 2023-07-10 12:54:53 +02:00
ipq40xx kernel: bump 5.15 to 5.15.145 2024-01-07 12:57:30 +00:00
ipq806x kernel: bump 5.15 to 5.15.145 2024-01-07 12:57:30 +00:00
ipq807x kernel: bump 5.15 to 5.15.145 2024-01-07 12:57:30 +00:00
kirkwood kirkwood: fix Ctera C200 V1 ubi part name 2023-12-14 21:40:20 +01:00
lantiq Revert "lantiq: xway: kernel: enable SMP support" 2024-01-16 13:23:11 +01:00
layerscape treewide: fix shell errors during dump stage 2023-11-13 14:02:38 +01:00
malta treewide: remove files for building 5.10 kernel 2023-05-12 13:02:43 +02:00
mediatek mediatek: filogic: add support ASUS RT-AX59U 2024-01-20 19:07:15 +01:00
mpc85xx mpc85xx: allow mapping of cpu1 spin-table page 2023-12-04 14:21:21 +01:00
mvebu kernel: bump 5.15 to 5.15.145 2024-01-07 12:57:30 +00:00
mxs mxs: rework image generation 2023-07-06 17:04:13 +02:00
octeon kernel: bump 5.15 to 5.15.145 2024-01-07 12:57:30 +00:00
octeontx kernel: bump 5.15 to 5.15.145 2024-01-07 12:57:30 +00:00
omap treewide: remove files for building 5.10 kernel 2023-05-12 13:02:43 +02:00
oxnas kernel: bump 5.15 to 5.15.145 2024-01-07 12:57:30 +00:00
pistachio kernel: fix mtd/NVMEM regression affecting U-Boot env NVMEM driver 2023-11-02 09:45:08 +01:00
qoriq kernel: fix handling of CONFIG_DYNAMIC_DEBUG 2023-05-03 10:26:17 -07:00
ramips ramips: add support for D-Link COVR-X1860 A1 2024-01-08 21:13:54 +01:00
realtek realtek: d-link dgs-1210-10p improve sfp support 2024-01-24 17:53:41 +01:00
rockchip rockchip: configure eth pad driver strength for orangepi r1 plus lts 2024-01-05 23:36:31 +01:00
sifiveu kernel: bump 5.15 to 5.15.117 2023-06-17 12:09:03 +02:00
sunxi sunxi: fixes led for nanopi boards 2023-10-31 00:44:03 +01:00
tegra treewide: remove files for building 5.10 kernel 2023-05-12 13:02:43 +02:00
uml kernel: bump 5.15 to 5.15.132 2023-09-25 23:04:37 +02:00
x86 kernel: bump 5.15 to 5.15.139 2023-11-25 20:17:09 +01:00
zynq generic: enable CONFIG_ARM_CRYPTO for 32bit arm targets 2023-05-10 19:01:45 +02:00
Makefile build: fix issues with targets installed via feeds 2022-09-27 13:41:12 +02:00