From nobody  Mon Aug 18 01:07:48 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.5/8.8.5) id BAA06209;
          Mon, 18 Aug 1997 01:07:48 -0700 (PDT)
Message-Id: <199708180807.BAA06209@hub.freebsd.org>
Date: Mon, 18 Aug 1997 01:07:48 -0700 (PDT)
From: shin@sm.sony.co.jp
To: freebsd-gnats-submit@freebsd.org
Subject: read(2) from /dev/bktr0 hangs
X-Send-Pr-Version: www-1.0

>Number:         4329
>Category:       kern
>Synopsis:       read(2) from /dev/bktr0 hangs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 18 01:10:00 PDT 1997
>Closed-Date:    Tue Feb 3 12:26:16 PST 1998
>Last-Modified:  Tue Feb  3 12:26:49 PST 1998
>Originator:     Takao Shinohara
>Release:        2.2.2-RELEASE i386
>Organization:
Sony corporation
>Environment:
>Description:
read(2) from Bt848 device (/dev/bktr0) sleeps forever.
>How-To-Repeat:
dd if=/dev/bktr0 of=/dev/null bs=614400 count=1
>Fix:
*** brooktree848.c.~1~  Sun Aug 17 19:20:33 1997
--- brooktree848.c      Mon Aug 18 16:37:05 1997
***************
*** 1132,1141 ****
--- 1132,1158 ----

        bktr->flags &= ~(METEOR_CAP_MASK | METEOR_WANT_MASK);

+ #if 1 /* bugfix */
+       bt848 = bktr->base;
+       start_capture(bktr, METEOR_SINGLE);
+
+       /* wait for capture to complete */
+       bt848->int_stat = ALL_INTS_CLEARED;
+       bt848->gpio_dma_ctl = FIFO_ENABLED;
+       bt848->gpio_dma_ctl = bktr->capcontrol;
+
+       bt848->int_mask = BT848_INT_MYSTERYBIT |
+                       BT848_INT_RISCI      |
+                       BT848_INT_VSYNC      |
+                       BT848_INT_FMTCHG;
+
+       bt848->cap_ctl = bktr->bktr_cap_ctl;
+ #else
        /* Start capture */
        bt848 = bktr->base;
        bt848->gpio_dma_ctl = FIFO_ENABLED;
        bt848->gpio_dma_ctl = FIFO_RISC_ENABLED;
+ #endif

        status = tsleep((caddr_t)bktr, METPRI, "captur", 0);
        if (!status)            /* successful capture */

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: pst 
State-Changed-When: Tue Feb 3 12:26:16 PST 1998 
State-Changed-Why:  
Amancio claims he committed this fix on Feb 2. 
>Unformatted:
