netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] drivers: Transition to the faux device interface
@ 2025-03-17 10:13 Sudeep Holla
  2025-03-17 10:13 ` [PATCH 7/9] net: phy: fixed_phy: transition " Sudeep Holla
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Sudeep Holla @ 2025-03-17 10:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Sudeep Holla, Greg Kroah-Hartman, Lorenzo Pieralisi,
	Rafael J. Wysocki, Daniel Lezcano, linux-pm, Andre Przywara,
	Herbert Xu, Jeff Johnson, linux-crypto, Ard Biesheuvel, linux-efi,
	Alexandre Belloni, linux-rtc, Mark Brown, Takashi Iwai,
	linux-sound, Andrew Lunn, David S. Miller, netdev,
	Borislav Petkov, linux-acpi, Jonathan Cameron

Recently when debugging why one of the scmi platform device was not
showing up under /sys/devices/platform/firmware:scmi instead was
appearing directly under /sys/devices/platform, I noticed the new
faux interface /sys/devices/faux.

Looking through the discussion and the background, I got excited and
took the opportunity to clear all the platform devices under
/sys/devices/platform on the Arm Juno/FVP platforms that are really
faux devices. Only the platform devices created for the device nodes
from the DT remain under /sys/devices/platform after these changes.

All the patches are independent of each other.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
Greg Kroah-Hartman (1):
      regulator: dummy: convert to use the faux device interface

Sudeep Holla (8):
      cpuidle: psci: Transition to the faux device interface
      hwrng: arm-smccc-trng - transition to the faux device interface
      efi: Remove redundant creation of the "efivars" platform device
      rtc: efi: Transition to the faux device interface
      virt: efi_secret: Transition to the faux device interface
      ASoC: soc-utils: Transition to the faux device interface
      net: phy: fixed_phy: transition to the faux device interface
      ACPI: APEI: EINJ: Transition to the faux device interface

 drivers/acpi/apei/einj-core.c             | 32 +++++++++---------------
 drivers/char/hw_random/arm_smccc_trng.c   | 40 +++++++++++++++++++++---------
 drivers/cpuidle/cpuidle-psci.c            | 26 +++++++-------------
 drivers/firmware/efi/efi.c                | 10 --------
 drivers/firmware/smccc/smccc.c            | 21 ----------------
 drivers/net/phy/fixed_phy.c               | 16 ++++++------
 drivers/regulator/dummy.c                 | 37 +++++++---------------------
 drivers/rtc/rtc-efi.c                     | 31 ++++++++++++++++-------
 drivers/virt/coco/efi_secret/efi_secret.c | 41 ++++++++++++++++++-------------
 sound/soc/soc-utils.c                     | 34 +++++++++----------------
 10 files changed, 124 insertions(+), 164 deletions(-)
---
base-commit: 80e54e84911a923c40d7bee33a34c1b4be148d7a
change-id: 20250315-plat2faux_dev-8c28b35be96a
-- 
Regards,
Sudeep


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 7/9] net: phy: fixed_phy: transition to the faux device interface
  2025-03-17 10:13 [PATCH 0/9] drivers: Transition to the faux device interface Sudeep Holla
@ 2025-03-17 10:13 ` Sudeep Holla
  2025-03-17 12:29   ` Andrew Lunn
  2025-03-17 13:01 ` [PATCH 0/9] drivers: Transition " Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Sudeep Holla @ 2025-03-17 10:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Sudeep Holla, Greg Kroah-Hartman, Andrew Lunn, David S. Miller,
	netdev

The net fixed phy driver does not require the creation of a platform
device. Originally, this approach was chosen for simplicity when the
driver was first implemented.

With the introduction of the lightweight faux device interface, we now
have a more appropriate alternative. Migrate the driver to utilize the
faux bus, given that the platform device it previously created was not
a real one anyway. This will simplify the code, reducing its footprint
while maintaining functionality.

Cc: Andrew Lunn <andrew@lunn.ch>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/net/phy/fixed_phy.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index aef739c20ac4d5a271465a677a85ef7c18cfce70..ee7831a9849b3728ca9c541da35d17e089985da2 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -10,7 +10,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/platform_device.h>
+#include <linux/device/faux.h>
 #include <linux/list.h>
 #include <linux/mii.h>
 #include <linux/phy.h>
@@ -40,7 +40,7 @@ struct fixed_phy {
 	struct gpio_desc *link_gpiod;
 };
 
-static struct platform_device *pdev;
+static struct faux_device *fdev;
 static struct fixed_mdio_bus platform_fmb = {
 	.phys = LIST_HEAD_INIT(platform_fmb.phys),
 };
@@ -337,9 +337,9 @@ static int __init fixed_mdio_bus_init(void)
 	struct fixed_mdio_bus *fmb = &platform_fmb;
 	int ret;
 
