# ATAPI cdrom vanishes with ahci_enable



## Terry_Kennedy (Oct 16, 2010)

I'm running 8-STABLE on a Supermicro X8DTH-iF (BIOS 2.0a - latest) which uses an ICH10 SATA controller. It has 6 ports, which are populated as follows:

0 - WDC WD3200BEKT HDD
1 - Lite-On DS-8A4S DVD-R
2 - WDC WD3200BEKT HDD
3-5 - Unused

Everything is detected and works fine in legacy (non-AHCI) mode:


```
atapci0: <Intel ICH10 SATA300 controller> port 0xaff0-0xaff7,0xafac-0xafaf,0xafe0-0xafe7,0xafa8-0xafab,0xaea0-0xaebf mem 0xfaad8000-0xfaad87ff irq 19 at device 31.2 on pci0
atapci0: [ITHREAD]
atapci0: AHCI called from vendor specific driver
atapci0: AHCI v1.20 controller with 6 3Gbps ports, PM not supported
ata2: <ATA channel 0> on atapci0
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci0
ata3: [ITHREAD]
ata4: <ATA channel 2> on atapci0
ata4: [ITHREAD]
ata5: <ATA channel 3> on atapci0
ata5: [ITHREAD]
ata6: <ATA channel 4> on atapci0
ata6: [ITHREAD]
ata7: <ATA channel 5> on atapci0
ata7: [ITHREAD]
[...]
ad0: 305245MB <WDC WD3200BEKT-60F3T1 12.01A12> at ata2-master UDMA100 SATA 3Gb/s
acd0: DVDR <Slimtype DVD A DS8A4S/JP55> at ata3-master UDMA100 SATA 1.5Gb/s
ad1: 305245MB <WDC WD3200BEKT-60F3T1 12.01A12> at ata4-master UDMA100 SATA 3Gb/s
```

When I added these lines to /boot/loader.conf:


```
ahci_load="YES"
ahci_enable="YES"
```

The boot messages change to:


```
ahci0: <Intel ICH10 AHCI SATA controller> port 0xaff0-0xaff7,0xafac-0xafaf,0xafe0-0xafe7,0xafa8-0xafab,0xaea0-0xaebf mem 0xfaad8000-0xfaad87ff irq 19 at device 31.2 on pci0
ahci0: [ITHREAD]
ahci0: AHCI v1.20 with 6 3Gbps ports, Port Multiplier not supported
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich0: [ITHREAD]
ahcich1: <AHCI channel> at channel 1 on ahci0
ahcich1: [ITHREAD]
ahcich2: <AHCI channel> at channel 2 on ahci0
ahcich2: [ITHREAD]
ahcich3: <AHCI channel> at channel 3 on ahci0
ahcich3: [ITHREAD]
ahcich4: <AHCI channel> at channel 4 on ahci0
ahcich4: [ITHREAD]
ahcich5: <AHCI channel> at channel 5 on ahci0
ahcich5: [ITHREAD]
[...]
ada0 at ahcich0 bus 0 scbus2 target 0 lun 0
ada0: <WDC WD3200BEKT-60F3T1 12.01A12> ATA-8 SATA 2.x device
ada0: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 305245MB (625142448 512 byte sectors: 16H 63S/T 16383C)
ada1 at ahcich2 bus 0 scbus4 target 0 lun 0
ada1: <WDC WD3200BEKT-60F3T1 12.01A12> ATA-8 SATA 2.x device
ada1: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
ada1: Command Queueing enabled
ada1: 305245MB (625142448 512 byte sectors: 16H 63S/T 16383C)
pass2 at ahcich1 bus 0 scbus3 target 0 lun 0
pass2: <Slimtype DVD A  DS8A4S JP55> Removable CD-ROM SCSI-0 device 
pass2: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO 8192bytes)
```

Note that my DVD drive is now showing up as a pass0 device and isn't usable. I tried adding this to /boot/loader.conf:


```
atapicam_load="YES"
```

But that didn't change anything. The BIOS is configured for AHCI mode, and given that everything works in legacy mode, I don't think it is a BIOS issue. I could continue to use legacy mode, but want to be prepared for the eventual change in default behavior and deprecation of legacy mode.

A verbose boot returns some additional info, though I'm not sure it is useful:


```
ahcich0: AHCI reset...
ahcich0: SATA connect time=0ms status=00000123
ahcich0: ready wait time=2ms
ahcich0: AHCI reset done: device found
ahcich1: AHCI reset...
ahcich1: SATA connect time=0ms status=00000113
ahcich1: ready wait time=0ms
ahcich1: AHCI reset done: device found
ahcich2: AHCI reset...
ahcich2: SATA connect time=0ms status=00000123
ahcich2: ready wait time=2ms
ahcich2: AHCI reset done: device found
ahcich3: AHCI reset...
ahcich3: SATA connect timeout status=00000000
ahcich3: AHCI reset done: phy reset found no device
ahcich4: AHCI reset...
ahcich4: SATA connect timeout status=00000000
ahcich4: AHCI reset done: phy reset found no device
ahcich5: AHCI reset...
ahcich5: SATA connect timeout status=00000000
ahcich5: AHCI reset done: phy reset found no device
(aprobe0:ahcich0:0:0:0): SIGNATURE: 0000
(aprobe1:ahcich1:0:0:0): SIGNATURE: eb14
(aprobe2:ahcich2:0:0:0): SIGNATURE: 0000
```

/sys/dev/ata/chipsets/ata-ahci.c says that the eb14 signature is ATA_ATAPI_MASTER, so I'm not sure what's going wrong here. Anyone have any ideas?


----------



## SirDice (Oct 16, 2010)

You'll need to have a *device cd* in your kernel config.

AHCI will 'transform' all the devices to CAM. Meaning you'll have to add the equivalent SCSI devices instead of ATAPI.


----------



## Terry_Kennedy (Oct 16, 2010)

SirDice said:
			
		

> You'll need to have a *device cd* in your kernel config.


I wonder how I missed that - it seems so obvious now. :\

Thanks!


----------

