[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <66d9daa106d7840e972dba35914e6983@kernel.org>
Date: Tue, 18 Jul 2023 21:53:25 +0200
From: Michael Walle <mwalle@...nel.org>
To: Andrew Lunn <andrew@...n.ch>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Yisen Zhuang <yisen.zhuang@...wei.com>,
Salil Mehta <salil.mehta@...wei.com>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
Marek BehĂșn <kabel@...nel.org>,
Xu Liang <lxu@...linear.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Simon Horman <simon.horman@...igine.com>
Subject: Re: [PATCH net-next v3 03/11] net: phy: replace is_c45 with
phy_accces_mode
Am 2023-07-18 19:40, schrieb Andrew Lunn:
>> static inline bool phy_has_c45_registers(struct phy_device *phydev)
>> {
>> - return phydev->is_c45;
>> + return phydev->access_mode != PHY_ACCESS_C22;
>> }
>
> So this is making me wounder if we have a clean separation between
> register spaces and access methods.
The idea is to at least have it behind a helper which can be changed
if we get that information from somewhere else.
But right now, a PHY is considered to have c45 registers if it is
probed via c45 (accesses).
Instead of checking the access mode, I could also introduce a
bitmask(?)/flags has_c22/has_c45_registers. But how would you tell
if a PHY as c22 registers? Probe both c22 and c45? What if the bus
can't do c45?
> Should there be a phy_has_c22_registers() ?
>
> A PHY can have both C22 registers and C45 registers. It is up to the
> driver to decide which it wants to access when.
But isn't it also the driver which has the ultimate information whether
a PHY has c22 register space and/or c45 one?
Maybe we need to clarify what "has c22/c45 registers space" actually
means. Responds to MII c22/c45 access?
-michael
> Should phydev->access_mode really be phydev->access_mode_c45_registers
> to indicate how to access the C45 registers if phy_has_c45_registers()
> is true?
>
> Has there been a review of all uses of phydev->is_c45 to determine if
> the user wants to know if C45 registers exist,
> a.k.a. phy_has_c45_registers(), or if C45 bus transactions can be
> performed, and then later in this series, additionally if C45 over C22
> can be performed. These are different things.
>
> I need to keep reading the patches...
>
> Andrew
Powered by blists - more mailing lists