kernel/4611: Cannot read from an atapi tape drive

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

kernel/4611: Cannot read from an atapi tape drive

Juha Erkkila
>Number:         4611
>Category:       kernel
>Synopsis:       Cannot read from an atapi tape drive
>Confidential:   yes
>Severity:       non-critical
>Priority:       medium
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:      
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 10 11:20:01 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Juha Erkkila
>Release:        3.8
>Organization:
net
>Environment:
       
        System      : OpenBSD 3.8
        Architecture: OpenBSD.i386
        Machine     : i386
>Description:

I have an atapi tape drive, that has worked fine with previous
OpenBSD releases.  It appears these are supported, at least the
atapiscsi(4) manpage tells that ``ATAPI tape drives [appear] as
st(4) devices'', so I guess I should be able to use them as such.

However, starting with OpenBSD 3.8, I can not use restore(8)
to read my backups I've made with dump(8).

>How-To-Repeat:

Have a dump tape ready.  Put it into tape drive, and try this:

$ restore -Nrv
Verify tape and initialize maps
restore: tape read error: Input/output error
$ restore -i
restore: tape read error: Input/output error

While doing this, xconsole does not show any error messages from
the kernel.  However, the drive appears to work fine when
accessed with mt(8) to rewind and forward the tape.

>Fix:

No fix, but I verified that my drive works fine with 3.7 (ramdisk
kernel), so it's unlikely a hardware problem.  Checking out relevant
changes between 3.7 and 3.8 should help in finding out the fix.

Juha

dmesg, of course:

OpenBSD 3.8-stable (GENERIC) #0: Tue Nov  1 14:38:35 EET 2005
    [hidden email]:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel Pentium III ("GenuineIntel" 686-class, 512KB L2 cache) 551 MHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,SER,MMX,FXSR,SSE
cpu0: disabling processor serial number
real mem  = 133787648 (130652K)
avail mem = 115462144 (112756K)
using 1658 buffers containing 6791168 bytes (6632K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(75) BIOS, date 08/18/99, BIOS32 rev. 0 @ 0xf0530
apm0 at bios0: Power Management spec V1.2
apm0: AC on, battery charge unknown
apm0: flags 30102 dobusy 0 doidle 1
pcibios0 at bios0: rev 2.1 @ 0xf0000/0xbe2
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xf0b60/128 (6 entries)
pcibios0: PCI Interrupt Router at 000:04:0 ("VIA VT82C586 ISA" rev 0x00)
pcibios0: PCI bus #2 is the last bus
bios0: ROM list: 0xc0000/0x8000
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "VIA VT82C691 PCI" rev 0x22
ppb0 at pci0 dev 1 function 0 "VIA VT82C598 AGP" rev 0x00
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 "ATI Rage Pro" rev 0x5c
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
pcib0 at pci0 dev 4 function 0 "VIA VT82C596A ISA" rev 0x09
pciide0 at pci0 dev 4 function 1 "VIA VT82C571 IDE" rev 0x06: ATA33, channel 0 configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0: <Maxtor 91021U2>
wd0: 16-sector PIO, LBA, 9770MB, 20010816 sectors
wd1 at pciide0 channel 0 drive 1: <ST33232A>
wd1: 16-sector PIO, LBA, 3077MB, 6303024 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
wd1(pciide0:0:1): using PIO mode 4, Ultra-DMA mode 2
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <PLEXTOR, CD-R PX-320A, 1.03> SCSI0 5/cdrom removable
atapiscsi1 at pciide0 channel 1 drive 1
scsibus1 at atapiscsi1: 2 targets
st0 at scsibus1 targ 0 lun 0: <HP, COLORADO 8GB, 2.06> SCSI2 1/sequential removable
st0: drive empty or not ready
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2
st0(pciide0:1:1): using PIO mode 4, DMA mode 2
uhci0 at pci0 dev 4 function 2 "VIA VT83C572 USB" rev 0x02: irq 5
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: VIA UHCI root hub, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
ppb1 at pci0 dev 4 function 3 "VIA VT82C596 Power" rev 0x00
ppb1: not configured by system firmware
eap0 at pci0 dev 9 function 0 "Ensoniq AudioPCI97" rev 0x06: irq 5
ac97: codec id 0x43525913 (Cirrus Logic CS4297A rev 3)
ac97: codec features headphone, 20 bit DAC, 18 bit ADC, Crystal Semi 3D
audio0 at eap0
midi0 at eap0: <AudioPCI MIDI UART>
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
midi1 at pcppi0: <PC speaker>
spkr0 at pcppi0
sysbeep0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
lm0 at isa0 port 0x290/8: W83781D
npx0 at isa0 port 0xf0/16: using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
isapnp0 at isa0 port 0x279: read port 0x20b
ep1 at isapnp0 "3Com 3C509B EtherLink III, TCM5095, PNP80F7, " port 0x210/16 irq 9: address 00:50:04:23:7a:70, utp (default utp)
biomask ed65 netmask ef65 ttymask ffe7
pctr: 686-class user-level performance counters enabled
mtrr: Pentium Pro MTRR support
dkcsum: wd0 matches BIOS drive 0x80
dkcsum: wd1 matches BIOS drive 0x81
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302


>Release-Note:
>Audit-Trail:
>Unformatted:

Reply | Threaded
Open this post in threaded view
|

Re: kernel/4611: Cannot read from an atapi tape drive

Juha Erkkila
The following reply was made to PR kernel/4611; it has been noted by GNATS.

From: Juha Erkkila <[hidden email]>
To: Kenneth R Westerback <[hidden email]>
Cc: [hidden email]
Subject: Re: kernel/4611: Cannot read from an atapi tape drive
Date: Sat, 12 Nov 2005 14:47:03 +0200

 On Thu, Nov 10, 2005 at 06:39:26PM -0500, Kenneth R Westerback wrote:
 > Then please try various points along the 3.7 to 3.8 path. You are
 > the first person I've ever encountered who has an atapi tape drive.
 > Certainly no developer admits to having one. If you can narrow it
 > down to a particular change I might be able to help.
 
 The drive still works with 3.7-current from 2005-06-24, but not from
 2005-06-25, so the commit that broke it must be this one:
 
 http://www.openbsd.org/cgi-bin/cvsweb/src/sys/scsi/st.c#rev1.48
 
 > Alternatively, running a kernel with the options
 >
 > option SCSIDEBUG
 > option SCSIDEBUG_LEVEL=0xf0
 > option SCSIDEBUG_BUSES=0x2
 > option SCSIDEBUG_TARGETS=0x1
 > option SCSIDEBUG_LUNS=0x1
 >
 > and sending me the output produced when the failure occurs would
 > help.
 
 After putting these options into a kernel built from 2005-06-25 sources,
 the output I get from the kernel as I do ``restore -i'' is this:
 
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): open: dev=0xe00 (unit 0 (of 4))
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_cmd
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_get_xs
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): calling pool_get
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): returning
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_done
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): command: 0,0,0,0,0,0-[0 bytes]
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): back in cmd()
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): sc_err1,err = 0x0
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_free_xs
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): calling private start()
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): ststart
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): mounting
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_cmd
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_get_xs
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): calling pool_get
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): returning
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_done
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): command: 1b,0,0,0,1,0-[0 bytes]
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): back in cmd()
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): sc_err1,err = 0x0
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_free_xs
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): calling private start()
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): ststart
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_cmd
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_get_xs
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): calling pool_get
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): returning
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_done
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): command: 0,0,0,0,0,0-[0 bytes]
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): back in cmd()
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): sc_err1,err = 0x0
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_free_xs
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): calling private start()
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): ststart
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_cmd
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_get_xs
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): calling pool_get
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): returning
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_done
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): command: 5a,0,0,0,0,0,0,0,ff,0-[255 bytes]
 Nov 12 01:23:58 purplesea /bsd: ------------------------------
 Nov 12 01:23:58 purplesea /bsd: 000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 Nov 12 01:23:58 purplesea /bsd: 016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 Nov 12 01:23:58 purplesea /bsd: 032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 Nov 12 01:23:58 purplesea /bsd: 048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 Nov 12 01:23:58 purplesea /bsd: ------------------------------
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): back in cmd()
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): sc_err1,err = 0x1
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): code:0x70 valid:0 key:0x5 ili:0 eom:0 fmark:0 extra:16
 Nov 12 01:23:58 purplesea /bsd: ------------------------------
 Nov 12 01:23:58 purplesea /bsd: 000: 70 00 05 00 00 00 00 10 00 00 00 00 20 00 00 00
 Nov 12 01:23:58 purplesea /bsd: 016: 00 00 01 03 00 00 00 00 00 00 00 00 00 00 00 00
 Nov 12 01:23:58 purplesea /bsd: ------------------------------
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): calling private err_handler()
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_interpret_sense returned 22
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_free_xs
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): calling private start()
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): ststart
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): scsi_mode_sense_big: page 0, error = 22
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): open complete
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): ststrategy: 32768 bytes @ blk 0
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): ststart
 Nov 12 01:23:58 purplesea /bsd: st0(atapiscsi1:0:0): closing
 
 
 The following patch fixes the problem for me (after applying, both dump
 and restore work fine):
 
 Index: scsi_base.c
 ===================================================================
 RCS file: /cvs/src/sys/scsi/scsi_base.c,v
 retrieving revision 1.87
 diff -u -p -r1.87 scsi_base.c
 --- scsi_base.c 29 Aug 2005 00:41:44 -0000 1.87
 +++ scsi_base.c 12 Nov 2005 09:36:48 -0000
 @@ -492,23 +492,21 @@ scsi_do_mode_sense(sc_link, page, buf, p
  if (big)
  *big = 0;
 
 - if ((sc_link->flags & SDEV_ATAPI) == 0) {
 - /*
 - * Try 6 byte mode sense request first. Some devices don't
 - * distinguish between 6 and 10 byte MODE SENSE commands,
 - * returning 6 byte data for 10 byte requests. Don't bother
 - * with SMS_DBD. Check returned data length to ensure that
 - * at least a header (3 additional bytes) is returned.
 - */
 - error = scsi_mode_sense(sc_link, 0, page, &buf->headers.hdr,
 -    sizeof(*buf), flags, 20000);
 - if (error == 0 && buf->headers.hdr.data_length > 2) {
 - *page_data = scsi_mode_sense_page(&buf->headers.hdr,
 -    page_len);
 - offset = sizeof(struct scsi_mode_header);
 - blk_desc_len = buf->headers.hdr.blk_desc_len;
 - goto blk_desc;
 - }
 + /*
 + * Try 6 byte mode sense request first. Some devices don't distinguish
 + * between 6 and 10 byte MODE SENSE commands, returning 6 byte data for
 + * 10 byte requests. Don't bother with SMS_DBD. Check returned data
 + * length to ensure that at least a header (3 additional bytes) is
 + * returned.
 + */
 + error = scsi_mode_sense(sc_link, 0, page, &buf->headers.hdr,
 +    sizeof(*buf), flags, 20000);
 + if (error == 0 && buf->headers.hdr.data_length > 2) {
 + *page_data = scsi_mode_sense_page(&buf->headers.hdr,
 +    page_len);
 + offset = sizeof(struct scsi_mode_header);
 + blk_desc_len = buf->headers.hdr.blk_desc_len;
 + goto blk_desc;
  }
 
  /*