Bug 54517

Summary: ide-tape does not work with DMA on
Product: [Retired] Red Hat Linux Reporter: Pete Zaitcev <zaitcev>
Component: kernelAssignee: Pete Zaitcev <zaitcev>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: afom_m, dan, john_hull, jth, redhat-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-08-06 21:50:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pete Zaitcev 2001-10-10 20:29:02 UTC
ide-tape does not work correctly on majority of tapes with DMA on.
There is even a report of a system hang (hidden inside Bug #38404).
See also Bug #36628 - in case of no hang the data are still
incorrect.

The issue appeared in kernel 2.4.

Comment 1 Kent 2001-10-25 00:59:40 UTC
In kernel-2.4.3 my TR5 ide-tape worked fine.
After upgrading to kernel-2.4.9-6 it no longer does.

Returns I/O errors when access attempted... even just a rewind or retension.

The following contains the ide-tape messages from the logs

ide-tape: Dumping ATAPI Identify Device tape parameters
ide-tape: Protocol Type: <6>ATAPI
ide-tape: Device Type: 1 - <6>Streaming Tape Device
ide-tape: Removable: Yes
ide-tape: Command Packet DRQ Type: <6>Accelerated DRQ
ide-tape: Command Packet Size: <6>12 bytes
ide-tape: Model: Seagate STT20000A
ide-tape: Firmware Revision: 8A51
ide-tape: Serial Number: 
ide-tape: Write buffer size: 372736 bytes
ide-tape: DMA: Yes
ide-tape: LBA: Yes
ide-tape: IORDY can be disabled: Yes
ide-tape: IORDY supported: Yes
ide-tape: ATAPI overlap supported: No
ide-tape: PIO Cycle Timing Category: 2
ide-tape: DMA Cycle Timing Category: 2
ide-tape: Single Word DMA supported modes: <6>0 <6>1 <6>2 <6>(active) <6>
ide-tape: Multi Word DMA supported modes: <6>0 <6>1 <6>2 <6>(active) <6>
ide-tape: Enhanced PIO Modes: Mode 3
ide-tape: Minimum Multi-word DMA cycle per word: <6>120 ns
ide-tape: Manufacturer's Recommended Multi-word cycle: <6>120 ns
ide-tape: Minimum PIO cycle without IORDY: <6>120 ns
ide-tape: Minimum PIO cycle with IORDY: <6>120 ns
ide-tape: hdd <-> ht0: Seagate STT20000A rev 8A51
ide-tape: Dumping the results of the MODE SENSE packet command
ide-tape: Mode Parameter Header:
ide-tape: Mode Data Length - 23
ide-tape: Medium Type - 183
ide-tape: Device Specific Parameter - 16
ide-tape: Block Descriptor Length - 0
ide-tape: Capabilities and Mechanical Status Page:
ide-tape: Page code - 42
ide-tape: Page length - 18
ide-tape: Read only - No
ide-tape: Supports reverse space - Yes
ide-tape: Supports erase initiated formatting - No
ide-tape: Supports QFA two Partition format - Yes
ide-tape: Supports locking the medium - No
ide-tape: The volume is currently locked - No
ide-tape: The device defaults in the prevent state - No
ide-tape: Supports ejecting the medium - No
ide-tape: Supports error correction - Yes
ide-tape: Supports data compression - No
ide-tape: Supports 512 bytes block size - Yes
ide-tape: Supports 1024 bytes block size - No
ide-tape: Supports 32768 bytes block size / Restricted byte count for PIO
transfers - No
ide-tape: Maximum supported speed in KBps - 1000
ide-tape: Continuous transfer limits in blocks - 108
ide-tape: Current speed in KBps - 1000
ide-tape: Buffer size - 331776
ide-tape: Adjusted block size - 512
ide-tape: hdd <-> ht0: 1000KBps, 6*54kB buffer, 9720kB pipeline, 110ms tDSC, DMA
ide-tape: Reached idetape_chrdev_open
ide-tape: Reached idetape_read_position
ide-tape: Reached idetape_read_position_callback
ide-tape: Reached idetape_read_position
ide-tape: Reached idetape_read_position_callback
ide-tape: Reached idetape_read_position_callback
ide-tape: Reached idetape_read_position_callback
ide-tape: Reached idetape_chrdev_open
ide-tape: Reached idetape_read_position
ide-tape: Reached idetape_read_position_callback
ide-tape: Reached idetape_read_position
ide-tape: Reached idetape_read_position_callback
ide-tape: ht0: I/O error, pc =  1, key =  3, asc = 30, ascq =  0
ide-tape: Reached idetape_chrdev_open
ide-tape: Reached idetape_read_position
ide-tape: Reached idetape_read_position_callback
ide-tape: Reached idetape_read_position
ide-tape: Reached idetape_read_position_callback
ide-tape: ht0: I/O error, pc =  1, key =  3, asc = 30, ascq =  0
ide-tape: Reached idetape_chrdev_open
ide-tape: Reached idetape_read_position
ide-tape: ht0: I/O error, pc = 10, key =  3, asc = 30, ascq =  0
ide-tape: ht0: I/O error, pc = 34, key =  3, asc = 30, ascq =  0
ide-tape: Reached idetape_read_position_callback
ide-tape: ht0: I/O error, pc =  0, key =  3, asc = 30, ascq =  0
ide-tape: ht0: drive not ready


Comment 2 Pete Zaitcev 2001-10-25 18:29:24 UTC
Try to do "hdparm -d0 /dev/ht0", please. Should work.


Comment 3 Kent 2001-10-25 20:08:57 UTC
Tried hdparm -d0 /dev/ht0 

# hdparm -d0 /dev/ht0
/dev/ht0 not supported by hdparm

However, I instead thought to use the associated hd device.
# hdparm -d0 /dev/hdd
/dev/hdd:
 setting using_dma to 0 (off)
 using_dma    =  0 (off)

But the problem still persists.  After the first access (like mt -f /dev/nht0
retension) it will return device busy until the machine is rebooted.  Reloading
the ide-tape module and re hdparm'ing it doesn't help.

Hmmm... just tried the following procedure
1) reboot
2) insmod ide-tape
3) hdparm -d0 /dev/hdd
4) cat /dev/urandom > /dev/ht0

and that seemed to run ok. However, after the tape rewinded on close, the device
now reports

# mt -f /dev/nht0 status
/dev/nht0: Device or resource busy


Comment 4 Dan Ryan 2002-01-14 20:52:39 UTC
I've been seeing spotty behaviour of my tape since going to 2.4-9, prior (base 
release of RH 7.1) it seemed fine. Now, its been getting harder to do backups 
and I'm not confident of the "saving" of my data. I use the "taper" tool. This 
weekend, as with the last week backup - ended up with a hung kernel and forced 
reboot. This bug seems to articulate the issues I'm having and the H/W seems 
identical.

Here's my output from /var/log/messages for the last session. Questions, feel 
free to e-mail me. I really must get this fixed - I need to do my backups!

Jan 12 13:00:00 vile kernel: ide-tape: Dumping ATAPI Identify Device tape 
parameters
Jan 12 13:00:00 vile kernel: ide-tape: Protocol Type: <6>ATAPI
Jan 12 13:00:00 vile kernel: ide-tape: Device Type: 1 - <6>Streaming Tape Device
Jan 12 13:00:00 vile kernel: ide-tape: Removable: Yes
Jan 12 13:00:00 vile kernel: ide-tape: Command Packet DRQ Type: <6>Accelerated 
DRQ
Jan 12 13:00:00 vile kernel: ide-tape: Command Packet Size: <6>12 bytes
Jan 12 13:00:00 vile kernel: ide-tape: Model: Seagate STT20000A
Jan 12 13:00:00 vile kernel: ide-tape: Firmware Revision: 8A51
Jan 12 13:00:00 vile kernel: ide-tape: Serial Number:  
Jan 12 13:00:00 vile kernel: ide-tape: Write buffer size: 372736 bytes
Jan 12 13:00:00 vile kernel: ide-tape: DMA: Yes
Jan 12 13:00:00 vile kernel: ide-tape: LBA: Yes
Jan 12 13:00:00 vile kernel: ide-tape: IORDY can be disabled: Yes
Jan 12 13:00:00 vile kernel: ide-tape: IORDY supported: Yes
Jan 12 13:00:00 vile kernel: ide-tape: ATAPI overlap supported: No
Jan 12 13:00:00 vile kernel: ide-tape: PIO Cycle Timing Category: 2
Jan 12 13:00:00 vile kernel: ide-tape: DMA Cycle Timing Category: 2
Jan 12 13:00:00 vile kernel: ide-tape: Single Word DMA supported modes: <6>0 
<6>1 <6>2 <6>(active) <6>
Jan 12 13:00:00 vile kernel: ide-tape: Multi Word DMA supported modes: <6>0 
<6>1 <6>2 <6>(active) <6>
Jan 12 13:00:00 vile kernel: ide-tape: Enhanced PIO Modes: Mode 3
Jan 12 13:00:00 vile kernel: ide-tape: Minimum Multi-word DMA cycle per word: 
<6>120 ns
Jan 12 13:00:00 vile kernel: ide-tape: Manufacturer's Recommended Multi-word 
cycle: <6>120 ns
Jan 12 13:00:00 vile kernel: ide-tape: Minimum PIO cycle without IORDY: <6>120 
ns
Jan 12 13:00:00 vile kernel: ide-tape: Minimum PIO cycle with IORDY: <6>120 ns
Jan 12 13:00:00 vile kernel: ide-tape: hdd <-> ht0: Seagate STT20000A rev 8A51
Jan 12 13:00:00 vile kernel: ide-tape: Dumping the results of the MODE SENSE 
packet command
Jan 12 13:00:00 vile kernel: ide-tape: Mode Parameter Header:
Jan 12 13:00:00 vile kernel: ide-tape: Mode Data Length - 23
Jan 12 13:00:00 vile kernel: ide-tape: Medium Type - 183
Jan 12 13:00:00 vile kernel: ide-tape: Device Specific Parameter - 144
Jan 12 13:00:00 vile kernel: ide-tape: Block Descriptor Length - 0 
Jan 12 13:00:00 vile kernel: ide-tape: Capabilities and Mechanical Status Page:
Jan 12 13:00:00 vile kernel: ide-tape: Page code - 42
Jan 12 13:00:00 vile kernel: ide-tape: Page length - 18
Jan 12 13:00:00 vile kernel: ide-tape: Read only - Yes
Jan 12 13:00:00 vile kernel: ide-tape: Supports reverse space - Yes
Jan 12 13:00:00 vile kernel: ide-tape: Supports erase initiated formatting - No
Jan 12 13:00:00 vile kernel: ide-tape: Supports QFA two Partition format - Yes
Jan 12 13:00:00 vile kernel: ide-tape: Supports locking the medium - No
Jan 12 13:00:00 vile kernel: ide-tape: The volume is currently locked - No
Jan 12 13:00:00 vile kernel: ide-tape: The device defaults in the prevent 
state - No
Jan 12 13:00:00 vile kernel: ide-tape: Supports ejecting the medium - No
Jan 12 13:00:00 vile kernel: ide-tape: Supports error correction - Yes
Jan 12 13:00:00 vile kernel: ide-tape: Supports data compression - No
Jan 12 13:00:00 vile kernel: ide-tape: Supports 512 bytes block size - Yes
Jan 12 13:00:00 vile kernel: ide-tape: Supports 1024 bytes block size - No
Jan 12 13:00:00 vile kernel: ide-tape: Supports 32768 bytes block size / 
Restricted byte count for PIO t
ransfers - No
Jan 12 13:00:00 vile kernel: ide-tape: Maximum supported speed in KBps - 1000
Jan 12 13:00:00 vile kernel: ide-tape: Continuous transfer limits in blocks - 
108
Jan 12 13:00:00 vile kernel: ide-tape: Current speed in KBps - 1000
Jan 12 13:00:00 vile kernel: ide-tape: Buffer size - 331776
Jan 12 13:00:00 vile kernel: ide-tape: Adjusted block size - 512
Jan 12 13:00:00 vile kernel: ide-tape: hdd <-> ht0: 1000KBps, 6*54kB buffer, 
9720kB pipeline, 110ms tDSC
, DMA
Jan 12 13:00:00 vile kernel: ide-tape: Reached idetape_chrdev_open
Jan 12 13:00:38 vile last message repeated 3 times
an 12 13:00:42 vile kernel: ide-tape: Reached idetape_chrdev_open
Jan 12 13:00:44 vile kernel: ide-tape: ht0: I/O error, pc = 19, key =  7, asc = 
27, ascq =  0
Jan 12 13:01:00 vile kernel: ide-tape: Reached idetape_chrdev_open 
Jan 12 13:01:01 vile kernel: ide-tape: ht0: I/O error, pc =  a, key =  7, asc = 
27, ascq =  0
Jan 12 13:01:01 vile kernel: ide-tape: ht0: I/O error, pc =  a, key =  7, asc = 
27, ascq =  0

-- At this point the taper command hangs, and no work is done, intervention 
results (like kill -9 the process and restarting the operation) results in the 
further I/O errors and the kernel hanging.

-d

Comment 5 Dan Ryan 2002-01-14 22:04:04 UTC
One more item - I just read 56576 - I'm not running ext3 or RAID (just 2 other 
IDE based HDDs - ext2 fs') but before the kernel up ended last week, the disks 
reported bad things going on. Here's that messages output...

Jan  5 13:00:00 vile kernel: ide-tape: Supports 1024 bytes block size - No
Jan  5 13:00:00 vile kernel: ide-tape: Supports 32768 bytes block size / 
Restricted byte count for PIO t
ransfers - No
Jan  5 13:00:00 vile kernel: ide-tape: Maximum supported speed in KBps - 1000
Jan  5 13:00:00 vile kernel: ide-tape: Continuous transfer limits in blocks - 
108
Jan  5 13:00:00 vile kernel: ide-tape: Current speed in KBps - 1000
Jan  5 13:00:00 vile kernel: ide-tape: Buffer size - 331776
Jan  5 13:00:00 vile kernel: ide-tape: Adjusted block size - 512
Jan  5 13:00:00 vile kernel: ide-tape: hdd <-> ht0: 1000KBps, 6*54kB buffer, 
9720kB pipeline, 110ms tDSC
, DMA
Jan  5 13:00:00 vile kernel: ide-tape: Reached idetape_chrdev_open
Jan  5 13:00:31 vile last message repeated 3 times
Jan  5 13:01:42 vile last message repeated 2 times
Jan  5 13:02:54 vile kernel: hdd: timeout waiting for DMA
Jan  5 13:02:54 vile kernel: ide_dmaproc: chipset supported ide_dma_timeout 
func only: 14
Jan  5 13:02:54 vile kernel: hdd: status timeout: status=0xd0 { Busy }
Jan  5 13:02:54 vile kernel: hdd: drive not ready for command
Jan  5 13:02:54 vile kernel: hdd: ATAPI reset complete
Jan  5 13:02:54 vile kernel: ide-tape: ht0: I/O error, pc =  a, key =  2, asc 
=  4, ascq =  1
Jan  5 13:02:57 vile last message repeated 181 times
Jan  5 13:02:57 vile kernel: ide-tape: ht0: I/O error, pc = 10, key =  2, asc 
=  4, ascq =  1
Jan  5 13:02:57 vile kernel: ide-tape: Couldn't write a filemark
Jan  5 13:02:57 vile kernel: ide-tape: ht0: I/O error, pc = 10, key =  2, asc 
=  4, ascq =  1


