Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Manikandan Muralidharan" <manikandan.m@microchip.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v7 3/5] i3c: mipi-i3c-hci: add microchip sama7d65 SoC compatible with the required quirk
Date: Mon, 25 May 2026 10:23:31 +0000	[thread overview]
Message-ID: <20260525102331.8AE921F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260525092405.1514213-4-manikandan.m@microchip.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Reusing AMD-specific hardcoded timing quirks for a Microchip SoC will result in incorrect I3C bus frequencies.
--

commit 8dab9b9edc49c0214800ec48372900ae0b5bbae4
Author: Manikandan Muralidharan <manikandan.m@microchip.com>

i3c: mipi-i3c-hci: add microchip sama7d65 SoC compatible with the required quirk

This commit adds support for the Microchip sama7d65 SoC I3C HCI master IP.
It introduces clock acquisition during probe and applies specific quirks
to the new compatible string.

> diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
> index b781dbed21650..4cdf2abd42197 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/core.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/core.c
[ ... ]
> @@ -969,6 +970,7 @@ static int i3c_hci_init(struct i3c_hci *hci)
>  static int i3c_hci_probe(struct platform_device *pdev)
>  {
>  	const struct mipi_i3c_hci_platform_data *pdata = pdev->dev.platform_data;
> +	struct clk_bulk_data *clks;
>  	struct i3c_hci *hci;
>  	int irq, ret;
[ ... ]
> @@ -1001,6 +1003,11 @@ static int i3c_hci_probe(struct platform_device *pdev)
>  	if (!hci->quirks && platform_get_device_id(pdev))
>  		hci->quirks = platform_get_device_id(pdev)->driver_data;
>  
> +	ret = devm_clk_bulk_get_all_enabled(&pdev->dev, &clks);
> +	if (ret < 0)
> +		return dev_err_probe(&pdev->dev, ret,
> +				     "Failed to get clocks\n");
> +
>  	ret = i3c_hci_init(hci);
[ ... ]
> @@ -1031,6 +1038,9 @@ static void i3c_hci_remove(struct platform_device *pdev)
>  
>  static const __maybe_unused struct of_device_id i3c_hci_of_match[] = {
>  	{ .compatible = "mipi-i3c-hci", },
> +	{ .compatible = "microchip,sama7d65-i3c-hci",
> +	  .data = (void *)(ulong)(HCI_QUIRK_PIO_MODE | HCI_QUIRK_OD_PP_TIMING |
> +				  HCI_QUIRK_RESP_BUF_THLD) },

[Severity: High]
Will applying HCI_QUIRK_OD_PP_TIMING to this Microchip SoC result in
incorrect I3C bus frequencies?

This quirk typically invokes amd_set_od_pp_timing(), which writes hardcoded
timing divisors (0x00cf00cf for Open Drain and 0x00160016 for Push-Pull) to
the controller's vendor-specific registers. These fixed values were
calculated for a 9MHz I3C bus frequency assuming an AMD platform's specific
fixed input clock of roughly 400 MHz.

Since the Microchip SoC acquires its clocks dynamically via
devm_clk_bulk_get_all_enabled() as seen above, its input clock rate could
differ and vary based on the system's clock tree configuration.

Should these timing divisors be calculated dynamically against the actual
input clock rate obtained from the clock framework rather than blindly
reusing the fixed AMD divisors?

>  	{},
>  };
>  MODULE_DEVICE_TABLE(of, i3c_hci_of_match);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260525092405.1514213-1-manikandan.m@microchip.com?part=3

  reply	other threads:[~2026-05-25 10:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25  9:24 [PATCH v7 0/5] Add microchip sama7d65 SoC I3C support Manikandan Muralidharan
2026-05-25  9:24 ` [PATCH v7 1/5] dt-bindings: i3c: mipi-i3c-hci: add Microchip SAMA7D65 compatible Manikandan Muralidharan
2026-05-25  9:24 ` [PATCH v7 2/5] clk: at91: sama7d65: add peripheral clock for I3C Manikandan Muralidharan
2026-05-31 14:50   ` Claudiu Beznea
2026-05-25  9:24 ` [PATCH v7 3/5] i3c: mipi-i3c-hci: add microchip sama7d65 SoC compatible with the required quirk Manikandan Muralidharan
2026-05-25 10:23   ` sashiko-bot [this message]
2026-06-02 16:57     ` Frank Li
2026-06-04 10:53       ` Manikandan.M
2026-06-08 17:04   ` Frank Li
2026-05-25  9:24 ` [PATCH v7 4/5] ARM: dts: microchip: add I3C controller Manikandan Muralidharan
2026-05-25 10:30   ` sashiko-bot
2026-05-25  9:24 ` [PATCH v7 5/5] ARM: configs: at91: sama7: add sama7d65 i3c-hci Manikandan Muralidharan
2026-06-07 12:19 ` [PATCH v7 0/5] Add microchip sama7d65 SoC I3C support Claudiu Beznea
2026-06-14 20:39 ` (subset) " Alexandre Belloni

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=20260525102331.8AE921F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=manikandan.m@microchip.com \
    --cc=robh@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