Timofei V. Bondarenko
timm at ipi.ac.ru
Thu Apr 28 03:00:15 EDT 2005
Todd Poynor wrote:
> Timofei V. Bondarenko wrote:
>> It would be nice to unlock the rw partitions only.
>> After add_mtd_partitions() my startap code has no handle to actual
>> partition info.
>> The mtd_partition.mtdp seems only choice, though it prevents
>> partitions from registering...
>> So, could couple of lines in add_mtd_partitions() do that work?
> If I understand correctly, it may be the same issue I ran into on Intel
> NOR flash: the chip driver (which may have the knowledge of whether the
> particular chips are locked or lockable) gets to see the "whole device"
> struct mtd_info at probe time, but doesn't see the "partition" structs
> registered later via add_mtd_partitions(), which have the per-partition
> r/w flags.
> I tried adding a callback to the chip driver at each device/partition
> add (see first patch attempt in recent "Fixup Intel flash that powers up
> locked" thread). But I believe that was part of what was (justifiably)
> deemed messy about the patch.
Do you mean 'mtd_info::notify_add' ?
I've mentioned the 'mtd_partition::mtdp' - it could be an alternative
(a bit complicated though). The register_mtd_user() also may help...
> So far the general verdict on these flashes that power up locked seems
> to be either leave all blocks locked or unlock all blocks (either in the
> bootloader or at flash probe time), and let custom code in userspace
> lock/unlock what is needed. I do like the idea of the kernel rectifying
> lock status with the map flags myself, though...
I'm not complaining about.
More information about the linux-mtd