lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 13 Nov 2019 07:25:57 +0100
From:   Heiner Kallweit <hkallweit1@...il.com>
To:     Florian Fainelli <f.fainelli@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        David Miller <davem@...emloft.net>,
        Realtek linux nic maintainers <nic_swsd@...ltek.com>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 0/3] r8169: use rtl821x_modify_extpage exported
 from Realtek PHY driver

On 13.11.2019 05:13, Florian Fainelli wrote:
> 
> 
> On 11/12/2019 1:22 PM, Heiner Kallweit wrote:
>> Certain Realtek PHY's support a proprietary "extended page" access mode
>> that is used in the Realtek PHY driver and in r8169 network driver.
>> Let's implement it properly in the Realtek PHY driver and export it for
>> use in other drivers like r8169.
>>
>> Heiner Kallweit (3):
>>   net: phy: realtek: export rtl821x_modify_extpage
>>   r8169: use rtl821x_modify_extpage
>>   r8169: consider new hard dependency on REALTEK_PHY
>>
>>  drivers/net/ethernet/realtek/Kconfig      |  3 +-
>>  drivers/net/ethernet/realtek/r8169_main.c | 41 +++++++++--------------
>>  drivers/net/phy/realtek.c                 | 36 ++++++++++++--------
>>  include/linux/realtek_phy.h               |  8 +++++
>>  4 files changed, 46 insertions(+), 42 deletions(-)
> 
> The delta is not that impressive and this creates not quite a layering
> violation, but some really weird inter dependency if nothing else. Could
> we simply move all the PHY programming down the PHY driver instead or is
> this too cumbersome/fragile to do right now?
> 
The Realtek chips come with integrated MAC and PHY, so the dependency
reflects the physical structure. Moving all PHY configuration to the
PHY driver would be best of course, but:
- Even though few chip versions use the PHY ID of a PHY that exists
  also standalone, the configuration sequence differs. So it seems
  they differ.
- From a certain chip version the PHY ID is always the same:
  Realtek OUI, but model and revision number being zero. Means we'd have
  to intercept the PHY ID reads and return artificial PHY ID's.
- PHY config sequence partially includes efuse reads from MAC registers,
  see rtl8168d_1_hw_phy_config. OK, maybe we could read the efuse first,
  and hand over the value to the PHY driver via PHY driver private data
  structure.
  
Heiner

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