[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2d6f98b01fdce3247b8f93f0467e7f1cdb6e080e.camel@microchip.com>
Date: Fri, 3 Feb 2023 10:48:02 +0000
From: <Rakesh.Sankaranarayanan@...rochip.com>
To: <andrew@...n.ch>
CC: <olteanv@...il.com>, <davem@...emloft.net>,
<linux@...linux.org.uk>, <Woojung.Huh@...rochip.com>,
<linux-kernel@...r.kernel.org>, <pabeni@...hat.com>,
<kuba@...nel.org>, <edumazet@...gle.com>, <netdev@...r.kernel.org>,
<UNGLinuxDriver@...rochip.com>, <f.fainelli@...il.com>
Subject: Re: [RFC PATCH net-next 07/11] net: dsa: microchip: lan937x: update
switch register
Hi Andrew,
Thanks for the comment, I will change and test the code as you
explained and update the patch in next revision.
Thanks,
Rakesh S.
On Thu, 2023-02-02 at 16:40 +0100, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> On Thu, Feb 02, 2023 at 06:29:26PM +0530, Rakesh Sankaranarayanan
> wrote:
> > Second switch in cascaded connection doesn't have port with macb
> > interface. dsa_switch_register returns error if macb interface is
> > not up. Due to this reason, second switch in cascaded connection
> > will
> > not report error during dsa_switch_register and mib thread work
> > will be
> > invoked even if actual switch register is not done. This will lead
> > to
> > kernel warning and it can be avoided by checking device tree setup
> > status. This will return true only after actual switch register is
> > done.
>
> What i think you need to do is move the code into ksz_setup().
>
> With a D in DSA setup, dsa_switch_register() adds the switch to the
> list of switches, and then a check is performed to see if all
> switches
> in the cluster have been registered. If not, it just returns. If all
> switches have been registered, it then iterates over all the switches
> can calls dsa_switch_ops.setup().
>
> By moving the start of the MIB counter into setup(), it will only be
> started once all the switches are present, and it means you don't
> need
> to look at DSA core internal state.
>
> Andrew
Powered by blists - more mailing lists