Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Abdurrahman Hussain" <abdurrahman@nexthop.ai>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2] of: property: add i2c-parent to fw_devlink supplier bindings
Date: Sat, 15 Aug 2026 23:48:19 +0000	[thread overview]
Message-ID: <20260815234819.BA8731F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260815-b4-of-property-add-i2c-parent-v2-1-239c6da9e097@nexthop.ai>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The custom `i2c-parent` parser uses an incorrect compatible string (`toshiba,tc9563`) to detect TC9563 devices, bypassing the custom parsing logic for actual hardware.
--

--- Patch [1]: [PATCH v2] of: property: add i2c-parent to fw_devlink supplier bindings ---
commit 53359fe4a5d6b17938d753a47bed08284aafa03a
Author: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Subject: of: property: add i2c-parent to fw_devlink supplier bindings

This commit teaches fw_devlink about the i2c-parent property so consumers
are unbound before the parent adapter's device, ensuring proper teardown
ordering. It introduces a custom parser for i2c-parent to handle differing
layouts, specifically to accommodate the toshiba,tc9563 node which holds a
phandle followed by an i2c slave-address cell.

Link: https://patch.msgid.link/20260813-b4-of-property-add-i2c-parent-v1-1-a2487e920ce1@nexthop.ai

> diff --git a/drivers/of/property.c b/drivers/of/property.c
> index 72cf12907de03..e9ceb26c03000 100644
> --- a/drivers/of/property.c
> +++ b/drivers/of/property.c

[ ... ]

> @@ -1471,6 +1471,22 @@ static struct device_node *parse_gpio_compat(struct device_node *np,
>  	return sup_args.np;
>  }
>  
> +static struct device_node *parse_i2c_parent(struct device_node *np,
> +					    const char *prop_name, int index)
> +{
> +	if (strcmp(prop_name, "i2c-parent"))
> +		return NULL;
> +
> +	/* toshiba,tc9563 is <phandle addr>; every other user is bare phandles */
> +	if (of_device_is_compatible(np, "toshiba,tc9563")) {

[Severity: High]
Is this the correct compatible string for the TC9563 PCIe switch?

According to the device tree bindings, actual hardware nodes for the
TC9563 use the compatible string "pci1179,0623" rather than
"toshiba,tc9563".

If the compatible string doesn't match, this check will fail during boot
and fall through to the bare phandle parser. Will this cause fw_devlink
to parse the second cell of the property (the I2C slave address, e.g.,
0x77) as a phandle?

If another node happens to have that value as its phandle, it appears
this could create a spurious device link that might block the PCIe
switch from probing or create a dependency cycle.

> +		if (index)
> +			return NULL;
> +		return of_parse_phandle(np, prop_name, 0);
> +	}
> +
> +	return of_parse_phandle(np, prop_name, index);
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260815-b4-of-property-add-i2c-parent-v2-1-239c6da9e097@nexthop.ai?part=1

      reply	other threads:[~2026-08-15 23:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-15 23:37 [PATCH v2] of: property: add i2c-parent to fw_devlink supplier bindings Abdurrahman Hussain
2026-08-15 23:48 ` sashiko-bot [this message]

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=20260815234819.BA8731F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=abdurrahman@nexthop.ai \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --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