[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190813155231.GZ14290@lunn.ch>
Date: Tue, 13 Aug 2019 17:52:31 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Marek BehĂșn <marek.behun@....cz>
Cc: netdev@...r.kernel.org, Heiner Kallweit <hkallweit1@...il.com>,
Sebastian Reichel <sebastian.reichel@...labora.co.uk>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
"David S . Miller" <davem@...emloft.net>
Subject: Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: fix RGMII-ID port setup
On Tue, Aug 13, 2019 at 05:44:16PM +0200, Marek BehĂșn wrote:
> Hi Andrew,
>
> > We should read the switch registers. I think you can set the defaults
> > using strapping pins. And in general, the driver always reads state
> > from the hardware rather than caching it.
>
> hmm. The cmode is cached for each port, though. For example
> mv88e6390x_port_set_cmode compares the new requested value with the
> cached one and doesn't do anything if they are equal.
>
> If mv88e6xxx_port_setup_mac can be called once per second by phylink as
> you say, do we really want to read the value via MDIO every time? We
> already have cmode cached (read from registers at mv88e6xxx_setup, and
> then changed when cmode change is requested). From cmode we can already
> differentiate mode in the terms of phy_interface_t, unless it is RGMII,
> in which case we would have to read RX/TX timing.
Hi Marek
cmode gets used a lot, and in interrupt thread context. So i think it
was worth caching it. RGMII Rx/Tx timing is not used much, so i don't
think it is worth caching it. But as you say, using cmode to determine
if the registers actually need to be read does make sense. Most ports
don't use RGMII, they have internal PHYs.
Andrew
Powered by blists - more mailing lists