-	pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
+	fdev = faux_device_create("Fixed MDIO bus", NULL, NULL);
+	if (!fdev)
+		return -ENODEV;
 
 	fmb->mii_bus = mdiobus_alloc();
 	if (fmb->mii_bus == NULL) {
@@ -350,7 +350,7 @@ static int __init fixed_mdio_bus_init(void)
 	snprintf(fmb->mii_bus->id, MII_BUS_ID_SIZE, "fixed-0");
 	fmb->mii_bus->name = "Fixed MDIO Bus";
 	fmb->mii_bus->priv = fmb;
-	fmb->mii_bus->parent = &pdev->dev;
+	fmb->mii_bus->parent = &fdev->dev;
 	fmb->mii_bus->read = &fixed_mdio_read;
 	fmb->mii_bus->write = &fixed_mdio_write;
 	fmb->mii_bus->phy_mask = ~0;
@@ -364,7 +364,7 @@ static int __init fixed_mdio_bus_init(void)
 err_mdiobus_alloc:
 	mdiobus_free(fmb->mii_bus);
 err_mdiobus_reg:
-	platform_device_unregister(pdev);
+	faux_device_destroy(fdev);
 	return ret;
 }
 module_init(fixed_mdio_bus_init);
@@ -376,7 +376,7 @@ static void __exit fixed_mdio_bus_exit(void)
 
 	mdiobus_unregister(fmb->mii_bus);
 	mdiobus_free(fmb->mii_bus);
-	platform_device_unregister(pdev);
+	faux_device_destroy(fdev);
 
 	list_for_each_entry_safe(fp, tmp, &fmb->phys, node) {
 		list_del(&fp->node);

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 7/9] net: phy: fixed_phy: transition to the faux device interface
  2025-03-17 10:13 ` [PATCH 7/9] net: phy: fixed_phy: transition " Sudeep Holla
@ 2025-03-17 12:29   ` Andrew Lunn
  2025-03-17 13:00     ` Greg Kroah-Hartman
  2025-03-17 14:17     ` Sudeep Holla
  0 siblings, 2 replies; 9+ messages in thread
From: Andrew Lunn @ 2025-03-17 12:29 UTC (permalink / raw)
  To: Sudeep Holla; +Cc: linux-kernel, Greg Kroah-Hartman, David S. Miller, netdev

On Mon, Mar 17, 2025 at 10:13:19AM +0000, Sudeep Holla wrote:
> The net fixed phy driver does not require the creation of a platform
> device. Originally, this approach was chosen for simplicity when the
> driver was first implemented.
> 
> With the introduction of the lightweight faux device interface, we now
> have a more appropriate alternative. Migrate the driver to utilize the
> faux bus, given that the platform device it previously created was not
> a real one anyway. This will simplify the code, reducing its footprint
> while maintaining functionality.
> 
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: netdev@vger.kernel.org
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/net/phy/fixed_phy.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)

8 insertions, 8 deletions. How does this reduce its footprint?

Seems like pointless churn to me. Unless there is a real advantage to
faux bus you are not enumerating in your commit message.

	Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 7/9] net: phy: fixed_phy: transition to the faux device interface
  2025-03-17 12:29   ` Andrew Lunn
@ 2025-03-17 13:00     ` Greg Kroah-Hartman
  2025-03-17 14:17     ` Sudeep Holla
  1 sibling, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2025-03-17 13:00 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Sudeep Holla, linux-kernel, David S. Miller, netdev

On Mon, Mar 17, 2025 at 01:29:31PM +0100, Andrew Lunn wrote:
> On Mon, Mar 17, 2025 at 10:13:19AM +0000, Sudeep Holla wrote:
> > The net fixed phy driver does not require the creation of a platform
> > device. Originally, this approach was chosen for simplicity when the
> > driver was first implemented.
> > 
> > With the introduction of the lightweight faux device interface, we now
> > have a more appropriate alternative. Migrate the driver to utilize the
> > faux bus, given that the platform device it previously created was not
> > a real one anyway. This will simplify the code, reducing its footprint
> > while maintaining functionality.
> > 
> > Cc: Andrew Lunn <andrew@lunn.ch>
> > Cc: "David S. Miller" <davem@davemloft.net>
> > Cc: netdev@vger.kernel.org
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > ---
> >  drivers/net/phy/fixed_phy.c | 16 ++++++++--------
> >  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> 8 insertions, 8 deletions. How does this reduce its footprint?
> 
> Seems like pointless churn to me. Unless there is a real advantage to
> faux bus you are not enumerating in your commit message.

It stops the abuse of using a platform device for something that is NOT
a platform device.  This file should have never used a platform device
for this in the first place, and this change is fixing that design bug.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/9] drivers: Transition to the faux device interface
  2025-03-17 10:13 [PATCH 0/9] drivers: Transition to the faux device interface Sudeep Holla
  2025-03-17 10:13 ` [PATCH 7/9] net: phy: fixed_phy: transition " Sudeep Holla
