mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: "Nick Warne" <nick@ukfsn.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.3 - 8139too timeout debug info
Date: Sun, 29 Feb 2004 02:41:27 +0900	[thread overview]
Message-ID: <87znb3t83c.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <403F7EEF.4124.2432E62F@localhost>

[-- Attachment #1: Type: text/plain, Size: 796 bytes --]

"Nick Warne" <nick@ukfsn.org> writes:

> Firstly, I am starting a fresh thread here, as I have subscribed to 
> the lkml now so I can reply in a timely manner, and also the other 
> thread was broke as I was replying 'off-list' - sorry about that.
> 
> OK, to recap.  With 2.6.3 I get timeouts with 8139too under network 
> load (any load).  I have never had any problems with these _same_ two 
> cards under any other kernel version over the last 3 years.
> 
> If I use the 8139too.c from 2.6.2, and build 2.6.3 with it, all works 
> fine (I am running this version right now).

Interesting.

Please try the attached patch for debugging. After this problem
happen, send the all output of dmesg, all .config, and "cat /proc/interrupts".

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 8139too-debug.patch --]
[-- Type: text/x-patch, Size: 5288 bytes --]

---

 drivers/net/8139too.c |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+)

diff -puN drivers/net/8139too.c~8139too-debug drivers/net/8139too.c
--- linux-2.6.3/drivers/net/8139too.c~8139too-debug	2004-02-29 02:33:44.000000000 +0900
+++ linux-2.6.3-hirofumi/drivers/net/8139too.c	2004-02-29 02:37:45.000000000 +0900
@@ -718,6 +718,25 @@ static const unsigned int rtl8139_rx_con
 static const unsigned int rtl8139_tx_config =
 	(TX_DMA_BURST << TxDMAShift) | (TX_RETRY << TxRetryShift);
 
