Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@kernel.org>
To: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
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 4/9] firmware: arm_scmi: Fall back to ACPI HID when "compatible" is absent
Date: Wed, 2 Sep 2026 09:03:02 +0100	[thread overview]
Message-ID: <20260902-able-collie-of-purring-87badd@sudeepholla> (raw)
In-Reply-To: <20260824104337.00002275@oss.qualcomm.com>

On Mon, Aug 24, 2026 at 10:43:37AM -0700, Jonathan Cameron wrote:
> On Thu, 13 Aug 2026 12:32:59 +0100
> Sudeep Holla <sudeep.holla@kernel.org> wrote:
> 
> > scmi_debugfs_common_setup() uses the "compatible" property to
> > populate the debugfs transport type string. ACPI-described SCMI
> > devices do not provide that DT property, so the string remains
> > NULL and debugfs setup falls through the allocation failure path.
> > 
> > Check the property lookup result and use the ACPI HID as the
> > fallback transport type when an ACPI companion is present.
> > 
> > All supported DT SCMI platforms are expected to provide "compatible",
> > so the non-ACPI fallback is not needed for normal DT operation. Keep
> > the explicit "unknown" fallback anyway to avoid passing NULL to
> > kstrdup() if that assumption is ever violated.
> > 
> > Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
> Can drop some complexity in here and rely on the stubs in acpi.h a little more.
> 
> > ---
> >  drivers/firmware/arm_scmi/driver.c | 16 ++++++++++++++--
> >  1 file changed, 14 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> > index 9014723e0f7f..9ad827c6a9ab 100644
> > --- a/drivers/firmware/arm_scmi/driver.c
> > +++ b/drivers/firmware/arm_scmi/driver.c
> > @@ -16,6 +16,7 @@
> >  
> >  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> >  
> > +#include <linux/acpi.h>
> >  #include <linux/bitmap.h>
> >  #include <linux/cleanup.h>
> >  #include <linux/debugfs.h>
> > @@ -3063,6 +3064,15 @@ static void scmi_debugfs_common_cleanup(void *d)
> >  	kfree(dbg->type);
> >  }
> >  
> > +static const char *scmi_acpi_device_hid(struct acpi_device *adev)
> > +{
> > +#ifdef CONFIG_ACPI
> 
> Hmm. Ugly that acpi_device_id returns an empty string.
> 
> However given when !CONFIG_ACPI the stub for ACPI_COMPANION(dev) is
> NULL.  You don't need this dance anyway.
> 

That was exactly my thoughts initially until builder bots complained.
But acpi_device_hid() is defined only for CONFIG_ACPI, though I can
handle it runtime, I need to define acpi_device_hid() as NULL for
!CONFIG_ACPI as alternative.

-- 
Regards,
Sudeep


  reply	other threads:[~2026-09-02  8:03 UTC|newest]

Thread overview: 33+ 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-09-02  7:51     ` Sudeep Holla
2026-09-02 23:26       ` Jonathan Cameron
2026-09-03  9:16         ` Bartosz Golaszewski
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
2026-09-02  7:53     ` Sudeep Holla
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-09-02 13:39     ` Sudeep Holla
2026-09-02 23:29       ` Jonathan Cameron
2026-09-03  6:36         ` Sudeep Holla
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-09-02  8:03     ` Sudeep Holla [this message]
2026-09-02  8:09       ` Sudeep Holla
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-09-02 13:52     ` Sudeep Holla
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-09-03 13:43     ` Sudeep Holla
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
2026-09-02  8:25     ` Sudeep Holla
2026-09-02 23:31       ` Jonathan Cameron
2026-09-03  6:39         ` Sudeep Holla

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=20260902-able-collie-of-purring-87badd@sudeepholla \
    --to=sudeep.holla@kernel.org \
    --cc=arm-scmi@vger.kernel.org \
    --cc=cristian.marussi@arm.com \
    --cc=jonathan.cameron@oss.qualcomm.com \
    --cc=kernel-team@meta.com \
    --cc=leitao@debian.org \
    --cc=linux-arm-kernel@lists.infradead.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