From: "Arnd Bergmann" <arnd@arndb.de>
To: "Arthur Crépin Leblond" <arthur@marmottus.net>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"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>
Cc: Netdev <netdev@vger.kernel.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] w5100: restore GPIO-based link detection
Date: Tue, 04 Aug 2026 17:02:48 +0200 [thread overview]
Message-ID: <75937d1b-8ae9-4daa-bc36-08bdf5a6c5a9@app.fastmail.com> (raw)
In-Reply-To: <20260804-wiznet-link-gpio-v1-1-b626fd4f7ccb@marmottus.net>
On Tue, Aug 4, 2026, at 16:38, Arthur Crépin Leblond wrote:
> Commit dacf281771a9 ("w5100: remove unused gpio link detection")
> dropped the link_gpio/link_irq handling on the grounds that no
> devicetree user passed a "link" GPIO at the time.
>
> Signed-off-by: Arthur Crépin Leblond <arthur@marmottus.net>
Hi Arthur,
The patch description could use some more explanation here, and
a clarification that you don't just bring back the original
broken code but add devicetree support for it.
> .../devicetree/bindings/net/wiznet,w5x00.txt | 8 ++-
> drivers/net/ethernet/wiznet/w5100.c | 84 ++++++++++++++++++++++
> 2 files changed, 89 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/wiznet,w5x00.txt
> b/Documentation/devicetree/bindings/net/wiznet,w5x00.txt
> index e9665798c4be..e97ce3cb9183 100644
> --- a/Documentation/devicetree/bindings/net/wiznet,w5x00.txt
> +++ b/Documentation/devicetree/bindings/net/wiznet,w5x00.txt
> @@ -25,6 +25,7 @@ Optional properties:
> According to the w5500 datasheet, the chip allows a maximum of 80
> MHz, however,
> board designs may need to limit this value.
> - local-mac-address: See ethernet.txt in the same directory.
> +- link-gpios: a GPIO line used for the link detection interrupt
>
>
> Example (for Raspberry Pi with pin control stuff for GPIO irq):
> @@ -38,13 +39,14 @@ Example (for Raspberry Pi with pin control stuff
> for GPIO irq):
> interrupt-parent = <&gpio>;
> interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
> spi-max-frequency = <30000000>;
> + link-gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
> };
> };
Ok, so you are using the binding I suggested originally,
which I think is fine here, but note that Rob asked for
the binding to be converted to yaml format in
https://lore.kernel.org/all/20260427145010.GA2502144-robh@kernel.org/
I avoiding touching it by just removing the broken implementation,
but it would be good if you could do this now.
> +
> + priv->link_irq = gpiod_to_irq(priv->link_gpio);
> + if (priv->link_irq < 0) {
> + err = priv->link_irq;
> + goto err_gpio;
> + }
> +
> + err = request_any_context_irq(priv->link_irq, w5100_detect_link,
> + IRQF_TRIGGER_RISING |
> + IRQF_TRIGGER_FALLING,
> + link_name, priv->ndev);
I think you can just use a hardcoded link name here, and
an open-coded gpiod_to_irq(priv->link_gpio) for simplicity. My
previous version kept this from the original code, but if you
reintroduce it, you can improve it further (as you did elsewhere
already)
I would probably also use devm_request_threaded_irq()
> @@ -840,6 +918,7 @@ static int w5100_suspend(struct device *dev)
>
> if (netif_running(ndev)) {
> netif_carrier_off(ndev);
> +
> netif_device_detach(ndev);
...
> w5100_hw_close(priv);
> }
> +
> return 0;
The whitespace changes should not be part of the patch.
Arnd
next prev parent reply other threads:[~2026-08-04 15:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 14:38 [PATCH] w5100: restore GPIO-based link detection Arthur Crépin Leblond
2026-08-04 15:02 ` Arnd Bergmann [this message]
2026-08-04 17:47 ` Arthur Crépin Leblond
2026-08-04 17:54 ` Andrew Lunn
2026-08-05 8:25 ` Arthur Crépin Leblond
2026-08-05 9:11 ` Arnd Bergmann
2026-08-05 9:44 ` Arthur Crépin Leblond
2026-08-05 10:46 ` Arnd Bergmann
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=75937d1b-8ae9-4daa-bc36-08bdf5a6c5a9@app.fastmail.com \
--to=arnd@arndb.de \
--cc=andrew+netdev@lunn.ch \
--cc=arthur@marmottus.net \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).