Testing CAM wrapper for ata(4) controller drivers

Goran Lowkrantz glz at hidden-powers.com
Fri Dec 4 00:14:55 UTC 2009


--On Wednesday, December 02, 2009 3:55 PM +0200 Alexander Motin 
<mav at FreeBSD.org> wrote:

> Hi.
>
> I would like to present for testing patch, turning ata(4) controllers
> drivers into native SIMs of new CAM ATA infrastructure. This patch adds
> new ATA_CAM kernel option, which allows switching between legacy and new
>  CAM-based operation modes. To enable new mode you should add
> options	ATA_CAM
> line to the kernel configuration file in addition to the ones required
> by CAM infrastructure and rebuild/reinstall the kernel.
>
===
Tested on a ASUSTeK M2N-VM DVI with good results. Only problem found was 
with a CF card in a SATA-CF adapter. It lies that it can handle DMA but 
fails miserably. Searched the web but could find no way to disable DMA when 
using CAM-ATA.

Here is the inital rescan result after attaching it and the timeout when 
doing an identify:
(aprobe0:ahcich1:0:15:0): SIGNATURE: 0000
(aprobe0:ahcich2:0:15:0): SIGNATURE: 0000
(aprobe0:ahcich1:0:15:0): SIGNATURE: 0000
(aprobe0:ahcich2:0:15:0): SIGNATURE: 0000
(aprobe0:ahcich0:0:15:0): SIGNATURE: 0000
(aprobe0:ahcich0:0:0:0): SIGNATURE: 0000
ada2 at ahcich0 bus 0 scbus2 target 0 lun 0
ada2: <SanDisk SDCFX-1024 HDX 3.17> ATA/ATAPI-4 device
ada2: 150.000MB/s transfers (SATA 1.x, PIO4, PIO size 2048bytes)
ada2: 977MB (2001888 512 byte sectors: 16H 63S/T 1986C)
(aprobe0:ahcich1:0:15:0): SIGNATURE: 0000
(aprobe0:ahcich2:0:15:0): SIGNATURE: 0000
ahcich0: Timeout on slot 0
ahcich0: is 00000000 cs 00000001 ss 00000000 rs 00000001 tfd d0 serr 
00000000
ahcich0: port is not ready (timeout 10000ms) tfd = 00000080
ahcich0: device ready timeout
ahcich0: Timeout on slot 0
ahcich0: is 00000000 cs 00000003 ss 00000000 rs 00000003 tfd 00 serr 000000
# camcontrol readcap ada2
(pass5:ahcich0:0:0:0): READ CAPACITY(10). CDB: 25 0 0 0 0 0 0 0 0 0
(pass5:ahcich0:0:0:0): CAM Status: Unconditionally Re-queue Request

When mounted and trying to write atime this happens:
g_vfs_done():ada2a[WRITE(offset=114688, length=16384)]error = 5
ahcich0: Timeout on slot 0
ahcich0: is 00000000 cs 00000001 ss 00000000 rs 00000001 tfd 80 serr 
00000000
ahcich0: port is not ready (timeout 10000ms) tfd = 00000080
ahcich0: device ready timeout
ahcich0: Timeout on slot 0
ahcich0: is 00000000 cs 00000001 ss 00000000 rs 00000001 tfd 80 serr 
00000000
ahcich0: port is not ready (timeout 10000ms) tfd = 00000080
ahcich0: device ready timeout
ahcich0: Timeout on slot 0
ahcich0: is 00000000 cs 00000001 ss 00000000 rs 00000001 tfd 80 serr 
00000000
ahcich0: port is not ready (timeout 10000ms) tfd = 00000080
ahcich0: device ready timeout
ahcich0: Timeout on slot 0
ahcich0: is 00000000 cs 00000001 ss 00000000 rs 00000001 tfd 80 serr 
00000000
ahcich0: port is not ready (timeout 10000ms) tfd = 00000080
ahcich0: device ready timeout
ahcich0: Timeout on slot 0
ahcich0: is 00000000 cs 00000001 ss 00000000 rs 00000001 tfd 80 serr 
00000000
ahcich0: port is not ready (timeout 10000ms) tfd = 00000080
ahcich0: device ready timeout
g_vfs_done():ada2a[WRITE(offset=114688, length=16384)]error = 5
fsync: giving up on dirty
0xffffff00068e9760: tag devfs, type VCHR
    usecount 1, writecount 0, refcount 5 mountedhere 0xffffff0006bff600
    flags ()
    v_object 0xffffff0004e40438 ref 0 pages 6
    lock type devfs: EXCL by thread 0xffffff0006389390 (pid 1946)
        dev ada2a
