From: "Justin P. Mattock" <justinmattock@gmail.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: netdev@vger.kernel.org
Subject: Re: WARNING: at net/sched/sch_generic.c:256 dev_watchdog+0x1f2/0x200()
Date: Tue, 20 Mar 2012 07:16:17 -0700 [thread overview]
Message-ID: <4F689131.2030607@gmail.com> (raw)
In-Reply-To: <20120320093709.GA5058@electric-eye.fr.zoreil.com>
On 03/20/2012 02:37 AM, Francois Romieu wrote:
> (Larry removed)
>
> Justin Mattock<justinmattock@gmail.com> :
> [...]
>> seems I see this with the latest linux-next:
>
> Thanks for testing.
>
> [...]
>> [21740.318685] r8169 0000:06:00.0: eth0: link up
>> [21752.292679] r8169 0000:06:00.0: eth0: link up
>> [21764.268569] r8169 0000:06:00.0: eth0: link up
>> [21776.254393] r8169 0000:06:00.0: eth0: link up
>> [21788.235797] r8169 0000:06:00.0: eth0: link up
>> [21800.196524] r8169 0000:06:00.0: eth0: link up
>> [21812.172497] r8169 0000:06:00.0: eth0: link up
>
> This is completely broken. I could understand a few up/down link changes
> until things settles but the driver should not claim periodically that
> the link is up when there is no cable, at least not with a supported chipset.
>
> Can you apply the debug helper below and report a complete dmesg from
> boot with the same test (please remove l-k, netdev is good enough) ?
I removed linux-kernel from the Cc's and applied your patch.. system
built fine, and suspend wakes up fine without the ethernet trying to
connect like it was doing. will run this patch for a few Thanks for this!
dmesg is here: http://fpaste.org/jHSX/
(I have another patch added in, but it should not affect anything).
>
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 61e6ab4..880264a 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -61,7 +61,8 @@
> #endif /* RTL8169_DEBUG */
>
> #define R8169_MSG_DEFAULT \
> - (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN)
> + (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN | \
> + NETIF_MSG_LINK)
>
> #define TX_BUFFS_AVAIL(tp) \
> (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1)
> @@ -731,7 +732,7 @@ struct rtl8169_private {
> void (*phy_reset_enable)(struct rtl8169_private *tp);
> void (*hw_start)(struct net_device *);
> unsigned int (*phy_reset_pending)(struct rtl8169_private *tp);
> - unsigned int (*link_ok)(void __iomem *);
> + unsigned int (*link_ok)(struct rtl8169_private *);
> int (*do_ioctl)(struct rtl8169_private *tp, struct mii_ioctl_data *data, int cmd);
>
> struct {
> @@ -1260,14 +1261,28 @@ static unsigned int rtl8169_xmii_reset_pending(struct rtl8169_private *tp)
> return rtl_readphy(tp, MII_BMCR)& BMCR_RESET;
> }
>
> -static unsigned int rtl8169_tbi_link_ok(void __iomem *ioaddr)
> +static unsigned int rtl8169_tbi_link_ok(struct rtl8169_private *tp)
> {
> + void __iomem *ioaddr = tp->mmio_addr;
> +
> return RTL_R32(TBICSR)& TBILinkOk;
> }
>
> -static unsigned int rtl8169_xmii_link_ok(void __iomem *ioaddr)
> +static unsigned int rtl8169_xmii_link_ok(struct rtl8169_private *tp)
> {
> - return RTL_R8(PHYstatus)& LinkStatus;
> + void __iomem *ioaddr = tp->mmio_addr;
> + struct net_device *dev = tp->dev;
> + u8 status;
> +
> + status = RTL_R8(PHYstatus)& LinkStatus;
> + netif_info(tp, link, dev,
> + "bmcr: %04x bmsr: %04x gbcr: %04x gbsr: %04x\n",
> + rtl_readphy(tp, MII_BMCR),
> + rtl_readphy(tp, MII_BMSR),
> + rtl_readphy(tp, MII_CTRL1000),
> + rtl_readphy(tp, MII_STAT1000));
> +
> + return status;
> }
>
> static void rtl8169_tbi_reset_enable(struct rtl8169_private *tp)
> @@ -1335,7 +1350,7 @@ static void __rtl8169_check_link_status(struct net_device *dev,
> struct rtl8169_private *tp,
> void __iomem *ioaddr, bool pm)
> {
> - if (tp->link_ok(ioaddr)) {
> + if (tp->link_ok(tp)) {
> rtl_link_chg_patch(tp);
> /* This is to cancel a scheduled suspend if there's one. */
> if (pm)
> @@ -3309,7 +3324,6 @@ static void rtl_hw_phy_config(struct net_device *dev)
> static void rtl_phy_work(struct rtl8169_private *tp)
> {
> struct timer_list *timer =&tp->timer;
> - void __iomem *ioaddr = tp->mmio_addr;
> unsigned long timeout = RTL8169_PHY_TIMEOUT;
>
> assert(tp->mac_version> RTL_GIGA_MAC_VER_01);
> @@ -3323,7 +3337,7 @@ static void rtl_phy_work(struct rtl8169_private *tp)
> goto out_mod_timer;
> }
>
> - if (tp->link_ok(ioaddr))
> + if (tp->link_ok(tp))
> return;
>
> netif_warn(tp, link, tp->dev, "PHY reset until link up\n");
next prev parent reply other threads:[~2012-03-20 14:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120205134050.7e135bb231b613806a2e0b70@gmail.com>
[not found] ` <4F2F0065.9040909@lwfinger.net>
[not found] ` <20120205222141.GA26223@electric-eye.fr.zoreil.com>
2012-02-05 22:59 ` WARNING: at net/sched/sch_generic.c:256 dev_watchdog+0x1f2/0x200() Justin P. Mattock
2012-03-19 4:01 ` Justin Mattock
2012-03-20 9:37 ` Francois Romieu
2012-03-20 14:16 ` Justin P. Mattock [this message]
2012-03-20 21:31 ` Justin P. Mattock
2012-03-20 23:27 ` Francois Romieu
2012-03-21 5:15 ` Justin P. Mattock
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=4F689131.2030607@gmail.com \
--to=justinmattock@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.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).