RFC: ATA to CAM integration patch

Pieter de Goeje pieter at degoeje.nl
Sat Jun 27 12:59:14 UTC 2009


On Friday 26 June 2009 20:47:26 Alexander Motin wrote:
> To test our work you should:
>   - have any AHCI compatible controller configured to native AHCI mode
> (not a COMPATIBLE or RAID or whatever else) by BIOS;
>   - have some Serial ATA/ATAPI drives connected to AHCI controller;
>   - patch your recently updated 8-CURRENT with this patch:
> 	http://people.freebsd.org/~mav/cam-ata.20090626.patch
>   - rebuild and install world and kernel;
>   - read new ahci man page;
>   - make sure that you will be able to boot if your SATA disk devices
> name change from some ad4 to ada0;
>   - load ahci kernel module using loader prompt or loader.conf;
>   - boot.

Excellent stuff.
I've installed the patch and it works fine. Excerpt from dmesg:

nox# dmesg | grep -E "(ahci|ada|ata)"
ahci0: <AHCI controller> mem 0xfc000000-0xfc001fff irq 19 at device 0.0 on pci3
ahci0: [ITHREAD]                                                               
ahci0: AHCI v1.00 controller with 2 3Gbps ports, PM supported                  
ahcich0: <AHCI channel> at channel 0 on ahci0                                  
ahcich0: [ITHREAD]                                                             
ahcich1: <AHCI channel> at channel 1 on ahci0                                  
ahcich1: [ITHREAD]                                                             
atapci0: <JMicron JMB363 UDMA133 controller> port 0xb000-0xb007,0xb100-0xb103,0xb200-0xb207,0xb300-0xb303,0xb400-0xb40f irq 16 at device 0.1 on pci3
atapci0: [ITHREAD]                                                                                                                                  
ata2: <ATA channel 0> on atapci0
ata2: [ITHREAD]
ahci1: <AHCI controller> port 0xe600-0xe607,0xe700-0xe703,0xe800-0xe807,0xe900-0xe903,0xea00-0xea1f mem 0xfc106000-0xfc1067ff irq 19 at device 31.2 on pci0
ahci1: [ITHREAD]
ahci1: AHCI v1.20 controller with 6 3Gbps ports, PM supported
ahcich2: <AHCI channel> at channel 0 on ahci1
ahcich2: [ITHREAD]
ahcich3: <AHCI channel> at channel 1 on ahci1
ahcich3: [ITHREAD]
ahcich4: <AHCI channel> at channel 2 on ahci1
ahcich4: [ITHREAD]
ahcich5: <AHCI channel> at channel 3 on ahci1
ahcich5: [ITHREAD]
ahcich6: <AHCI channel> at channel 4 on ahci1
ahcich6: [ITHREAD]
ahcich7: <AHCI channel> at channel 5 on ahci1
ahcich7: [ITHREAD]
(probe1:ahcich1:0:15:0): SIGNATURE: 0000
(probe0:ahcich1:0:0:0): SIGNATURE: 0000
(probe7:ahcich7:0:15:0): SIGNATURE: 0000
(probe0:ahcich7:0:0:0): SIGNATURE: 0000
ada0 at ahcich1 bus 0 target 0 lun 0
ada0: <WDC WD6400AAKS-00A7B0 01.03B01> ATA/ATAPI-8 SATA 2.x device
ada0: 300.000MB/s transfers
ada0: 610479MB (1250261615 512 byte sectors: 16H 63S/T 16383C)
ada0: Native Command Queueing Enabled
ada1 at ahcich7 bus 0 target 0 lun 0
ada1: <WDC WD6400AAKS-00A7B0 01.03B01> ATA/ATAPI-8 SATA 2.x device
ada1: 300.000MB/s transfers
ada1: 610479MB (1250261615 512 byte sectors: 16H 63S/T 16383C)
ada1: Native Command Queueing Enabled

One disk is connected to the AHCI part of the JMicron controller, the other to the
ICH9 controller (motherboard: Gigabyte P35-DS3R). I couldn't connect both disks to
the ICH9 controller because it's BIOS is broken when set to AHCI and refuses to
detect more than one disk. Connecting both disks to the JMicron controller worked
fine. Simple speed tests with dd perform as expected (~200MB/s writes when the two
disks are striped).

However there is a problem with camcontrol:

nox# camcontrol devlist
cam_periph_mapmem: attempt to map 79200 bytes, which is greater than DFLTPHYS(65536)
camcontrol: error sending CAMIOCOMMAND ioctl: Argument list too long

nox# camcontrol inquiry ada0
ahcich1: ahci_ch_intr ERROR is 48000000 cs 00000100 ss 00000000 rs 00000100 tfd 451 serr 00000000

nox# camcontrol inquiry ada1
ahcich7: ahci_ch_intr ERROR is 40000001 cs 00002000 ss 00000000 rs 00002000 tfd 451 serr 00000000


Regards,
Pieter de Goeje



More information about the freebsd-current mailing list