Re: [RFC PATCH net-next v4 28/28] net: phy: add qca8k driver for qca8k switch internal PHY

Florian Fainelli
2021-05-08T15:45:24Z

On 5/8/2021 4:30 AM, Ansuel Smith wrote:
> On Sat, May 08, 2021 at 12:35:35PM +0800, DENG Qingfang wrote:
>> On Sat, May 08, 2021 at 02:29:18AM +0200, Ansuel Smith wrote:
>>> Add initial support for qca8k internal PHYs. The internal PHYs requires
>>> special mmd and debug values to be set based on the switch revision
>>> passwd using the dev_flags. Supports output of idle, receive and eee_wake
>>> errors stats.
>>> Some debug values sets can't be translated as the documentation lacks any
>>> reference about them.
>>
>> I think this can be merged into at803x.c, as they have almost the same
>> registers, and some features such as interrupt handler and cable test
>> can be reused.
>>
>
> Wouldn't this be a little bit confusing? But actually yes... interrupt
> handler and cable test have the same regs. My main concern is about the
> phy_dev flags and the dbg regs that I think are different and would
> create some confusion. If this It's not a proble, sure I can rework this
> a put in the at803x.c phy driver.

Consistency is key, and having all of your PHY eggs in the same PHY
driver basket is easier for maintenance and generalizing features.
drivers/net/phy/broadcom.c contains PHY entries for integrated PHY
switches, too (5395, 53125). As far as phydev::dev_flags, you can skip
interpreting those unless you match the QCA8K PHY driver entry/probe.
--
Florian