The next day right after the .daily job runs - this starts, it didn't get any 
better...

Jan  6 04:04:33 vile kernel: 6>03:05: rw=0, want=84215048, limit=8924076
Jan  6 04:04:33 vile kernel: EXT2-fs error (device ide0(3,5)): ext2_check_page: 
bad entry in directory #
277360: unaligned directory entry - offset=6025216, inode=3629477077, 
rec_len=29763, name_len=159
Jan  6 04:04:33 vile kernel: attempt to access beyond end of device
Jan  6 04:04:33 vile kernel: 03:05: rw=0, want=84215048, limit=8924076
Jan  6 04:04:33 vile kernel: EXT2-fs error (device ide0(3,5)): ext2_check_page: 
bad entry in directory #
277360: unaligned directory entry - offset=6029312, inode=215517292, 
rec_len=61007, name_len=29
Jan  6 04:04:33 vile kernel: attempt to access beyond end of device
Jan  6 04:04:33 vile kernel: 03:05: rw=0, want=84215048, limit=8924076
Jan  6 04:04:33 vile kernel: EXT2-fs error (device ide0(3,5)): ext2_check_page: 
bad entry in directory #
277360: unaligned directory entry - offset=6033408, inode=267566604, 
rec_len=39146, name_len=215

- A reboot, fsck of "/" fixed everything up - but somthing's look'n a miss...



