Skip to content

mtd: add experimental P105 native append writes - #91

Merged
henrikklee merged 4 commits into
OrchardLinux:mainfrom
shaynelegault:p105/07-ftl-append
Nov 7, 2026
Merged

henrikklee merged 4 commits into
OrchardLinux:mainfrom
shaynelegault:p105/07-ftl-append

Conversation

@shaynelegault

@shaynelegault shaynelegault commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

P105 can now append logical writes through the native kernel VFL/SwissPPNFTL path. Each complete 16 KiB program and its metadata pass synchronous readback before the map changes. Partial-sector updates preserve untouched bytes, and flush/FUA follow the same completion rule.

This exports three source commits as MTD patches 0006–0008, scoped to apple-armv7, and records separate device/chip evidence. Allocation preserves Apple contexts, VFL bootstrap members and mapped blocks. Every candidate is checked completely before use. Native summaries support fresh replay after open or closed blocks; an interrupted summary requires a fully validated data prefix. The allocator stops at ENOSPC; erase and reclamation remain open.

Both write Kconfig options default off. Logical writes also require write_enable=1, a verified program callback and a supported replay state. The recovered allocation floor must equal the final visible journal sequence. That holds for the saved 64 GB map checked by the C core. The caller must fence the intended logical partition. Request processing uses a NOIO allocation scope to prevent recursive writeback while its lock is held.

The inherited operating policy defaults to 32768 explicit read callbacks and ten minutes from probe. Program-internal blank checks and readback stay inside their provider callback, whose deadline is checked before and after completion. An installed root needs an explicit operating policy. P105 storage_read and storage_write stay missing, which keeps installation gated.

Validation:

  • The official exporter proves the three patches reproduce Linux c63274165870417f01cc3e1264067cef71d9c0b2 from dependency 161217fd32. Selection changes from 28 to 31 patches on ARMv7; both ARM64 selections remain at 450.
  • Exact current ARMv7 core, block, fixture and H2FMI objects compile in read-only and write-enabled configurations with W=1 and warnings as errors, retaining the inherited vmstat.h enum warning.
  • All 26 real Linux KUnit cases pass on pinned pristine v6.12 with exact core/block/test C and a validation-only dependency symbol for the synthetic program provider. This excludes H2FMI hardware.
  • Host ASan/UBSan checks pass 26 core cases, 13 read-only cases, 25 request-helper cases plus 2048 varied requests, and queue/provider policy checks. Coverage includes all 16 lanes, 8160 footer entries, uncertain programs, NOIO scope and fresh replay.
  • Actual C replay of saved pages matches 28830 map boundary checks and native LwVM/System prefixes. The full Orchard suite completed 663 tests with one Linux-only Cascadia runtime fixture skipped. The three modules that launch isolated Python children were rerun in a private venv installed from this exact checkout: all 32 tests passed, and python -I resolves this checkout. All 34 catalog checks and four kernel-tree/export tests pass; the matrix regenerated unchanged.

The exact kernel writer awaits physical qualification. The earlier unplugged Omarchy desktop used the local Python backend. Native iOS recovery after writes, reboot persistence and interruption handling still require approved device work.

The topic-only delta is fd7bf97…4d93e3b. This draft targets upstream main. Merge dependencies are patch scoping (#85), verified PPN programming (#87), then bounded native-map recovery (#89). The latter carries the read and recovery-producer prerequisites.

@shaynelegault
shaynelegault marked this pull request as ready for review November 7, 2026 05:07
henrikklee added a commit that referenced this pull request Nov 7, 2026
Add the append writes of #91 to kernel/patches/armv7/mtd: the iOS disk
of the 64 GB iPad mini 1 becomes writable. Writing is part of the driver;
the default-off MTD_APPLE_SFTL_WRITE option and the write_enable module
parameter are gone. The disk stays read-only only when the replayed
journal does not end at the allocation floor. Without reclamation (#93),
writes fail once the blank blocks are used up. The patch keeps Shayne
Legault as author and notes the changes and his original commit IDs.
The bring-up notes and the board README follow the driver as carried.

Assisted-by: LLM
shaynelegault and others added 4 commits November 7, 2026 20:35
Document native VFL/SwissPPNFTL recovery, saved-capture crosschecks,
KUnit results and the latest finite provider lifetime. Keep both logical
storage capabilities missing until exact-revision device qualification.
Record the host and ARM64 test limits separately from hardware evidence.

All 34 catalog tests pass. Matrix regeneration leaves capability rows
unchanged; the P105 device and A5 chip schemas validate.

Assisted-by: LLM
Add the PPN page provider and the Apple VFL/SwissPPNFTL translation layer
of OrchardLinux#89 to kernel/patches/armv7/mtd, built into the apple-armv7 kernel. The
64 GB iPad mini 1's iOS disk appears as a read-only applesftlN, and its
LwVM partitions with it.

The read budget and lifetime module parameters are gone, so a mounted
root reads for as long as the system runs; a provider error still stops
the reader. Each patch keeps Shayne Legault as author and notes the
changes and his original commit IDs. The bring-up notes and the board
README follow the driver as carried.

Assisted-by: LLM
Describe the kernel append, summary replay and logical write policy
following native-map recovery. Keep storage_write missing and retain the
installation gate while the exact kernel revision awaits physical write
qualification. Record separate A5 append evidence and the outstanding
recovery, persistence and reclamation work.

The source passes both current ARMv7 object variants and 26 real Linux
KUnit cases. Host checks cover request updates and bounded provider
forwarding. Document their scope together with default-off policy and
NOIO request allocation. Kernel patch export remains a separate step.

Regenerate the support matrix and run all 34 catalog tests with the
checkout's absolute PYTHONPATH; both storage states stay missing.

Assisted-by: LLM
Add the append writes of OrchardLinux#91 to kernel/patches/armv7/mtd: the iOS disk
of the 64 GB iPad mini 1 becomes writable. Writing is part of the driver;
the default-off MTD_APPLE_SFTL_WRITE option and the write_enable module
parameter are gone. The disk stays read-only only when the replayed
journal does not end at the allocation floor. Without reclamation (OrchardLinux#93),
writes fail once the blank blocks are used up. The patch keeps Shayne
Legault as author and notes the changes and his original commit IDs.
The bring-up notes and the board README follow the driver as carried.

Assisted-by: LLM
@henrikklee
henrikklee merged commit 296cab7 into OrchardLinux:main Nov 7, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants