[PATCH v7 09/12] i3c: dw-i3c-master: Add ACPI ID for Tegra410
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Tue Jul 28 00:19:22 PDT 2026
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Pointer address assigned to an integer bitmask variable for quirks under ACPI PRP0001 matching.
--
--- Patch [9]: [PATCH v7 09/12] i3c: dw-i3c-master: Add ACPI ID for Tegra410 ---
commit 4b2659ca2047946e238179b5da94407cbd49ffa2
Author: Akhil R <akhilrajeev at 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 273d7a0020993..12069aa56fad8 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -1855,11 +1855,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 is a pre-existing issue, but does dw_i3c_common_probe() improperly cast
pointers to integer bitmasks under ACPI PRP0001 matching?
If a system uses the ACPI PRP0001 HID alongside the "altr,agilex5-dw-i3c-master"
compatible string, device_get_match_data() will return a pointer to
altr_agilex5_drvdata.
Because the device has an ACPI companion, the probe function processes it like
this:
drivers/i3c/master/dw-i3c-master.c:dw_i3c_common_probe() {
...
if (has_acpi_companion(&pdev->dev)) {
quirks = (unsigned long)device_get_match_data(&pdev->dev);
} else if (pdev->dev.of_node) {
...
}
Will this cause the memory address of altr_agilex5_drvdata to be cast directly
to an integer bitmask, resulting in random quirks being activated based on
memory alignment (e.g., falsely applying DW_I3C_ACPI_SKIP_CLK_RST or
DW_I3C_DISABLE_RUNTIME_PM_QUIRK)?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260728065955.809445-1-akhilrajeev@nvidia.com?part=9
More information about the linux-i3c
mailing list