Comment 6 Pete Zaitcev 2002-02-13 19:29:51 UTC
Been communicating with Dan in private e-mail.
It seems possible that he expirienced a dust/debree
contamination of the tape drive.

Since ide-tape does NOT plug into SCSI layer, it does not
translate KEY/ASC/ASCQ codes into readable messages
(message bodies are located in SCSI layer).


Comment 7 Dan Ryan 2002-02-13 19:33:43 UTC
Turning off DMA does the trick as well... Looks like stay clean and no DMA...

Comment 8 Pete Zaitcev 2002-02-26 18:57:05 UTC
*** Bug 60311 has been marked as a duplicate of this bug. ***

Comment 9 Joergen Thomsen 2002-03-11 20:51:11 UTC
Out of the box Redhat 7.2 installation: the hdparm -d0 /dev/hda solution does not work. The 
system boots from a SCSI disk. There are no other IDE devices in the system but a HP Colorado 
5GB as master on the primary IDE controller. The drive does not at all move upon a tar -tf /dev/ht0 
command, but emits the error message mentioned by others in the log (asc=2c). 
mt -f 
/dev/ht0 status, rewind and retension commands do work as well as the 
tar -cf /dev/ht0 ..... 
command


Comment 10 Pete Zaitcev 2002-03-11 22:34:38 UTC
The ASC 2C on HP Colorado is covered with Bug #36628 and has
nothing to do with IDE DMA. So, it's not surprising that hdparm -d0
did not help, because it was irrelevant.

The problem was fixed some time ago. Make sure you are running
2.4.9-21, 2.4.9-31, other currently available update for 2.4.9,
or a Rawhide kernel.


Comment 11 Joergen Thomsen 2002-03-12 22:26:17 UTC
You are wrong about the DMA. I upgraded everything including kernel 2.4.9-31. The situation has 
changed and improved, but is not perfect. 
With DMA on the drive reports a lot of errors:
ide-
tape: ht0: I/O error, pc=a, key=9, asc=3, ascq=c
and a tar -cf /dev/ht0 dir
does not 
succeed even if the driver itself tries to set DMA off according to the messages in 
/var/log/messages
With DMA off I am in most cases able to do succesful backups with tar, 
but without using the -W option (verify) as it produces a lot of errors. A separate verification run with 
tar -d does succeed, however.
It seems that using the tar -b 64 option for a 32 KB buffer is 
needed (32 KB deduced from the ide-tape: hda <-> ht0 message ...16*32KB buffer ... in 
/var/log/messages). Otherwise 'unexepected EOF found' messages may appear.


Comment 12 Joshua Giles 2002-03-28 20:27:40 UTC
This bug still occurs in Hampton beta 3

Comment 13 Michael K. Johnson 2002-04-15 19:10:16 UTC
Which of the reports here from Dell are on the PE500?


Comment 14 Joshua Giles 2002-04-23 22:03:40 UTC
The 3-28 report originated from a PE500SC

Comment 15 Michael K. Johnson 2002-08-06 21:50:07 UTC
PE500SC is separate, it's #52452 -- that's a completely different
problem.

While we probably have to continue to disable DMA for tape drives,
it also seems that using ide-scsi and the st device is the best way
to use ide tapes.  This is likely to be the resolution to this bug
report: if you still have problems, then use ide-scsi.  If that does
not solve it, open a new bug report specifically for your hardware,
like #52452.

Comment 16 Pete Zaitcev 2002-08-07 19:27:22 UTC
Closing because 1. we now have automatic disabling in initscripts
rc.system (not in kernel!), 2. to stop confusing people into
thinking anything can be done generically for all permutations
of tapes and IDE chipsets (jth@ had this illusion, see above).