Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ACPI: arm64: use platform_device_set_fwnode()
@ 2026-07-28 14:07 Bartosz Golaszewski
  2026-07-28 14:07 ` [PATCH 1/2] ACPI/APMT: " Bartosz Golaszewski
  2026-07-28 14:07 ` [PATCH 2/2] ACPI/IORT: " Bartosz Golaszewski
  0 siblings, 2 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2026-07-28 14:07 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Catalin Marinas,
	Will Deacon, Rafael J. Wysocki, Len Brown, Danilo Krummrich,
	Greg Kroah-Hartman
  Cc: brgl, linux-acpi, linux-arm-kernel, linux-kernel,
	Bartosz Golaszewski

Note: This must go through the driver core tree where the prerequisite
commit 8877c06885ce ("driver core: platform: provide
platform_device_set_fwnode()") lives before the upcoming merge window!

A series of recent changes in platform device code provided the
platform_device_set_fwnode() helper but later changes converted all its
users to different APIs. The function however should be used whenever a
dynamically allocated platform device gets a firmware node assigned so
use it in two such cases in ACPI arm64 drivers.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
Bartosz Golaszewski (2):
      ACPI/APMT: use platform_device_set_fwnode()
      ACPI/IORT: use platform_device_set_fwnode()

 drivers/acpi/arm64/apmt.c | 2 +-
 drivers/acpi/arm64/iort.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
base-commit: 0d33d21e47d9dc66f91e44da3fc9220c74d93df7
change-id: 20260728-acpi-arm64-pdev-set-fwnode-1d50f24a5c12

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>



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

* [PATCH 1/2] ACPI/APMT: use platform_device_set_fwnode()
  2026-07-28 14:07 [PATCH 0/2] ACPI: arm64: use platform_device_set_fwnode() Bartosz Golaszewski
@ 2026-07-28 14:07 ` Bartosz Golaszewski
  2026-07-28 15:56   ` Sudeep Holla
  2026-07-28 14:07 ` [PATCH 2/2] ACPI/IORT: " Bartosz Golaszewski
  1 sibling, 1 reply; 6+ messages in thread
From: Bartosz Golaszewski @ 2026-07-28 14:07 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Catalin Marinas,
	Will Deacon, Rafael J. Wysocki, Len Brown, Danilo Krummrich,
	Greg Kroah-Hartman
  Cc: brgl, linux-acpi, linux-arm-kernel, linux-kernel,
	Bartosz Golaszewski

Platform devices using the split approach of calling
platform_device_alloc() and platform_device_add() must not assign the
firmware nodes manually but use the provided
platform_device_set_fwnode() function which additionally makes sure we
track the reference count of the firmware node correctly.

Replace the manual assignment of the firmware node with a call to
platform_device_set_fwnode().

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/acpi/arm64/apmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/arm64/apmt.c b/drivers/acpi/arm64/apmt.c
index bb010f6164e528acd802f65afd80d65a57f5844f..c927e4f08ec2c98137d4e3c64ec1709d672ad9a2 100644
--- a/drivers/acpi/arm64/apmt.c
+++ b/drivers/acpi/arm64/apmt.c
@@ -99,7 +99,7 @@ static int __init apmt_add_platform_device(struct acpi_apmt_node *node,
 	if (ret)
 		goto dev_put;
 
-	pdev->dev.fwnode = fwnode;
+	platform_device_set_fwnode(pdev, fwnode);
 
 	ret = platform_device_add(pdev);
 

-- 
2.47.3



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

* [PATCH 2/2] ACPI/IORT: use platform_device_set_fwnode()
  2026-07-28 14:07 [PATCH 0/2] ACPI: arm64: use platform_device_set_fwnode() Bartosz Golaszewski
  2026-07-28 14:07 ` [PATCH 1/2] ACPI/APMT: " Bartosz Golaszewski
@ 2026-07-28 14:07 ` Bartosz Golaszewski
  2026-07-28 15:59   ` Sudeep Holla
  1 sibling, 1 reply; 6+ messages in thread
From: Bartosz Golaszewski @ 2026-07-28 14:07 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Catalin Marinas,
	Will Deacon, Rafael J. Wysocki, Len Brown, Danilo Krummrich,
	Greg Kroah-Hartman
  Cc: brgl, linux-acpi, linux-arm-kernel, linux-kernel,
	Bartosz Golaszewski

Platform devices using the split approach of calling
platform_device_alloc() and platform_device_add() must not assign the
firmware nodes manually but use the provided
platform_device_set_fwnode() function which additionally makes sure we
track the reference count of the firmware node correctly.

Replace the manual assignment of the firmware node with a call to
platform_device_set_fwnode().

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/acpi/arm64/iort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index 34412cd697d8bdc3654c40ca539ddc695a926a26..1020ac953e428797b5b90bd73c6c6ae35e6fd352 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -1992,7 +1992,7 @@ static int __init iort_add_platform_device(struct acpi_iort_node *node,
 		goto dev_put;
 	}
 
-	pdev->dev.fwnode = fwnode;
+	platform_device_set_fwnode(pdev, fwnode);
 
 	if (ops->dev_dma_configure)
 		ops->dev_dma_configure(&pdev->dev, node);

-- 
2.47.3



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

* Re: [PATCH 1/2] ACPI/APMT: use platform_device_set_fwnode()
  2026-07-28 14:07 ` [PATCH 1/2] ACPI/APMT: " Bartosz Golaszewski
@ 2026-07-28 15:56   ` Sudeep Holla
  2026-07-28 16:08     ` Danilo Krummrich
  0 siblings, 1 reply; 6+ messages in thread
From: Sudeep Holla @ 2026-07-28 15:56 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Lorenzo Pieralisi, Hanjun Guo, Catalin Marinas, Will Deacon,
	Rafael J. Wysocki, Len Brown, Danilo Krummrich,
	Greg Kroah-Hartman, brgl, linux-acpi, linux-arm-kernel,
	linux-kernel

On Tue, Jul 28, 2026 at 04:07:16PM +0200, Bartosz Golaszewski wrote:
> Platform devices using the split approach of calling
> platform_device_alloc() and platform_device_add() must not assign the
> firmware nodes manually but use the provided
> platform_device_set_fwnode() function which additionally makes sure we
> track the reference count of the firmware node correctly.
> 
> Replace the manual assignment of the firmware node with a call to
> platform_device_set_fwnode().
> 

I don't see platform_device_set_fwnode() in the upstream tree, is it in
-next ? I didn't see -next tag as well.

> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
>  drivers/acpi/arm64/apmt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/arm64/apmt.c b/drivers/acpi/arm64/apmt.c
> index bb010f6164e528acd802f65afd80d65a57f5844f..c927e4f08ec2c98137d4e3c64ec1709d672ad9a2 100644
> --- a/drivers/acpi/arm64/apmt.c
> +++ b/drivers/acpi/arm64/apmt.c
> @@ -99,7 +99,7 @@ static int __init apmt_add_platform_device(struct acpi_apmt_node *node,
>  	if (ret)
>  		goto dev_put;
>  
> -	pdev->dev.fwnode = fwnode;
> +	platform_device_set_fwnode(pdev, fwnode);
>  

Assuming platform_device_set_fwnode() does what is needed,

Acked-by: Sudeep Holla <sudeep.holla@kernel.org>

-- 
Regards,
Sudeep


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

* Re: [PATCH 2/2] ACPI/IORT: use platform_device_set_fwnode()
  2026-07-28 14:07 ` [PATCH 2/2] ACPI/IORT: " Bartosz Golaszewski
@ 2026-07-28 15:59   ` Sudeep Holla
  0 siblings, 0 replies; 6+ messages in thread
From: Sudeep Holla @ 2026-07-28 15:59 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Lorenzo Pieralisi, Hanjun Guo, Catalin Marinas, Will Deacon,
	Rafael J. Wysocki, Len Brown, Danilo Krummrich,
	Greg Kroah-Hartman, brgl, linux-acpi, linux-arm-kernel,
	linux-kernel

On Tue, Jul 28, 2026 at 04:07:17PM +0200, Bartosz Golaszewski wrote:
> Platform devices using the split approach of calling
> platform_device_alloc() and platform_device_add() must not assign the
> firmware nodes manually but use the provided
> platform_device_set_fwnode() function which additionally makes sure we
> track the reference count of the firmware node correctly.
> 
> Replace the manual assignment of the firmware node with a call to
> platform_device_set_fwnode().
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
>  drivers/acpi/arm64/iort.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
> index 34412cd697d8bdc3654c40ca539ddc695a926a26..1020ac953e428797b5b90bd73c6c6ae35e6fd352 100644
> --- a/drivers/acpi/arm64/iort.c
> +++ b/drivers/acpi/arm64/iort.c
> @@ -1992,7 +1992,7 @@ static int __init iort_add_platform_device(struct acpi_iort_node *node,
>  		goto dev_put;
>  	}
>  
> -	pdev->dev.fwnode = fwnode;
> +	platform_device_set_fwnode(pdev, fwnode);
>  

Acked-by: Sudeep Holla <sudeep.holla@kernel.org>

With the condition specified in 1/2. I assume you plan to take it via the
same tree that introduces platform_device_set_fwnode() ?

-- 
Regards,
Sudeep


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

* Re: [PATCH 1/2] ACPI/APMT: use platform_device_set_fwnode()
  2026-07-28 15:56   ` Sudeep Holla
@ 2026-07-28 16:08     ` Danilo Krummrich
  0 siblings, 0 replies; 6+ messages in thread
From: Danilo Krummrich @ 2026-07-28 16:08 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Bartosz Golaszewski, Lorenzo Pieralisi, Hanjun Guo,
	Catalin Marinas, Will Deacon, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, brgl, linux-acpi, linux-arm-kernel,
	linux-kernel

On Tue Jul 28, 2026 at 5:56 PM CEST, Sudeep Holla wrote:
> I don't see platform_device_set_fwnode() in the upstream tree, is it in
> -next ? I didn't see -next tag as well.

It should be contained in linux-next through driver-core-next.


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

end of thread, other threads:[~2026-07-28 16:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-28 14:07 [PATCH 0/2] ACPI: arm64: use platform_device_set_fwnode() Bartosz Golaszewski
2026-07-28 14:07 ` [PATCH 1/2] ACPI/APMT: " Bartosz Golaszewski
2026-07-28 15:56   ` Sudeep Holla
2026-07-28 16:08     ` Danilo Krummrich
2026-07-28 14:07 ` [PATCH 2/2] ACPI/IORT: " Bartosz Golaszewski
2026-07-28 15:59   ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox