Bug 8809

Summary: libata detects no cdrom drive
Product: IO/Storage Reporter: Hauke (mail)
Component: Serial ATAAssignee: Tejun Heo (htejun)
Status: CLOSED CODE_FIX    
Severity: normal CC: kristen.c.accardi
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: >= 2.6.22 Subsystem:
Regression: --- Bisected commit-id:
Attachments: lspci -nn output
full dmesg output
ich8-map-01b-update.patch

Description Hauke 2007-07-25 10:02:33 UTC
Most recent kernel where this bug did not occur: 2.6.21
Distribution: archlinux
Hardware Environment: notebook with intel ICH8 chip, sata hdd, cdrom
Software Environment:
Problem Description:

I use a custom kernel version 2.6.22.1
my harddrive is working well. it is a sata drive. The IDE interface is an Intel ICH8-Controller:

00:1f.2 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA IDE Controller (rev 03)

dmesg:

ata_piix 0000:00:1f.2: version 2.11
ata_piix 0000:00:1f.2: MAP [ IDE IDE -- -- ]
scsi0 : ata_piix
scsi1 : ata_piix
ata1: PATA max UDMA/100 cmd 0x00000000000101f0 ctl 0x00000000000103f6 bmdma 0x000000000001ffa0 irq 14
ata2: SATA max UDMA/133 cmd 0x0000000000010170 ctl 0x0000000000010376 bmdma 0x000000000001ffa8 irq 15
ata1.00: ATA-7: Hitachi HTS541612J9SA00, SBDOC70P, max UDMA/100
ata1.00: 234441648 sectors, multi 16: LBA48 NCQ (depth 0/32)
ata1.00: configured for UDMA/100
scsi 0:0:0:0: Direct-Access     ATA      Hitachi HTS54161 SBDO PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 234441648 512-byte hardware sectors (120034 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
sd 0:0:0:0: [sda] 234441648 512-byte hardware sectors (120034 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 < sda5 sda6 sda7 > sda4
sd 0:0:0:0: [sda] Attached SCSI disk
sd 0:0:0:0: Attached scsi generic sg0 type 0

all right!
now it seems that my cdrom is not a sata device. so it it an atapi, right?
if I load the ide-cd module (incl. ide-generic etc) (I have to comile it as module - otherwise ---> kernel panic) dmesg said:

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
ide0: I/O resource 0x3F6-0x3F6 not free.
ide0: ports already in use, skipping probe
ide1: I/O resource 0x376-0x376 not free.
ide1: ports already in use, skipping probe

so the sata driver blocks the interface.

with kernel (kernel.org) version 2.6.21 it was possible to load libata together with atapi support for cdrom. 


without atapi support no cdrom will detected. 
cdrom-device: HL-DT-ST DVDRAM GSA-T20N, ATAPI CD/DVD-ROM drive

same with kernel (kernel.org) 2.6.23-rc1

sorry for my english
Comment 1 Tejun Heo 2007-07-25 22:05:35 UTC
Please post the result of 'lpsci -nn' and full dmesg without the generic driver.  Thanks.
Comment 2 Hauke 2007-07-26 02:39:01 UTC
Created attachment 12152 [details]
lspci -nn output
Comment 3 Hauke 2007-07-26 02:39:56 UTC
Created attachment 12153 [details]
full dmesg output
Comment 4 Tejun Heo 2007-07-26 22:07:37 UTC
cc'ing Kristen.  It seems something is wrong with the ich8 map table.  It's entry 10b which is currently { IDE, IDE, NA, NA } but HTS541612J9SA00 is a SATA drive and ODD isn't detected.  Should it be { P0, P2, IDE, IDE } like earlier controllers?
Comment 5 Hauke 2007-07-29 08:14:41 UTC
if someone needs more information about my system/problem, please post. 

greets
Hauke
Comment 6 Dennis Nilsson 2007-08-01 08:22:37 UTC
I have the same issue, the cdrom works with ide-generic built-in, but then harddrive will use ide-generic aswell, libata also freezes cdrom, if ide-generic built as module and modprobed after boot we get:
ide0: I/O resource 0x3F6-0x3F6 not free.
ide0: ports already in use, skipping probe
ide1: I/O resource 0x376-0x376 not free.
ide1: ports already in use, skipping probe
Comment 7 Tejun Heo 2007-08-01 08:33:21 UTC
What do you mean by 'libata also freezes cdrom'?
Comment 8 Dennis Nilsson 2007-08-02 08:06:21 UTC
freezes is probably not the right word but as you can see, even if libata doesn't detect the cdrom, it's resources are in use (ide1).
Comment 9 Tejun Heo 2007-08-02 09:37:47 UTC
Created attachment 12234 [details]
ich8-map-01b-update.patch

OIC, you meant grabbing the resources and not letting ide-generic take it.  'freeze' usually means something like the controller dying while holding PCI bus and is a bit strong for occupying the IO ports.  I was scared, you know.  :-)

Does the attached patch change anything?
Comment 10 Dennis Nilsson 2007-08-02 11:26:08 UTC
Thats excactl what I mean :). The patch seems to have solved the issue.
from dmesg:
ata2.01: ATAPI: HL-DT-ST DVDRAM GSA-T20N, WA03, max UDMA/33
ata2.01: configured for UDMA/33

dvd/cdrom is now /dev/sr0 and /dev/sg1

excellent work! thank you.
Comment 11 Tejun Heo 2007-08-03 01:33:46 UTC
Dennis, I'm still not sure whether the MAP value is correct one.  There should be several IDE controller related options in the BIOS.  Is the controller in "combined" mode?  How many SATA and PATA ports do you have on the board?  If you have PATA port, can you connect a PATA device to the port and report boot log?
Comment 12 Dennis Nilsson 2007-08-03 04:14:53 UTC
I'm on a new MSI ex600 laptop (santa rosa), there's not many options in bios only type,dma,pio and they are all set to auto. I assume I only got 2 sata-ports hdd and cdrom. 
Comment 13 Tejun Heo 2007-08-03 04:45:38 UTC
Right, yeah I think [P0 P2 IDE IDE] is correct.  You have a SATA hard drive detected on ata1 and a PATA dvdram on ata2.  I'll try to find a document about this and verify it.
Comment 14 Hauke 2007-08-04 08:47:44 UTC
God-Like!!
Perfect work - thank you!

The Patch works for me. Will I find it in the next kernel version/release?

Greets

Hauke
Comment 15 Tejun Heo 2007-08-04 09:14:17 UTC
Yeah, probably.  I still can't find any doc from intel which describes the mapping for map 01b tho.
Comment 16 Tejun Heo 2007-08-06 10:50:31 UTC
Patch submitted.  Closing.