All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Fil Dunsky" <filipp.dunsky@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v3 2/3] net: mdio: Add Cortina CS7542 bus controller
Date: Fri, 27 Nov 2026 09:27:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-236978@kernel.org> (raw)
In-Reply-To: <20261126-b4-cs7542-mdio-v3-2-35739a0f3225@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] net: mdio: missing APB clock enablement in
  cs75xx_mdio_probe()
--

commit 78d590aee35acd115434c7d0b0c0e975167e8993
Author: Fil Dunsky <filipp.dunsky@gmail.com>

net: mdio: Add Cortina CS7542 bus controller

This commit adds a driver for the Cortina Systems CS7542 MDIO bus
controller supporting Clause 22 PHY register access via polling.

> diff --git a/drivers/net/mdio/mdio-cs75xx.c b/drivers/net/mdio/mdio-cs75xx.c
> new file mode 100644
> index 0000000000000..c3d80a983404c
> --- /dev/null
> +++ b/drivers/net/mdio/mdio-cs75xx.c

[ ... ]

> +static int cs75xx_mdio_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct cs75xx_mdio *priv;
> +	struct mii_bus *bus;
> +	u32 cfg;
> +
> +	bus = devm_mdiobus_alloc_size(dev, sizeof(*priv));
> +	if (!bus)
> +		return -ENOMEM;
> +
> +	priv = bus->priv;
> +	priv->base = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(priv->base))
> +		return PTR_ERR(priv->base);
> +
> +	cfg = readl(priv->base + PER_MDIO_CFG);
> +	/* The firmware configures the MDC rate; retain its prescaler. */
> +	cfg |= MDIO_CFG_MANUAL;
> +	writel(cfg, priv->base + PER_MDIO_CFG);
> +	writel(MDIO_CTRL_DONE, priv->base + PER_MDIO_CTRL);

[Severity: Medium]
Should cs75xx_mdio_probe() acquire and enable the APB input clock with
devm_clk_get_enabled() before accessing PER_MDIO_CFG and PER_MDIO_CTRL?

The companion DT binding in Documentation/devicetree/bindings/net/cortina,cs7542-mdio.yaml
makes clocks a required property.  Even when retaining the firmware
prescaler, leaving the clock unclaimed means probe accesses can hit an
unclocked block, or clk_disable_unused can gate the clock later and make
cs75xx_mdio_read() and cs75xx_mdio_write() time out with -ETIMEDOUT.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126-b4-cs7542-mdio-v3-0-35739a0f3225@gmail.com?part=2

  parent reply	other threads:[~2026-11-27  9:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  9:27 [PATCH net-next v3 0/3] Add Cortina Systems CS7542 MDIO controller support Fil Dunsky via B4 Relay
2026-11-26  9:27 ` Fil Dunsky
2026-11-26  9:27 ` [PATCH net-next v3 1/3] dt-bindings: net: Add Cortina CS7542 MDIO controller Fil Dunsky via B4 Relay
2026-11-26  9:27   ` Fil Dunsky
2026-11-26  9:27 ` [PATCH net-next v3 2/3] net: mdio: Add Cortina CS7542 bus controller Fil Dunsky via B4 Relay
2026-11-26  9:27   ` Fil Dunsky
2026-11-26 15:31   ` Andrew Lunn
2026-11-26 15:46     ` Fil Dunsky
2026-11-27  9:27   ` sashiko-bot [this message]
2026-11-26  9:27 ` [PATCH net-next v3 3/3] MAINTAINERS: Add Cortina CS7542 MDIO controller entry Fil Dunsky via B4 Relay
2026-11-26  9:27   ` Fil Dunsky

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=sashiko-outbox-236978@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=filipp.dunsky@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.