From: "Danilo Krummrich" <dakr@kernel.org>
To: "Bartosz Golaszewski" <brgl@kernel.org>
Cc: "Andy Shevchenko" <andriy.shevchenko@intel.com>,
"Bartosz Golaszewski" <bartosz.golaszewski@oss.qualcomm.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Brendan Higgins" <brendan.higgins@linux.dev>,
"David Gow" <david@davidgow.net>,
"Rae Moar" <raemoar63@gmail.com>,
"Andy Shevchenko" <andy@kernel.org>,
<driver-core@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
<linux-kselftest@vger.kernel.org>, <kunit-dev@googlegroups.com>
Subject: Re: [PATCH v4 1/3] driver core: platform: remove software node on release()
Date: Mon, 11 May 2026 17:04:01 +0200 [thread overview]
Message-ID: <DIFXTWSAEDHD.RMJBLY7XXEXU@kernel.org> (raw)
In-Reply-To: <CAMRc=MfBnbSUxwjVjf81K-W8uQ8ecXmK=8=FkRqVvK+6AipQuw@mail.gmail.com>
On Mon May 11, 2026 at 4:50 PM CEST, Bartosz Golaszewski wrote:
> On Mon, May 11, 2026 at 4:31 PM Danilo Krummrich <dakr@kernel.org> wrote:
>>
>> On Mon May 11, 2026 at 4:17 PM CEST, Bartosz Golaszewski wrote:
>> > On Mon, 11 May 2026 16:00:23 +0200, Danilo Krummrich <dakr@kernel.org> said:
>> >> On Mon May 11, 2026 at 9:33 AM CEST, Bartosz Golaszewski wrote:
>> >>> Danilo: if there are no further comments, can you pick it up for v7.1?
>> >>
>> >> It seems that sashiko has a valid concern in [1]; can you confirm?
>> >>
>> >> [1] https://sashiko.dev/#/patchset/20260430-swnode-remove-on-dev-unreg-v4-0-01574da0aed3%40oss.qualcomm.com
>> >>
>> >
>> > Yes, I explained it here[1]. Basically it's similar to how we need to call
>> > platform_device_add_data() for devices created with platform_device_alloc().
>> >
>> > We can consider adding platform_device_add_software_node() once there's
>> > a potential user but for now I'd just leave it like this.
>>
>> But there are users that already need this, no? There is Xe [1] and Surface GPE
>> [2], or am I missing something?
>>
>> [1] https://elixir.bootlin.com/linux/v7.1-rc2/source/drivers/gpu/drm/xe/xe_i2c.c#L99
>> [2] https://elixir.bootlin.com/linux/v7.1-rc2/source/drivers/platform/surface/surface_gpe.c#L308
>
> Right, I was not aware of these. That could indeed cause a regression.
> I'd like to fix the problem in v7.1 but also keep it minimal so adding
> platform_device_add_software_node() and updating drivers to using it
> may be the next step but for now: how about adding
> platform_device_release_full() which would call
> device_remove_software_node() and then the existing
> platform_device_release()? We'd replace the .release callback of
> struct device in platform_device_register_full() but if the user just
> uses platform_device_alloc(), they would keep the regular .release()
> that doesn't remove the software node?
>
> That would go into v7.1 and then I'd provide
> platform_device_add_software_node(), use it in all drivers that need
> it, and then we'd remove platform_device_release_full() and go back to
> a single, unified release callback?
>
> Does it make sense?
If it is just those two (and at least I did not find any other drivers) it might
be easier to just add platform_device_add_software_node(), use it within those
two drivers and still land it for v7.1.
I feel like this change turns out simpler and less error prone than the above
workaround to keep changes local to the driver core.
next prev parent reply other threads:[~2026-05-11 15:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260430-swnode-remove-on-dev-unreg-v4-0-01574da0aed3@oss.qualcomm.com>
[not found] ` <20260430-swnode-remove-on-dev-unreg-v4-1-01574da0aed3@oss.qualcomm.com>
[not found] ` <afNEwrHLNTA4ywrN@ashevche-desk.local>
[not found] ` <CAMRc=McH0zKz87z0TwPFrzZHMW6psytMaLZybM3pUk6OvUfo9Q@mail.gmail.com>
2026-05-11 7:33 ` [PATCH v4 1/3] driver core: platform: remove software node on release() Bartosz Golaszewski
2026-05-11 14:00 ` Danilo Krummrich
2026-05-11 14:17 ` Bartosz Golaszewski
2026-05-11 14:31 ` Danilo Krummrich
2026-05-11 14:50 ` Bartosz Golaszewski
2026-05-11 15:04 ` Danilo Krummrich [this message]
2026-05-11 16:08 ` Bartosz Golaszewski
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=DIFXTWSAEDHD.RMJBLY7XXEXU@kernel.org \
--to=dakr@kernel.org \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=brendan.higgins@linux.dev \
--cc=brgl@kernel.org \
--cc=david@davidgow.net \
--cc=dmitry.torokhov@gmail.com \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=raemoar63@gmail.com \
--cc=rafael@kernel.org \
/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