From: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
To: Sudeep Holla <sudeep.holla@kernel.org>
Cc: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
kernel-team@meta.com, Cristian Marussi <cristian.marussi@arm.com>,
Breno Leitao <leitao@debian.org>
Subject: Re: [PATCH v3 2/9] firmware: arm_scmi: Extend transport driver macro to support ACPI
Date: Mon, 24 Aug 2026 10:04:31 -0700 [thread overview]
Message-ID: <20260824100431.00002daf@oss.qualcomm.com> (raw)
In-Reply-To: <20260813-acpi_scmi_pcc-v3-2-cb6b88b4ebb3@kernel.org>
On Thu, 13 Aug 2026 12:32:57 +0100
Sudeep Holla <sudeep.holla@kernel.org> wrote:
> Extend the SCMI transport driver helper to support ACPI-based systems.
> Introduce an internal helper macro that accepts both OF and ACPI match
> tables, and expose two wrappers:
>
> - DEFINE_SCMI_TRANSPORT_DRIVER(...) for DT/OF transports
> - DEFINE_SCMI_ACPI_TRANSPORT_DRIVER(...) for ACPI transports
>
> For ACPI, set the generated platform_driver .acpi_match_table via
> ACPI_PTR().
ACPI_PTR() is often more trouble that it is worth because of need
to guard the tables if they turn up in code where ACPI might not be present.
Now if someone fancied doing the work to make it work like pm_ptr()
then that would nicer. That one lets the compiler both see the stuff beyond
the pointer, but also do dead code removal on it later.
Anyhow, doesn't actually matter either way here because you only use that
with a non NULL pointer in a driver that is ACPI only.
If you really want to do it, maybe pair with of_match_ptr() but
that one is even worse as maybe some will be having fun with SCMI and
PRP0001.
Anyhow, random diversion aside, it makes no difference in practice.
> The ACPI wrapper relies on the firmware-node propagation
> provided by the preceding change so fwnode lookups on the spawned
> platform device see the correct firmware description.
>
> Keep existing DT users unchanged while allowing transports to be probed
> using struct acpi_device_id tables on ACPI platforms.
>
> Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
> ---
> drivers/firmware/arm_scmi/common.h | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
> index cc7d11c3c1f3..0b896171faa2 100644
> --- a/drivers/firmware/arm_scmi/common.h
> +++ b/drivers/firmware/arm_scmi/common.h
> @@ -9,6 +9,7 @@
> #ifndef _SCMI_COMMON_H
> #define _SCMI_COMMON_H
>
> +#include <linux/acpi.h>
> #include <linux/bitfield.h>
> #include <linux/completion.h>
> #include <linux/device.h>
> @@ -615,7 +616,8 @@ struct scmi_transport_supplier __supplier = { \
> .th.supplier_put = scmi_transport_supplier_put, \
> }
>
> -#define DEFINE_SCMI_TRANSPORT_DRIVER(__tag, __drv, __desc, __match, __core_ops)\
> +#define __DEFINE_SCMI_TRANSPORT_DRIVER(__tag, __drv, __desc, __of_match, \
> + __acpi_match, __core_ops) \
> static void __tag##_dev_free(void *data) \
> { \
> struct platform_device *spdev = data; \
> @@ -679,11 +681,18 @@ err_mem: \
> static struct platform_driver __drv = { \
> .driver = { \
> .name = #__tag "_transport", \
> - .of_match_table = __match, \
> + .of_match_table = __of_match, \
> + .acpi_match_table = ACPI_PTR(__acpi_match), \
> }, \
> .probe = __tag##_probe, \
> }
>
> +#define DEFINE_SCMI_TRANSPORT_DRIVER(__tag, __drv, __desc, __match, __core_ops)\
> + __DEFINE_SCMI_TRANSPORT_DRIVER(__tag, __drv, __desc, __match, NULL, __core_ops)
> +
> +#define DEFINE_SCMI_ACPI_TRANSPORT_DRIVER(__tag, __drv, __desc, __match, __core_ops)\
> + __DEFINE_SCMI_TRANSPORT_DRIVER(__tag, __drv, __desc, NULL, __match, __core_ops)
> +
> void scmi_notification_instance_data_set(const struct scmi_handle *handle,
> void *priv);
> void *scmi_notification_instance_data_get(const struct scmi_handle *handle);
>
next prev parent reply other threads:[~2026-08-24 17:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 11:32 [PATCH v3 0/9] firmware: arm_scmi: Refactoring and enablement of ACPI PCC transport Sudeep Holla
2026-08-13 11:32 ` [PATCH v3 1/9] firmware: arm_scmi: Set fwnode for the generated SCMI platform device Sudeep Holla
2026-08-24 16:51 ` Jonathan Cameron
2026-08-13 11:32 ` [PATCH v3 2/9] firmware: arm_scmi: Extend transport driver macro to support ACPI Sudeep Holla
2026-08-24 17:04 ` Jonathan Cameron [this message]
2026-08-13 11:32 ` [PATCH v3 3/9] firmware: arm_scmi: Convert OF-only paths to generic fwnode in SCMI core Sudeep Holla
2026-08-24 17:39 ` Jonathan Cameron
2026-08-13 11:32 ` [PATCH v3 4/9] firmware: arm_scmi: Fall back to ACPI HID when "compatible" is absent Sudeep Holla
2026-08-24 17:43 ` Jonathan Cameron
2026-08-13 11:33 ` [PATCH v3 5/9] firmware: arm_scmi: Pass protocol ID to chan_available() transport callback Sudeep Holla
2026-08-24 17:45 ` Jonathan Cameron
2026-08-13 11:33 ` [PATCH v3 6/9] firmware: arm_scmi: Refactor protocol device creation logic Sudeep Holla
2026-08-24 17:49 ` Jonathan Cameron
2026-08-13 11:33 ` [PATCH v3 7/9] firmware: arm_scmi: Add ACPI PCC transport Sudeep Holla
2026-08-24 20:17 ` Jonathan Cameron
2026-08-13 11:33 ` [PATCH v3 8/9] firmware: arm_scmi: Initialise known ACPI protocol devices and channels Sudeep Holla
2026-08-24 20:21 ` Jonathan Cameron
2026-08-13 11:33 ` [PATCH v3 9/9] firmware: arm_scmi: Validate PCC shared memory signature Sudeep Holla
2026-08-24 20:24 ` Jonathan Cameron
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=20260824100431.00002daf@oss.qualcomm.com \
--to=jonathan.cameron@oss.qualcomm.com \
--cc=arm-scmi@vger.kernel.org \
--cc=cristian.marussi@arm.com \
--cc=kernel-team@meta.com \
--cc=leitao@debian.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=sudeep.holla@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