From nobody  Sun Jan  3 16:21:41 1999
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id QAA28913;
          Sun, 3 Jan 1999 16:21:41 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199901040021.QAA28913@hub.freebsd.org>
Date: Sun, 3 Jan 1999 16:21:41 -0800 (PST)
From: petry@netmasters.com
To: freebsd-gnats-submit@freebsd.org
Subject: pps driver doesn't clear ppbus control port on open or close
X-Send-Pr-Version: www-1.0

>Number:         9297
>Category:       kern
>Synopsis:       pps driver doesn't clear ppbus control port on open or close
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan  3 16:30:01 PST 1999
>Closed-Date:    Thu Jun 1 15:20:41 PDT 2000
>Last-Modified:  Thu Jun 01 15:21:19 PDT 2000
>Originator:     Michael Petry
>Release:        3.0 Current
>Organization:
>Environment:
FreeBSD zditto.NetMasters.Com 3.0-CURRENT FreeBSD 3.0-CURRENT #6: Sun Jan  3 18:54:57 EST 1999     petry@zditto.NetMasters.Com:/usr/src/sys/compile/PC.UP  i386
>Description:
/sys/dev/ppbus/pps.c doesn't clear the device control registers on
ppsopen.  It should also clean up in ppsclose to avoid confusion
for other ppbus users,
>How-To-Repeat:
Open the device.  Close the device. Try to reopen.
The open will complete, but the device may not interrupt
since the control register was never reset.

>Fix:
*** /sys/dev/ppbus/pps.c        Thu Dec 10 22:10:08 1998
--- pps.c       Sun Jan  3 19:11:10 1999
***************
*** 133,138 ****
--- 135,142 ----
        if (ppb_request_bus(&sc->pps_dev, PPB_WAIT|PPB_INTR))
                return (EINTR);
  
+       ppb_wctr(&sc->pps_dev, 0);
+ 
        ppb_wctr(&sc->pps_dev, IRQENABLE);
  
        return(0);
***************
*** 144,149 ****
--- 148,157 ----
        struct pps_data *sc = softc[minor(dev)];
  
        sc->ppsparam.mode = 0;
+ 
+       ppb_wdtr(&sc->pps_dev, 0);
+       ppb_wctr(&sc->pps_dev, 0);
+ 
        ppb_release_bus(&sc->pps_dev);
        return(0);
  }

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Thu Jun 1 15:20:41 PDT 2000 
State-Changed-Why:  
This patch seems to have made its way in at some point in time. 

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