Re: ide-cd problem (2.0.xx)

Gadi Oxman (gadio@netvision.net.il)
Sat, 14 Jun 1997 01:52:24 +0400 (IDT)


On Fri, 13 Jun 1997, Gabriel Paubert wrote:

>
> Hello,
>
> I've a problem with my ATAPI CDROM. When installing Linux from CD
> (S.u.S.E), it is _very_ slow when unpacking large files. And
> /var/log/messages is full of the following:
>
> May 7 19:09:10 pcgp kernel: hdb: irq timeout: status=0x58
> May 7 19:09:10 pcgp kernel: hdb: ATAPI reset complete
> May 7 19:09:21 pcgp kernel: hdb: irq timeout: status=0x58
> May 7 19:09:21 pcgp kernel: hdb: ATAPI reset complete
> May 7 19:09:31 pcgp kernel: hdb: irq timeout: status=0x58
> May 7 19:09:31 pcgp kernel: hdb: ATAPI reset complete
> May 7 19:09:41 pcgp kernel: hdb: irq timeout: status=0x58
> May 7 19:09:41 pcgp kernel: hdb: ATAPI reset complete
>
> it seems I get a few CDROM accesses then something goes wrong and ends in
> a timeout after 10 seconds or so. And throughput is about 40 minutes for
> 30 megs :-(, measured when installing XFree sources. When installing small
> packages (with S.u.S.E.'s YaST) it runs fine, and I'm quite sure
> it's correctly cabled.
>
> The following is my configuration from hdparm -i:
>
> /dev/hda:
>
> Model=ST51080A, FwRev=09.09.01, SerialNo=EAB64847
> Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
> RawCHS=2100/16/63, TrkSize=65535, SectSize=987, ECCbytes=4
> BuffType=3(DualPortCache), BuffSize=256kB, MaxMultSect=32, MultSect=off
> DblWordIO=no, maxPIO=2(fast), DMA=yes, maxDMA=0(slow)
> CurCHS=2100/16/63, CurSects=2116800, LBA=yes, LBAsects=2116800
> tDMA={min:120,rec:120}, DMA modes: sword0 sword1 sword2 *mword0 mword1 mword2
> IORDY=yes, tPIO={min:180,w/IORDY:120}, PIO modes: mode3 mode4
>
> /dev/hdb:
>
> Model=GCD-R580B, FwRev=1.05, SerialNo=
> Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }
> RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
> BuffType=0(?), BuffSize=4kB, MaxMultSect=0
> DblWordIO=no, maxPIO=2(fast), DMA=yes, maxDMA=2(fast)
> (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
> tDMA={min:150,rec:200}, DMA modes: *sword0 *sword1 *sword2 *mword0 *mword1
> IORDY=on/off, tPIO={min:180,w/IORDY:180}, PIO modes: mode3
>
> This has happened with 2.0.18, 2.0.28 and 2.0.29.
>
> Any idea ? I'm not in a hurry, but installations are truly slow.
>
> Brief hardware description (I can give more details if necessary):
> P-133 32 Mb, Intel Natoma/Triton II chipset, ATI Mach64, Ethernet 3Com 3C595,
> SCSI AH152x+1Gb IBM DPES31080.
>
> Gabriel.

The following patch should work around the problem.

Gadi

diff -u --recursive --new-file v2.0.18/linux/drivers/block/ide-cd.c linux/drivers/block/ide-cd.c
--- v2.0.18/linux/drivers/block/ide-cd.c Thu Aug 1 16:36:31 1996
+++ linux/drivers/block/ide-cd.c Thu Dec 19 23:34:47 1996
@@ -1115,6 +1115,11 @@
/* Number of sectors to transfer. */
nsect = rq->nr_sectors;

+#if !STANDARD_ATAPI
+ if (nsect > drive->cdrom_info.max_sectors)
+ nsect = drive->cdrom_info.max_sectors;
+#endif /* not STANDARD_ATAPI */
+
/* Starting sector. */
sector = rq->sector;

@@ -2627,6 +2632,8 @@
CDROM_CONFIG_FLAGS (drive)->drq_interrupt = 0;

#if ! STANDARD_ATAPI
+ drive->cdrom_info.max_sectors = 256;
+
CDROM_CONFIG_FLAGS (drive)->old_readcd = 0;
CDROM_CONFIG_FLAGS (drive)->toctracks_as_bcd = 0;
CDROM_CONFIG_FLAGS (drive)->tocaddr_as_bcd = 0;
@@ -2675,6 +2682,9 @@
/* uses CD in slot 0 when value is set to 3 */
CDROM_STATE_FLAGS (drive)->sanyo_slot = 3;
}
+
+ else if (strcmp (drive->id->model, "GCD-R580B") == 0)
+ drive->cdrom_info.max_sectors = 124;

}
#endif /* not STANDARD_ATAPI */
diff -u --recursive --new-file v2.0.18/linux/drivers/block/ide.h linux/drivers/block/ide.h
--- v2.0.18/linux/drivers/block/ide.h Sat Aug 31 20:10:16 1996
+++ linux/drivers/block/ide.h Thu Dec 19 23:33:57 1996
@@ -282,6 +282,8 @@
/* The result of the last successful request sense command
on this device. */
struct atapi_request_sense sense_data;
+
+ int max_sectors;
};

#endif /* CONFIG_BLK_DEV_IDECD */