On Tue, 13 Jan 2004, Peter Osterlund wrote:
On Tue, 13 Jan 2004, Doug Holland wrote:
When I run dmesg, I get thousands of these error messages.
ide-cd: write_intr decode_status bad hdc: command error: status=0x51 { DriveReady SeekComplete Error } hdc: command error: error=0x54 end_request: I/O error, dev hdc, sector 5736 ide-cd: write_intr decode_status bad hdc: command error: status=0x51 { DriveReady SeekComplete Error } hdc: command error: error=0x54 end_request: I/O error, dev hdc, sector 5744 ide-cd: write_intr decode_status bad hdc: command error: status=0x51 { DriveReady SeekComplete Error } hdc: command error: error=0x54 ... Does anybody here have any ideas on how to get rid of these errors?
I don't know yet, but I have the same problem on one of my IDE drives (Sony CRX175A). I only have a problem when using native ide support in a 2.6 kernel. In 2.4 the drive works with both native ide and scsi emulation, and it also works with scsi emulation in 2.6.
I have another IDE drive (HP 8100) on the same ide channel which works perfectly with native ide in 2.6, so it can't be that packet writing using native ide is completely broken in 2.6.
I've found that the errors are caused by the seek commands generated by ide-cd. Increasing IDECD_SEEK_THRESHOLD to a very large value works for me (see patch below). With the standard threshold I get: ... cdrom_transfer_packet_command: 28 00 00 04 33 80 00 00 1e 00 00 00 cdrom_transfer_packet_command: 2b 00 00 00 01 27 00 00 00 00 00 00 cdrom_transfer_packet_command: 28 00 00 00 01 27 00 00 19 00 00 00 cdrom_transfer_packet_command: 28 00 00 00 01 07 00 00 0a 00 00 00 cdrom_transfer_packet_command: 28 00 00 00 00 13 00 00 0d 00 00 00 cdrom_transfer_packet_command: 28 00 00 00 00 00 00 00 10 00 00 00 cdrom_transfer_packet_command: 2a 00 00 00 00 00 00 00 20 00 00 00 cdrom_transfer_packet_command: 2b 00 00 00 01 00 00 00 00 00 00 00 ide-cd: media marked write protected hdc: command error: status=0x51 { DriveReady SeekComplete Error } hdc: command error: error=0x54 end_request: I/O error, dev hdc, sector 1024 cdrom_transfer_packet_command: 03 00 00 00 12 00 00 00 00 00 00 00 end_request: I/O error, dev hdc, sector 1032 ... With a bigger threshold, I could successfully write >100MB to a CDRW. Does anyone know what the seek commands are good for? --- linux/drivers/ide/ide-cd.c.old 2004-03-23 00:08:39.000000000 +0100 +++ linux/drivers/ide/ide-cd.c 2004-03-23 00:03:20.000000000 +0100 @@ -915,6 +915,7 @@ int cmd_len; struct cdrom_info *info = drive->driver_data; ide_startstop_t startstop; + int i; if (CDROM_CONFIG_FLAGS(drive)->drq_interrupt) { /* Here we should have been called after receiving an interrupt @@ -939,6 +940,10 @@ cmd_len = ATAPI_MIN_CDB_BYTES; /* Send the command to the device. */ + printk("cdrom_transfer_packet_command:"); + for (i = 0; i < cmd_len; i++) + printk(" %02x", rq->cmd[i]); + printk("\n"); HWIF(drive)->atapi_output_bytes(drive, rq->cmd, cmd_len); /* Start the DMA if need be */ @@ -1267,7 +1272,7 @@ } -#define IDECD_SEEK_THRESHOLD (1000) /* 1000 blocks */ +#define IDECD_SEEK_THRESHOLD (10000000) /* 1000 blocks */ #define IDECD_SEEK_TIMER (5 * WAIT_MIN_SLEEP) /* 100 ms */ #define IDECD_SEEK_TIMEOUT (2 * WAIT_CMD) /* 20 sec */ -- Peter Osterlund - petero2@telia.com http://w1.894.telia.com/~u89404340