public inbox for linux-efi@vger.kernel.org
 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 3/9] efi: Remove redundant creation of the "efivars" platform device Sudeep Holla
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ 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] 13+ messages in thread

* [PATCH 3/9] efi: Remove redundant creation of the "efivars" platform device
  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 17:06   ` Ard Biesheuvel
  2025-03-17 10:13 ` [PATCH 4/9] rtc: efi: Transition to the faux device interface Sudeep Holla
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Sudeep Holla @ 2025-03-17 10:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sudeep Holla, Greg Kroah-Hartman, Ard Biesheuvel, linux-efi

The "efivars" platform device is created but never tracked or used,
as there is no driver associated with it. Since this device serves
no functional purpose, removing its creation without affecting any
functionality.

Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-efi@vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/firmware/efi/efi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 7309394b8fc98cf7a3424af209b752f0251c8c89..eec173cb1f398d3b4f28b42c917e50e1728dc277 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -446,7 +446,6 @@ static int __init efisubsys_init(void)
 		error = efivar_ssdt_load();
 		if (error)
 			pr_err("efi: failed to load SSDT, error %d.\n", error);
-		platform_device_register_simple("efivars", 0, NULL, 0);
 	}
 
 	BLOCKING_INIT_NOTIFIER_HEAD(&efivar_ops_nh);

-- 
2.34.1


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

* [PATCH 4/9] rtc: efi: 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 3/9] efi: Remove redundant creation of the "efivars" platform device Sudeep Holla
@ 2025-03-17 10:13 ` Sudeep Holla
  2025-03-17 13:07   ` Greg Kroah-Hartman
  2025-03-17 10:13 ` [PATCH 5/9] virt: efi_secret: " Sudeep Holla
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Sudeep Holla @ 2025-03-17 10:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Sudeep Holla, Greg Kroah-Hartman, Ard Biesheuvel,
	Alexandre Belloni, linux-rtc, linux-efi

The EFI RTC 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: Ard Biesheuvel <ardb@kernel.org>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org
Cc: linux-efi@vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/firmware/efi/efi.c |  3 ---
 drivers/rtc/rtc-efi.c      | 31 ++++++++++++++++++++++---------
 2 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index eec173cb1f398d3b4f28b42c917e50e1728dc277..18deb2d212ce6944927f5e3a9a40bb6754e7ffa9 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -427,9 +427,6 @@ static int __init efisubsys_init(void)
 		}
 	}
 
-	if (efi_rt_services_supported(EFI_RT_SUPPORTED_TIME_SERVICES))
-		platform_device_register_simple("rtc-efi", 0, NULL, 0);
-
 	/* We register the efi directory at /sys/firmware/efi */
 	efi_kobj = kobject_create_and_add("efi", firmware_kobj);
 	if (!efi_kobj) {
diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c
index fa8bf82df9488e7d1c23c058b4a3032dde74bc6e..3d21a470e8ff9777c5eeb991f3aa9170f6351930 100644
--- a/drivers/rtc/rtc-efi.c
+++ b/drivers/rtc/rtc-efi.c
@@ -14,7 +14,7 @@
 #include <linux/module.h>
 #include <linux/stringify.h>
 #include <linux/time.h>
-#include <linux/platform_device.h>
+#include <linux/device/faux.h>
 #include <linux/rtc.h>
 #include <linux/efi.h>
 
@@ -254,7 +254,7 @@ static const struct rtc_class_ops efi_rtc_ops = {
 	.proc		= efi_procfs,
 };
 
-static int __init efi_rtc_probe(struct platform_device *dev)
+static int __init efi_rtc_probe(struct faux_device *dev)
 {
 	struct rtc_device *rtc;
 	efi_time_t eft;
@@ -268,7 +268,7 @@ static int __init efi_rtc_probe(struct platform_device *dev)
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
-	platform_set_drvdata(dev, rtc);
+	faux_device_set_drvdata(dev, rtc);
 
 	rtc->ops = &efi_rtc_ops;
 	clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features);
@@ -282,15 +282,28 @@ static int __init efi_rtc_probe(struct platform_device *dev)
 	return devm_rtc_register_device(rtc);
 }
 
-static struct platform_driver efi_rtc_driver = {
-	.driver = {
-		.name = "rtc-efi",
-	},
+static struct faux_device_ops efi_rtc_fdev_ops = {
+	.probe = efi_rtc_probe,
 };
 
-module_platform_driver_probe(efi_rtc_driver, efi_rtc_probe);
+static int __init rtc_efi_init(void)
+{
+	struct faux_device *fdev;
+
+	if (!efi_rt_services_supported(EFI_RT_SUPPORTED_TIME_SERVICES))
+		return 0;
+
+	fdev = faux_device_create("rtc-efi", NULL, &efi_rtc_fdev_ops);
+	if (!fdev) {
+		pr_err("rtc-efi: could not create the device\n");
+		return -ENODEV;
+	}
+
+	return 0;
+}
+device_initcall(rtc_efi_init);
 
 MODULE_AUTHOR("dann frazier <dannf@dannf.org>");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("EFI RTC driver");
-MODULE_ALIAS("platform:rtc-efi");
+MODULE_ALIAS("faux:rtc-efi");

-- 
2.34.1


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

* [PATCH 5/9] virt: efi_secret: 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 3/9] efi: Remove redundant creation of the "efivars" platform device Sudeep Holla
  2025-03-17 10:13 ` [PATCH 4/9] rtc: efi: Transition to the faux device interface Sudeep Holla
@ 2025-03-17 10:13 ` Sudeep Holla
  2025-03-17 13:06   ` Greg Kroah-Hartman
  2025-03-17 13:01 ` [PATCH 0/9] drivers: " Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Sudeep Holla @ 2025-03-17 10:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sudeep Holla, Greg Kroah-Hartman, Ard Biesheuvel, linux-efi

The EFI secret area 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: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-efi@vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/firmware/efi/efi.c                |  6 -----
 drivers/virt/coco/efi_secret/efi_secret.c | 41 ++++++++++++++++++-------------
 2 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 18deb2d212ce6944927f5e3a9a40bb6754e7ffa9..4654a88d4e12f354a891118edf9001755285c69a 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -24,7 +24,6 @@
 #include <linux/initrd.h>
 #include <linux/io.h>
 #include <linux/kexec.h>
-#include <linux/platform_device.h>
 #include <linux/random.h>
 #include <linux/reboot.h>
 #include <linux/slab.h>
@@ -464,11 +463,6 @@ static int __init efisubsys_init(void)
 	if (efi_enabled(EFI_DBG) && efi_enabled(EFI_PRESERVE_BS_REGIONS))
 		efi_debugfs_init();
 
-#ifdef CONFIG_EFI_COCO_SECRET
-	if (efi.coco_secret != EFI_INVALID_TABLE_ADDR)
-		platform_device_register_simple("efi_secret", 0, NULL, 0);
-#endif
-
 	return 0;
 
 err_remove_group:
diff --git a/drivers/virt/coco/efi_secret/efi_secret.c b/drivers/virt/coco/efi_secret/efi_secret.c
index 1864f9f80617e082feb574a15327949972c8cc1e..4ba1a9f3b8a90981795d296d0a8dfdc9edb22966 100644
--- a/drivers/virt/coco/efi_secret/efi_secret.c
+++ b/drivers/virt/coco/efi_secret/efi_secret.c
@@ -16,7 +16,7 @@
  * is the GUID of the secret entry, and its content is the secret data.
  */
 
-#include <linux/platform_device.h>
+#include <linux/device/faux.h>
 #include <linux/seq_file.h>
 #include <linux/fs.h>
 #include <linux/kernel.h>
@@ -152,17 +152,12 @@ static const struct inode_operations efi_secret_dir_inode_operations = {
 	.unlink         = efi_secret_unlink,
 };
 
-static int efi_secret_map_area(struct platform_device *dev)
+static int efi_secret_map_area(struct faux_device *dev)
 {
 	int ret;
 	struct efi_secret *s = efi_secret_get();
 	struct linux_efi_coco_secret_area *secret_area;
 
-	if (efi.coco_secret == EFI_INVALID_TABLE_ADDR) {
-		dev_err(&dev->dev, "Secret area address is not available\n");
-		return -EINVAL;
-	}
-
 	secret_area = memremap(efi.coco_secret, sizeof(*secret_area), MEMREMAP_WB);
 	if (secret_area == NULL) {
 		dev_err(&dev->dev, "Could not map secret area EFI config entry\n");
@@ -191,7 +186,7 @@ static int efi_secret_map_area(struct platform_device *dev)
 	return ret;
 }
 
-static void efi_secret_securityfs_teardown(struct platform_device *dev)
+static void efi_secret_securityfs_teardown(struct faux_device *dev)
 {
 	struct efi_secret *s = efi_secret_get();
 	int i;
@@ -210,7 +205,7 @@ static void efi_secret_securityfs_teardown(struct platform_device *dev)
 	dev_dbg(&dev->dev, "Removed securityfs entries\n");
 }
 
-static int efi_secret_securityfs_setup(struct platform_device *dev)
+static int efi_secret_securityfs_setup(struct faux_device *dev)
 {
 	struct efi_secret *s = efi_secret_get();
 	int ret = 0, i = 0, bytes_left;
@@ -307,7 +302,7 @@ static void efi_secret_unmap_area(void)
 	}
 }
 
-static int efi_secret_probe(struct platform_device *dev)
+static int efi_secret_probe(struct faux_device *dev)
 {
 	int ret;
 
@@ -326,23 +321,35 @@ static int efi_secret_probe(struct platform_device *dev)
 	return ret;
 }
 
-static void efi_secret_remove(struct platform_device *dev)
+static void efi_secret_remove(struct faux_device *dev)
 {
 	efi_secret_securityfs_teardown(dev);
 	efi_secret_unmap_area();
 }
 
-static struct platform_driver efi_secret_driver = {
+static struct faux_device_ops efi_secret_ops = {
 	.probe = efi_secret_probe,
 	.remove = efi_secret_remove,
-	.driver = {
-		.name = "efi_secret",
-	},
 };
 
-module_platform_driver(efi_secret_driver);
+static int __init efi_secret_init(void)
+{
+	struct faux_device *fdev;
+
+	if (efi.coco_secret == EFI_INVALID_TABLE_ADDR)
+		return 0;
+
+	fdev = faux_device_create("efi_secret", NULL, &efi_secret_ops);
+	if (!fdev) {
+		pr_err("efi_secret: could not create the device\n");
+		return -ENODEV;
+	}
+
+	return 0;
+}
+device_initcall(efi_secret_init);
 
 MODULE_DESCRIPTION("Confidential computing EFI secret area access");
 MODULE_AUTHOR("IBM");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:efi_secret");
+MODULE_ALIAS("faux:efi_secret");

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 13+ 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
                   ` (2 preceding siblings ...)
  2025-03-17 10:13 ` [PATCH 5/9] virt: efi_secret: " 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
  5 siblings, 1 reply; 13+ 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] 13+ messages in thread

* Re: [PATCH 5/9] virt: efi_secret: Transition to the faux device interface
  2025-03-17 10:13 ` [PATCH 5/9] virt: efi_secret: " Sudeep Holla
