From owner-freebsd-current@FreeBSD.ORG Wed Nov 18 17:14:47 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id B0FDF1065672; Wed, 18 Nov 2009 17:14:46 +0000 (UTC) (envelope-from nork@FreeBSD.org) Date: Thu, 19 Nov 2009 02:14:40 +0900 From: Norikatsu Shigemura To: Alexander Motin Message-Id: <20091119021440.560884b2.nork@FreeBSD.org> In-Reply-To: <4B042304.8060807@FreeBSD.org> References: <20091119004651.7432a6e4.nork@FreeBSD.org> <4B042304.8060807@FreeBSD.org> X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org, Norikatsu Shigemura Subject: Re: How do I use NCQ of Intel X25-E(SSD) on ahci(4)? 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, 18 Nov 2009 17:14:47 -0000 Hi Alexander. On Wed, 18 Nov 2009 18:38:28 +0200 Alexander Motin wrote: > > Native Command Queuing (NCQ) yes 30/0x1E > > Here is the reason ^^^ > This drive support less tags (31) then your AHCI controller does (32). > Support for such case is not implemented yet. As temporary solution you > may limit controller to use only 31 tag, then NCQ will be used. All you > need is to go to ahci.c and change line > ch->numslots = ...; > to > ch->numslots = min(31, ...); Oops, OK! I confirmed following patch: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --- sys/dev/ahci/ahci.c.orig 2009-11-17 22:25:07.474418000 +0900 +++ sys/dev/ahci/ahci.c 2009-11-19 02:00:22.193688908 +0900 @@ -779,7 +779,7 @@ ch->caps = ctlr->caps; ch->caps2 = ctlr->caps2; ch->quirks = ctlr->quirks; - ch->numslots = ((ch->caps & AHCI_CAP_NCS) >> AHCI_CAP_NCS_SHIFT) + 1, + ch->numslots = min(31, ((ch->caps & AHCI_CAP_NCS) >> AHCI_CAP_NCS_SHIFT) + 1), mtx_init(&ch->mtx, "AHCI channel lock", NULL, MTX_DEF); resource_int_value(device_get_name(dev), device_get_unit(dev), "pm_level", &ch->pm_level); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ahci(4) can use NCQ of X25-E. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ATA/ATAPI-7 SATA 2.x device ada0: 300.000MB/s transfers ada0: Command Queueing enabled ada0: 61057MB (125045424 512 byte sectors: 16H 63S/T 16383C) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # camcontrol tags ada0 (pass0:ahcich0:0:0:0): device openings: 31 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Thank you!