Powerbeam M5 XW Configuration Loss after reboot

Progress! Thank you for looking into this.
There really seem to be multiple variants of this issue (works fine, JFFS write doesn't work but sysupgrade does, neither works) - I'm starting to wonder if it's a timing issue.
When I first installed on my NanoStation AC loco (19.07.2 on top of WA.v8.5.4), I ended up in the "JFFS can't write, but sysupgrade works" case, but reflashing the same 19.07.2 fixed it. Now on the same device, 22.03 is fine but 23.05 can't sysupgrade.

I think I have a very strong candidate:
This commit was introduced between v5.10 and v5.15:
http://www.infradead.org/pipermail/linux-mtd/2020-October/082805.html

Without unblocking the chip as was done in the "legacy way", plus UBNT's U-boot enabling block protection by force will cause the issues.

Enabling CONFIG_MTD_SPI_NOR_WP_DISABLE for ath79/generic should do the trick. Building now.

Edit: it does the trick. PR is here: https://github.com/openwrt/openwrt/pull/14237 - please review and test.

Wonderful news!
I'm unfortunately unable to pull my unit from production duty to test it. Soon, hopefully.
Two questions regarding your fix:

  • Any idea why some of us experience a non-functioning (i.e.no error reported, but does nothing) sysupgrade?
  • I'm surprised to see the config change on the default ath79 config. is there a risk to break other devices? So far, I believe that the issue has only been reported on (some?) Ubiquiti.

Good question, actually - I think maybe earlier versions contained some other bugs affecting software write protect, that caused the unlocking done by sysupgrade to be ineffective.

Only generic subtarget. This reverts back to the old behaviour from kernel 5.10, before the change I found was introduced - so very, very unlikely. Previously, kernel simply unlocked every flash with SWP at boot.

Not sure which "earlier versions" you're referring to. In my case, once on 23.05.2, I can no longer flash anything with sysupgrade. My understanding is that @humaita (above) had the same issue, as well as @nivex in #13750.

Ah, this may also depend on exact HW type and what U-boot does. On my NSlocoM5 XW sysupgrade worked, and I did my local build shortly after 23.05.2 release, with same kernel.

Does this mean that the change is in snapshots now? If that's the case, I will test.

No, it's not yet. Please see PR linked above.

Patch tested on Nanostation AC loco, but result are inconclusive.

  • I couldn't test with 1c26bcb108 (23.05.2) - the build was failing because of https://github.com/openwrt/packages/pull/22668 - so I tested with the current HEAD of openwrt-23.05 (59fd8f08cf)
  • Patch doesn't apply on 23.05 branch, but is easy to adapt.
  • Build succeeded, reflash succeeded, but upon reboot, configuration hadn't been preserved. However, luci was also missing.
  • Since I was running out of time, I decided to reflash to 22.03.6 with the command-line interface, but sysupgrade output ended with
Tue Dec 19 03:10:26 UTC 2023 upgrade: Commencing upgrade. Closing all shell sessions.
Command failed: Connection failed
root@OpenWrt:~# Connection to 192.168.1.1 closed by remote host.
Connection to 192.168.1.1 closed.
  • Upon reboot, I was still on 23.05 with no luci. So it's not clear if sysupgrade failed because of the error above or a read-only flash.

I need to spend more time to figure out the details of the build system. But I also found that someone is claiming success with MTD_SPI_NOR_SWP_DISABLE=y here: https://github.com/openwrt/openwrt/issues/12882#issuecomment-1763536450

Probably the flash for Nanostation AC behaves differently because of size and protected areas. My patch was merged, you can try factory-flashing the snapshot now (assuming builds were passed already, ofc)

The snapshot build is indeed working on my Nanostation AC loco. Thanks!
I haven't made progress on my local build on the 23.05 branch, so the verdict is still out on that one. But given that both branches are on Linux 5.15, I'm very optimistic.
Full details here.

Great, glad to hear that. I will open PR for 23.05 branch too - probably tomorrow.

I've got hit by this issue AGAIN when trying to bump flash size for my units using 16MB Winbond chips, so I decided to share.

For W25Q128FVFG, the kernel unlock mechanism would not work, for some reason - despite flashrom showing the chip isn't protected, nor could U-boot autoupdate itself. I had to go back to version 5.5.9 by going through 6.0.4-beta, 5.6.15 (both through TFTP), and then to 5.5.9 using web upgrade - from then I could install OpenWrt factory image through the web interface, too. I tested on OpenWrt v23.05.2 which is known broken - so there is another option to use current release instead. Version 5.6.15 wasn't enough, I had to take the extra step down to v5.5.9.

There wasn't much doubt left, but an official 23.05 is now out with the fix (23.05.3), and it works as expected on my Nanostation AC loco. :partying_face: :tada: