Linux-i3c Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Akhil R <akhilrajeev@nvidia.com>
To: <sashiko-bot@kernel.org>
Cc: <Frank.Li@kernel.org>, <akhilrajeev@nvidia.com>,
	<alexandre.belloni@bootlin.com>, <conor+dt@kernel.org>,
	<devicetree@vger.kernel.org>, <linux-hwmon@vger.kernel.org>,
	<linux-i3c@lists.infradead.org>, <robh@kernel.org>,
	<sashiko-reviews@lists.linux.dev>
Subject: Re: [PATCH v6 09/12] i3c: dw-i3c-master: Add ACPI ID for Tegra410
Date: Mon, 27 Jul 2026 14:42:19 +0000	[thread overview]
Message-ID: <20260727144219.177646-1-akhilrajeev@nvidia.com> (raw)
In-Reply-To: <20260721042259.80FA81F000E9@smtp.kernel.org>

On Tue, 21 Jul 2026 04:22:59 +0000, Sashiko AI review <sashiko-bot@kernel.org> wrote:
> commit bf82e9c156c66763c855e5549bd1a91bafc5fdf3
> Author: Akhil R <akhilrajeev@nvidia.com>
>
> i3c: dw-i3c-master: Add ACPI ID for Tegra410
>
> Update variable names to generic names and add Tegra410 ACPI ID to
> support the I3C controller in Tegra410, which is a DesignWare I3C host
> controller.
>
> > diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> > index 3ec3ab1c13b4c..efe37f5224c71 100644
> > --- a/drivers/i3c/master/dw-i3c-master.c
> > +++ b/drivers/i3c/master/dw-i3c-master.c
> > @@ -1860,11 +1860,12 @@ static const struct of_device_id dw_i3c_master_of_match[] = {
> >  };
> >  MODULE_DEVICE_TABLE(of, dw_i3c_master_of_match);
> >  
> > -static const struct acpi_device_id amd_i3c_device_match[] = {
> > +static const struct acpi_device_id dw_i3c_master_acpi_match[] = {
> >  	{ "AMDI0015", AMD_I3C_OD_PP_TIMING },
> > +	{ "NVDA2018", DW_I3C_ACPI_SKIP_CLK_RST },
>
> [Severity: High]
> This isn't a bug introduced by this patch, but adding a new ACPI ID brings
> attention to a pre-existing issue when handling ACPI bindings.
>
> Does this driver safely handle ACPI PRP0001 bindings?
>
> In dw_i3c_common_probe(), if an ACPI companion is present, the match data is
> cast to an integer bitmask:
>
> 	if (has_acpi_companion(&pdev->dev)) {
> 		quirks = (unsigned long)device_get_match_data(&pdev->dev);
> 	} else if (pdev->dev.of_node) {
>
> When an ACPI device binds using the PRP0001 mechanism, it utilizes the OF
> compatible strings and the OF match table. In this scenario,
> device_get_match_data() returns the .data pointer from the of_device_id
> table (e.g. &altr_agilex5_drvdata), rather than an integer quirk bitmask
> from the acpi_device_id table.
>
> Because of the unconditional cast, won't this store a kernel memory address
> into master->quirks instead of a valid bitmask, thereby activating random
> driver quirks?
>
> [Severity: High]
> This is also a pre-existing issue, but does dw_i3c_common_remove() correctly
> handle devres clock cleanup when the device is in runtime suspend?
>
> The probe function acquires and enables the core and pclk clocks using
> devm_clk_get_optional_enabled(). These clocks are explicitly disabled in
> dw_i3c_master_runtime_suspend().
>
> If dw_i3c_common_remove() is invoked while the device is in runtime suspend,
> the clocks are already disabled. Since dw_i3c_common_remove() does not wake
> the device (e.g., via pm_runtime_get_sync()), won't the devres cleanup
> routine run clk_disable_unprepare() again on already disabled clocks,
> leading to a negative clock enable count?

Both are pre-existing behaviours not introduced by adding the Tegra410
ACPI ID; they are better handled separately.

> >  	{ }
> >  };
> > -MODULE_DEVICE_TABLE(acpi, amd_i3c_device_match);
> > +MODULE_DEVICE_TABLE(acpi, dw_i3c_master_acpi_match);

Best Regards,
Akhil

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

  reply	other threads:[~2026-07-27 14:42 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21  4:07 [PATCH v6 00/12] Support ACPI and SETAASA device discovery Akhil R
2026-07-21  4:07 ` [PATCH v6 01/12] dt-bindings: i3c: Add mipi-i3c-static-method to support SETAASA Akhil R
2026-07-21  4:16   ` sashiko-bot
2026-07-21  4:07 ` [PATCH v6 02/12] i3c: master: Use unified device property interface Akhil R
2026-07-21  4:25   ` sashiko-bot
2026-07-22 10:38   ` Adrian Hunter
2026-07-27  8:26     ` Akhil R
2026-07-27 16:07       ` Frank Li
2026-07-21  4:07 ` [PATCH v6 03/12] i3c: master: Support ACPI enumeration of child devices Akhil R
2026-07-21  4:32   ` sashiko-bot
2026-07-21  4:07 ` [PATCH v6 04/12] i3c: master: Add support for devices using SETAASA Akhil R
2026-07-21  4:30   ` sashiko-bot
2026-07-27 12:57     ` Akhil R
2026-07-27 16:12       ` Frank Li
2026-07-28  5:47         ` Akhil R
2026-07-21  4:07 ` [PATCH v6 05/12] i3c: master: Add support for devices without PID Akhil R
2026-07-21  4:26   ` sashiko-bot
2026-07-27 14:12     ` Akhil R
2026-07-27 16:14       ` Frank Li
2026-07-21  4:07 ` [PATCH v6 06/12] i3c: master: match I3C device through DT and ACPI Akhil R
2026-07-21  4:25   ` sashiko-bot
2026-07-27 14:39     ` Akhil R
2026-07-27 16:16       ` Frank Li
2026-07-21  4:07 ` [PATCH v6 07/12] i3c: dw-i3c-master: Add SETAASA as supported CCC Akhil R
2026-07-21  4:24   ` sashiko-bot
2026-07-21  4:07 ` [PATCH v6 08/12] i3c: dw-i3c-master: Add ACPI core clock frequency quirk Akhil R
2026-07-21  4:26   ` sashiko-bot
2026-07-27 14:41     ` Akhil R
2026-07-27 16:19       ` Frank Li
2026-07-21  4:07 ` [PATCH v6 09/12] i3c: dw-i3c-master: Add ACPI ID for Tegra410 Akhil R
2026-07-21  4:22   ` sashiko-bot
2026-07-27 14:42     ` Akhil R [this message]
2026-07-21  4:07 ` [PATCH v6 10/12] hwmon: spd5118: Remove 16-bit addressing Akhil R
2026-07-21  4:25   ` sashiko-bot
2026-07-21  4:07 ` [PATCH v6 11/12] hwmon: spd5118: Add I3C support Akhil R
2026-07-21  4:35   ` sashiko-bot
2026-07-21  4:08 ` [PATCH v6 12/12] arm64: defconfig: Enable I3C and SPD5118 hwmon Akhil R
2026-07-21  4:28   ` sashiko-bot
2026-07-21 16:52 ` [PATCH v6 00/12] Support ACPI and SETAASA device discovery Frank Li
2026-07-27 14:52   ` Akhil R

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=20260727144219.177646-1-akhilrajeev@nvidia.com \
    --to=akhilrajeev@nvidia.com \
    --cc=Frank.Li@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=robh@kernel.org \
    --cc=sashiko-bot@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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