Devicetree
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: iustin.stolniceanu@analog.com
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org,
	parthiban.veerasooran@microchip.com, hkallweit1@gmail.com,
	linux@armlinux.org.uk, marcelo.schmitt@analog.com,
	alvin.sipraga@analog.com, ciprian.regus@analog.com,
	Selvamani.Rajagopal@onsemi.com, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 7/7] net: ethernet: adi: adin1110: Add OA TC6 protocol support for ADIN1110
Date: Tue, 24 Nov 2026 12:02:50 +0000	[thread overview]
Message-ID: <179552177040.3135.10993155208943619451@kernel.org> (raw)
In-Reply-To: <20261123115743.29523-8-iustin.stolniceanu@analog.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] On the new OA TC6 path, the ADIN1110 hardware reset is left to
  oa_tc6_init(), which does not follow the reset constraints the driver…
- [Low] The strap/property hint in adin1110_oa_tc6_probe()
  (drivers/net/ethernet/adi/adin1110.c) is printed in the wrong cases.

--

net: ethernet: adi: adin1110: Add OA TC6 protocol support for ADIN1110

This adds OPEN Alliance TC6 SPI protocol support for the ADIN1110. It uses
the oa_tc6 framework and is enabled by the adi,spi-oa-tc6 property.
Register accesses go through read_reg/write_reg callbacks so the MAC
configuration code is shared by both protocols, and the ADIN2111 is
rejected with -ENODEV in TC6 mode.

> diff --git a/drivers/net/ethernet/adi/adin1110.c b/drivers/net/ethernet/adi/adin1110.c
> index 10e7ef33be108..72710d3edd7b3 100644
> --- a/drivers/net/ethernet/adi/adin1110.c
> +++ b/drivers/net/ethernet/adi/adin1110.c

[ ... ]

> @@ -1115,14 +1230,91 @@ static int adin1110_check_spi(struct adin1110_priv *priv)

[ ... ]

