Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Dec 1999 18:08:08 -0800
From:      Ed Hall <edhall@screech.weirdnoise.com>
To:        Peter Wemm <peter@netplex.com.au>
Cc:        Matthew Dillon <dillon@apollo.backplane.com>, "Jonathan M. Bresler" <jmb@hub.freebsd.org>, kris@hub.freebsd.org, freebsd-hackers@FreeBSD.ORG
Message-ID:  <199912080208.SAA11430@screech.weirdnoise.com>

next in thread | raw e-mail | index | archive | help
Subject: Re: PCI DMA lockups in 3.2 (3.3 maybe?)
In-Reply-To: Your message of "Tue, 07 Dec 1999 20:01:39 +0800."
             <19991207120139.869F01CC6@overcee.netplex.com.au> 
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
--------
I just reviewed the (so far) working 3.3 test system.  I was mistaken
about the 4.0 driver; looks like you didn't get around to that.  You
have a wrapper around ncr_intr() that sets up guard areas--and a call
to splcam() that might well be what's stabilizing things.  Here are
the diffs (preceded by the CVS ident string):

** $FreeBSD: src/sys/pci/ncr.c,v 1.141.2.4 1999/08/29 16:31:53 peter Exp $

% diff /tmp/ncr.c ncr.c
*** /tmp/ncr.c	Tue Dec  7 15:37:50 1999
--- ncr.c	Thu Oct 28 11:41:56 1999
***************
*** 3314,3319 ****
--- 3314,3325 ----
  	
  	found = -1;
  	for (i = 0; i < sizeof(ncr_chip_table)/sizeof(ncr_chip_table[0]); i++) {
+ /*
+  *  Ignore chips that support LOAD/STORE, so the sym_hipd driver will 
+  *  attach them without any conflict.
+  */
+ 		if (ncr_chip_table[i].features & FE_LDSTR)
+ 			continue;
  		if (device_id	== ncr_chip_table[i].device_id &&
  		    ncr_chip_table[i].minrevid <= revision_id) {
  			if (found < 0 || 
***************
*** 3872,3883 ****
  **==========================================================
  */
  
  static void
! ncr_intr(vnp)
  	void *vnp;
  {
  	ncb_p np = vnp;
- 	int oldspl = splcam();
  
  	if (DEBUG_FLAGS & DEBUG_TINY) printf ("[");
  
--- 3878,3890 ----
  **==========================================================
  */
  
+ int ncr_int_count = 0;
+ 
  static void
! ncr_intr1(vnp)
  	void *vnp;
  {
  	ncb_p np = vnp;
  
  	if (DEBUG_FLAGS & DEBUG_TINY) printf ("[");
  
***************
*** 3893,3900 ****
  	};
  
  	if (DEBUG_FLAGS & DEBUG_TINY) printf ("]\n");
  
! 	splx (oldspl);
  }
  
  /*==========================================================
--- 3900,3932 ----
  	};
  
  	if (DEBUG_FLAGS & DEBUG_TINY) printf ("]\n");
+ }
+ 
+ #define GUARDS 16
  
! static void
! ncr_intr(vnp)
! 	void *vnp;
! {
! 	int i;
! 	int clobber;
! 	int guard[GUARDS];
! 
! 	clobber = 0;
! 	for (i = 0; i < GUARDS; i++)
! 		guard[i] = 0xcafebabe;
! 
! 	ncr_int_count++;
! 	ncr_intr1(vnp);
! 
! 	for (i = 0; i < GUARDS; i++) {
! 		if (guard[i] != 0xcafebabe) {
! 			printf("guard[%d] = 0x%x\n", i, guard[i]);
! 			clobber++;
! 		}
! 	}
! 	if (clobber != 0)
! 		panic("ncr_intr: stack clobber 0x%x\n", clobber);
  }
  
  /*==========================================================
***************
*** 4878,4884 ****
--- 4910,4920 ----
  static void
  ncr_poll(struct cam_sim *sim)
  {       
+ 	int oldspl;
+ 
+ 	oldspl = splcam();
  	ncr_intr(cam_sim_softc(sim));  
+ 	splx(oldspl);
  }
  



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912080208.SAA11430>