From owner-freebsd-current@FreeBSD.ORG Wed Dec 2 13:56:15 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 28ADC1065676 for ; Wed, 2 Dec 2009 13:56:15 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id A41038FC13 for ; Wed, 2 Dec 2009 13:56:14 +0000 (UTC) Received: by bwz5 with SMTP id 5so180207bwz.3 for ; Wed, 02 Dec 2009 05:56:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:subject:x-enigmail-version:content-type :content-transfer-encoding; bh=q0uk3KuQIfTRzUyus0za381F4QVTlYpTLx8udnPujIg=; b=S3zjp7s0/V79wqvLGM/auRjfZECuci3A6q4J26KOvtvyP8GXWm3e/EUeU0aBZY2/JF O0ggzZHkHHnAL0eCYbkkBC3731Aw36ZaR7JAwn7iv2MMYA6CanypM3uBx10GV3AtlpXS 0GRX7UkH7d9POF+ZtG+THQPNDHNSK0qQuqAbQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type:content-transfer-encoding; b=QFstwHz3oqram0ch8anSVqZqssF8YrWWGNs3QbEbrFeIvWSBNTeZwMwYA4spguu8s+ Lm7DV8hwNjR/y/isobeujvX6LJT9UQ+6lKdO7tDkMdSTb5mVSDKxiYFYnVqp1Kl8y9MA gBC831IpaAXCRIxm0ajnhiyHbqU4AzzqZPN4Q= Received: by 10.204.34.3 with SMTP id j3mr180409bkd.23.1259762173217; Wed, 02 Dec 2009 05:56:13 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 16sm422199fxm.12.2009.12.02.05.56.12 (version=SSLv3 cipher=RC4-MD5); Wed, 02 Dec 2009 05:56:12 -0800 (PST) Sender: Alexander Motin Message-ID: <4B1671EE.1010301@FreeBSD.org> Date: Wed, 02 Dec 2009 15:55:58 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20090901) MIME-Version: 1.0 To: FreeBSD-Current X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: 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: Wed, 02 Dec 2009 13:56:15 -0000 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. In legacy mode, the only difference will be - the way in which SATA speeds reported. Instead of mixing SATA revisions with PATA modes, they were separated, as they should be, allowing, for example, DMA-incapable or buggy SATA devices (usually PATA devices with built-in PATA/SATA converter) to work in PIO mode. While doing it, I had to completely rewrite ata(4) mode setting code, so legacy operation also need to be tested. I have successfully tested it on Intel, NVidia, VIA, Marvell, JMicron PATA controllers with all PIO/DMA modes. Different controllers feedbacks are especially welcome. In new mode, everything becomes different. atacontrol tool will not report ATA buses any more. All management should be done via camcontrol tool now. atadisk, ataraid, atapicd, atapifd, atapist and atapicam kernel options and respective code are useless now. Instead of ad, acd, afd, ast devices you'll get ada, cd, da, sa. The main regression of the new mode is a lack of ataraid alternative, to support cheap BIOS-based ATA RAIDs. If somebody has time and wish to port that code from inside ata(4) into GEOM module, to make it work over CAM also, I would appreciate that and propose a help, if needed. In new mode some tools, like burncd, using legacy ata(4) interfaces (acd), are no longer applicable and should be replaced by alternatives, working via SCSI interfaces (cd). SMART support for new mode implemented in smartmontools SVN, and will be present in next release. New mode at this moment won't give much benefits to the old controllers, not supported by new ahci(4) and siis(4) drivers, may be just more fair scheduling for PATA devices sharing cable. But it is required step to unify infrastructure. After this step will be done, it will be possible to improve functionality, where it is supported by hardware. Until that time it would require too much extra work to keep compatibility with both world. Present patch can be found here: http://people.freebsd.org/~mav/ata-wrap.20091202.patch It applies to both recent HEAD and 8-STABLE. To work in new mode on 8-STABLE it requires recent SVN revision 200008 to be merged from HEAD. Respective patch for now could be found here: http://people.freebsd.org/~mav/r200008.patch Feedbacks are welcome. On any problems, don't forget to enable verbose kernel debug messages to obtain more information. -- Alexander Motin