+#define RTL8139_DUMP(dev) do {						\
+	printk("%s: %s: run %d, stop %d\n", dev->name, __FUNCTION__,	\
+	       netif_running(dev), netif_queue_stopped(dev));		\
+	rtl8139_dump(dev->priv);					\
+} while(0)
+
+static void rtl8139_dump(struct rtl8139_private *tp)
+{
+	void *ioaddr = tp->mmio_addr;
+	int i;
+
+	for (i = 0; i < tp->regs_len; i++) {
+		if (i && (i % 16) == 0)
+			printk("\n");
+		printk("%02x ", RTL_R8(i));
+	}
+	printk("\n");
+}
+
 static void __rtl8139_cleanup_dev (struct net_device *dev)
 {
 	struct rtl8139_private *tp;
@@ -1355,6 +1374,10 @@ static int rtl8139_open (struct net_devi
 
 	rtl8139_start_thread(dev);
 
+	spin_lock_irq(&tp->lock);
+	RTL8139_DUMP(dev);
+	spin_unlock_irq(&tp->lock);
+
 	return 0;
 }
 
@@ -1673,6 +1696,11 @@ static void rtl8139_tx_timeout (struct n
 	u8 tmp8;
 	unsigned long flags;
 
+	printk("%s: irq %d\n", __FUNCTION__, irqs_disabled());
+	spin_lock_irq(&tp->lock);
+	RTL8139_DUMP(dev);
+	spin_unlock_irq(&tp->lock);
+
 	DPRINTK ("%s: Transmit timeout, status %2.2x %4.4x "
 		 "media %2.2x.\n", dev->name,
 		 RTL_R8 (ChipCmd),
@@ -1737,6 +1765,12 @@ static int rtl8139_start_xmit (struct sk
 	}
 
 	spin_lock_irq(&tp->lock);
+	{
+		u32 txstatus = RTL_R32(TxStatus0 + (entry * sizeof(u32)));
+		if (!(txstatus & TxStatOK) && (txstatus & TxUnderrun))
+			printk("8139too: durning re-transmit (%08x)\n",
+			       txstatus);
+	}
 	RTL_W32_F (TxStatus0 + (entry * sizeof (u32)),
 		   tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
 
@@ -1780,6 +1814,7 @@ static void rtl8139_tx_interrupt (struct
 
 		/* Note: TxCarrierLost is always asserted at 100mbps. */
 		if (txstatus & (TxOutOfWindow | TxAborted)) {
+			RTL8139_DUMP(dev);
 			/* There was an major error, log it. */
 			if (netif_msg_tx_err(tp))
 				printk(KERN_DEBUG "%s: Transmit error, Tx status %8.8x.\n",
@@ -1836,6 +1871,9 @@ static void rtl8139_rx_err (u32 rx_statu
 #ifdef CONFIG_8139_OLD_RX_RESET
 	int tmp_work;
 #endif
+	spin_lock_irq(&tp->lock);
+	RTL8139_DUMP(dev);
+	spin_unlock_irq(&tp->lock);
 
 	if (netif_msg_rx_err (tp)) 
 		printk(KERN_DEBUG "%s: Ethernet frame had errors, status %8.8x.\n",
@@ -2061,6 +2099,8 @@ static void rtl8139_weird_interrupt (str
 	assert (tp != NULL);
 	assert (ioaddr != NULL);
 
+	RTL8139_DUMP(dev);
+
 	/* Update the error count. */
 	tp->stats.rx_missed_errors += RTL_R32 (RxMissed);
 	RTL_W32 (RxMissed, 0);
@@ -2209,6 +2249,10 @@ static int rtl8139_close (struct net_dev
 	int ret = 0;
 	unsigned long flags;
 
+	spin_lock_irq(&tp->lock);
+	RTL8139_DUMP(dev);
+	spin_unlock_irq(&tp->lock);
+
 	netif_stop_queue (dev);
 
 	if (tp->thr_pid >= 0) {
@@ -2271,6 +2315,7 @@ static void rtl8139_get_wol(struct net_d
 	void *ioaddr = np->mmio_addr;
 
 	spin_lock_irq(&np->lock);
+	RTL8139_DUMP(dev);
 	if (rtl_chip_info[np->chipset].flags & HasLWake) {
 		u8 cfg3 = RTL_R8 (Config3);
 		u8 cfg5 = RTL_R8 (Config5);
@@ -2314,6 +2359,7 @@ static int rtl8139_set_wol(struct net_de
 		return -EINVAL;
 
 	spin_lock_irq(&np->lock);
+	RTL8139_DUMP(dev);
 	cfg3 = RTL_R8 (Config3) & ~(Cfg3_LinkUp | Cfg3_Magic);
 	if (wol->wolopts & WAKE_PHY)
 		cfg3 |= Cfg3_LinkUp;
@@ -2352,6 +2398,7 @@ static int rtl8139_get_settings(struct n
 {
 	struct rtl8139_private *np = dev->priv;
 	spin_lock_irq(&np->lock);
+	RTL8139_DUMP(dev);
 	mii_ethtool_gset(&np->mii, cmd);
 	spin_unlock_irq(&np->lock);
 	return 0;
@@ -2362,6 +2409,7 @@ static int rtl8139_set_settings(struct n
 	struct rtl8139_private *np = dev->priv;
 	int rc;
 	spin_lock_irq(&np->lock);
+	RTL8139_DUMP(dev);
 	rc = mii_ethtool_sset(&np->mii, cmd);
 	spin_unlock_irq(&np->lock);
 	return rc;
@@ -2370,12 +2418,14 @@ static int rtl8139_set_settings(struct n
 static int rtl8139_nway_reset(struct net_device *dev)
 {
 	struct rtl8139_private *np = dev->priv;
+	RTL8139_DUMP(dev);
 	return mii_nway_restart(&np->mii);
 }
 
 static u32 rtl8139_get_link(struct net_device *dev)
 {
 	struct rtl8139_private *np = dev->priv;
+	RTL8139_DUMP(dev);
 	return mii_link_ok(&np->mii);
 }
 
@@ -2409,6 +2459,7 @@ static void rtl8139_get_regs(struct net_
 	regs->version = RTL_REGS_VER;
 
 	spin_lock_irq(&np->lock);
+	RTL8139_DUMP(dev);
 	memcpy_fromio(regbuf, np->mmio_addr, regs->len);
 	spin_unlock_irq(&np->lock);
 }
@@ -2554,6 +2605,10 @@ static int rtl8139_suspend (struct pci_d
 	void *ioaddr = tp->mmio_addr;
 	unsigned long flags;
 
+	spin_lock_irqsave (&tp->lock, flags);
+	RTL8139_DUMP(dev);
+	spin_unlock_irqrestore (&tp->lock, flags);
+
 	if (!netif_running (dev))
 		return 0;
 
@@ -2583,6 +2638,7 @@ static int rtl8139_resume (struct pci_de
 	struct net_device *dev = pci_get_drvdata (pdev);
 	struct rtl8139_private *tp = dev->priv;
 
+	RTL8139_DUMP(dev);
 	if (!netif_running (dev))
 		return 0;
 	pci_restore_state (pdev, tp->pci_state);

_

  parent reply	other threads:[~2004-02-28 17:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-27 17:31 Nick Warne
2004-02-27 17:40 ` Matt H.
2004-02-27 17:50   ` Nick Warne
2004-02-28 17:41 ` OGAWA Hirofumi [this message]
2004-02-28 18:47   ` Nick Warne
2004-02-29  7:58     ` OGAWA Hirofumi
2004-02-29  8:09       ` OGAWA Hirofumi
2004-02-29 11:09         ` Nick Warne
     [not found] <4041BAA6.28283.2CEC419B@localhost>
     [not found] ` <87fzcut9ua.fsf@devron.myhome.or.jp>
2004-02-29 11:57   ` Nick Warne
2004-02-29 12:38     ` OGAWA Hirofumi
2004-02-29 13:05       ` Nick Warne
2004-02-29 18:28         ` OGAWA Hirofumi
2004-03-01 18:29           ` Nick Warne
2004-03-22 21:17             ` Jeff Garzik
2004-03-22 22:51               ` OGAWA Hirofumi
2004-03-31 19:42                 ` Christian Gut
2004-04-01  3:56                   ` OGAWA Hirofumi
2004-04-04 17:02                     ` OGAWA Hirofumi
2004-03-23 21:07 Nick Warne

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=87znb3t83c.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nick@ukfsn.org \
    /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

Powered by JetHome