netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Norbert Jurkeit <norbert.jurkeit@web.de>,
	Florian Fainelli <f.fainelli@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>, David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Frank Crawford <frank@crawford.emu.id.au>
Subject: Re: [PATCH net] net: phy: replace preliminary fix for PHY driver sometimes not binding to the device
Date: Thu, 3 Jan 2019 21:13:38 +0100	[thread overview]
Message-ID: <442e8e2a-2528-bbe8-fb74-9f998f336ad1@gmail.com> (raw)
In-Reply-To: <c80fc109-616b-3e88-9b86-08745002ae84@web.de>

On 29.12.2018 12:46, Norbert Jurkeit wrote:
> Am 29.12.18 um 03:48 schrieb Florian Fainelli:
>> Heiner; are you positive that the PHY is not in a power down mode
>> (BMCR.PDOWN = 1) at the time the r8169 probe is done? Because if that
>> was the case, there is no guarantee (per 802.3 clause 22 spec) that the
>> PHY must correctly respond to MDIO operations other than read/write to
>> BMCR register and this could explain that problem, as well as the
>> general lack of connectivity for these users.
> 
> This is a good point, at least in my case. My RTL8111 interface is connected to a Wifi router which is normally located out of sight when I sit in front of my PC, otherwise I might have noticed this earlier:
> 
> When I reboot from kernel 4.18.18 the LAN port status LED turns off at the end of the shutdown sequence and remains off with most 4.19.* kernels until "rmmod r8169; modprobe r8169" is issued.
> 
> When I shutdown&poweroff from kernel 4.18.18 the LED of course also turns off but lights up immediately after the PC power button is pressed. The network then comes up successfully with all tested 4.19.* kernels.
> 
> When I reboot from kernel 4.19.* the LED does NOT turn off during shutdown (only for about 1s during boot shortly before the login screen appears) and the network also comes up successfully with all 4.19.* kernels.
> 
I'd like to come back to these observations. I had a few German beers
to relax my mind and get fresh ideas. And it helped ..

IMO the following explains why the LED stays off when booting from 4.18
to 4.19: phylib support was added to r8169 with 4.19. Up to 4.18 the
driver had its own implementation for powering down and up the PHY.
When powering down the PHY it disabled autonegotiation. From 4.19
genphy_resume() is used to power up the PHY and this function doesn't
touch the "aneg enabled" bit in the PHY (register BMCR).
Therefore aneg is disabled during boot and the LED stays off.
genphy_config_aneg() sets the "aneg enabled" bit later.

A cold boot initializes the PHY and enables aneg.

Rebooting from 4.19 doesn't disable aneg, therefore LED stays on.

I think this effect and the other issue (falsely loading genphy driver)
are overlapping and most likely not related (even if certain symptoms
seem to indicate this). At least I have no explanation for how
disabled aneg could prevent the dedicated PHY driver from binding to
the PHY device.

Heiner

  parent reply	other threads:[~2019-01-03 20:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-24 11:21 [PATCH net] net: phy: replace preliminary fix for PHY driver sometimes not binding to the device Heiner Kallweit
2018-12-25 15:17 ` Heiner Kallweit
2018-12-28 21:02 ` David Miller
2018-12-28 21:56   ` Heiner Kallweit
2018-12-29  2:42 ` Florian Fainelli
2018-12-29  2:48   ` Florian Fainelli
2018-12-29  9:45     ` Heiner Kallweit
2018-12-29 11:46     ` Norbert Jurkeit
2018-12-29 11:54       ` Heiner Kallweit
2018-12-29 13:27         ` Norbert Jurkeit
2018-12-29 13:55           ` Heiner Kallweit
2018-12-29 15:31             ` Norbert Jurkeit
2018-12-29 15:44               ` Heiner Kallweit
2018-12-29 16:59                 ` Norbert Jurkeit
2019-01-06 15:45                   ` Heiner Kallweit
2019-01-03 20:13       ` Heiner Kallweit [this message]
2018-12-29  9:33   ` Heiner Kallweit

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=442e8e2a-2528-bbe8-fb74-9f998f336ad1@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=frank@crawford.emu.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=norbert.jurkeit@web.de \
    /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).