From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LM25B-0001hp-Nm for mharc-grub-devel@gnu.org; Sun, 11 Jan 2009 10:18:33 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LM25A-0001gR-1w for grub-devel@gnu.org; Sun, 11 Jan 2009 10:18:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LM258-0001eO-34 for grub-devel@gnu.org; Sun, 11 Jan 2009 10:18:31 -0500 Received: from [199.232.76.173] (port=47888 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LM257-0001eF-Td for grub-devel@gnu.org; Sun, 11 Jan 2009 10:18:29 -0500 Received: from mailout09.t-online.de ([194.25.134.84]:55058) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LM257-0006Ty-Kc for grub-devel@gnu.org; Sun, 11 Jan 2009 10:18:29 -0500 Received: from fwd09.aul.t-online.de by mailout09.sul.t-online.de with smtp id 1LM252-0002iR-03; Sun, 11 Jan 2009 16:18:24 +0100 Received: from [10.3.2.2] (TnPaaeZYrhviXZkZJyMJXJ2MHOPoFe2FZ4g2vJ1X+NIYp1a4CzPAJoDD9rUSjEiwf7@[217.235.249.194]) by fwd09.aul.t-online.de with esmtp id 1LM24n-0puwVc0; Sun, 11 Jan 2009 16:18:09 +0100 Message-ID: <496A0DB2.3030906@t-online.de> Date: Sun, 11 Jan 2009 16:18:10 +0100 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 SeaMonkey/1.1.11 MIME-Version: 1.0 To: grub-devel@gnu.org Content-Type: multipart/mixed; boundary="------------040908060408010407010900" X-ID: TnPaaeZYrhviXZkZJyMJXJ2MHOPoFe2FZ4g2vJ1X+NIYp1a4CzPAJoDD9rUSjEiwf7 X-TOI-MSGID: 31bea96f-cc02-42b1-9eb7-19f06940c9cb X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [PATCH] Fix ATA compatibility mode check X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 15:18:32 -0000 This is a multi-part message in MIME format. --------------040908060408010407010900 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit For the compatibility mode check, the ATA driver uses the bits in the "Revision" byte instead of the "Programming Interface Byte" of the class value (See T13/1510D). The compat_use[] flags are never set. This patch fixes both issues. Christian 2009-01-11 Christian Franke * disk/ata.c (grub_ata_pciinit): Fix bit numbers of compatibility mode check. Fix setting of compat_use[]. --------------040908060408010407010900 Content-Type: text/x-diff; name="grub2-ata-compat-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="grub2-ata-compat-fix.patch" diff --git a/disk/ata.c b/disk/ata.c index 6e0b8b8..4ca63c2 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -504,7 +504,7 @@ grub_ata_pciinit (int bus, int device, int func, for (i = 0; i < 2; i++) { /* Set to 0 when the channel operated in compatibility mode. */ - int compat = (class >> (2 * i)) & 1; + int compat = (class >> (8 + 2 * i)) & 1; rega = 0; regb = 0; @@ -515,7 +515,7 @@ grub_ata_pciinit (int bus, int device, int func, { rega = grub_ata_ioaddress[i]; regb = grub_ata_ioaddress2[i]; - compat_use[i] = 0; + compat_use[i] = 1; } else if (compat) { --------------040908060408010407010900--