@ 2025-03-17 13:01 ` Greg Kroah-Hartman
  2025-03-17 14:28   ` Sudeep Holla
  2025-03-17 14:20 ` Mark Brown
  2025-03-17 18:10 ` (subset) " Mark Brown
  3 siblings, 1 reply; 9+ messages in thread
From: Greg Kroah-Hartman @ 2025-03-17 13:01 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, Lorenzo Pieralisi, Rafael J. Wysocki,
	Daniel Lezcano, linux-pm, Andre Przywara, Herbert Xu,
	Jeff Johnson, linux-crypto, Ard Biesheuvel, linux-efi,
	Alexandre Belloni, linux-rtc, Mark Brown, Takashi Iwai,
	linux-sound, Andrew Lunn, David S. Miller, netdev,
	Borislav Petkov, linux-acpi, Jonathan Cameron

On Mon, Mar 17, 2025 at 10:13:12AM +0000, Sudeep Holla wrote:
> Recently when debugging why one of the scmi platform device was not
> showing up under /sys/devices/platform/firmware:scmi instead was
> appearing directly under /sys/devices/platform, I noticed the new
> faux interface /sys/devices/faux.
> 
> Looking through the discussion and the background, I got excited and
> took the opportunity to clear all the platform devices under
> /sys/devices/platform on the Arm Juno/FVP platforms that are really
> faux devices. Only the platform devices created for the device nodes
> from the DT remain under /sys/devices/platform after these changes.
> 
> All the patches are independent of each other.

That's great, but you need to send these all independently to each
subsystem as needed.  Having it all in one series doesn't work for any
of the maintainers of any of the subsystems.

And I'm glad to see this work happening, thanks for doing that!

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 7/9] net: phy: fixed_phy: transition to the faux device interface
  2025-03-17 12:29   ` Andrew Lunn
  2025-03-17 13:00     ` Greg Kroah-Hartman
@ 2025-03-17 14:17     ` Sudeep Holla
  1 sibling, 0 replies; 9+ messages in thread
From: Sudeep Holla @ 2025-03-17 14:17 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: linux-kernel, Sudeep Holla, Greg Kroah-Hartman, David S. Miller,
	netdev

On Mon, Mar 17, 2025 at 01:29:31PM +0100, Andrew Lunn wrote:
> On Mon, Mar 17, 2025 at 10:13:19AM +0000, Sudeep Holla wrote:
> > The net fixed phy driver does not require the creation of a platform
> > device. Originally, this approach was chosen for simplicity when the
> > driver was first implemented.
> > 
> > With the introduction of the lightweight faux device interface, we now
> > have a more appropriate alternative. Migrate the driver to utilize the
> > faux bus, given that the platform device it previously created was not
> > a real one anyway. This will simplify the code, reducing its footprint
> > while maintaining functionality.
> > 
> > Cc: Andrew Lunn <andrew@lunn.ch>
> > Cc: "David S. Miller" <davem@davemloft.net>
> > Cc: netdev@vger.kernel.org
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > ---
> >  drivers/net/phy/fixed_phy.c | 16 ++++++++--------
> >  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> 8 insertions, 8 deletions. How does this reduce its footprint?
>

I meant the use of struct faux_device vs struct platform_device. Yes
it is not a big deal.

> Seems like pointless churn to me. Unless there is a real advantage to
> faux bus you are not enumerating in your commit message.
> 

Greg has answered that, so will skip.

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/9] drivers: Transition to the faux device interface
  2025-03-17 10:13 [PATCH 0/9] drivers: Transition to the faux device interface Sudeep Holla
  2025-03-17 10:13 ` [PATCH 7/9] net: phy: fixed_phy: transition " Sudeep Holla
  2025-03-17 13:01 ` [PATCH 0/9] drivers: Transition " Greg Kroah-Hartman
@ 2025-03-17 14:20 ` Mark Brown
  2025-03-17 18:10 ` (subset) " Mark Brown
  3 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2025-03-17 14:20 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, Greg Kroah-Hartman, Lorenzo Pieralisi,
	Rafael J. Wysocki, Daniel Lezcano, linux-pm, Andre Przywara,
	Herbert Xu, Jeff Johnson, linux-crypto, Ard Biesheuvel, linux-efi,
	Alexandre Belloni, linux-rtc, Takashi Iwai, linux-sound,
	Andrew Lunn, David S. Miller, netdev, Borislav Petkov, linux-acpi,
	Jonathan Cameron

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

On Mon, Mar 17, 2025 at 10:13:12AM +0000, Sudeep Holla wrote:

> All the patches are independent of each other.

If that's the case don't send them in a series, it makes things more
complicated to apply and the CCs cause more mail.  Split independent
things up by subsystem.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/9] drivers: Transition to the faux device interface
  2025-03-17 13:01 ` [PATCH 0/9] drivers: Transition " Greg Kroah-Hartman
