[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4a461367-5b5d-4716-8c54-dc41c10b7ee7@kernel.org>
Date: Thu, 16 Jan 2025 13:49:38 +0200
From: Roger Quadros <rogerq@...nel.org>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Russell King <linux@...linux.org.uk>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Siddharth Vadapalli <s-vadapalli@...com>, srk@...com, danishanwar@...com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH net-next 1/4] net: ethernet: am65-cpsw: call
netif_carrier_on/off() when appropriate
On 15/01/2025 19:13, Maxime Chevallier wrote:
> Hello Roger,
>
> On Wed, 15 Jan 2025 18:43:00 +0200
> Roger Quadros <rogerq@...nel.org> wrote:
>
>> Call netif_carrier_on/off when link is up/down.
>> When link is up only wake TX netif queue if network device is
>> running.
>>
>> Signed-off-by: Roger Quadros <rogerq@...nel.org>
>> ---
>> drivers/net/ethernet/ti/am65-cpsw-nuss.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
>> index dcb6662b473d..36c29d3db329 100644
>> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
>> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
>> @@ -2155,6 +2155,7 @@ static void am65_cpsw_nuss_mac_link_down(struct phylink_config *config, unsigned
>> cpsw_sl_ctl_clr(port->slave.mac_sl, mac_control);
>>
>> am65_cpsw_qos_link_down(ndev);
>> + netif_carrier_off(ndev);
>
> You shouldn't need to do that, phylink does that for you :
> https://elixir.bootlin.com/linux/v6.13-rc3/source/drivers/net/phy/phylink.c#L1434
>
> Are you facing any specific problem that motivates that patch ?
No. I overlooked it.
>
>> netif_tx_stop_all_queues(ndev);
>> }
>>
>> @@ -2196,7 +2197,9 @@ static void am65_cpsw_nuss_mac_link_up(struct phylink_config *config, struct phy
>> cpsw_ale_control_set(common->ale, port->port_id, ALE_PORT_STATE, ALE_PORT_STATE_FORWARD);
>>
>> am65_cpsw_qos_link_up(ndev, speed);
>> - netif_tx_wake_all_queues(ndev);
>> + netif_carrier_on(ndev);
>
> Same here, phylink will set the carrier on by itself.
Thanks for catching this. I'll drop this patch on next spin.
>
> Thanks,
>
> Maxime
--
cheers,
-roger
Powered by blists - more mailing lists