Re: drivers/net/dsa/dsa_loop_bdinfo.c build problems

From: Florian Fainelli
Date: Wed May 15 2024 - 15:27:10 EST


On 5/15/24 02:23, Stephen Langstaff wrote:
On Tue, May 14, 2024 at 5:17 PM Andrew Lunn <andrew@xxxxxxx> wrote:

On Tue, May 14, 2024 at 05:08:24PM +0100, Stephen Langstaff wrote:
If I sorted out building the dsa_loop_bdinfo.c code as a built-in do
you think that would solve the ordering issue?

Probably.

Well, some minor progress... when dsa_loop and dsa_loop_bdinfo are
built-in to the kernel then it appears that, at least for this
configuration, the driver probe function is called:

[ 0.053068] dsa_loop_bdinfo_init
[ 1.509255] dsa_loop_init
[ 1.513178] dsa_loop_drv_probe
[ 2.633673] dsa_loop_drv_probe
...
[ 3.273496] dsa_loop_drv_probe
[ 3.276589] dsa_loop_get_protocol
[ 3.281608] dsa-loop fixed-0:1f: skipping link registration for CPU port 5
[ 3.288558] (null): phylink: error: empty supported_interfaces
[ 3.294500] error creating PHYLINK: -22
[ 3.298343] dsa-loop fixed-0:1f lan1 (uninitialized): error -22
setting up PHY for tree 0, switch 0, port 0
[ 3.308145] (null): phylink: error: empty supported_interfaces
[ 3.314070] error creating PHYLINK: -22
[ 3.317907] dsa-loop fixed-0:1f lan2 (uninitialized): error -22
setting up PHY for tree 0, switch 0, port 1
[ 3.327677] (null): phylink: error: empty supported_interfaces
[ 3.333609] error creating PHYLINK: -22
[ 3.337449] dsa-loop fixed-0:1f lan3 (uninitialized): error -22
setting up PHY for tree 0, switch 0, port 2
[ 3.347223] (null): phylink: error: empty supported_interfaces
[ 3.353145] error creating PHYLINK: -22
[ 3.356983] dsa-loop fixed-0:1f lan4 (uninitialized): error -22
setting up PHY for tree 0, switch 0, port 3
[ 3.366855] device eth0 entered promiscuous mode
[ 3.371497] DSA: tree 0 setup
[ 3.374474] dsa-loop fixed-0:1f: DSA mockup driver: 0x1f

The -22 error appears to be related to the issues mentioned here:
https://www.spinics.net/lists/netdev/msg922961.html so I will now try
to apply the suggested short-term fix.

What changes have you done to the dsa_loop.c file for this error to show up? Currently the driver does the following:

static void dsa_loop_phylink_get_caps(struct dsa_switch *dsa, int port,
struct phylink_config *config)
{
bitmap_fill(config->supported_interfaces, PHY_INTERFACE_MODE_MAX);
__clear_bit(PHY_INTERFACE_MODE_NA, config->supported_interfaces);
config->mac_capabilities = ~0;
}

which is basically to say: I support everything, except PHY_INTERFACE_MDOE_NA.
--
Florian