From bel@white.orel.ru  Mon Dec 15 02:46:36 2003
Return-Path: <bel@white.orel.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E46D316A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 15 Dec 2003 02:46:36 -0800 (PST)
Received: from white.orel.ru (white.orel.ru [213.59.64.81])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0FD6043D2D
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 15 Dec 2003 02:46:35 -0800 (PST)
	(envelope-from bel@white.orel.ru)
Received: from white.orel.ru (localhost [127.0.0.1])
	by white.orel.ru (8.12.9/8.12.9) with ESMTP id hBFAkUuU022551
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 15 Dec 2003 13:46:31 +0300 (MSK)
	(envelope-from bel@white.orel.ru)
Received: (from bel@localhost)
	by white.orel.ru (8.12.9/8.12.9/Submit) id hBFAkTqG022550;
	Mon, 15 Dec 2003 13:46:29 +0300 (MSK)
Message-Id: <200312151046.hBFAkTqG022550@white.orel.ru>
Date: Mon, 15 Dec 2003 13:46:29 +0300 (MSK)
From: Andrew Belashov <bel@orel.ru>
Reply-To: Andrew Belashov <bel@orel.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Andrew Belashov <bel@orel.ru>
Subject: [patch] rl(4) driver incorrect reset TX descriptors after network errors
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         60250
>Category:       kern
>Synopsis:       [patch] rl(4) driver incorrect reset TX descriptors after network errors
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    wpaul
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 15 02:50:17 PST 2003
>Closed-Date:    Wed Jan 21 14:33:04 PST 2004
>Last-Modified:  Wed Jan 21 14:33:04 PST 2004
>Originator:     Andrew Belashov
>Release:        FreeBSD 5.1-RELEASE sparc64
>Organization:
JSC "CenterTelecom"
>Environment:
System: FreeBSD white 5.1-RELEASE FreeBSD 5.1-RELEASE #1: Wed Dec 10 16:15:47 MSK 2003 bel@orel.ru:/usr/obj/usr/src/sys/WHITE sparc64


	
>Description:
	Kernel panic with message "panic: trap: memory address not aligned"
	on FreeBSD/sparc64 after network errors on rl(4) interface.
	The reason: Driver incorrect reset array of TX descriptors (DVMA
	address).

>How-To-Repeat:
	
>Fix:

	Use this patch.

--- if_rl.c.diff begins here ---
--- sys/pci/if_rl.c.orig	Sun Jul  6 10:11:14 2003
+++ sys/pci/if_rl.c	Wed Dec 10 16:07:14 2003
@@ -1832,7 +1832,8 @@
 			    sc->rl_cdata.rl_tx_dmamap[i]);
 			m_freem(sc->rl_cdata.rl_tx_chain[i]);
 			sc->rl_cdata.rl_tx_chain[i] = NULL;
-			CSR_WRITE_4(sc, RL_TXADDR0 + i, 0x0000000);
+			CSR_WRITE_4(sc, RL_TXADDR0 + (i * sizeof(u_int32_t)),
+			    0x0000000);
 		}
 	}
 
--- if_rl.c.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->wpaul 
Responsible-Changed-By: ceri 
Responsible-Changed-When: Tue Dec 16 11:17:27 PST 2003 
Responsible-Changed-Why:  
Assign to the rl(4) author. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=60250 
State-Changed-From-To: open->closed 
State-Changed-By: wpaul 
State-Changed-When: Wed Jan 21 14:32:33 PST 2004 
State-Changed-Why:  
Patch applied to if_rl.c in -current. 

-Bill 

http://www.freebsd.org/cgi/query-pr.cgi?pr=60250 
>Unformatted:
