From: Miquel Raynal <miquel.raynal@bootlin.com>
To: "Usyskin, Alexander" <alexander.usyskin@intel.com>
Cc: "Richard Weinberger" <richard@nod.at>,
"Guenter Roeck" <linux@roeck-us.net>,
"Vignesh Raghavendra" <vigneshr@ti.com>,
"De Marchi, Lucas" <lucas.demarchi@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Jani Nikula" <jani.nikula@linux.intel.com>,
"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
"Tvrtko Ursulin" <tursulin@ursulin.net>,
"Poosa, Karthik" <karthik.poosa@intel.com>,
"Abliyev, Reuven" <reuven.abliyev@intel.com>,
"Weil, Oren jer" <oren.jer.weil@intel.com>,
linux-mtd <linux-mtd@lists.infradead.org>,
"DRI mailing list" <dri-devel@lists.freedesktop.org>,
intel-gfx <intel-gfx@lists.freedesktop.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v6 01/11] mtd: core: always create master device
Date: Wed, 11 Jun 2025 16:53:24 +0200 [thread overview]
Message-ID: <87y0tytjmj.fsf@bootlin.com> (raw)
In-Reply-To: <CY5PR11MB636692EFD9BB99B6F2D959BFED75A@CY5PR11MB6366.namprd11.prod.outlook.com> (Alexander Usyskin's message of "Wed, 11 Jun 2025 10:52:36 +0000")
Hello,
On 11/06/2025 at 10:52:36 GMT, "Usyskin, Alexander" <alexander.usyskin@intel.com> wrote:
>> Subject: Re: [PATCH v6 01/11] mtd: core: always create master device
>>
>> ----- Ursprüngliche Mail -----
>> > Von: "Miquel Raynal" <miquel.raynal@bootlin.com>
>> >> On 6/10/25 05:54, Richard Weinberger wrote:
>> >>> ----- Ursprüngliche Mail -----
>> >>>> Von: "Alexander Usyskin" <alexander.usyskin@intel.com>
>> >>>> Richard, I've reproduced your setup (modulo that I must load mtdram
>> manually)
>> >>>> and patch provided in this thread helps to fix the issue.
>> >>>> Can you apply and confirm?
>> >>> Yes, it fixes the issue here! :-)
>> >>>
>> >>
>> >> It doesn't seem to fix the issue if the partition data is in
>> >> devicetree.
>> >
>> > I had a look at the patch again. The whole mtd core makes assumptions on
>> > parenting, which is totally changed with this patch. There are so many
>> > creative ways this can break, I don't believe we are going to continue
>> > this route. I propose to revert the patch entirely for now. We need to
>> > find another approach, I'm sorry.
>>
>> I think reverting is a valid option to consider if the issue turns out to be
>> a "back to the drawing board" problem.
>>
>> > Alexander, can you please remind me what was your initial problem? I
>> > believe you needed to anchor runtime PM on the master device. Can you
>> > please elaborate again? Why taking the controller as source (the
>> > default, before your change) did not work? Also why was selecting
>> > MTD_PARTITIONED_MASTER not an option for you? I'm trying to get to the
>> > root of this change again, so we can find a solution fixing "the world"
>> > (fast) and in a second time a way to address your problem.
>>
>> IIRC the problem is that depending on CONFIG_MTD_PARTITIONED_MASTER
>> won't fly as PM needs to work with any configuration.
>> And enforcing CONFIG_MTD_PARTITIONED_MASTER will break existing
>> setups because mtd id's will change.
>>
>> On the other hand, how about placing the master device at the end
>> of the available mtd id space if CONFIG_MTD_PARTITIONED_MASTER=n?
>> A bit hacky but IMHO worth a thought.
>>
>> Thanks,
>> //Richard
>
> The original problem was that general purpose OS never set
> CONFIG_MTD_PARTITIONED_MASTER and we need valid device tree
> to power management to work.
>
> We can return to V7 of this patch that only creates dummy master if
> CONFIG_MTD_PARTITIONED_MASTER is off.
> In this case the hierarchy remains the same.
>
> Miquel, can you re-review v7 and say if it worth to revert current version and
> put v7 instead?
After taking inspiration from Richard's wisdom on IRC, we have another
proposal. Let's drop the mtd_master class. We need an mtd device to be
the master device, we already have one but we cannot keep *at the
beginning* of the ID space under the CONFIG_MTD_PARTITIONED_MASTER=n
configuration to avoid breaking userspace. So let's keep the master
anyway, with the following specificities in the problematic case:
- id is allocated from the max value downwards (avoids messing with
numbering)
- mtd device is simply hidden (same user experience as before)
Apparently this second point, while not natively supported, is something
the block world already does:
https://elixir.bootlin.com/linux/v6.15.1/source/include/linux/blkdev.h#L88
What do you think?
Thanks,
Miquèl
next prev parent reply other threads:[~2025-06-11 14:53 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-02 14:09 [PATCH v6 00/11] mtd: add driver for Intel discrete graphics Alexander Usyskin
2025-03-02 14:09 ` [PATCH v6 01/11] mtd: core: always create master device Alexander Usyskin
2025-06-08 1:37 ` Guenter Roeck
2025-06-08 7:00 ` Usyskin, Alexander
2025-06-08 19:37 ` Miquel Raynal
2025-06-09 0:59 ` Guenter Roeck
2025-06-09 9:43 ` Miquel Raynal
2025-06-09 12:23 ` Usyskin, Alexander
2025-06-09 13:08 ` Guenter Roeck
2025-06-09 15:16 ` Usyskin, Alexander
2025-06-09 15:53 ` Guenter Roeck
2025-06-09 21:27 ` Richard Weinberger
2025-06-10 11:02 ` Usyskin, Alexander
2025-06-10 12:54 ` Richard Weinberger
2025-06-10 16:15 ` Guenter Roeck
2025-06-11 9:34 ` Miquel Raynal
2025-06-11 10:26 ` Richard Weinberger
2025-06-11 10:52 ` Usyskin, Alexander
2025-06-11 14:53 ` Miquel Raynal [this message]
2025-06-12 10:01 ` Usyskin, Alexander
2025-06-12 10:25 ` Richard Weinberger
2025-06-12 12:37 ` Usyskin, Alexander
2025-03-02 14:09 ` [PATCH v6 02/11] mtd: add driver for intel graphics non-volatile memory device Alexander Usyskin
2025-03-02 14:09 ` [PATCH v6 03/11] mtd: intel-dg: implement region enumeration Alexander Usyskin
2025-03-02 14:09 ` [PATCH v6 04/11] mtd: intel-dg: implement access functions Alexander Usyskin
2025-03-02 14:09 ` [PATCH v6 05/11] mtd: intel-dg: register with mtd Alexander Usyskin
2025-03-02 14:09 ` [PATCH v6 06/11] mtd: intel-dg: align 64bit read and write Alexander Usyskin
2025-03-02 14:09 ` [PATCH v6 07/11] mtd: intel-dg: wake card on operations Alexander Usyskin
2025-03-02 14:09 ` [PATCH v6 08/11] drm/i915/nvm: add nvm device for discrete graphics Alexander Usyskin
2025-03-02 14:09 ` [PATCH v6 09/11] drm/i915/nvm: add support for access mode Alexander Usyskin
2025-03-02 14:09 ` [PATCH v6 10/11] drm/xe/nvm: add on-die non-volatile memory device Alexander Usyskin
2025-03-02 14:09 ` [PATCH v6 11/11] drm/xe/nvm: add support for access mode Alexander Usyskin
2025-03-02 15:02 ` ✗ Fi.CI.CHECKPATCH: warning for mtd: add driver for Intel discrete graphics (rev6) Patchwork
2025-03-02 15:02 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-03-02 15:22 ` ✓ i915.CI.BAT: success " Patchwork
2025-03-02 17:04 ` ✗ i915.CI.Full: failure " Patchwork
2025-03-18 16:02 ` [PATCH v6 00/11] mtd: add driver for Intel discrete graphics Miquel Raynal
2025-03-26 15:22 ` Usyskin, Alexander
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y0tytjmj.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=airlied@gmail.com \
--cc=alexander.usyskin@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=karthik.poosa@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux@roeck-us.net \
--cc=lucas.demarchi@intel.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=oren.jer.weil@intel.com \
--cc=reuven.abliyev@intel.com \
--cc=richard@nod.at \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tursulin@ursulin.net \
--cc=tzimmermann@suse.de \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).