All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ioana Ciornei <ioana.ciornei@nxp.com>
To: Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>
Cc: Tobias Waldekranz <tobias@waldekranz.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"hkallweit1@gmail.com" <hkallweit1@gmail.com>
Subject: Re: MDIO Debug Interface
Date: Fri, 10 Jul 2020 15:47:36 +0000	[thread overview]
Message-ID: <VI1PR0402MB3871B341615ED111B614CDE0E0650@VI1PR0402MB3871.eurprd04.prod.outlook.com> (raw)
In-Reply-To: 20200710133538.GF1014141@lunn.ch

On 7/10/20 4:35 PM, Andrew Lunn wrote:
>> In principle there is nothing in this para-virtualization design that
>> would preclude a quirky quad PHY from being accessed in a
>> virtualization-safe mode. The main use case for PHY access in a VM is
>> for detecting when the link went down. Worst case, the QEMU host-side
>> driver could lie about the PHY ID, and could only expose the clause 22
>> subset of registers that could make it compatible with genphy. I don't
>> think this changes the overall approach about how MDIO devices would be
>> virtualized with QEMU.
> 
> A more generic solution might be to fully virtualize the PHY. Let the
> host kernel drive the PHY, and QEMU can use /sys/bus/mdio_bus/devices,
> and uevents sent to user space. Ioana already added support for a PHY
> not bound to a MAC in phylink. You would need to add a UAPI for
> start/stop, and maybe a couple more operations, and probably export a
> bit more information.


You would still need a struct device to bind to that PHY and I am not 
sure what device that might be since the userspace cannot provide one.

> 
> This would then solve the quad PHY situation, and any other odd
> setups. And all the VM would require is genphy, keeping it simple.
> 
> 	Andrew
> 
> 

How would the genphy driver work if there is no MDIO register map for it 
to access? This suggestion seems something in between a software PHY and 
hardware PHY. Also, it would work only on PHYs and not any other device 
accessible over an MDIO bus (so you couldn't assign a DSA switch to a VM).

Coming back to a point that you made earlier, even as we speak, with an 
upstream kernel you can still have an userspace application accessing 
devices on a MDIO bus. Since the MDIO controller is memory mapped you 
just need some devmem commands wrapped-up in a nice script, no need for 
a vendor patch over an upstream kernel for this.

Ioana

  reply	other threads:[~2020-07-10 15:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-09 20:47 MDIO Debug Interface Tobias Waldekranz
2020-07-09 22:18 ` Vladimir Oltean
2020-07-09 22:48   ` Andrew Lunn
2020-07-10  7:51   ` Tobias Waldekranz
2020-07-09 22:36 ` Florian Fainelli
2020-07-10  8:29   ` Tobias Waldekranz
2020-07-09 22:39 ` Andrew Lunn
2020-07-09 22:57   ` Vladimir Oltean
2020-07-09 23:20     ` Andrew Lunn
2020-07-09 23:33       ` Vladimir Oltean
2020-07-10  9:30         ` Tobias Waldekranz
2020-07-10  9:45           ` Vladimir Oltean
2020-07-10 13:35             ` Andrew Lunn
2020-07-10 15:47               ` Ioana Ciornei [this message]
2020-07-10  8:51   ` Tobias Waldekranz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR0402MB3871B341615ED111B614CDE0E0650@VI1PR0402MB3871.eurprd04.prod.outlook.com \
    --to=ioana.ciornei@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=tobias@waldekranz.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.