All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix ATA compatibility mode check
@ 2009-01-11 15:18 Christian Franke
  2009-01-12 20:23 ` Christian Franke
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Franke @ 2009-01-11 15:18 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 414 bytes --]

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  <franke@computer.org>

	* disk/ata.c (grub_ata_pciinit): Fix bit numbers of compatibility
	mode check.  Fix setting of compat_use[].



[-- Attachment #2: grub2-ata-compat-fix.patch --]
[-- Type: text/x-diff, Size: 624 bytes --]

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)
 	{

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix ATA compatibility mode check
  2009-01-11 15:18 [PATCH] Fix ATA compatibility mode check Christian Franke
@ 2009-01-12 20:23 ` Christian Franke
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Franke @ 2009-01-12 20:23 UTC (permalink / raw)
  To: The development of GRUB 2

Christian Franke wrote:
> 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.

Committed.

Christian




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-12 20:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-11 15:18 [PATCH] Fix ATA compatibility mode check Christian Franke
2009-01-12 20:23 ` Christian Franke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.