From sean@visi.gothic.net.au  Tue Aug  6 08:58:08 2002
Return-Path: <sean@visi.gothic.net.au>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 870C537B401
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  6 Aug 2002 08:58:08 -0700 (PDT)
Received: from visi.gothic.net.au (visi.gothic.net.au [202.182.69.51])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C07E043E5E
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  6 Aug 2002 08:58:07 -0700 (PDT)
	(envelope-from sean@visi.gothic.net.au)
Received: from localhost (localhost [127.0.0.1])
	by visi.gothic.net.au (Postfix) with ESMTP id 455EBA6A33
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  7 Aug 2002 01:58:03 +1000 (EST)
Received: by visi.gothic.net.au (Postfix, from userid 1000)
	id 92708A6A2C; Wed,  7 Aug 2002 01:57:54 +1000 (EST)
Message-Id: <20020806155754.92708A6A2C@visi.gothic.net.au>
Date: Wed,  7 Aug 2002 01:57:54 +1000 (EST)
From: Sean <sean@gothic.net.au>
Reply-To: Sean <sean@gothic.net.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ATAPI TAPE hung in atrpq
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         41382
>Category:       kern
>Synopsis:       ATAPI TAPE hung in atrpq
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 06 09:00:06 PDT 2002
>Closed-Date:    Thu Sep 12 06:59:21 PDT 2002
>Last-Modified:  Thu Sep 12 06:59:21 PDT 2002
>Originator:     Sean Winn
>Release:        FreeBSD 4.6.1-RELEASE-p8 i386
>Organization:
>Environment:
FreeBSD 4.6.1-RELEASE-p8 #1: Tue Aug  6 20:35:01 EST 2002
    sean@old.private.gothic.net.au:/usr/obj/usr/src/sys/VENTURIS
Timecounter "i8254"  frequency 1193182 Hz
CPU: Pentium/P54C (120.51-MHz 586-class CPU)
  Origin = "GenuineIntel"  Id = 0x52c  Stepping = 12
  Features=0x1bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8>
real memory  = 33554432 (32768K bytes)
avail memory = 27869184 (27216K bytes)
Preloaded elf kernel "kernel" at 0xc04d0000.
Intel Pentium detected, installing workaround for F00F bug
md0: Malloc disk
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcib0: <Host to PCI bridge> on motherboard
pci0: <PCI bus> on pcib0
isab0: <SiS 85c503 PCI-ISA bridge> at device 1.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <SiS 5591 ATA33 controller> port
0xec50-0xec5f,0x90001004-0x90001007,0x4100000-0x
4100007,0x4100084-0x4100087,0x2040028-0x204002f irq 0 at device 1.1 on pci0
atapci0: Busmastering DMA not supported
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
pci0: <S3 Trio graphics accelerator> at 9.0 irq 11
ed0: <NE2000 PCI Ethernet (RealTek 8029)> port 0xec60-0xec7f irq 10 at
device 12.0 on pci0
ed0: address 00:00:01:00:c7:ef, type NE2000 (16 bit)
orm0: <Option ROM> at iomem 0xc0000-0xc7fff on isa0
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
kbd0 at atkbd0
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/15 bytes threshold
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
ad0: 1221MB <Seagate Technology 1275MB - ST31276A> [2482/16/63] at
ata0-master BIOSPIO
acd0: CD-RW <HP CD-Writer+ 7200> at ata1-master BIOSPIO
ast0: TAPE <Seagate STT20000A> at ata1-slave BIOSPIO

>Description:
	Seagte STT20000A (IDE Travan 5 tape drive) - using dump to write out
	a partition, dump hangs in 'atprq' (according to top) on
	closing the tape device.
	
>How-To-Repeat:
	1:47 root@venturis [~] dump -0af /dev/nast0 /usr
	  DUMP: Date of this level 0 dump: Wed Aug  7 01:47:12 2002
	  DUMP: Date of last level 0 dump: the epoch
	  DUMP: Dumping /dev/ad0s1e (/usr) to /dev/nast0
	  DUMP: mapping (Pass I) [regular files]
	  DUMP: mapping (Pass II) [directories]
	  DUMP: estimated 131270 tape blocks.
	  DUMP: dumping (Pass III) [directories]
	  DUMP: dumping (Pass IV) [regular files]
	  DUMP: 88.75% done, finished in 0:00
	  DUMP: DUMP: 137175 tape blocks on 1 volume
	  DUMP: finished in 342 seconds, throughput 401 KBytes/sec
  	  DUMP: Closing /dev/nast0
  	  
  	  (hangs here)
>Fix:



>Release-Note:
>Audit-Trail:

From: Ian Dowse <iedowse@maths.tcd.ie>
To: Sean <sean@gothic.net.au>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/41382: ATAPI TAPE hung in atrpq 
Date: Tue, 06 Aug 2002 17:47:48 +0100

 In message <20020806155754.92708A6A2C@visi.gothic.net.au>, Sean writes:
 >	Seagte STT20000A (IDE Travan 5 tape drive) - using dump to write out
 >	a partition, dump hangs in 'atprq' (according to top) on
 >	closing the tape device.
 
 The following patch is reported to fix this problem. Can you try
 it to see if it helps?
 
 Ian
 
 Index: atapi-all.c
 ===================================================================
 RCS file: /home/iedowse/CVS/src/sys/dev/ata/atapi-all.c,v
 retrieving revision 1.46.2.14
 diff -u -r1.46.2.14 atapi-all.c
 --- atapi-all.c	14 Jul 2002 12:35:28 -0000	1.46.2.14
 +++ atapi-all.c	14 Jul 2002 23:39:00 -0000
 @@ -186,6 +186,7 @@
      request->flags = flags;
      request->timeout = timeout * hz;
      request->ccbsize = atadev->param->packet_size ? 16 : 12;
 +    request->error = EINPROGRESS;
      bcopy(ccb, request->ccb, request->ccbsize);
      if (callback) {
  	request->callback = callback;
 @@ -215,7 +216,8 @@
      }
  
      /* wait for request to complete */
 -    tsleep((caddr_t)request, PRIBIO, "atprq", 0);
 +    if (request->error == EINPROGRESS)
 +	tsleep((caddr_t)request, PRIBIO, "atprq", 0);
      splx(s);
      error = request->error;
      if (error)
 

From: "Sean Winn" <sean@gothic.net.au>
To: "Ian Dowse" <iedowse@maths.tcd.ie>
Cc: <FreeBSD-gnats-submit@FreeBSD.org>
Subject: Re: kern/41382: ATAPI TAPE hung in atrpq 
Date: Wed, 7 Aug 2002 03:34:31 +1000

 From: "Ian Dowse" <iedowse@maths.tcd.ie>
 To: "Sean" <sean@gothic.net.au>
 Cc: <FreeBSD-gnats-submit@FreeBSD.org>
 Sent: Wednesday, August 07, 2002 2:47 AM
 Subject: Re: kern/41382: ATAPI TAPE hung in atrpq
 
 
 > In message <20020806155754.92708A6A2C@visi.gothic.net.au>, Sean writes:
 > > Seagte STT20000A (IDE Travan 5 tape drive) - using dump to write out
 > > a partition, dump hangs in 'atprq' (according to top) on
 > > closing the tape device.
 >
 > The following patch is reported to fix this problem. Can you try
 > it to see if it helps?
 
 Dump completed without a problem; makes the tape drive useful for backups
 again :)
 
 
 
 >
 > Ian
 >
 > Index: atapi-all.c
 > ===================================================================
 > RCS file: /home/iedowse/CVS/src/sys/dev/ata/atapi-all.c,v
 > retrieving revision 1.46.2.14
 > diff -u -r1.46.2.14 atapi-all.c
 > --- atapi-all.c 14 Jul 2002 12:35:28 -0000 1.46.2.14
 > +++ atapi-all.c 14 Jul 2002 23:39:00 -0000
 > @@ -186,6 +186,7 @@
 >      request->flags = flags;
 >      request->timeout = timeout * hz;
 >      request->ccbsize = atadev->param->packet_size ? 16 : 12;
 > +    request->error = EINPROGRESS;
 >      bcopy(ccb, request->ccb, request->ccbsize);
 >      if (callback) {
 >   request->callback = callback;
 > @@ -215,7 +216,8 @@
 >      }
 >
 >      /* wait for request to complete */
 > -    tsleep((caddr_t)request, PRIBIO, "atprq", 0);
 > +    if (request->error == EINPROGRESS)
 > + tsleep((caddr_t)request, PRIBIO, "atprq", 0);
 >      splx(s);
 >      error = request->error;
 >      if (error)
 >
 >
 >
 
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: johan 
Responsible-Changed-When: Tue Aug 20 09:20:26 PDT 2002 
Responsible-Changed-Why:  
Over to ATA maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41382 

From: "Charles Pinson" <pinson@ka.com>
To: <freebsd-gnats-submit@FreeBSD.org>, <sean@gothic.net.au>
Cc:  
Subject: Re: kern/41382: ATAPI TAPE hung in atrpq
Date: Tue, 3 Sep 2002 12:32:34 -0400

 ast0: TAPE <Seagate STT8000A> at ata1-master PIO4
 
 FreeBSD 4.6.2-RELEASE #0: Sat Aug 31 00:05:36 EDT 2002
 CPU: Pentium II/Pentium II Xeon/Celeron (398.27-MHz 686-class CPU)
   Origin = "GenuineIntel"  Id = 0x651  Stepping = 1
 
 Features=0x183f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,
 PA
 T,PSE36,MMX,FXSR>
 
 Prior to the patch, any tape operation to /dev/ast0 would hang after
 completion.
 
 The above patch to atapi-all.c corrected this problem with my Seagate 4/8 GB
 Seagate STT8000A Travan tape drive.
 
 Thanks for the fix!
 
 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Thu Sep 12 06:58:31 PDT 2002 
State-Changed-Why:  
Fix committed to current. 

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