netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	David Miller <davem@davemloft.net>,
	Realtek linux nic maintainers <nic_swsd@realtek.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 0/2] net: phy: add generic ndo_do_ioctl handler phy_do_ioctl
Date: Sun, 19 Jan 2020 20:19:03 +0100	[thread overview]
Message-ID: <82737a2f-b6c1-943e-42a2-d42d87212457@gmail.com> (raw)
In-Reply-To: <20200119185035.GC17720@lunn.ch>

On 19.01.2020 19:50, Andrew Lunn wrote:
>> Also it seems we don't consider situations like runtime PM yet.
>> Then the MDIO bus may not be accessible, but ndev is running
>> and PHY is attached.
> 
> I don't think this can happen. If the device is running, the MDIO bus
> has to work, or phylib is broken.
> 

netif_running() checks flag __LINK_STATE_START. Once the network has
been brought up, this flag is set. Also the comment in the code says:
"Test if the device has been brought up."
A driver has no means to clear this flag when runtime-suspending.
netif_device_detach() however clears flag __LINK_STATE_PRESENT.
I think it's not completely consistent if a device can be running
that is not present. IMO naming of netif_running() is misleading.
It better should be named netif_if_up(), or similar.

So far very few network drivers use runtime PM, this may be the
reason why such questions didn't come up before.

Speaking for r8169:
If interface is up and cable detached, then it runtime-suspends
and goes into PCI D3 (chip and MDIO bus not accessible).
But ndev is "running" and PHY is attached.

> I have had issue with the FEC, runtime PM and MDIO, but that was when
> the interface was not running, but an Ethernet switch was using the
> MDIO bus. MDIO transactions would time out, until i made the MDIO
> operations PM aware.
> 
> But in general, we should keep the running test, just to avoid
> breakage of assumptions we don't know about.
> 
> 	 Andrew
> 

Heiner

  reply	other threads:[~2020-01-19 19:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-19 13:31 [PATCH net-next 0/2] net: phy: add generic ndo_do_ioctl handler phy_do_ioctl Heiner Kallweit
2020-01-19 13:31 ` [PATCH net-next 1/2] " Heiner Kallweit
2020-01-19 13:32 ` [PATCH net-next 2/2] r8169: use " Heiner Kallweit
2020-01-19 16:12 ` [PATCH net-next 0/2] net: phy: add " Andrew Lunn
2020-01-19 17:18   ` Heiner Kallweit
2020-01-19 17:51     ` Andrew Lunn
2020-01-19 18:19       ` Heiner Kallweit
2020-01-19 18:50         ` Andrew Lunn
2020-01-19 19:19           ` Heiner Kallweit [this message]
2020-01-19 20:50             ` Andrew Lunn
2020-01-19 22:28               ` Heiner Kallweit
2020-01-20 20:35                 ` Heiner Kallweit
2020-01-20  9:42       ` David Miller
2020-01-20  9:43 ` David Miller

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=82737a2f-b6c1-943e-42a2-d42d87212457@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).