[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c8c01e53-0a45-4319-88ff-bfb0caba150c@lunn.ch>
Date: Tue, 14 May 2024 14:32:40 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Stephen Langstaff <stephenlangstaff1@...il.com>
Cc: Florian Fainelli <f.fainelli@...il.com>, linux-kernel@...r.kernel.org,
OlteanV@...il.com
Subject: Re: drivers/net/dsa/dsa_loop_bdinfo.c build problems
On Tue, May 14, 2024 at 10:28:55AM +0100, Stephen Langstaff wrote:
> On Mon, May 13, 2024 at 8:05 PM Florian Fainelli <f.fainelli@...il.com> wrote:
> > Attached is a configuration that I use on a x86-64 VM for testing that
> > is started with:
>
> That's kind of what I expect to be happening on my target, but it's not.
>
> I notice that your configuration does not define CONFIG_FIXED_PHY as
> either a module or built-in - could that explain both the fact that my
> dsa_loop_bdinfo.c does not get compiled when using the default
> Makefiles, and that if I force compilation to a module it does not
> appear to create the expected lanX@...0 interfaces?
>
> I have added some printk debug lines to the dsa_loop_init and
> dsa_loop_drv_probe functions, and only see the one from the init
> function, which makes me suspect that something is stopping the probe
> from happening - I assume this should happen when the dsa_loop_bdinfo
> module is inserted?
>
> root@...hine:~/dsa_test# ls
> dsa_loop.ko dsa_loop_bdinfo.ko
>
> root@...hine:~/dsa_test# modprobe dsa_core
> root@...hine:~/dsa_test#
>
> root@...hine:~/dsa_test# insmod dsa_loop_bdinfo.ko
> [ 51.742367] dsa_loop_bdinfo_init
>
> root@...hine:~/dsa_test# insmod dsa_loop.ko
> [ 58.485104] dsa_loop_init
This is probably an ordering problem.
dsa_loop_bdinfo calls mdiobus_register_board_info() with the bus_id
"fixed-0". That call adds it to a linked list, but does nothing else.
mdiobus_setup_mdiodev_from_board_info() is what walks the linked list
and sees if an MDIO bus matches the ID, and if so, calls the callback
to add a device to the bus. mdiobus_setup_mdiodev_from_board_info() is
only called from __mdiobus_register(). So the boardinfo needs to be
registered before the bus is registers. The other way around does not
work.
So try to making FIXED_PHY = m, and load it after dsa_loop_bdinfo.ko.
Andrew
Powered by blists - more mailing lists