From owner-freebsd-stable@FreeBSD.ORG Thu Oct 16 22:28:43 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9F05106568A; Thu, 16 Oct 2008 22:28:43 +0000 (UTC) (envelope-from fbsd-stable@mawer.org) Received: from outbound.icp-qv1-irony-out3.iinet.net.au (outbound.icp-qv1-irony-out3.iinet.net.au [203.59.1.148]) by mx1.freebsd.org (Postfix) with ESMTP id 0FBAF8FC19; Thu, 16 Oct 2008 22:28:42 +0000 (UTC) (envelope-from fbsd-stable@mawer.org) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkgBAD9W90jLzq3r/2dsb2JhbAAIxB+DbA X-IronPort-AV: E=Sophos;i="4.33,426,1220198400"; d="scan'208";a="338799269" Received: from unknown (HELO [10.24.1.1]) ([203.206.173.235]) by outbound.icp-qv1-irony-out3.iinet.net.au with ESMTP; 17 Oct 2008 05:58:30 +0800 Message-ID: <48F7B865.2040604@mawer.org> Date: Fri, 17 Oct 2008 08:55:49 +1100 From: Antony Mawer User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Jeremy Chadwick References: <676151223134689@webmail38.yandex.ru> <20081005004808.GA70137@icarus.home.lan> <48E99C18.6070602@yandex.ru> <20081006051211.GA10542@icarus.home.lan> <20081010115855.GA31707@icarus.home.lan> <20081016071700.GA2793@icarus.home.lan> In-Reply-To: <20081016071700.GA2793@icarus.home.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: kib@freebsd.org, "Andrey V. Elsukov" , freebsd-stable@freebsd.org, sos@freebsd.org Subject: Re: Request for testing: ata(4) MFC X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2008 22:28:43 -0000 Jeremy Chadwick wrote: > On Fri, Oct 10, 2008 at 04:58:55AM -0700, Jeremy Chadwick wrote: >> On Sun, Oct 05, 2008 at 10:12:11PM -0700, Jeremy Chadwick wrote: >>> On Mon, Oct 06, 2008 at 09:03:20AM +0400, Andrey V. Elsukov wrote: >>>> Jeremy Chadwick wrote: >>>>> Also, does your patch include any fixes (intentional or inadvertent) for >>>>> Intel MatrixRAID? This has been a sore spot for FreeBSD for quite >>>>> some time, and I'm curious to know if that has been fixed. >>>> There is only one fix for Intel Matrix RAID: >>>> http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/121899 >>> Ahh, yeah, I've seen that one as well. I'll apply the patch and let you >>> know if the behaviour documented in the PR happens. >> I'm sorry I haven't gotten around to testing this -- my day (night) job >> has kept me incredibly busy, and I've had hardly any time at home to >> work on personal projects. It sucks. >> >> I'll try to make time for testing either today or tomorrow. ... > Other items: > > - Could someone provide an explanation of the 48-bit LBA addressing > changes (see lines 988-1003 in the patch)? I'd like to know what they > do, and if further QA/testing is needed with this. This is probably more a question for Søren... I started looking at the moment, as the original 28->48bit crossover bug was in the same function not so long ago (ata-all.c rev1.280). The 48-bit LBA changes are introduced from ata-all.c rev1.282, which was the port multiplier changes. The logic just doesn't seem quite right to it to me, but I'm not an expert on the code or on ATA, so all of this could just be amateur mis-interpretation. From my reading of it, the code does this: /* * Check to see if we need to use a 48-bit command in place of the * standard 28-bit command, and if so, substitute as appropriate */ IF ((request_lba_addr + lba_count) >= max addressable by 28-bit LBA or lba_count > 256) and device supports 48-bit LBA THEN /* * The request either: * * - extends past the 28-bit boundary * - is for more than 256 sectors * * which necessitates the use of 48-bit LBA. Translate commands * into their 48-bit equivalents. */ ... ELSEIF the device supports 48-bit lba: /* * We prefer (need?) to use the 48-bit equivalents of these * commands regardless of what the LBA address of the reqest is */ ... END IF In rev 1.282, the ATA_READ_NATIVE_MAX_ADDRESS was moved down to the "ELSE" case of the IF statement. In otherwords, when the request is beyond the 28-bit boundary, OR it's > 256 sectors, ATA_READ_NATIVE_MAX_ADDRESS won't be translated... Søren, is this change intentional, or should it be also added to the switch statement in the top half of the IF block? The ATA code appears to be very lightly commented, which no doubt is something of a barrier to entry to those who are not familiar with issues such as the above... would any volunteers be helpful to help comment and/or document some of the code? We would likely need to confer with Søren and others to ensure that our interpretation was accurate, but it would certainly make tracking down issues easier for those unfamiliar with the code... --Antony