ahcich0: Timeout on slot 0



Rest of it:
atapci0 at pci0:0:6:0:     class=0x01018a card=0x82b31043 chip=0x056010de 
rev=0xa1 hdr=0x00
    vendor     = 'Nvidia Corp'
    device     = 'MCP67 PATA Controller (MCP67)'
    class      = mass storage
    subclass   = ATA
ahci0 at pci0:0:9:0:       class=0x010601 card=0x82b31043 chip=0x055410de 
rev=0xa2 hdr=0x00
    vendor     = 'Nvidia Corp'
    device     = 'MCP67 AHCI Controller'
    class      = mass storage
    subclass   = SATA
# camcontrol devlist
<DVD-16X DVD1648/BKH A001>         at scbus0 target 0 lun 0 (cd0,pass0)
<LITE-ON DVDRW SOHW-1653S CS09>    at scbus0 target 1 lun 0 (cd1,pass1)
<SanDisk SDCFX-1024 HDX 3.17>      at scbus2 target 0 lun 0 (ada2,pass5)
<ST380815AS 3.AAD>                 at scbus3 target 0 lun 0 (pass2,ada0)
<ST380815AS 3.AAD>                 at scbus4 target 0 lun 0 (pass3,ada1)
<Kingston DataTraveler G2 PMAP>    at scbus6 target 0 lun 0 (da0,pass4)

# camcontrol identify ada0
pass2: <ST380815AS 3.AAD> ATA/ATAPI-7 SATA 2.x device
pass2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO size 8192bytes)

protocol              ATA/ATAPI-7 SATA 2.x
device model          ST380815AS
firmware revision     3.AAD
serial number         5QZ2XRWG
cylinders             16383
heads                 16
sectors/track         63
sector size           logical 512, physical 512, offset 0
LBA supported         156301488 sectors
LBA48 supported       156301488 sectors
PIO supported         PIO4
DMA supported         WDMA2 UDMA6
overlap not supported

Feature                      Support  Enable    Value           Vendor
read ahead                     yes      yes
write cache                    yes      yes
flush cache                    yes      yes
Native Command Queuing (NCQ)   yes              31/0x1F
Tagged Command Queuing (TCQ)   no       no      31/0x1F
SMART                          yes      yes
microcode download             yes      yes
security                       yes      no
power management               yes      yes
advanced power management      no       no      65278/0xFEFE
automatic acoustic management  no       no      0/0x00  208/0xD0
media status notification      no       no
power-up in Standby            no       no
write-read-verify              yes      no      0/0x0
unload                         no       no
free-fall                      no       no
# camcontrol identify ada1
pass3: <ST380815AS 3.AAD> ATA/ATAPI-7 SATA 2.x device
pass3: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO size 8192bytes)

protocol              ATA/ATAPI-7 SATA 2.x
device model          ST380815AS
firmware revision     3.AAD
serial number         5QZ2XRWZ
cylinders             16383
heads                 16
sectors/track         63
sector size           logical 512, physical 512, offset 0
LBA supported         156301488 sectors
LBA48 supported       156301488 sectors
PIO supported         PIO4
DMA supported         WDMA2 UDMA6
overlap not supported

Feature                      Support  Enable    Value           Vendor
read ahead                     yes      yes
write cache                    yes      yes
flush cache                    yes      yes
Native Command Queuing (NCQ)   yes              31/0x1F
Tagged Command Queuing (TCQ)   no       no      31/0x1F
SMART                          yes      yes
microcode download             yes      yes
security                       yes      no
power management               yes      yes
advanced power management      no       no      65278/0xFEFE
automatic acoustic management  no       no      0/0x00  208/0xD0
media status notification      no       no
power-up in Standby            no       no
write-read-verify              yes      no      0/0x0
unload                         no       no
free-fall                      no       no

Boot dmesg:
Copyright (c) 1992-2009 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.0-STABLE #71: Wed Dec  2 22:26:06 CET 2009
    root at skade.glz.hidden-powers.com:/usr/obj/usr/src/sys/GENERIC amd64
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 5000+ (2600.26-MHz K8-class 
CPU)
  Origin = "AuthenticAMD"  Id = 0x60fb2  Stepping = 2
 
Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
  Features2=0x2001<SSE3,CX16>
  AMD Features=0xea500800<SYSCALL,NX,MMX+,FFXSR,RDTSCP,LM,3DNow!+,3DNow!>
  AMD Features2=0x11f<LAHF,CMP,SVM,ExtAPIC,CR8,Prefetch>
  TSC: P-state invariant
real memory  = 4294967296 (4096 MB)
avail memory = 4105179136 (3915 MB)
ACPI APIC Table: <082708 APIC1437>
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s)
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
ioapic0 <Version 1.1> irqs 0-23 on motherboard
kbd1 at kbdmux0
acpi0: <082708 XSDT1437> on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
acpi0: reservation of fefe1000, 1000 (3) failed
acpi0: reservation of fee01000, ff000 (3) failed
acpi0: reservation of fec00000, 1000 (3) failed
acpi0: reservation of fee00000, 1000 (3) failed
acpi0: reservation of 0, a0000 (3) failed
acpi0: reservation of 100000, cff00000 (3) failed
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x508-0x50b on acpi0
acpi_hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on 
acpi0
Timecounter "HPET" frequency 25000000 Hz quality 900
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pci0: <memory, RAM> at device 0.0 (no driver attached)
isab0: <PCI-ISA bridge> port 0x900-0x9ff at device 1.0 on pci0
isa0: <ISA bus> on isab0
pci0: <serial bus, SMBus> at device 1.1 (no driver attached)
ohci0: <OHCI (generic) USB controller> mem 0xf9eff000-0xf9efffff irq 21 at 
device 2.0 on pci0
ohci0: [ITHREAD]
usbus0: <OHCI (generic) USB controller> on ohci0
ehci0: <EHCI (generic) USB 2.0 controller> mem 0xf9efec00-0xf9efecff irq 22 
at device 2.1 on pci0
ehci0: [ITHREAD]
usbus1: EHCI version 1.0
usbus1: <EHCI (generic) USB 2.0 controller> on ehci0
ohci1: <OHCI (generic) USB controller> mem 0xf9efd000-0xf9efdfff irq 23 at 
device 4.0 on pci0
ohci1: [ITHREAD]
usbus2: <OHCI (generic) USB controller> on ohci1
ehci1: <EHCI (generic) USB 2.0 controller> mem 0xf9efe800-0xf9efe8ff irq 20 
at device 4.1 on pci0
ehci1: [ITHREAD]
usbus3: EHCI version 1.0
usbus3: <EHCI (generic) USB 2.0 controller> on ehci1
atapci0: <nVidia nForce MCP67 UDMA133 controller> port 
0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xffa0-0xffaf at device 6.0 on pci0
ata0: <ATA channel 0> on atapci0
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci0
ata1: [ITHREAD]
pci0: <multimedia, HDA> at device 7.0 (no driver attached)
pcib1: <ACPI PCI-PCI bridge> at device 8.0 on pci0
pci1: <ACPI PCI bus> on pcib1
fwohci0: <VIA Fire II (VT6306)> port 0xcc00-0xcc7f mem 
0xf9fff800-0xf9ffffff irq 16 at device 7.0 on pci1
fwohci0: [ITHREAD]
fwohci0: OHCI version 1.0 (ROM=1)
fwohci0: No. of Isochronous channels is 4.
fwohci0: EUI64 20:00:00:00:03:00:0a:a6
fwohci0: Phy 1394a available S400, 3 ports.
fwohci0: Link S400, max_rec 2048 bytes.
firewire0: <IEEE1394(FireWire) bus> on fwohci0
dcons_crom0: <dcons configuration ROM> on firewire0
dcons_crom0: bus_addr 0x2584000
fwe0: <Ethernet over FireWire> on firewire0
if_fwe0: Fake Ethernet address: 22:00:00:00:0a:a6
fwe0: Ethernet address: 22:00:00:00:0a:a6
fwip0: <IP over FireWire> on firewire0
fwip0: Firewire address: 20:00:00:00:03:00:0a:a6 @ 0xfffe00000000, S400, 
maxrec 2048
fwohci0: Initiate bus reset
fwohci0: fwohci_intr_core: BUS reset
fwohci0: fwohci_intr_core: node_id=0x00000000, SelfID Count=1, CYCLEMASTER 
mode
ahci0: <NVIDIA MCP67 AHCI SATA controller> port 
0xb480-0xb487,0xb400-0xb403,0xb080-0xb087,0xb000-0xb003,0xac00-0xac0f mem 
0xf9ef6000-0xf9ef7fff irq 22 at device 9.0 on pci0
ahci0: [ITHREAD]
ahci0: AHCI v1.10 with 4 3Gbps ports, Port Multiplier 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]
nfe0: <NVIDIA nForce MCP67 Networking Adapter> port 0xa880-0xa887 mem 
0xf9efc000-0xf9efcfff,0xf9efe400-0xf9efe4ff,0xf9efe000-0xf9efe00f irq 23 at 
device 10.0 on pci0
miibus0: <MII bus> on nfe0
atphy0: <Atheros F1 10/100/1000 PHY> PHY 1 on miibus0
atphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, auto
nfe0: Ethernet address: 00:1d:60:9a:8f:4e
nfe0: [FILTER]
nfe0: [FILTER]
nfe0: [FILTER]
nfe0: [FILTER]
nfe0: [FILTER]
nfe0: [FILTER]
nfe0: [FILTER]
nfe0: [FILTER]
pcib2: <ACPI PCI-PCI bridge> at device 11.0 on pci0
pci2: <ACPI PCI bus> on pcib2
vgapci0: <VGA-compatible display> port 0xdc00-0xdc7f mem 
0xfd000000-0xfdffffff,0xd0000000-0xdfffffff,0xfa000000-0xfbffffff irq 17 at 
device 0.0 on pci2
pcib3: <ACPI PCI-PCI bridge> at device 12.0 on pci0
pci3: <ACPI PCI bus> on pcib3
em0: <Intel(R) PRO/1000 Network Connection 6.9.14> port 0xec00-0xec1f mem 
0xfebe0000-0xfebfffff,0xfebc0000-0xfebdffff irq 18 at device 0.0 on pci3
em0: Using MSI interrupt
em0: [FILTER]
em0: Ethernet address: 00:1b:21:2e:7d:3c
pcib4: <PCI-PCI bridge> at device 13.0 on pci0
pci4: <PCI bus> on pcib4
pcib5: <PCI-PCI bridge> at device 14.0 on pci0
pci5: <PCI bus> on pcib5
pcib6: <PCI-PCI bridge> at device 15.0 on pci0
pci6: <PCI bus> on pcib6
pcib7: <PCI-PCI bridge> at device 16.0 on pci0
pci7: <PCI bus> on pcib7
pcib8: <PCI-PCI bridge> at device 17.0 on pci0
pci8: <PCI bus> on pcib8
amdtemp0: <AMD K8 Thermal Sensors> on hostb3
acpi_button0: <Power Button> on acpi0
atrtc0: <AT realtime clock> port 0x70-0x71 on acpi0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: [FILTER]
cpu0: <ACPI CPU> on acpi0
powernow0: <PowerNow! K8> on cpu0
cpu1: <ACPI CPU> on acpi0
powernow1: <PowerNow! K8> on cpu1
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
ppc0: cannot reserve I/O port range
ZFS NOTICE: Prefetch is disabled by default if less than 4GB of RAM is 
present;
            to enable, add "vfs.zfs.prefetch_disable=0" to 
