RE: [PATCH v6 01/11] mtd: core: always create master device

Usyskin, Alexander
2025-06-12T13:20:59Z

> Subject: Re: [PATCH v6 01/11] mtd: core: always create master device
>
> ----- Ursprüngliche Mail -----
> > Von: "Alexander Usyskin" <alexander.usyskin@intel.com>
> > In general, it is fine for me - we have parent mtd initialized and participating
> > in power management.
> >
> > I can't see how to bend idr_alloc to allocate from the end and corner case
> > of full idr range is also will be problematic.
>
> I expected it to work because we can track the highest mtd ID and pass limits
> to idr_alloc(), no?
>
> Thanks,
> //richard

This will produce different ids if there are two mtd chips.
E.g.:
Before patches:
0 - first chip partition 1 - second chip partition
After patches:
0 - first chip partition 1 - first chip master
2 - second chip partition 3 - second chip master

Or we should manually give region for master's ids at the end
of idr range near UINT_MAX.
And that requires careful manual handling of overflows.

Personally, I think it is bad idea to rely on partition number,
but it is the status-quo now.

- -
Thanks,
Sasha