Bug 15198

Summary: CD changer autodetection doesn't work, causing SCSI timeout [PATCH]
Product: Base System Reporter: Don Lewis <truckman>
Component: kernAssignee: Kenneth D. Merry <ken>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Don Lewis freebsd_committer freebsd_triage 1999-12-01 03:30:01 UTC
A SCSI bus timeout occurs when the driver attempts to access the
second slot in the CD changer (cd2).  If the cdX devices are listed
in /etc/fstab, the machine totally wedges.  If no attempt is made
to mount the cdX devices, the machine is otherwise usable.

Copyright (c) 1992-1999 FreeBSD Inc.
Copyright (c) 1982, 1986, 1989, 1991, 1993
	The Regents of the University of California. All rights reserved.
FreeBSD 3.3-STABLE #3: Sun Nov 28 08:45:20 PST 1999
    gdonl@gvpc85.gv.tsc.tdk.com:/usr/src/sys/compile/TSC_INTERNAL
Timecounter "i8254"  frequency 1193182 Hz
Timecounter "TSC"  frequency 265910120 Hz
CPU: Pentium II (265.91-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x633  Stepping = 3
  Features=0x80f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,MMX>
real memory  = 67108864 (65536K bytes)
avail memory = 62078976 (60624K bytes)
Preloaded elf kernel "kernel" at 0xc030a000.
Preloaded userconfig_script "/boot/kernel.conf" at 0xc030a09c.
Pentium Pro MTRR support enabled
Probing for devices on PCI bus 0:
chip0: <Intel 82440FX (Natoma) PCI and memory controller> rev 0x02 on pci0.0.0
chip1: <Intel 82371SB PCI to ISA bridge> rev 0x01 on pci0.7.0
ide_pci0: <Intel PIIX3 Bus-master IDE controller> rev 0x00 on pci0.7.1
vga0: <Matrox MGA 2164W graphics accelerator> rev 0x00 int a irq 10 on pci0.11.0
xl0: <3Com 3c905-TX Fast Etherlink XL> rev 0x00 int a irq 9 on pci0.15.0
xl0: Ethernet address: 00:60:08:31:f9:87
xl0: autoneg complete, link status good (half-duplex, 10Mbps)
ahc0: <Adaptec 2940 Ultra SCSI adapter> rev 0x00 int a irq 10 on pci0.19.0
ahc0: aic7880 Wide Channel A, SCSI Id=7, 16/255 SCBs
Probing for devices on the ISA bus:
sc0 on isa
sc0: VGA color <16 virtual consoles, flags=0x0>
atkbdc0 at 0x60-0x6f on motherboard
atkbd0 irq 1 on isa
psm0 not found
sio0 at 0x3f8-0x3ff irq 4 flags 0x10 on isa
sio0: type 16550A
sio1: configured irq 3 not in bitmap of probed irqs 0
sio1 not found at 0x2f8
fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
fdc0: FIFO enabled, 8 bytes threshold
fd0: 1.44MB 3.5in
wdc0 not found at 0x1f0
wdc1 not found at 0x170
ppc0 at 0x378 irq 7 on isa
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
lpt0: <generic printer> on ppbus 0
lpt0: Interrupt-driven port
ppi0: <generic parallel i/o> on ppbus 0
plip0: <PLIP network interface> on ppbus 0
aic0 at 0x340-0x35f irq 11 on isa
aic0: aic6360, disconnection
vga0 at 0x3c0-0x3df maddr 0xa0000 msize 131072 on isa
npx0 on motherboard
npx0: INT 16 interface
Waiting 2 seconds for SCSI devices to settle
sa0 at aic0 bus 0 target 5 lun 0
sa0: <HP C1557A UL01> Removable Sequential Access SCSI-2 device 
sa0: 5.000MB/s transfers (5.000MHz, offset 8)
pass4 at aic0 bus 0 target 5 lun 1
pass4: <HP C1557A UL01> Removable Changer SCSI-2 device 
pass4: 5.000MB/s transfers (5.000MHz, offset 8)
da0 at ahc0 bus 0 target 0 lun 0
da0: <SEAGATE ST34371N 0484> Fixed Direct Access SCSI-2 device 
da0: 20.000MB/s transfers (20.000MHz, offset 15), Tagged Queueing Enabled
da0: 4148MB (8496884 512 byte sectors: 255H 63S/T 528C)
changing root device to da0s1a
cd0 at ahc0 bus 0 target 5 lun 0
cd0: <NEC CD-ROM DRIVE:462 1.14> Removable CD-ROM SCSI-2 device 
cd0: 10.000MB/s transfers (10.000MHz, offset 15)
cd0: Attempt to query device size failed: NOT READY, Medium not present
WARNING: / was not properly dismounted
da1 at ahc0 bus 0 target 1 lun 0
da1: <WDIGTL WDE2170-1807A3 1.80> Fixed Direct Access SCSI-2 device 
da1: 40.000MB/s transfers (20.000MHz, offset 8, 16bit)
da1: 2047MB (4194057 512 byte sectors: 255H 63S/T 261C)
cd1 at aic0 bus 0 target 6 lun 0
cd1: <PIONEER CD-ROM DRM-6324X 1.03> Removable CD-ROM SCSI-2 device 
cd1: 5.000MB/s transfers (5.000MHz, offset 8)
cd1: cd present [12205 x 2048 byte records]
(cd2:aic0:0:6:1): ccb 0xc0871800 - timed out, phase 84
cd2 at aic0 bus 0 target 6 lun 1
cd2: <PIONEER CD-ROM DRM-6324X 1.03> Removable CD-ROM SCSI-2 device 
cd2: 5.000MB/s transfers (5.000MHz, offset 8)
cd2: cd present [36007 x 2048 byte records]
cd3 at aic0 bus 0 target 6 lun 2
cd3: <PIONEER CD-ROM DRM-6324X 1.03> Removable CD-ROM SCSI-2 device 
cd3: 5.000MB/s transfers (5.000MHz, offset 8)
cd3: cd present [211343 x 2048 byte records]
cd4 at aic0 bus 0 target 6 lun 3
cd4: <PIONEER CD-ROM DRM-6324X 1.03> Removable CD-ROM SCSI-2 device 
cd4: 5.000MB/s transfers (5.000MHz, offset 8)
cd4: Attempt to query device size failed: NOT READY, Medium not present
cd5 at aic0 bus 0 target 6 lun 4
cd5: <PIONEER CD-ROM DRM-6324X 1.03> Removable CD-ROM SCSI-2 device 
cd5: 5.000MB/s transfers (5.000MHz, offset 8)
cd5: Attempt to query device size failed: NOT READY, Medium not present
cd6 at aic0 bus 0 target 6 lun 5
cd6: <PIONEER CD-ROM DRM-6324X 1.03> Removable CD-ROM SCSI-2 device 
cd6: 5.000MB/s transfers (5.000MHz, offset 8)
cd6: Attempt to query device size failed: NOT READY, Medium not present
cd9660: RockRidge Extension

Fix: Adding a quirk entry to the driver fixes the problem, even though the
comments say this shouldn't be necessary.
Comment 1 ken 1999-12-01 05:37:50 UTC
Don Lewis wrote...
> 
> >Number:         15198
> >Category:       kern
> >Synopsis:       CD changer autodetection doesn't work, causing SCSI timeout [PATCH]

[ ... ]

> FreeBSD 3.3-STABLE of the 19991129 vintage with a PIONEER CD-ROM DRM-6324X
> LUN-based CD-ROM changer connected via an aic SCSI controller.
> 
> >Description:
> 
> A SCSI bus timeout occurs when the driver attempts to access the
> second slot in the CD changer (cd2).  If the cdX devices are listed
> in /etc/fstab, the machine totally wedges.  If no attempt is made
> to mount the cdX devices, the machine is otherwise usable.

[ ... ]

> cd1 at aic0 bus 0 target 6 lun 0
> cd1: <PIONEER CD-ROM DRM-6324X 1.03> Removable CD-ROM SCSI-2 device 
> cd1: 5.000MB/s transfers (5.000MHz, offset 8)
> cd1: cd present [12205 x 2048 byte records]
> (cd2:aic0:0:6:1): ccb 0xc0871800 - timed out, phase 84
> cd2 at aic0 bus 0 target 6 lun 1
> cd2: <PIONEER CD-ROM DRM-6324X 1.03> Removable CD-ROM SCSI-2 device 
> cd2: 5.000MB/s transfers (5.000MHz, offset 8)
> cd2: cd present [36007 x 2048 byte records]
[ ... ]

> >Fix:
> 	
> Adding a quirk entry to the driver fixes the problem, even though the
> comments say this shouldn't be necessary.

Indeed, I'm certainly surprised that adding a quirk fixed the problem.  I
suppose this device must take a long time to respond to a read capacity.

With most changers, it's no big deal if the changer gets switched into the
changer scheduling code with lun 1 instead of lun 0.  You usually don't see
any sort of trouble.

With the patch, do the lockups still happen when you boot the machine?  I
wouldn't expect the patch to have much effect on that, since all LUNs of
the changer will be run through the changer scheduling mechanism once the
second lun is detected...  Unless the CDs are being mounted as they are
found.

In any case, the lockup shouldn't happen, although finding the lockup might
be rather difficult.  Can you break into the debugger when the lockup
happens and get a stack trace?

Ken
-- 
Kenneth Merry
ken@kdm.org
Comment 2 Kenneth D. Merry freebsd_committer freebsd_triage 1999-12-02 07:12:25 UTC
State Changed
From-To: open->analyzed

We've got a solution, and some ideas on why this is happening. 


Comment 3 Kenneth D. Merry freebsd_committer freebsd_triage 1999-12-02 07:12:25 UTC
Responsible Changed
From-To: freebsd-bugs->ken

My driver, I'll handle it. 
Comment 4 Kenneth D. Merry freebsd_committer freebsd_triage 1999-12-08 05:13:46 UTC
State Changed
From-To: analyzed->closed

Patch applied in revision 1.29 scsi_cd.c in -current and revision 1.14.2.8 
of scsi_cd.c in RELENG_3.  Let me know if you have problems after you update 
to the new version.