@ 2025-03-17 13:06   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2025-03-17 13:06 UTC (permalink / raw)
  To: Sudeep Holla; +Cc: linux-kernel, Ard Biesheuvel, linux-efi

On Mon, Mar 17, 2025 at 10:13:17AM +0000, Sudeep Holla wrote:
>  MODULE_DESCRIPTION("Confidential computing EFI secret area access");
>  MODULE_AUTHOR("IBM");
>  MODULE_LICENSE("GPL");
> -MODULE_ALIAS("platform:efi_secret");
> +MODULE_ALIAS("faux:efi_secret");

Again, no need for a module alias anymore.


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

* Re: [PATCH 4/9] rtc: efi: Transition to the faux device interface
  2025-03-17 10:13 ` [PATCH 4/9] rtc: efi: Transition to the faux device interface Sudeep Holla
@ 2025-03-17 13:07   ` Greg Kroah-Hartman
  2025-03-17 14:04     ` Sudeep Holla
  0 siblings, 1 reply; 13+ messages in thread
From: Greg Kroah-Hartman @ 2025-03-17 13:07 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, Ard Biesheuvel, Alexandre Belloni, linux-rtc,
	linux-efi

On Mon, Mar 17, 2025 at 10:13:16AM +0000, Sudeep Holla wrote:
> The EFI RTC 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: Ard Biesheuvel <ardb@kernel.org>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: linux-rtc@vger.kernel.org
> Cc: linux-efi@vger.kernel.org
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/firmware/efi/efi.c |  3 ---
>  drivers/rtc/rtc-efi.c      | 31 ++++++++++++++++++++++---------
>  2 files changed, 22 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index eec173cb1f398d3b4f28b42c917e50e1728dc277..18deb2d212ce6944927f5e3a9a40bb6754e7ffa9 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -427,9 +427,6 @@ static int __init efisubsys_init(void)
>  		}
>  	}
>  
> -	if (efi_rt_services_supported(EFI_RT_SUPPORTED_TIME_SERVICES))
> -		platform_device_register_simple("rtc-efi", 0, NULL, 0);
> -
>  	/* We register the efi directory at /sys/firmware/efi */
>  	efi_kobj = kobject_create_and_add("efi", firmware_kobj);
>  	if (!efi_kobj) {
> diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c
> index fa8bf82df9488e7d1c23c058b4a3032dde74bc6e..3d21a470e8ff9777c5eeb991f3aa9170f6351930 100644
> --- a/drivers/rtc/rtc-efi.c
> +++ b/drivers/rtc/rtc-efi.c
> @@ -14,7 +14,7 @@
>  #include <linux/module.h>
>  #include <linux/stringify.h>
>  #include <linux/time.h>
> -#include <linux/platform_device.h>
> +#include <linux/device/faux.h>
>  #include <linux/rtc.h>
>  #include <linux/efi.h>
>  
> @@ -254,7 +254,7 @@ static const struct rtc_class_ops efi_rtc_ops = {
>  	.proc		= efi_procfs,
>  };
>  
> -static int __init efi_rtc_probe(struct platform_device *dev)
> +static int __init efi_rtc_probe(struct faux_device *dev)
>  {
>  	struct rtc_device *rtc;
>  	efi_time_t eft;
> @@ -268,7 +268,7 @@ static int __init efi_rtc_probe(struct platform_device *dev)
>  	if (IS_ERR(rtc))
>  		return PTR_ERR(rtc);
>  
> -	platform_set_drvdata(dev, rtc);
> +	faux_device_set_drvdata(dev, rtc);
>  
>  	rtc->ops = &efi_rtc_ops;
>  	clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features);
> @@ -282,15 +282,28 @@ static int __init efi_rtc_probe(struct platform_device *dev)
>  	return devm_rtc_register_device(rtc);
>  }
>  
> -static struct platform_driver efi_rtc_driver = {
> -	.driver = {
> -		.name = "rtc-efi",
> -	},
> +static struct faux_device_ops efi_rtc_fdev_ops = {
> +	.probe = efi_rtc_probe,
>  };
>  
> -module_platform_driver_probe(efi_rtc_driver, efi_rtc_probe);
> +static int __init rtc_efi_init(void)
> +{
> +	struct faux_device *fdev;
> +
> +	if (!efi_rt_services_supported(EFI_RT_SUPPORTED_TIME_SERVICES))
> +		return 0;
> +
> +	fdev = faux_device_create("rtc-efi", NULL, &efi_rtc_fdev_ops);
> +	if (!fdev) {
> +		pr_err("rtc-efi: could not create the device\n");
> +		return -ENODEV;
> +	}
> +
> +	return 0;
> +}
> +device_initcall(rtc_efi_init);
>  
>  MODULE_AUTHOR("dann frazier <dannf@dannf.org>");
>  MODULE_LICENSE("GPL");
>  MODULE_DESCRIPTION("EFI RTC driver");
> -MODULE_ALIAS("platform:rtc-efi");
> +MODULE_ALIAS("faux:rtc-efi");

No alias please.

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

* Re: [PATCH 4/9] rtc: efi: Transition to the faux device interface
  2025-03-17 13:07   ` Greg Kroah-Hartman
@ 2025-03-17 14:04     ` Sudeep Holla
  0 siblings, 0 replies; 13+ messages in thread
From: Sudeep Holla @ 2025-03-17 14:04 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Ard Biesheuvel, Alexandre Belloni, Sudeep Holla,
	linux-rtc, linux-efi

On Mon, Mar 17, 2025 at 02:07:00PM +0100, Greg Kroah-Hartman wrote:
> On Mon, Mar 17, 2025 at 10:13:16AM +0000, Sudeep Holla wrote:
> > The EFI RTC 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: Ard Biesheuvel <ardb@kernel.org>
> > Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > Cc: linux-rtc@vger.kernel.org
> > Cc: linux-efi@vger.kernel.org
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > ---
> >  drivers/firmware/efi/efi.c |  3 ---
> >  drivers/rtc/rtc-efi.c      | 31 ++++++++++++++++++++++---------
> >  2 files changed, 22 insertions(+), 12 deletions(-)
> > 

[...]

> > -MODULE_ALIAS("platform:rtc-efi");
> > +MODULE_ALIAS("faux:rtc-efi");
> 
> No alias please.

Thanks for the review, will drop all the alias.

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 13+ 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
                   ` (3 preceding siblings ...)
  2025-03-17 13:01 ` [PATCH 0/9] drivers: " Greg Kroah-Hartman
@ 2025-03-17 14:20 ` Mark Brown
  2025-03-17 18:10 ` (subset) " Mark Brown
  5 siblings, 0 replies; 13+ 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] 13+ messages in thread

* Re: [PATCH 0/9] drivers: Transition to the faux device interface
  2025-03-17 13:01 ` [PATCH 0/9] drivers: " Greg Kroah-Hartman
@ 2025-03-17 14:28   ` Sudeep Holla
  0 siblings, 0 replies; 13+ 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] 13+ messages in thread

* Re: [PATCH 3/9] efi: Remove redundant creation of the "efivars" platform device
  2025-03-17 10:13 ` [PATCH 3/9] efi: Remove redundant creation of the "efivars" platform device Sudeep Holla
@ 2025-03-17 17:06   ` Ard Biesheuvel
  2025-03-17 17:19     ` Sudeep Holla
  0 siblings, 1 reply; 13+ messages in thread
From: Ard Biesheuvel @ 2025-03-17 17:06 UTC (permalink / raw)
  To: Sudeep Holla; +Cc: linux-kernel, Greg Kroah-Hartman, linux-efi

On Mon, 17 Mar 2025 at 11:13, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> The "efivars" platform device is created but never tracked or used,
> as there is no driver associated with it. Since this device serves
> no functional purpose, removing its creation without affecting any
> functionality.
>
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: linux-efi@vger.kernel.org
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/firmware/efi/efi.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index 7309394b8fc98cf7a3424af209b752f0251c8c89..eec173cb1f398d3b4f28b42c917e50e1728dc277 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -446,7 +446,6 @@ static int __init efisubsys_init(void)
>                 error = efivar_ssdt_load();
>                 if (error)
>                         pr_err("efi: failed to load SSDT, error %d.\n", error);
> -               platform_device_register_simple("efivars", 0, NULL, 0);
>         }
>
>         BLOCKING_INIT_NOTIFIER_HEAD(&efivar_ops_nh);
>

IIRC the efi-pstore module autoloads based on this platform device

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

* Re: [PATCH 3/9] efi: Remove redundant creation of the "efivars" platform device
  2025-03-17 17:06   ` Ard Biesheuvel
@ 2025-03-17 17:19     ` Sudeep Holla
  0 siblings, 0 replies; 13+ messages in thread
From: Sudeep Holla @ 2025-03-17 17:19 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: linux-kernel, Sudeep Holla, Greg Kroah-Hartman, linux-efi

On Mon, Mar 17, 2025 at 06:06:24PM +0100, Ard Biesheuvel wrote:
> On Mon, 17 Mar 2025 at 11:13, Sudeep Holla <sudeep.holla@arm.com> wrote:
> >
> > The "efivars" platform device is created but never tracked or used,
> > as there is no driver associated with it. Since this device serves
> > no functional purpose, removing its creation without affecting any
> > functionality.
> >
> > Cc: Ard Biesheuvel <ardb@kernel.org>
> > Cc: linux-efi@vger.kernel.org
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > ---
> >  drivers/firmware/efi/efi.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> > index 7309394b8fc98cf7a3424af209b752f0251c8c89..eec173cb1f398d3b4f28b42c917e50e1728dc277 100644
> > --- a/drivers/firmware/efi/efi.c
> > +++ b/drivers/firmware/efi/efi.c
> > @@ -446,7 +446,6 @@ static int __init efisubsys_init(void)
> >                 error = efivar_ssdt_load();
> >                 if (error)
> >                         pr_err("efi: failed to load SSDT, error %d.\n", error);
> > -               platform_device_register_simple("efivars", 0, NULL, 0);
> >         }
> >
> >         BLOCKING_INIT_NOTIFIER_HEAD(&efivar_ops_nh);
> >
>
> IIRC the efi-pstore module autoloads based on this platform device

Indeed I see now, thanks. My bad grep skills didn't work well to catch
this. I will update accordingly.

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 13+ 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
                   ` (4 preceding siblings ...)
  2025-03-17 14:20 ` Mark Brown
@ 2025-03-17 18:10 ` Mark Brown
  5 siblings, 0 replies; 13+ 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] 13+ messages in thread

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

Thread overview: 13+ 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 3/9] efi: Remove redundant creation of the "efivars" platform device Sudeep Holla
2025-03-17 17:06   ` Ard Biesheuvel
2025-03-17 17:19     ` Sudeep Holla
2025-03-17 10:13 ` [PATCH 4/9] rtc: efi: Transition to the faux device interface Sudeep Holla
2025-03-17 13:07   ` Greg Kroah-Hartman
2025-03-17 14:04     ` Sudeep Holla
2025-03-17 10:13 ` [PATCH 5/9] virt: efi_secret: " Sudeep Holla
2025-03-17 13:06   ` Greg Kroah-Hartman
2025-03-17 13:01 ` [PATCH 0/9] drivers: " 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