Repository navigation
P105 NAND: Cascadia's 16 GB support and write-failure handling on top of #93; checkpointed data fix - #210
Merged
Conversation
…ted write-failure handling and 16 GB support ported on top Compares Shayne Legault's merged H2FMI/apple-sftl stack and draft #93 with rzxvx's apple_ppn/apple_ftl in Project Cascadia ad28ba4, and lists what each side keeps, what is ported and in which order it is qualified. Assisted-by: LLM
The P105's translation layer registered only on the 64 GB NAND package. Port Cascadia's 16 GB layout into it (patch 0018, authored by rzxvx): four banks of 1064 blocks of 256 pages, 1055 superblocks, the VFL in blocks 1062/1063, iOS 8.4.1's context and summary rules. A 16 GB P105 now gets a read-only applesftl disk of 16,000,000,000 bytes. 0017 first moves #93's fixed 64 GB constants into a geometry descriptor, unchanged in behaviour for the 64 GB package. KUnit gains a synthetic 16 GB medium (3 cases); all 84 apple-sftl and apple-h2fmi cases pass. Untested on hardware. Assisted-by: LLM
H2FMI only worked in the DDR interface iBoot leaves and refused to probe otherwise. Patch 0019 (authored by rzxvx) ports Cascadia's controller facts into it: the SDR bring-up order with the power state set after the NAND reset, the measured timing, firmware and bad-block table reads, and SDR page transfers as one start per 4112-byte unit. The DDR path is unchanged; nothing on today's boot chain takes the SDR path yet. The armv7 config turns on STRICT_DEVMEM and IO_STRICT_DEVMEM, so /dev/mem can no longer reach the NAND controller's registers that H2FMI claims. Cascadia added this after a user-space tool reset the controller in the middle of a program and tore a page (its 2026-11-16 incident). KUnit: 85 cases pass. Untested on hardware. Assisted-by: LLM
A failed program stopped the P105's NAND writer and every later I/O on that bus. Patch 0021 (authored by rzxvx) ports Cascadia's session give-up: the failed block is abandoned, its live pages move to a new block, and the write completes there; after eight failures in a session the writer still stops. 0020 lets H2FMI reset the packages after a failed transaction instead of refusing all further I/O, which the give-up needs because every superblock spans both buses. Torn pages still stop the writer until the next patch. KUnit: 87 cases pass (the old stop-on-failure cases now assert the give-up). Untested on hardware. Assisted-by: LLM
A torn page at the end of an open block made the whole P105 medium unreadable. Patch 0022 (authored by rzxvx) ports Cascadia's give_up_torn: the load skips that one page and its four sequences, and the first write moves the block's live pages elsewhere. Only malformed metadata on the block's last programmed page counts as torn; read errors and unknown statuses still stop the load, as #93 decided. KUnit: 89 cases pass. Untested on hardware. Assisted-by: LLM
…oposal Patch 0023 (authored by rzxvx) adds CONFIG_MTD_APPLE_H2FMI_FAULT_INJECT, default n: debugfs fault attributes make a page program fail before or after it reaches the NAND, or an erase fail, so the give-up paths can be exercised on a tablet as Cascadia did. KUnit gains Cascadia's fault script on synthetic media: 90 cases pass. The merge proposal now lists what each port became, compares #93's native context encoder with Cascadia's iOS 8.4.1 encoder field by field (port 2, offline: the w0c dump is private), and marks what needs a tablet or the dump in its order section. device.toml notes that the 16 GB read path is untested. Assisted-by: LLM
Fusion patch 0022 treats native data with an older user epoch as a torn page. When another programmed page follows, SFTL aborts the map load with -EBADMSG. Accept the older epoch for subtype-1 disk data that the checkpoint already covers. The loader can skip those records during replay and still validate newer records. Add the ARM KUnit regression and record the 64 GB P105 comparison. All 954 ranges read by the iPad matched an independent reconstruction from raw flash captured during the same boot. Assisted-by: LLM Signed-off-by: Shayne Legault <8741557+shaynelegault@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On top of #93 (now merged), for the iPad mini 1 (P105) internal storage:
docs/bring-up/p105-nand-merge-proposal.md, Orchard's stack as the base with Cascadia's tested parts ported on top.Reclamation stays off on the P105 (
reclaims = false). Writing is still untested on a device.