/boot/loader.conf.
ZFS filesystem version 13
ZFS storage pool version 13
Timecounters tick every 1.000 msec
Waiting 5 seconds for SCSI devices to settle
firewire0: 1 nodes, maxhop <= 0 cable IRM irm(0)  (me)
firewire0: bus manager 0
usbus0: 12Mbps Full Speed USB v1.0
usbus1: 480Mbps High Speed USB v2.0
usbus2: 12Mbps Full Speed USB v1.0
usbus3: 480Mbps High Speed USB v2.0
ugen0.1: <nVidia> at usbus0
uhub0: <nVidia OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen1.1: <nVidia> at usbus1
uhub1: <nVidia EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
ugen2.1: <nVidia> at usbus2
uhub2: <nVidia OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
ugen3.1: <nVidia> at usbus3
uhub3: <nVidia EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus3
uhub0: 6 ports with 6 removable, self powered
uhub2: 6 ports with 6 removable, self powered
uhub1: 6 ports with 6 removable, self powered
uhub3: 6 ports with 6 removable, self powered
ugen3.2: <vendor 0x0424> at usbus3
uhub4: <vendor 0x0424 product 0x2524, class 9/0, rev 2.00/0.00, addr 2> on 
usbus3
ugen1.2: <Kingston> at usbus1
umass0: <Kingston DataTraveler G2, class 0/0, rev 2.00/1.10, addr 2> on 
usbus1
umass0:  SCSI over Bulk-Only; quirks = 0x0000
uhub4: 4 ports with 2 removable, self powered
umass0:6:0:-1: Attached to scbus6
(aprobe0:ata0:0:0:0): SIGNATURE: eb14
(aprobe0:ata0:0:1:0): SIGNATURE: eb14
(aprobe3:ahcich1:0:15:0): SIGNATURE: 0000
(aprobe0:ahcich1:0:0:0): SIGNATURE: 0000
(aprobe4:ahcich2:0:15:0): SIGNATURE: 0000
(aprobe0:ahcich2:0:0:0): SIGNATURE: 0000
ada0 at ahcich1 bus 0 scbus3 target 0 lun 0
ada0: <ST380815AS 3.AAD> ATA/ATAPI-7 SATA 2.x device
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO size 8192bytes)
ada0: Command Queueing enabled
ada0: 76319MB (156301488 512 byte sectors: 16H 63S/T 16383C)
ada1 at ahcich2 bus 0 scbus4 target 0 lun 0
ada1: <ST380815AS 3.AAD> ATA/ATAPI-7 SATA 2.x device
ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO size 8192bytes)
ada1: Command Queueing enabled
ada1: 76319MB (156301488 512 byte sectors: 16H 63S/T 16383C)
cd0 at ata0 bus 0 scbus0 target 0 lun 0
cd0: <DVD-16X DVD1648/BKH A001> Removable CD-ROM SCSI-0 device
cd0: 33.300MB/s transfers (UDMA2, PIO size 8192bytes)
cd0: Attempt to query device size failed: NOT READY, Medium not present
da0 at umass-sim0 bus 0 scbus6 target 0 lun 0
da0: <Kingston DataTraveler G2 PMAP> Removable Direct Access SCSI-0 device
da0: 40.000MB/s transfers
da0: 15320MB (31375360 512 byte sectors: 255H 63S/T 1953C)
cd1 at ata0 bus 0 scbus0 target 1 lun 0
cd1: <LITE-ON DVDRW SOHW-1653S CS09> Removable CD-ROM SCSI-0 device
cd1: 66.700MB/s transfers (UDMA4, PIO size 8192bytes)
cd1: Attempt to query device size failed: NOT READY, Medium not present
SMP: AP CPU #1 Launched!
ugen3.3: <Belkin Corporation> at usbus3
uhid0: <Flip CC Device> on usbus3
(da0:umass-sim0:0:0:0): unsupportable block size 83886080
Root mount waiting for: usbus3
ugen3.4: <Tablet> at usbus3
ums0: <Tablet XD-0608-U, class 0/0, rev 1.10/1.26, addr 4> on usbus3
ums0: 3 buttons and [XYZ] coordinates ID=1
Root mount waiting for: usbus3
ugen3.5: <vendor 0x046d> at usbus3
ukbd0: <vendor 0x046d product 0xc30e, class 0/0, rev 1.10/1.80, addr 5> on 
usbus3
kbd2 at ukbd0
uhid1: <vendor 0x046d product 0xc30e, class 0/0, rev 1.10/1.80, addr 5> on 
usbus3
Trying to mount root from zfs:system

Thanks.
/glz

---
"There is hopeful symbolism in the fact that flags do not wave in a vacuum."
                -- Arthur C. Clarke


More information about the freebsd-current mailing list