RE: [PATCH net-next v13 15/15] net: ethernet: onsemi: s2500: Add driver support for S2500

From: Selvamani Rajagopal

Date: Thu Dec 03 2026 - 13:38:40 EST


> -----Original Message-----
> From: netdev-bot+sashiko@xxxxxxxxxx <netdev-bot+sashiko@xxxxxxxxxx>
> Sent: Thursday, December 3, 2026 9:47 AM
> Subject: Re: [PATCH net-next v13 15/15] net: ethernet: onsemi: s2500: Add driver
> support for S2500
>
> > +
> > + ret = s2500_set_mac_filter(ndev, addr->sa_data);
> > + if (ret)
> > + return ret;
>
> [Severity: Medium]
> What happens to unicast receive if one of the writes in
> s2500_write_filter() fails here?


The error is returned to the caller. Recovery requires further SPI transactions,
which may also fail, so we would prefer to keep the current implementation..

>
> IFF_LIVE_ADDR_CHANGE is set, so this can run while the interface is up
> with RXEN and ADRF set. s2500_set_mac_filter() first writes
> ADDRFILTH(0) = 0. s2500_write_filter() then makes four separate control
> writes and sets S2500_MAC_ADDRFILT_ENABLE only in the last one.
>
> Any of those writes can fail. Examples are -EPROTO from
> oa_tc6_check_ctrl_write_reply() when the echo does not match, or an SPI
> transfer error.
>
> On that path s2500_set_mac_address() returns the error without
> reprogramming slot 0 with the old ndev->dev_addr. Slot 0 stays disabled
> while ADRF is still set. Wouldn't the MAC-PHY then drop every unicast
> frame for this node, while dev_addr still holds the old address?
>
> Nothing else seems to reprogram slot 0 afterwards.
> s2500_set_rx_mode() only touches promiscuous mode and multicast slots
> 1-3, and s2500_open() does not call s2500_init(). The problem would
> therefore survive a down/up cycle until a later MAC change succeeds or
> the driver is re-probed.
>
> Would it make sense to write ndev->dev_addr back into slot 0 when this
> fails?
>
> > +
> --
> Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202-s2500-
> mac-phy-support-v13-0-a2908fad2693%40onsemi.com
> <https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202-s2500-mac-phy-support-v13-0-a2908fad2693%40onsemi.com
> etdev-ai.bots.linux.dev>