mtd: rawnand: vf610_nfc: fix the OOB of written pages and command timeouts
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest3 patches 0 repliesNew
- v23 patches 2 repliesSuperseded
- v12 patches 0 repliesSuperseded
Changes in v3 from the cover letter
- 3/3: a timeout in the raw re-read of vf610_nfc_correct_data() was counted as an ECC failure by vf610_nfc_read_page(). It is returned now (Sashiko)
- 1/3, 2/3: no change
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | mtd: rawnand: vf610_nfc: write the OOB bytes on page writesdrivers/ | +2 | 0 replies | |
| 2/3 | mtd: rawnand: vf610_nfc: keep a timed-out command from completing the next onedrivers/ | +9 | 0 replies | |
| 3/3 | mtd: rawnand: vf610_nfc: return an error when a command times outdrivers/ | +21 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH v3 0/3] mtd: rawnand: vf610_nfc: fix the OOB of written pages and command timeouts
From: Mehmet Fide <[email protected]>
Three fixes for the vf610_nfc driver. All three were pointed out by Sashiko, on the large-OOB series [1] and on v1 of this one [2].
1/3: the ECC page write transfers the spare area out of the controller SRAM but nothing ever puts chip->oob_poi there, so every written page gets whatever the previous transfer left behind as its OOB.
2/3: a command that timed out can still finish later, and then the next command returns before the controller is done.
3/3: a timeout is only logged, the callers report success.
Tested on a Colibri VF50 (MX30LF1G18AC) with v7.4-rc2, PROVE_LOCKING and DEBUG_ATOMIC_SLEEP. A debug patch skipped the wait of one command, so that the command finished after the status flags had been cleared, and counted the commands that returned while the controller was still busy:
unpatched: 250 after 100 forced timeouts
completion reinitialized (v1): 41 after 100 forced timeouts
this series: 0 after 200 forced timeouts
With the series each forced timeout came back as a read error and the reads after it returned the right data. An 8 MiB UBIFS write read back identical after dropping the caches, with no ECC corrections or failures and no lockdep or atomic sleep report.
For the v3 change the debug patch forced the timeout in the raw re-read of an erased page, 50 times. With v2 each read of that page from /dev/mtd succeeded and ecc_failures went up by one, with v3 each read failed with ETIMEDOUT and ecc_failures stayed 0.
Changes in v3:
- 3/3: a timeout in the raw re-read of vf610_nfc_correct_data() was counted as an ECC failure by vf610_nfc_read_page(). It is returned now (Sashiko)
- 1/3, 2/3: no change
Changes in v2:
- rebased on v7.4-rc2. The large-OOB fix that patch 1 builds on (vf610_nfc_spare_size()) is merged, which was the build failure Sashiko reported on v1 1/2
- 1/3: comment dropped, commit message shortened, no code change
- 2/3: rewritten. Sashiko was right that reinitializing the completion is not enough, see the numbers above. The idle interrupt is now disabled on a timeout and the status flags are cleared before a command starts
- 3/3: new
[1] https://lore.kernel.org/linux-mtd/[email protected]/
[2] https://lore.kernel.org/linux-mtd/[email protected]/
v2: https://lore.kernel.org/linux-mtd/[email protected]/
Mehmet Fide (3):
mtd: rawnand: vf610_nfc: write the OOB bytes on page writes
mtd: rawnand: vf610_nfc: keep a timed-out command from completing the
next one
mtd: rawnand: vf610_nfc: return an error when a command times out
drivers/mtd/nand/raw/vf610_nfc.c | 43 ++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 11 deletions(-)
base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
Signature · 1 line
2.56.0