mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: filipp.dunsky@gmail.com
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/3] net: mdio: Add Cortina CS7542 bus controller
Date: Mon, 23 Nov 2026 20:40:36 +0100	[thread overview]
Message-ID: <e55e5103-db9c-43ed-8bcb-406909fe8f5f@lunn.ch> (raw)
In-Reply-To: <20261123-b4-cs7542-mdio-v1-2-626d0a0e3b4d@gmail.com>

> +++ b/drivers/net/mdio/Kconfig
> @@ -291,3 +291,16 @@ config MDIO_BUS_MUX_MMIOREG
>  
>  endmenu
>  endmenu
> +
> +config MDIO_CS75XX
> +	tristate "Cortina Systems CS7542 MDIO controller"

This file is sorted by tristate string. So this goes between

Broadcom UniMAC MDIO bus controller

and

GPIO lib-based bitbanged MDIO buses

MDIO_CAVIUM is an odd ball. I suggest after it.


> +	depends on OF_MDIO && HAS_IOMEM
> +	help
> +	  Support Clause 22 PHY register access through the CS7542 MDIO
> +	  controller, retaining the prescaler configured by platform firmware.
> +	  Transactions use bounded polling and recover from late completion.
> +	  Device Tree describes the PHYs sharing this management bus.
> +
> +	  To compile this driver as a module, choose M here: the module
> +	  will be called mdio-cs75xx.
> +
> diff --git a/drivers/net/mdio/Makefile b/drivers/net/mdio/Makefile
> index 048586746..2afa6066f 100644
> --- a/drivers/net/mdio/Makefile
> +++ b/drivers/net/mdio/Makefile
> @@ -35,3 +35,4 @@ obj-$(CONFIG_MDIO_BUS_MUX_MESON_G12A)	+= mdio-mux-meson-g12a.o
>  obj-$(CONFIG_MDIO_BUS_MUX_MESON_GXL)	+= mdio-mux-meson-gxl.o
>  obj-$(CONFIG_MDIO_BUS_MUX_MMIOREG) 	+= mdio-mux-mmioreg.o
>  obj-$(CONFIG_MDIO_BUS_MUX_MULTIPLEXER) 	+= mdio-mux-multiplexer.o
> +obj-$(CONFIG_MDIO_CS75XX) += mdio-cs75xx.o

This file is also sorted.

> +struct cs75xx_mdio {
> +	void __iomem *base;
> +	struct mii_bus *bus;
> +	bool pending;

This pending is odd.

> +static int cs75xx_mdio_wait(struct cs75xx_mdio *priv)
> +{
> +	u32 val;
> +	int ret;
> +
> +	ret = readl_poll_timeout_atomic(priv->base + PER_MDIO_CTRL, val,
> +					val & MDIO_CTRL_DONE, 1,
> +				       CS75XX_MDIO_TIMEOUT_US);
> +	if (!ret) {
> +		writel(MDIO_CTRL_DONE, priv->base + PER_MDIO_CTRL);
> +		priv->pending = false;
> +	}

Have you seen this fail?

MDIO busses are simple things, it is just a big shift register. They
pretty much don't fail, except if the clock is not ticking. Any
failure is generally fatal, and you can expect cascading failures, the
next operation is going to fail, and the one after that etc.

So i would throw away pending.

    Andrew

---
pw-bot: cr

  reply	other threads:[~2026-11-23 19:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 18:41 [PATCH net-next 0/3] Add Cortina Systems CS7542 MDIO controller support Fil Dunsky via B4 Relay
2026-11-23 18:41 ` [PATCH net-next 1/3] dt-bindings: net: Add Cortina CS7542 MDIO controller Fil Dunsky via B4 Relay
2026-11-23 18:41 ` [PATCH net-next 2/3] net: mdio: Add Cortina CS7542 bus controller Fil Dunsky via B4 Relay
2026-11-23 19:40   ` Andrew Lunn [this message]
2026-11-23 20:41     ` Fil Dunsky
2026-11-23 18:41 ` [PATCH net-next 3/3] MAINTAINERS: Add Cortina CS7542 MDIO controller entry Fil Dunsky via B4 Relay
2026-11-23 19:41   ` Andrew Lunn

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=e55e5103-db9c-43ed-8bcb-406909fe8f5f@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andrew+netdev@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=filipp.dunsky@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®