@ 2025-03-17 14:28   ` Sudeep Holla
  0 siblings, 0 replies; 9+ messages in thread
From: Sudeep Holla @ 2025-03-17 14:28 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Lorenzo Pieralisi, Rafael J. Wysocki,
	Daniel Lezcano, linux-pm, Andre Przywara, Herbert Xu,
	Jeff Johnson, linux-crypto, Ard Biesheuvel, linux-efi,
	Alexandre Belloni, linux-rtc, Mark Brown, Takashi Iwai,
	linux-sound, Andrew Lunn, David S. Miller, netdev,
	Borislav Petkov, linux-acpi, Jonathan Cameron

On Mon, Mar 17, 2025 at 02:01:55PM +0100, Greg Kroah-Hartman wrote:
> On Mon, Mar 17, 2025 at 10:13:12AM +0000, Sudeep Holla wrote:
> > Recently when debugging why one of the scmi platform device was not
> > showing up under /sys/devices/platform/firmware:scmi instead was
> > appearing directly under /sys/devices/platform, I noticed the new
> > faux interface /sys/devices/faux.
> > 
> > Looking through the discussion and the background, I got excited and
> > took the opportunity to clear all the platform devices under
> > /sys/devices/platform on the Arm Juno/FVP platforms that are really
> > faux devices. Only the platform devices created for the device nodes
> > from the DT remain under /sys/devices/platform after these changes.
> > 
> > All the patches are independent of each other.
> 
> That's great, but you need to send these all independently to each
> subsystem as needed.  Having it all in one series doesn't work for any
> of the maintainers of any of the subsystems.
> 

Sure I can do that. I initially had idea of creating a macro that made
all of them depend on the macro but later dropped as I wanted to check
if that is good or a bad idea. I just asked you in the thread 2/9.

> And I'm glad to see this work happening, thanks for doing that!
> 

Thanks for adding faux interface!

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (subset) [PATCH 0/9] drivers: Transition to the faux device interface
  2025-03-17 10:13 [PATCH 0/9] drivers: Transition to the faux device interface Sudeep Holla
                   ` (2 preceding siblings ...)
  2025-03-17 14:20 ` Mark Brown
@ 2025-03-17 18:10 ` Mark Brown
  3 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2025-03-17 18:10 UTC (permalink / raw)
  To: linux-kernel, Sudeep Holla
  Cc: Greg Kroah-Hartman, Lorenzo Pieralisi, Rafael J. Wysocki,
	Daniel Lezcano, linux-pm, Andre Przywara, Herbert Xu,
	Jeff Johnson, linux-crypto, Ard Biesheuvel, linux-efi,
	Alexandre Belloni, linux-rtc, Takashi Iwai, linux-sound,
	Andrew Lunn, David S. Miller, netdev, Borislav Petkov, linux-acpi,
	Jonathan Cameron

On Mon, 17 Mar 2025 10:13:12 +0000, Sudeep Holla wrote:
> Recently when debugging why one of the scmi platform device was not
> showing up under /sys/devices/platform/firmware:scmi instead was
> appearing directly under /sys/devices/platform, I noticed the new
> faux interface /sys/devices/faux.
> 
> Looking through the discussion and the background, I got excited and
> took the opportunity to clear all the platform devices under
> /sys/devices/platform on the Arm Juno/FVP platforms that are really
> faux devices. Only the platform devices created for the device nodes
> from the DT remain under /sys/devices/platform after these changes.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[6/9] ASoC: soc-utils: Transition to the faux device interface
      commit: 18abb3797f1ceca97a705aa1c14cbec5c6fcab79

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-03-17 18:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17 10:13 [PATCH 0/9] drivers: Transition to the faux device interface Sudeep Holla
2025-03-17 10:13 ` [PATCH 7/9] net: phy: fixed_phy: transition " Sudeep Holla
2025-03-17 12:29   ` Andrew Lunn
2025-03-17 13:00     ` Greg Kroah-Hartman
2025-03-17 14:17     ` Sudeep Holla
2025-03-17 13:01 ` [PATCH 0/9] drivers: Transition " Greg Kroah-Hartman
2025-03-17 14:28   ` Sudeep Holla
2025-03-17 14:20 ` Mark Brown
2025-03-17 18:10 ` (subset) " Mark Brown

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).