From owner-freebsd-current@FreeBSD.ORG Fri Dec 4 00:14:55 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C5431065676 for ; Fri, 4 Dec 2009 00:14:55 +0000 (UTC) (envelope-from glz@hidden-powers.com) Received: from mail.hidden-powers.com (mail.hidden-powers.com [213.242.135.162]) by mx1.freebsd.org (Postfix) with ESMTP id 9B97C8FC08 for ; Fri, 4 Dec 2009 00:14:54 +0000 (UTC) Received: from mail.hidden-powers.com (localhost [127.0.0.1]) by dkim.hidden-powers.com (Postfix) with ESMTP id 0D86E6E533; Fri, 4 Dec 2009 00:55:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=hidden-powers.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s= selector1; bh=5cpEzqTZtK0469x1jb+denE19vc=; b=t02RwjWBNbAmufXI7z 809lKJW4RPz09dQsmFo9TUVtYQaGJhKM8kwNd+ZOOVwB8qoG2GO9yDg4lKyQZvcy 0N4c7/LPg6qDCrkTrkD1RjdyBRp5xoMwL1JZP1aOOLUjnyK0J20e8CHcwtq9rc0O TejOerQL2RDQGEl6e5NwJ3wjI= Received: from [10.255.253.2] (unknown [10.255.253.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.hidden-powers.com (Postfix) with ESMTPSA id C103B6E532; Fri, 4 Dec 2009 00:55:36 +0100 (CET) Date: Fri, 04 Dec 2009 00:55:36 +0100 From: Goran Lowkrantz To: Alexander Motin Message-ID: In-Reply-To: <4B1671EE.1010301@FreeBSD.org> References: <4B1671EE.1010301@FreeBSD.org> X-Mailer: Mulberry/4.0.8 (Win32) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: FreeBSD-Current Subject: Re: Testing CAM wrapper for ata(4) controller drivers X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 00:14:55 -0000 --On Wednesday, December 02, 2009 3:55 PM +0200 Alexander Motin 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: 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@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@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 at scbus0 target 0 lun 0 (cd0,pass0) at scbus0 target 1 lun 0 (cd1,pass1) at scbus2 target 0 lun 0 (ada2,pass5) at scbus3 target 0 lun 0 (pass2,ada0) at scbus4 target 0 lun 0 (pass3,ada1) at scbus6 target 0 lun 0 (da0,pass4) # camcontrol identify ada0 pass2: 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: 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@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 Features2=0x2001 AMD Features=0xea500800 AMD Features2=0x11f 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 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: iomem 0xfed00000-0xfed003ff on acpi0 Timecounter "HPET" frequency 25000000 Hz quality 900 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pci0: at device 0.0 (no driver attached) isab0: port 0x900-0x9ff at device 1.0 on pci0 isa0: on isab0 pci0: at device 1.1 (no driver attached) ohci0: mem 0xf9eff000-0xf9efffff irq 21 at device 2.0 on pci0 ohci0: [ITHREAD] usbus0: on ohci0 ehci0: mem 0xf9efec00-0xf9efecff irq 22 at device 2.1 on pci0 ehci0: [ITHREAD] usbus1: EHCI version 1.0 usbus1: on ehci0 ohci1: mem 0xf9efd000-0xf9efdfff irq 23 at device 4.0 on pci0 ohci1: [ITHREAD] usbus2: on ohci1 ehci1: mem 0xf9efe800-0xf9efe8ff irq 20 at device 4.1 on pci0 ehci1: [ITHREAD] usbus3: EHCI version 1.0 usbus3: on ehci1 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xffa0-0xffaf at device 6.0 on pci0 ata0: on atapci0 ata0: [ITHREAD] ata1: on atapci0 ata1: [ITHREAD] pci0: at device 7.0 (no driver attached) pcib1: at device 8.0 on pci0 pci1: on pcib1 fwohci0: 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: on fwohci0 dcons_crom0: on firewire0 dcons_crom0: bus_addr 0x2584000 fwe0: on firewire0 if_fwe0: Fake Ethernet address: 22:00:00:00:0a:a6 fwe0: Ethernet address: 22:00:00:00:0a:a6 fwip0: 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: 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: at channel 0 on ahci0 ahcich0: [ITHREAD] ahcich1: at channel 1 on ahci0 ahcich1: [ITHREAD] ahcich2: at channel 2 on ahci0 ahcich2: [ITHREAD] ahcich3: at channel 3 on ahci0 ahcich3: [ITHREAD] nfe0: port 0xa880-0xa887 mem 0xf9efc000-0xf9efcfff,0xf9efe400-0xf9efe4ff,0xf9efe000-0xf9efe00f irq 23 at device 10.0 on pci0 miibus0: on nfe0 atphy0: 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: at device 11.0 on pci0 pci2: on pcib2 vgapci0: port 0xdc00-0xdc7f mem 0xfd000000-0xfdffffff,0xd0000000-0xdfffffff,0xfa000000-0xfbffffff irq 17 at device 0.0 on pci2 pcib3: at device 12.0 on pci0 pci3: on pcib3 em0: 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: at device 13.0 on pci0 pci4: on pcib4 pcib5: at device 14.0 on pci0 pci5: on pcib5 pcib6: at device 15.0 on pci0 pci6: on pcib6 pcib7: at device 16.0 on pci0 pci7: on pcib7 pcib8: at device 17.0 on pci0 pci8: on pcib8 amdtemp0: on hostb3 acpi_button0: on acpi0 atrtc0: port 0x70-0x71 on acpi0 uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 uart0: [FILTER] cpu0: on acpi0 powernow0: on cpu0 cpu1: on acpi0 powernow1: on cpu1 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 atkbdc0: at port 0x60,0x64 on isa0 atkbd0: 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: at usbus0 uhub0: on usbus0 ugen1.1: at usbus1 uhub1: on usbus1 ugen2.1: at usbus2 uhub2: on usbus2 ugen3.1: at usbus3 uhub3: 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: at usbus3 uhub4: on usbus3 ugen1.2: at usbus1 umass0: 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: 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: 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: 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: 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: 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: at usbus3 uhid0: on usbus3 (da0:umass-sim0:0:0:0): unsupportable block size 83886080 Root mount waiting for: usbus3 ugen3.4: at usbus3 ums0: on usbus3 ums0: 3 buttons and [XYZ] coordinates ID=1 Root mount waiting for: usbus3 ugen3.5: at usbus3 ukbd0: on usbus3 kbd2 at ukbd0 uhid1: 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