Subject: kern/24185: New atppc always reports write threshold as 1.
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <paul@Plectere.com>
List: netbsd-bugs
Date: 01/21/2004 11:21:07
>Number:         24185
>Category:       kern
>Synopsis:       New atppc always reports write threshold as 1.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 21 19:22:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Paul Shupak
>Release:        NetBSD 1.6ZH
>Organization:
>Environment:
	
	
System: NetBSD svcs 1.6ZH NetBSD 1.6ZH (SVCS) #5: Mon Jan 12 11:31:51 PST 2004 root@svcs:/sys/arch/i386/compile/SVCS i386
Architecture: i386
Machine: i386
>Description:
	The service bit in the ECR register is set by the previous test,
	but has not been cleared, so the write threshhold is misreported
	on the first loop iteration.
>How-To-Repeat:
	Use the new ppbus code.
>Fix:
Index: atppc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/atppc.c,v
retrieving revision 1.3
diff -c -r1.3 atppc.c
*** atppc.c	2004/01/21 00:33:37	1.3
--- atppc.c	2004/01/21 19:13:57
***************
*** 559,564 ****
--- 559,568 ----
  	atppc_w_ctr(atppc, (ctr_sav & ~IRQENABLE) & ~PCD);
  	atppc_barrier_w(atppc);
  
+ 	/* Clear the serviceIntr bit we've already set in the above loop */
+ 	atppc_w_ecr(atppc, ATPPC_ECR_TST);
+ 	atppc_barrier_w(atppc);
+ 
  	/* Determine writeIntrThreshold - empty FIFO until serviceIntr is set */
  	for(atppc->sc_wthr = 0; i > -1; i--) {
  		cc = atppc_r_fifo(atppc); 
>Release-Note:
>Audit-Trail:
>Unformatted: