From: Heiner Kallweit Subject: Re: [PATCH net] net: phy: replace preliminary fix for PHY driver sometimes not binding to the device Date: Sat, 29 Dec 2018 14:55:32 +0100 Message-ID: References: <1bafaa75-18a2-87a2-a9cb-01b951c1d1f7@gmail.com> <8b4f48b1-dc97-1f8d-c9a8-d67b41591d07@gmail.com> <129c56aa-e3ab-36ee-4447-8154a3e96952@gmail.com> <49a3cf01-8f1d-bf67-cfcb-c5a0537a68c9@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Florian Fainelli , Andrew Lunn , "netdev@vger.kernel.org" , Frank Crawford To: Norbert Jurkeit Return-path: Received: from mail-wr1-f66.google.com ([209.85.221.66]:37592 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbeL2Nzk (ORCPT ); Sat, 29 Dec 2018 08:55:40 -0500 Received: by mail-wr1-f66.google.com with SMTP id s12so23129341wrt.4 for ; Sat, 29 Dec 2018 05:55:38 -0800 (PST) In-Reply-To: <49a3cf01-8f1d-bf67-cfcb-c5a0537a68c9@web.de> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 29.12.2018 14:27, Norbert Jurkeit wrote: > Am 29.12.18 um 12:54 schrieb Heiner Kallweit: >> >> Good to know, I'll check. In this context, do you have Wake-on-LAN enabled? >> IOW, what does "ethtool " state in line "Wake-on:" ? > > "ethtool enp1s0" yields >     Supports Wake-on: pumbg >     Wake-on: d > > Unfortunately I could not find any BIOS switch to enable WOL, but although not persistent, "ethtool -s enp1s0 wol g" works for 1 reboot. I issued that command in a session with kernel 4.18.18, rebooted and noticed that between shutdown and new boot the LAN port status LED turned off for 1s, then turn on again and network came up with a 4.19 kernel which normally fails in this szenario. > > Great, then let's go for one more test. Could you apply the following to 4.19 and start in a fail scenario? I would be interested in the additional dmesg line, just grep for "hk:". diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 99bc3de90..20457c4e6 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -7048,6 +7048,7 @@ static int r8169_mdio_register(struct rtl8169_private *tp) new_bus->name = "r8169"; new_bus->priv = tp; new_bus->parent = &pdev->dev; + new_bus->phy_mask = GENMASK(31, 1); new_bus->irq[0] = PHY_IGNORE_INTERRUPT; snprintf(new_bus->id, MII_BUS_ID_SIZE, "r8169-%x", PCI_DEVID(pdev->bus->number, pdev->devfn)); diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 51990002d..b92699397 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -793,6 +793,8 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) if (r) return ERR_PTR(r); + pr_info("hk: addr = %d, phyid = 0x%08x, bmcr = 0x%x\n", addr, phy_id, mdiobus_read(bus, addr, 0)); + /* If the phy_id is mostly Fs, there is no device there */ if ((phy_id & 0x1fffffff) == 0x1fffffff) return ERR_PTR(-ENODEV); -- 2.20.1