Re: [PATCH 1/1] mtd: ubi: skip programming unused bits in ubi headers

From: Richard Weinberger

Date: Fri Nov 07 2025 - 04:18:11 EST


----- Ursprüngliche Mail -----
> Von: "Cheng Ming Lin" <linchengming884@xxxxxxxxx>
>> Here I am reaching the limits of my UBI knowledge, so I would prefer
>> Richard to (in)validate what I am saying, but AFAIU, the VID header can
>> be literally anywhere in the page, not just at the start or end of a
>> subpage, so in the vid_hdr_shift I would expect some extra maths to
>> happen, no?

Good catch!
I had to read the code change twice to see the problem, though. :-S

> I understand your point now. If the VID header is not guaranteed to be
> at the start or end of a subpage, then yes, my current logic needs to be
> reworked to cover that case.

Yes. This can be configured using ubiattach --vid-hdr-offset ...
With nandsim you can test all kind of combinations.

Thanks,
//richard