Re: bluetooth / hcseriald panics -current.

From: Maksim Yevmenkin <maksim.yevmenkin_at_savvis.net>
Date: Tue, 02 Nov 2004 11:52:52 -0800
Hi Niki,

sorry for the delay. i was able to reproduce and track down the problem. 
please find attached patch. let me know if it works for you.

i'm sorry about this.

max

Niki Denev wrote:
> Maksim Yevmenkin writes:
> 
>>
>> stack trace?
>> what is the version of sio.c?
>>
>> i'm trying to reproduce it on my system with xircom cbt adapter.
>>
> 
> sio.c is 1.456
> 
> here is the crash message and the trace :
> 
> kernel trap 12 with interrupts disabled
> 
> Fatal trap 12: page fault while in kernel mode
> fault virtual address = 0x64
> fault code            = supervisor write, page not present
> instruction pointer   = 0x8:0xc062f2b1
> stack pointer         = 0x10:0xe6879a2c
> frame pointer         = 0x10:0xe6879a38
> code segment          = base 0x0, limit 0xfffff, type 0x1b
>                      = DPL 0, pres 1, def32 1, gran 1
> processor eflags      = resume, IOPL = 0
> current process       = 542 (hcseriald)
> [thread 100071]
> Stopped at      comstop+0x75:    andl   $-0x5,0x64(%eax)
> db> trace
> comstop(c1d6c000,3) at comstop+0x75
> ttyflush(c1d6c000,3,c1fd0600,303468,e6879a80) at ttyflush+0x37
> ng_h4_open(c1d5f900,c1d6c000) at ng_h4_open+0x194
> ttioctl(c1d6c000,8004741b,e6879c60,3,c206a948) at ttioctl+0xc32
> ttyioctl(c1d5f900,8004741b,e6879c60,3,c1d8b180) at ttyioctl+0x41
> spec_ioctl(d540bb88,e6879c34,c056a017,e6879b88,c06e8100) at spec_ioctl+0xee
> spec_vnoperate(d540bb88) at spec_vnoperate+0x13
> vn_ioctl(c1d84110,8004741b,e6879c60,c1ff0380,c1d8b180) at vn_ioctl+0x1ab
> ioctl(c1d8b180,e6879d14,3,1,246) at ioctl+0x3e0
> syscall(2f,2f,2f,bfbfe8ec,bfbfee67) at syscall+0x213
> Xint0x80_syscall() at Xint0x80_syscall+0x1f
> --- syscall (54, FreeBSD ELF32, ioctl), eip = 0x280ce80f, esp = 
> 0xbfbfe80c, ebp = 0xbfbfed54 ---
> db>
> 
> --niki
> 


--- /usr/src/sys/netgraph/bluetooth/drivers/h4/ng_h4.c	Sat Jul 10 17:06:58 2004
+++ ng_h4.c	Tue Nov  2 11:47:26 2004
_at__at_ -25,7 +25,7 _at__at_
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: ng_h4.c,v 1.5 2003/05/10 05:51:25 max Exp $
+ * $Id: ng_h4.c,v 1.7 2004/08/23 18:08:15 max Exp $
  * $FreeBSD: src/sys/netgraph/bluetooth/drivers/h4/ng_h4.c,v 1.10 2004/06/26 08:44:04 phk Exp $
  * 
  * Based on:
_at__at_ -70,6 +70,8 _at__at_
  *****************************************************************************
  *****************************************************************************/
 
+NET_NEEDS_GIANT("ng_h4");
+
 /* MALLOC define */
 #ifndef NG_SEPARATE_MALLOC
 MALLOC_DEFINE(M_NETGRAPH_H4, "netgraph_h4", "Netgraph Bluetooth H4 node");
_at__at_ -199,7 +201,7 _at__at_
 
 	/* Set back pointers */
 	NG_NODE_SET_PRIVATE(sc->node, sc);
-	tp->t_sc = (caddr_t) sc;
+	tp->t_lsc = (caddr_t) sc;
 
 	/* The node has to be a WRITER because data can change node status */
 	NG_NODE_FORCE_WRITER(sc->node);
_at__at_ -228,7 +230,7 _at__at_
 static int
 ng_h4_close(struct tty *tp, int flag)
 {
-	ng_h4_info_p	sc = (ng_h4_info_p) tp->t_sc;
+	ng_h4_info_p	sc = (ng_h4_info_p) tp->t_lsc;
 	int		s;
 
 	s = spltty(); /* XXX */
_at__at_ -236,7 +238,7 _at__at_
 	ttyflush(tp, FREAD | FWRITE);
 	clist_free_cblocks(&tp->t_outq);
 	if (sc != NULL) {
-		tp->t_sc = NULL;
+		tp->t_lsc = NULL;
 
 		if (sc->node != NULL) {
 			if (sc->flags & NG_H4_TIMEOUT)
_at__at_ -285,7 +287,7 _at__at_
 ng_h4_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
 		struct thread *td)
 {
-	ng_h4_info_p	sc = (ng_h4_info_p) tp->t_sc;
+	ng_h4_info_p	sc = (ng_h4_info_p) tp->t_lsc;
 	int		s, error = 0;
 
 	s = spltty(); /* XXX */
_at__at_ -326,7 +328,7 _at__at_
 static int
 ng_h4_input(int c, struct tty *tp)
 {
-	ng_h4_info_p	sc = (ng_h4_info_p) tp->t_sc;
+	ng_h4_info_p	sc = (ng_h4_info_p) tp->t_lsc;
 
 	if (sc == NULL || tp != sc->tp ||
 	    sc->node == NULL || NG_NODE_NOT_VALID(sc->node))
_at__at_ -546,7 +548,7 _at__at_
 static int
 ng_h4_start(struct tty *tp)
 {
-	ng_h4_info_p	sc = (ng_h4_info_p) tp->t_sc;
+	ng_h4_info_p	sc = (ng_h4_info_p) tp->t_lsc;
 
 	if (sc == NULL || tp != sc->tp || 
 	    sc->node == NULL || NG_NODE_NOT_VALID(sc->node))
Received on Tue Nov 02 2004 - 18:53:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:20 UTC