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] [day] [month] [year] [list]
Message-ID: <Zyz6nolj9-9bjyx8@shell.armlinux.org.uk>
Date: Thu, 7 Nov 2024 17:36:30 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Romain Gantois <romain.gantois@...tlin.com>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Dan Murphy <dmurphy@...com>,
	Florian Fainelli <f.fainelli@...il.com>,
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
	Maxime Chevallier <maxime.chevallier@...tlin.com>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	stable@...r.kernel.org
Subject: Re: [PATCH net v2] net: phy: dp83869: fix status reporting for
 1000base-x autonegotiation

On Mon, Nov 04, 2024 at 09:52:32AM +0100, Romain Gantois wrote:
> The DP83869 PHY transceiver supports converting from RGMII to 1000base-x.
> In this operation mode, autonegotiation can be performed, as described in
> IEEE802.3.
> 
> The DP83869 has a set of fiber-specific registers located at offset 0xc00.
> When the transceiver is configured in RGMII-to-1000base-x mode, these
> registers are mapped onto offset 0, which should, in theory, make reading
> the autonegotiation status transparent.
> 
> However, the fiber registers at offset 0xc04 and 0xc05 do not follow the
> bit layout of their standard counterparts. Thus, genphy_read_status()
> doesn't properly read the capabilities advertised by the link partner,
> resulting in incorrect link parameters.

This description is wrong. The format of registers 4 and 5 depends on
the media.

In twisted-pair ethernet, then:

ADVERTISE_PAUSE_ASYM / LPA_PAUSE_ASYM
ADVERTISE_PAUSE_CAP / LPA_PAUSE_CAP
ADVERTISE_100FULL / LPA_100FULL
ADVERTISE_100HALF / LPA_100HALF
ADVERTISE_10FULL / LPA_10FULL
ADVERTISE_10HALF / LPA_10HALF
ADVERTISE_CSMA

apply. In 1000base-X:

ADVERTISE_1000XPSE_ASYM / LPA_1000XPAUSE_ASYM
ADVERTISE_1000XPAUSE / LPA_1000XPAUSE
ADVERTISE_1000XHALF / LPA_1000XHALF
ADVERTISE_1000XFULL / LPA_1000XFULL

apply - these being bits 8, 7, 6, 5:

> +#define DP83869_LPA_1000FULL   BIT(5)
> +#define DP83869_LPA_PAUSE_CAP  BIT(7)
> +#define DP83869_LPA_PAUSE_ASYM BIT(8)
> +#define DP83869_LPA_LPACK      BIT(14)

so these are just reimplementing definitions we already have. Please
use the existing definitions. Even better, use mii_lpa_mod_linkmode_x()
and linkmode_adv_to_mii_adv_x() which we already have in your code.

Same likely goes for DP83869_BP_*

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