[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2b190b5f-5abb-3647-333c-da51d6bab593@gmail.com>
Date: Mon, 20 Jan 2020 21:35:13 +0100
From: Heiner Kallweit <hkallweit1@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Florian Fainelli <f.fainelli@...il.com>,
David Miller <davem@...emloft.net>,
Realtek linux nic maintainers <nic_swsd@...ltek.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 0/2] net: phy: add generic ndo_do_ioctl handler
phy_do_ioctl
On 19.01.2020 23:28, Heiner Kallweit wrote:
> On 19.01.2020 21:50, Andrew Lunn wrote:
>>> 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.
>>
>> Hi Heiner
>>
> Hi Andrew,
>
Hi Andrew
>> And how does it get out of this state? I assume the PHY interrupts
>> when the link is established. Is phylib handling this interrupt? If
>> so, when phylib accesses the MDIO bus, the bus needs to be runtime PM
>> aware. And if the bus is runtime PM aware, the IOCTL handler should
>> work, when the device is runtime suspended. If the MAC is handling
>> this interrupt, and it is the MAC interrupt handler which is run-time
>> unsuspending, then the ioctl handler is not going to work unless it
>> also runtime unsuspends.
>>
> The chip (wherever the magic happens) generates a PCI PME if WoL
> config includes detection of physical link-up. The PCI core then
> runtime-resumes the device.
> I'd prefer the ioctl to return an error here instead of e.g.
> 0xffff for a register read.
>
I checked a little further and indeed there's a need to check whether
net_device is present, but net core (dev_ifsioc) already does this
check before calling the ndo_do_ioctl handler. So we don't have to
do it in the handler again.
I saw that David applied my series already. So I'll send a follow-up
series that:
- renames phy_do_ioctl to phy_do_ioctl_running
- adds phy_do_ioctl (w/o check that netdev is running)
- converts users to phy_do_ioctl
>> Andrew
>>
> Heiner
>
Heiner
Powered by blists - more mailing lists