Netdev List
 help / color / mirror / Atom feed
From: "Arthur Crépin Leblond" <arthur@marmottus.net>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Lunn <andrew@lunn.ch>, 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>,
	Netdev <netdev@vger.kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] w5100: restore GPIO-based link detection
Date: Wed, 5 Aug 2026 15:42:52 +0200	[thread overview]
Message-ID: <anM93A0l2inhFxFu@pc-du-fromage> (raw)
In-Reply-To: <1111a5e1-49bb-44b6-918d-7cda152a318b@app.fastmail.com>

On Wed, Aug 05, 2026 at 12:46:14PM +0200, Arnd Bergmann wrote:
>On Wed, Aug 5, 2026, at 11:44, Arthur Crépin Leblond wrote:
>> On Wed, Aug 05, 2026 at 11:11:53AM +0200, Arnd Bergmann wrote:
>> You're right for the W5100 that would not make any sense during data
>> transfers it would trigger the interrupt. That's unreliable.
>>
>> I am using the W5500, and in the datasheet it says
>>
>>    Link LED
>>    This shows the Link status.
>>    Low: Link is established
>>    High: Link is not established
>>
>> I can confirm it is what is happening, I don't see any changes
>> of state during TX/RX.
>
>Ok, good. On the other hand, the W5500 also has a PHYCFG register
>that should tell you the link status without looking at the
>GPIO line, though it's not clear if the CON/DISCON interrupt
>fires on link state change in MACRAW mode.
>
>It probably makes sense to wire up link w5100_get_link() to
>the phy register for w5500 either way, as that works without
>connecting a GPIO. Then you can just describe the LINKLED
>signal as an optional interrupt in the DT binding to trigger
>checking the link state in that register.
>
>     Arnd

Seems to work, the PHYCFG[0] bit gets updated on link change.

Arthur

      reply	other threads:[~2026-08-05 13:43 UTC|newest]

Thread overview: 9+ 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
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
2026-08-05 13:42           ` Arthur Crépin Leblond [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=anM93A0l2inhFxFu@pc-du-fromage \
    --to=arthur@marmottus.net \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=arnd@arndb.de \
    --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