immortalwrt/target/linux
Lech Perczak f024f4b1b0 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>
2023-12-24 12:42:12 +01:00
..
airoha
apm821xx apm821xx: convert to nvmem-layout 2023-11-25 22:50:32 +01:00
archs38
armsr kernel: bump 6.1 to 6.1.69 2023-12-21 11:26:35 +01:00
at91
ath25
ath79 ath79: generic: disable SPI-NOR write protect unconditionally 2023-12-24 12:42:12 +01:00
bcm27xx kernel: bump 6.1 to 6.1.69 2023-12-21 11:26:35 +01:00
bcm47xx
bcm53xx kernel: backport upstream brcm_nvram fix for NAND controller 2023-12-18 08:33:04 +01:00
bcm63xx
bcm4908 kernel: bump 5.15 to 5.15.137 2023-10-27 19:43:06 +01:00
bmips bmips: remove mac-address-increment 2023-11-22 00:02:01 +01:00
gemini gemini: usb-fotg210: remove uneeded dependency on @USB_SUPPORT 2023-11-08 22:01:44 +01:00
generic kernel: bump 6.1 to 6.1.69 2023-12-21 11:26:35 +01:00
imx imx: enable CONFIG_CPU_FREQ_THERMAL 2023-12-12 19:35:03 +01:00
ipq40xx ipq40xx: update ASUS RT-AC58U leds DTS nodes 2023-12-02 21:57:38 +01:00
ipq806x kernel: bump 6.1 to 6.1.69 2023-12-21 11:26:35 +01:00
ixp4xx ixp4xx: add Generic subtarget definition 2023-12-09 14:45:50 +01:00
kirkwood kirkwood: backport fix Ctera C200 V1 ubi part name to 6.1 2023-12-15 17:59:35 +01:00
lantiq kernel: bump 5.15 to 5.15.143 2023-12-19 14:18:55 +01:00
layerscape kernel: bump 5.15 to 5.15.142 2023-12-11 17:39:57 +01:00
malta
mediatek kernel: bump 5.15 to 5.15.143 2023-12-19 14:18:55 +01:00
mpc85xx mpc85xx: allow mapping of cpu1 spin-table page 2023-12-04 14:20:46 +01:00
mvebu mvebu: fix RTC of IEI-World Puzzle M90x devices 2023-12-18 22:17:09 +00:00
mxs
octeon kernel: bump 6.1 to 6.1.68 2023-12-19 14:12:25 +01:00
octeontx kernel: bump 5.15 to 5.15.140 2023-11-29 23:41:33 +01:00
omap
oxnas kernel: bump 5.15 to 5.15.141 2023-12-04 12:47:55 +01:00
pistachio kernel: fix mtd/NVMEM regression affecting U-Boot env NVMEM driver 2023-10-31 17:33:28 +01:00
qoriq qoriq: pad rootfs with zeros 2023-12-02 14:06:56 +02:00
qualcommax ipq807x: add support for ZTE MF269 2023-12-14 10:30:19 +08:00
ramips kernel: modules: break-out WM8960 codec module 2023-12-11 18:01:43 +00:00
realtek realtek: 5.15: rtl93xx: support 100BASE-T and 10BASE-T MAC modes 2023-12-24 01:36:39 +01:00
rockchip rockchip: make SMP affinity of RTL8152 on XHCI more robust 2023-12-15 18:02:43 +01:00
sifiveu kernel: remove CONFIG_DEVTMPFS_SAFE from target config 2023-11-19 16:46:24 +01:00
sunxi sunxi: mark upstreamed patches as such 2023-12-19 16:02:05 +01:00
tegra
uml
x86 Revert "x86: add support for Mellanox Spectrum SN2000 Switches" 2023-12-23 07:52:05 +00:00
zynq
Makefile