[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240509.132341.474491799593158015.fujita.tomonori@gmail.com>
Date: Thu, 09 May 2024 13:23:41 +0900 (JST)
From: FUJITA Tomonori <fujita.tomonori@...il.com>
To: andrew@...n.ch
Cc: netdev@...r.kernel.org, kuba@...nel.org, jiri@...nulli.us,
horms@...nel.org, fujita.tomonori@...il.com
Subject: Re: [PATCH net-next v4 6/6] net: tn40xx: add PHYLIB support
Hi,
On Wed, 08 May 2024 22:18:51 +0900 (JST)
FUJITA Tomonori <fujita.tomonori@...il.com> wrote:
>>> priv->link = 0;
>>> if (priv->link_loop_cnt++ > TN40_LINK_LOOP_MAX) {
>>> /* MAC reset */
>>> tn40_set_link_speed(priv, 0);
>>> + tn40_set_link_speed(priv, priv->speed);
>>> priv->link_loop_cnt = 0;
>>
>> This should move into the link_down callback.
>
> I'll try phylink callbacks to see if they would work.
I found that the link_down callback doesn't work well for the MAC
reset above.
Currently, when TN40_REG_MAC_LNK_STAT register tells that the link is
off, the driver configures the MAC to generate an interrupt
periodically; tn40_write_reg(priv, 0x5150, 1000000) is called in
tn40_link_changed().
Eventually, the counter is over TN40_LINK_LOOP_MAX and then the driver
executes the MAC reset. Without the MAC reset, the NIC will not work.
The link_down callback is called only when the link becomes down so it
can't be used to trigger the MAC reset.
Powered by blists - more mailing lists