lkml.org 
[lkml]   [2023]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net] net: stmmac: dwmac-socfpga: Don't access SGMII adapter when not available
Hi Andrew,

On Tue, 28 Nov 2023 17:37:30 +0100
Andrew Lunn <andrew@lunn.ch> wrote:

> On Tue, Nov 28, 2023 at 10:45:37AM +0100, Maxime Chevallier wrote:
> > The SGMII adapter isn't present on all dwmac-socfpga implementations.
> > Make sure we don't try to configure it if we don't have this adapter.
>
> If it does not exist, why even try to call socfpga_sgmii_config()?
>
> It seems like this test needs moving up the call stack. socfpga_gen5_set_phy_mode():
>
> if (phymode == PHY_INTERFACE_MODE_SGMII)
> if (dwmac->sgmii_adapter_base)
> socfpga_sgmii_config(dwmac, true);
> else
> return -EINVAL;

I don't have access to a platform with the SGMII adapter available, but
my understanding is that we shouldn't error-out when we don't have the
adapter, as some other component (like the lynx PCS) might be there to
handle that mode.

However you have a valid point in that we might want to check if we
have either an SGMII adapter or a PCS, and if we have none of these we
error-out. Thanks for the suggestion, I'll address that :)

Maxime

\
 
 \ /
  Last update: 2023-11-28 18:27    [W:0.219 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site