LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "sun" <sun.zhitai@jp.fujitsu.com>
To: <linuxppc-embedded@ozlabs.org>
Subject: fix-up GIANFAR driver timer bug
Date: Thu, 29 Sep 2005 11:07:54 +0900	[thread overview]
Message-ID: <011901c5c49a$9aa01fc0$3f13180a@utsfd.cs.fujitsu.co.jp> (raw)

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

Repeat executing a command series like the attached descript will cause
system hanging or kernel panic shown below on a GIANFAR used system.
The attached patch is for fix the above issue.
The issue and the solution have been confirmed on
MPC8560ADS and MPC85555CDS evaluation boards.

----------
-sh-3.00# ./net_setting.sh
eth1 setting start
###set ip-address

###net Trying to free free IRQ103
down

###set MAC address

###net up
kernel BUG in cascade at kernel/timer.c:419!
Oops: Exception in kernel mode, sig: 5 [#1]
NIP: C0029090 LR: C00290A0 SP: CCD69B20 REGS: ccd69a70 TRAP: 0700    Not tainted
MSR: 00021000 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 00
TASK = cde58080[170] 'ifconfig' THREAD: ccd68000
Last syscall: 54
GPR00: 00000001 CCD69B20 CDE58080 C0311DD4 C031269C FFFBD700 C0311F4C C0311E94
GPR08: FFFBD869 00003B60 00000169 00003B5F FFFBD700 1010A204 00000000 00000000
GPR16: 00000000 1001C094 00000000 00000000 C07D2400 FFFF8914 C03092C0 C0310000
GPR24: C0310000 C0310000 C0280000 C0311DD4 00000017 C0311DD4 C0312694 C031269C
NIP [c0029090] cascade+0x40/0x78
LR [c00290a0] cascade+0x50/0x78
Call trace:
 [c002923c] run_timer_softirq+0x174/0x1d8
 [c0024b4c] __do_softirq+0x80/0xf4
 [c0024c18] do_softirq+0x58/0x60
 [c0003930] timer_interrupt+0xa0/0x208
 [c0002598] ret_from_except+0x0/0x18
 [c001f694] release_console_sem+0xc4/0x234
 [c001f95c] vprintk+0x158/0x1c0
 [c001fa14] printk+0x50/0x60
 [c014d91c] get_phy_info+0xcc/0xe4
 [c014b30c] gfar_enet_open+0x2ec/0x390
 [c01a7630] dev_open+0xb0/0xd8
 [c01a8dc4] dev_change_flags+0x6c/0x144
 [c01e6eec] devinet_ioctl+0x618/0x764
 [c01e8250] inet_ioctl+0x10c/0x120
 [c019dbcc] sock_ioctl+0x1ac/0x288
Kernel panic - not syncing: Aiee, killing interrupt handler!
 <0>Rebooting in 1 seconds..U-Boot 1.1.2 (Aug 19 2005 - 09:55:23)

[-- Attachment #2: fixIFCONFIGpanic.patch --]
[-- Type: application/octet-stream, Size: 1730 bytes --]

--- old_kernel/drivers/net/gianfar.c	2005-06-21 10:57:29.000000000 +0900
+++ new_kernel/drivers/net/gianfar.c	2005-09-26 17:05:46.116951768 +0900
@@ -541,6 +541,14 @@
 				MII_INTERRUPT_DISABLED);
 	}
 
+/* following 2 steps is a attempting to prevent system hanging/panic
+   when executing ifconfig command. by Sun Zhitai, Sep. 26 2005 */ 
+
+	cancel_delayed_work(&priv->tq);
+	del_timer_sync(&priv->phy_info_timer);
+
+/* appended end */
+
 	spin_unlock_irqrestore(&priv->lock, flags);
 
 	/* Free the IRQs */
@@ -770,7 +778,7 @@
 	init_timer(&priv->phy_info_timer);
 	priv->phy_info_timer.function = &gfar_phy_startup_timer;
 	priv->phy_info_timer.data = (unsigned long) priv->mii_info;
-	mod_timer(&priv->phy_info_timer, jiffies + HZ);
+	__mod_timer(&priv->phy_info_timer, jiffies + HZ);
 
 	/* Configure the coalescing support */
 	if (priv->txcoalescing)
@@ -1500,7 +1508,7 @@
 
 	schedule_work(&priv->tq);
 
-	mod_timer(&priv->phy_info_timer, jiffies +
+	__mod_timer(&priv->phy_info_timer, jiffies +
 			GFAR_PHY_CHANGE_TIME * HZ);
 }
 
@@ -1523,7 +1531,7 @@
 	/* If autonegotiation failed to start, and
 	 * we haven't timed out, reset the timer, and return */
 	if (result && secondary--) {
-		mod_timer(&priv->phy_info_timer, jiffies + HZ);
+		__mod_timer(&priv->phy_info_timer, jiffies + HZ);
 		return;
 	} else if (result) {
 		/* Couldn't start autonegotiation.
@@ -1564,7 +1572,7 @@
 	init_timer(&priv->phy_info_timer);
 	priv->phy_info_timer.function = &gfar_phy_timer;
 	priv->phy_info_timer.data = (unsigned long) mii_info->dev;
-	mod_timer(&priv->phy_info_timer, jiffies +
+	__mod_timer(&priv->phy_info_timer, jiffies +
 			GFAR_PHY_CHANGE_TIME * HZ);
 }
 

[-- Attachment #3: net_setting.sh --]
[-- Type: application/octet-stream, Size: 291 bytes --]

#! /bin/sh
date
echo "eth1 setting start"
sl(){
        echo
}

echo "###set ip-address"
ifconfig eth1 192.168.0.37 netmask 255.255.255.0
sl
echo "###net down"
ifconfig eth1 down
sl

echo "###set MAC address"
ifconfig eth1 hw ether 00:e0:0c:00:01:fd
sl

echo "###net up"
ifconfig eth1 up
sl

             reply	other threads:[~2005-09-29  2:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-29  2:07 sun [this message]
2005-09-29 14:30 ` fix-up GIANFAR driver timer bug Andy Fleming

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='011901c5c49a$9aa01fc0$3f13180a@utsfd.cs.fujitsu.co.jp' \
    --to=sun.zhitai@jp.fujitsu.com \
    --cc=linuxppc-embedded@ozlabs.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