[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230203231815.mue2aeynxuwqpuzr@skbuf>
Date: Sat, 4 Feb 2023 01:18:15 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Rakesh Sankaranarayanan <rakesh.sankaranarayanan@...rochip.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
andrew@...n.ch, f.fainelli@...il.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
woojung.huh@...rochip.com, UNGLinuxDriver@...rochip.com,
linux@...linux.org.uk
Subject: Re: [RFC PATCH net-next 02/11] net: dsa: microchip: lan937x: update
SMI index
On Thu, Feb 02, 2023 at 06:29:21PM +0530, Rakesh Sankaranarayanan wrote:
> Current DSA driver register mdio interface for a port in the
> format of SMI-switch_index:port_number, switch_index is derived
> using variable ds->index. For a single switch ds->index will be
> always zero, and for cascaded switch, ds->index should be one.
> But it is found that ds->index is getting updated only after
> mdio_register stage. Update mdio_register to use variable directly
> from device tree using "dsa,member" identifier.
>
> Signed-off-by: Rakesh Sankaranarayanan <rakesh.sankaranarayanan@...rochip.com>
> ---
Impossible, check again.
The call path is:
ksz_switch_register()
-> dsa_register_switch()
-> dsa_switch_probe()
-> dsa_switch_parse_of()
-> dsa_switch_parse_member_of()
-> sets ds->index
-> dsa_tree_setup()
-> dsa_tree_setup_switches()
-> dsa_switch_setup()
-> ksz_setup()
-> ksz_mdio_register()
-> you claim ds->index isn't set
You don't even need to be an expert on the code path, you can grep for
"ds->index = ", put a dump_stack() where it's set and one where you need
it, and compare in the stack trace which functions are common and where
they diverge.
Powered by blists - more mailing lists