> +static int adin1110_oa_tc6_probe(struct adin1110_priv *priv)
> +{

[ ... ]

> +	/* oa_tc6_init() attaches the PHY, which looks at netdev_ops. */
> +	netdev->netdev_ops = &adin1110_tc6_netdev_ops;
> +
> +	quirks.hwreset_settle_us = 50000;
> +	quirks.softreset_settle_us = 10000;
> +
> +	port_priv->tc6 = oa_tc6_init(priv->spidev, netdev, &quirks);

[Severity: Medium]
Does the reset done by oa_tc6_init() meet the ADIN1110 reset requirements
that this driver documents?

The generic SPI path does this in adin1110_check_spi():

	if (reset_gpio) {
		/* MISO pin is used for internal configuration, can't have
		 * anyone else disturbing the SDO line.
		 */
		spi_bus_lock(priv->spidev->controller);

		gpiod_set_value(reset_gpio, 1);
		fsleep(10000);
		gpiod_set_value(reset_gpio, 0);

		/* Need to wait 90 ms before interacting with
		 * the MAC after a HW reset.
		 */
		fsleep(90000);

		spi_bus_unlock(priv->spidev->controller);
	}

The TC6 path does this in oa_tc6_init():

	if (tc6->reset_gpio) {
		...
		fsleep(10);
		gpiod_set_value_cansleep(tc6->reset_gpio, 0);
		fsleep(tc6->quirks.hwreset_settle_us);
	}

The two sequences differ in three ways:

- Reset is held for about 10 us instead of 10 ms.
- The SPI bus is not locked. On a shared bus, another device's transfer
  could drive MISO while the ADIN1110 comes out of reset. The earlier
  commit in this series, "net: ethernet: oa_tc6: Allow custom reset settle
  time values", says the ADIN1110 tristates its SDO pin during reset.
- hwreset_settle_us is 50 ms here. The comment in adin1110_check_spi()
  says 90 ms is needed.

If the 90 ms wait or the bus lock is really required, could the first
control access in oa_tc6_check_ctrl_protection() reach a device that is
not ready? That would return -EPROTO, which is then reported as a strap
problem with -ENODEV. Or is the 90 ms comment in adin1110_check_spi()
stale?

> +	if (PTR_ERR_OR_ZERO(port_priv->tc6) == -EPROTO)
> +		return dev_err_probe(dev, -ENODEV,
> +				     "no OA TC6 reply, check the SPI_CFG1 strap and adi,spi-oa-tc6\n");
> +	if (IS_ERR(port_priv->tc6))
> +		return PTR_ERR(port_priv->tc6);

[ ... ]

> +	ret = adin1110_read_reg(priv, ADIN1110_PHY_ID, &val);
> +	if (ret < 0)
> +		return ret;
> +
> +	if (val != priv->cfg->phy_id_val)
> +		return dev_err_probe(dev, -ENODEV, "PHY ID expected: %x, read: %x\n",
> +				     priv->cfg->phy_id_val, val);

[Severity: Low]
The commit message says:

  If the MAC-PHY gives no valid OA TC6 reply during initialization, or
  the PHY ID does not match, probe fails with -ENODEV and a message
  pointing at the strap and the property.

This PHY ID mismatch message in adin1110_oa_tc6_probe() has no strap or
property hint. The matching check in adin1110_check_spi() gains one in
this same patch:

	"PHY ID expected: %x, read: %x, check the SPI_CFG1 strap and adi,spi-oa-tc6\n"

Should the two messages match?

There is a related question about the -EPROTO check above it. Does
-EPROTO from oa_tc6_init() really mean "no OA TC6 reply"? In oa_tc6.c it
is the generic result of any failed control reply check. For example,
oa_tc6_check_ctrl_read_reply() has:

	if (*tx_buf != *rx_buf)
		return -EPROTO;
	...
			if (complement != ~reply)
				return -EPROTO;

oa_tc6_check_ctrl_write_reply() also returns -EPROTO when its memcmp()
fails.

These checks run on every control access in every phase of
oa_tc6_init(): the protection check, soft reset, interrupt unmask,
PHY/MDIO init and enabling data transfer. oa_tc6_init() passes the errno
up unchanged.

A correctly strapped device could get one corrupted reply later in init.
Would that be reported as a strap or DT misconfiguration, with probe
returning -ENODEV instead of -EPROTO?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123115743.29523-1-iustin.stolniceanu%40analog.com

      reply	other threads:[~2026-11-24 12:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 11:57 [PATCH net-next v3 0/7] net: ethernet: adi: adin1110: Add OPEN Alliance TC6 support Iustin Stolniceanu
2026-11-23 11:57 ` [PATCH net-next v3 1/7] net: ethernet: oa_tc6: Forward declare struct mii_bus Iustin Stolniceanu
2026-11-23 11:57 ` [PATCH net-next v3 2/7] net: ethernet: oa_tc6: Allow custom reset settle time values Iustin Stolniceanu
2026-11-23 11:57 ` [PATCH net-next v3 3/7] net: ethernet: oa_tc6: Add support for MDIO indirect access Iustin Stolniceanu
2026-11-24 12:02   ` netdev-bot+sashiko
2026-11-23 11:57 ` [PATCH net-next v3 4/7] net: phy: adin1100: Add separate driver entries for ADIN1110/ADIN2111 Iustin Stolniceanu
2026-11-23 11:57 ` [PATCH net-next v3 5/7] net: phy: adin1100: Skip the soft reset on ADIN1110/ADIN2111 Iustin Stolniceanu
2026-11-24 12:02   ` netdev-bot+sashiko
2026-11-23 11:57 ` [PATCH net-next v3 6/7] dt-bindings: net: adi,adin1110: Add adi,spi-oa-tc6 Iustin Stolniceanu
2026-11-23 11:57 ` [PATCH net-next v3 7/7] net: ethernet: adi: adin1110: Add OA TC6 protocol support for ADIN1110 Iustin Stolniceanu
2026-11-24 12:02   ` netdev-bot+sashiko [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=179552177040.3135.10993155208943619451@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=Selvamani.Rajagopal@onsemi.com \
    --cc=alvin.sipraga@analog.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ciprian.regus@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=iustin.stolniceanu@analog.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=marcelo.schmitt@analog.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=parthiban.veerasooran@microchip.com \
    --cc=robh@kernel.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