Bug 9178

Summary: [pata_via probe]: CD-Rom devices are being recognized as DISKs when using pata driver
Product: IO/Storage Reporter: Michael Tokarev (mjt)
Component: Serial ATAAssignee: Alan (alan)
Status: CLOSED CODE_FIX    
Severity: normal CC: alan
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.20+, up to 2.6.23 Subsystem:
Regression: --- Bisected commit-id:

Description Michael Tokarev 2007-10-17 11:12:03 UTC
Most recent kernel where this bug did not occur:
I didn't try previous versions.  It worked flawlessly with IDE drivers, not PATA.

Distribution:
 n/a

Hardware Environment:
 several different machines, but the two things in common so far:
  chipset VIA VT8633 [Apollo Pro266]
  IDE: VIA VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)

Software Environment:
Vanilla kernels with a minimal set of (feature) patches, like unionfs and squashfs.

Problem Description:
IDE CD-ROM drive is being recognized as DISK when using pata_via instead of via82cxxx driver.  When using ol'good IDE driver, everything works as expected.

Here's the relevant parts of dmesg:

(2.6.20, one machine)
loading module pata_via
SCSI subsystem initialized
libata version 2.00 loaded.
pata_via 0000:00:11.1: version 0.2.1
ata1: PATA max UDMA/100 cmd 0x1F0 ctl 0x3F6 bmdma 0x1000 irq 14
ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0x1008 irq 15
scsi0 : pata_via
ata1.00: ATA-6, max UDMA/100, 156301488 sectors: LBA48 
ata1.00: ata1: dev 0 multi count 16
ata1.01: ATAPI, max UDMA/33
ata1.00: configured for UDMA/100
ata1.01: configured for UDMA/33
scsi1 : pata_via
ata2.00: ATA-6, max UDMA/100, 156301488 sectors: LBA48 
ata2.00: ata2: dev 0 multi count 16
ata2.01: ATAPI, max MWDMA0, CDB intr
ata2.00: configured for UDMA/100
ata2.01: failed to set xfermode (err_mask=0x1)
ata2.01: limiting speed to PIO3
ata2: failed to recover some devices, retrying in 5 secs
ata2.00: configured for UDMA/33
ata2.01: configured for PIO3
scsi 0:0:0:0: Direct-Access     ATA      ST380011A        8.01 PQ: 0 ANSI: 5
scsi 0:0:1:0: Direct-Access                                    PQ: 0 ANSI: 5
scsi 1:0:0:0: Direct-Access     ATA      ST380011A        8.01 PQ: 0 ANSI: 5
scsi 1:0:1:0: Direct-Access     IOMEGA   ZIP 250          51.G PQ: 0 ANSI: 5
loading module sd_mod
SCSI device sda: 156301488 512-byte hdwr sectors (80026 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 >
sd 0:0:0:0: Attached scsi disk sda
sd 0:0:1:0: Attached scsi disk sdb
SCSI device sdc: 156301488 512-byte hdwr sectors (80026 MB)
sdc: Write Protect is off
sdc: Mode Sense: 00 3a 00 00
SCSI device sdc: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sdc: sdc1 sdc2 sdc3 sdc4 < sdc5 sdc6 sdc7 >
sd 1:0:0:0: Attached scsi disk sdc
sd 1:0:1:0: Attached scsi removable disk sdd

Here's another machine, with the same chipset and with 2.6.23 kernel:

loading module pata_via
SCSI subsystem initialized
libata version 2.21 loaded.
pata_via 0000:00:11.1: version 0.3.2
scsi0 : pata_via
scsi1 : pata_via
ata1: PATA max UDMA/100 cmd 0x000101f0 ctl 0x000103f6 bmdma 0x00011000 irq 14
ata2: PATA max UDMA/100 cmd 0x00010170 ctl 0x00010376 bmdma 0x00011008 irq 15
ata1.00: ATA-6: ST380011A, 8.01, max UDMA/100
ata1.00: 156301488 sectors, multi 16: LBA48 
ata1.01: ATA-6: ST380011A, 8.01, max UDMA/100
ata1.01: 156301488 sectors, multi 16: LBA48 
ata1.00: configured for UDMA/100
ata1.01: configured for UDMA/100
ata2.00: ATAPI: FX4830T, R02E, max UDMA/33
ata2.01: ATAPI: IOMEGA  ZIP 250       ATAPI, 51.G, max MWDMA0, CDB intr
ata2.01: device is on DMA blacklist, disabling DMA
ata2.00: configured for UDMA/33
ata2.01: configured for PIO3
scsi 0:0:0:0: Direct-Access     ATA      ST380011A        8.01 PQ: 0 ANSI: 5
scsi 0:0:1:0: Direct-Access     ATA      ST380011A        8.01 PQ: 0 ANSI: 5
scsi scan: INQUIRY result too short (5), using 36
scsi 1:0:0:0: Direct-Access                                    PQ: 0 ANSI: 5
scsi 1:0:1:0: Direct-Access     IOMEGA   ZIP 250          51.G PQ: 0 ANSI: 5
loading module sd_mod
sd 0:0:0:0: [sda] 156301488 512-byte hardware sectors (80026 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 >
sd 0:0:0:0: [sda] Attached SCSI disk
sd 0:0:1:0: [sdb] 156301488 512-byte hardware sectors (80026 MB)
sd 0:0:1:0: [sdb] Write Protect is off
sd 0:0:1:0: [sdb] Mode Sense: 00 3a 00 00
sd 0:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sdb: sdb1 sdb2 sdb3 sdb4 < sdb5 sdb6 sdb7 >
sd 0:0:1:0: [sdb] Attached SCSI disk
sd 1:0:0:0: [sdc] Attached SCSI disk
sd 1:0:1:0: [sdd] Attached SCSI removable disk

A slight difference in configuration: on the first machine, two disks
are on first IDE channel, while CD-rom and ZIP drives are on the second;
while on the second machine, the disks are "spread" across two channels.
So in first case CD-Rom shares the IDE bus with a ZIP drive, while on
second case it shares the bus with an IDE disk.

As it is clear from the dmesg, sd_mod claims all IDE devices, including
cdrom.

Here's the output of hdparm -i with IDE module:

 Model=LTN483L, FwRev=ES13, SerialNo=
 Config={ SpinMotCtl Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }
 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=unknown, BuffSize=0kB, MaxMultSect=0
 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4 
 DMA modes:  sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 
 UDMA modes: udma0 udma1 *udma2 
 AdvancedPM=no

P.S. Can't figure out how to "Assign" a bug when submitting.  Alan asked to assign it to him.  Also, I found no better place than to put the bug under IO/IDE category - this is not SATA and not SCSI, but not IDE either ;)
Comment 1 Bartlomiej Zolnierkiewicz 2007-10-17 11:23:52 UTC
> P.S. Can't figure out how to "Assign" a bug when submitting.  Alan asked to
> assign it to him.  Also, I found no better place than to put the bug under
> IO/IDE category - this is not SATA and not SCSI, but not IDE either ;)

Should be for SATA (Jeff/Alan: somebody should ping bugzilla staff to update "Serial ATA" to something more meaningful) but no problem - I'll fix this and re-assign...
Comment 2 Michael Tokarev 2008-02-16 12:40:53 UTC
This issue seems to be fixed in 2.6.24[.2].  At least it now works correctly, and I don't see a reason to do a "bisect" to find the fix.. ;)