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:   Tue, 28 Jul 2020 17:39:28 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Jeremy Linton <jeremy.linton@....com>,
        Dan Callaghan <dan.callaghan@...ngear.com>,
        Andrew Lunn <andrew@...n.ch>
Cc:     Calvin Johnson <calvin.johnson@....nxp.com>,
        Russell King <linux@...linux.org.uk>, Jon <jon@...id-run.com>,
        Cristi Sovaiala <cristian.sovaiala@....com>,
        Ioana Ciornei <ioana.ciornei@....com>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Madalin Bucur <madalin.bucur@....nxp.com>,
        netdev <netdev@...r.kernel.org>, "linux.cj" <linux.cj@...il.com>,
        linux-acpi <linux-acpi@...r.kernel.org>
Subject: Re: [net-next PATCH v7 1/6] Documentation: ACPI: DSD: Document MDIO
 PHY

On 7/28/2020 3:30 PM, Jeremy Linton wrote:
> Hi,
> 
> On 7/28/20 3:06 AM, Dan Callaghan wrote:
>> Excerpts from Andrew Lunn's message of 2020-07-24 21:14:36 +02:00:
>>> Now i could be wrong, but are Ethernet switches something you expect
>>> to see on ACPI/SBSA platforms? Or is this a legitimate use of the
>>> escape hatch?
>>
>> As an extra data point: right now I am working on an x86 embedded
>> appliance (ACPI not Device Tree) with 3x integrated Marvell switches.
>> I have been watching this patch series with great interest, because
>> right now there is no way for me to configure a complex switch topology
>> in DSA without Device Tree.
> 
> DSA though, the switch is hung off a normal MAC/MDIO, right? (ignoring
> whether that NIC/MAC is actually hug off PCIe for the moment).

There is no specific bus, we have memory mapped, MDIO, SPI, I2C swiches
all supported within the driver framework right now.

> 
> It just has a bunch of phy devices strung out on that single MAC/MDIO.

It has a number of built-in PHYs that typically appear on a MDIO bus,
whether that bus is the switch's internal MDIO bus, or another MDIO bus
(which could be provided with just two GPIOs) depends on how the switch
is connected to its management host.

When the switch is interfaced via MDIO the switch also typically has a
MDIO interface called the pseudo-PHY which is how you can actually tap
into the control interface of the switch, as opposed to reading its
internal PHYs from the MDIO bus.

> So in ACPI land it would still have a relationship similar to the one
> Andrew pointed out with his DT example where the eth0->mdio->phy are all
> contained in their physical parent. The phy in that case associated with
> the parent adapter would be the first direct decedent of the mdio, the
> switch itself could then be represented with another device, with a
> further string of device/phys representing the devices. (I dislike
> drawing acsii art, but if this isn't clear I will, its also worthwhile
> to look at the dpaa2 docs for how the mac/phys work on this device for
> contrast.).

The eth0->mdio->phy relationship you describe is the simple case that
you are well aware of which is say what we have on the Raspberry Pi 4
with GENET and the external Broadcom PHY.

For an Ethernet switch connected to an Ethernet MAC, we have 4 different
types of objects:

- the Ethernet MAC which sits on its specific bus

- the Ethernet switch which also sits on its specific bus

- the built-in PHYs of the Ethernet switch which sit on whatever
bus/interface the switch provides to make them accessible

- the specific bus controller that provides access to the Ethernet switch

and this is a simplification that does not take into account Physical
Coding Sublayer devices, pure MDIO devices (with no foot in the Ethernet
land such as PCIe, USB3 or SATA PHYs), SFP, SFF and other pluggable modules.

> 
> If so, then its probably possible to represent with a fairly regular
> looking set of ACPI objects and avoids part of the core discussion here
> about whether we need a standardized way to pick phy's out of arbitrary
> parts of the hierarchy using a part of the spec intended for one off
> problems.

Using regular ACPI objects would work, however I do not see how it can
alleviate having this discussion. It has been repeated again and again
that we do not want to see snowflake ACPI representation that each and
every driver writer is going to draw inspiration from.

Upon further reading of the ACPI specification, I do not think we are
going to see much definition or a driving force show up about how the
Ethernet objects (MAC, PHY, switches, SFPs, etc.) relate to one another.
The ACPI specification seems to be more about defining the ACPI objects
and their methods, which is on a different scope than how to tie them
together.

What Calvin has done thus far is the closest to what I believe we can
achieve given how nebulous and arcane ACPI is for the PHY library
maintainers within this context.
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