Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[22.03] ramips: correct page read return value of the mt7621 nand driver #12698

Closed
wants to merge 1 commit into from

Conversation

Djfe
Copy link
Contributor

@Djfe Djfe commented May 23, 2023

read_page() need to return maximum number of bitflips instead of the accumulated number. Change takes from upstream mt7621 u-boot [1].

  • @read_page: function to read a page according to the ECC generator
  •          requirements; returns maximum number of bitflips
    
  •          corrected in any single ECC step, -EIO hw error
    

[1] https://lore.kernel.org/all/cover.1653015383.git.weijie.gao@mediatek.com/

Signed-off-by: Shiji Yang yangshiji66@qq.com
(cherry picked from commit 2fbb91d)


We need this to prevent devices in the 22 release from running into bootloops when badblocks occur in the ubi partition.
Affected are atleast Asus RT-AX53U and RT-AX54.

This remains a draft, until I or @Znevna find the time for testing :)

EDIT:
I run-tested the patch successfully on my RT-AX53U.
But since my device doesn't have any bad blocks, I want to wait for Piotr's feedback :)
This was confirmed to be fixing the described issue by Piotr. This is ready to be reviewed and merged now

read_page() need to return maximum number of bitflips instead of the
accumulated number. Change takes from upstream mt7621 u-boot [1].

 * @read_page:  function to read a page according to the ECC generator
 *              requirements; returns maximum number of bitflips
 *              corrected in any single ECC step, -EIO hw error

[1] https://lore.kernel.org/all/cover.1653015383.git.weijie.gao@mediatek.com/

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
(cherry picked from commit 2fbb91d)
@Djfe Djfe changed the title ramips: correct page read return value of the mt7621 nand driver [22.03] ramips: correct page read return value of the mt7621 nand driver May 23, 2023
@Djfe
Copy link
Contributor Author

Djfe commented May 23, 2023

Hi @PiotrX1,
it would mean a lot to me, if you could also test the following image on your router:
https://gigamove.rwth-aachen.de/de/download/b1f2b52142ca863d80a8e58c6924f303

I would like to backport @DragonBluep's fix to the last release branch :)
But my own RT-AX53U doesn't have any bad blocks, yet. (So I can't fully test this patch)
OpenWrt 23 might be up on the horizon, but some Freifunk Communities in Germany only now start switching to OpenWrt 22 and it would make sense to prevent bootloops for our OpenWrt-based OS on these new devices :)

You need to reset your config on install, when downgrading. (sysupgrade -n)
You may take a backup of your current config and restore it later, if you wish :)

I can't recommend you to run up-to-date snapshots anymore. Master just switched to Kernel 6.1 and that needs to be properly tested still :)
I forgot that it stays 5.15 and 6.1 is just optional.

But the master-based image uploaded by @DragonBluep in your issue #12674 (comment) should still work fine for now :)
It master includes many fixes and improvements for our device that haven't made it into a release, yet. (better wifi and ethernet for example)
Soon there will be a release candidate of openwrt-23.05 that you can simply update to. (estimated 1-2 weeks)

I'll mention you here, when that build's ready.

@github-actions github-actions bot added kernel pull request/issue with Linux kernel related changes target/ramips pull request/issue for ramips target release/22.03 pull request/issue targeted (also) for OpenWrt 22.03 release labels May 23, 2023
@PiotrX1
Copy link

PiotrX1 commented May 23, 2023

@Djfe installed by sysupgrade and it works fine

dfateyev referenced this pull request May 23, 2023
read_page() need to return maximum number of bitflips instead of the
accumulated number. Change takes from upstream mt7621 u-boot [1].

 * @read_page:  function to read a page according to the ECC generator
 *              requirements; returns maximum number of bitflips
 *              corrected in any single ECC step, -EIO hw error

[1] https://lore.kernel.org/all/cover.1653015383.git.weijie.gao@mediatek.com/

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
@Djfe Djfe marked this pull request as ready for review May 23, 2023 17:23
@Djfe
Copy link
Contributor Author

Djfe commented May 23, 2023

awesome! 👌

@chunkeey
Copy link
Member

80fbad1

@chunkeey chunkeey closed this May 28, 2023
@Djfe
Copy link
Contributor Author

Djfe commented May 28, 2023

thank you 👍
Could you help with getting this backported into 23 as well?
#12697

@Djfe Djfe deleted the mt7621_nand_bitflips-22 branch May 28, 2023 21:26
@PiotrX1
Copy link

PiotrX1 commented May 28, 2023

Sure, just give me files and I will check.

@Djfe
Copy link
Contributor Author

Djfe commented May 28, 2023

I meant @chunkeey
we don't need to test 23, just merge the backport

@kamileoo92
Copy link

;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel pull request/issue with Linux kernel related changes release/22.03 pull request/issue targeted (also) for OpenWrt 22.03 release target/ramips pull request/issue for ramips target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants