public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ide: Fix ata_id_has_dword_io to return DWORD I/O support properly
@ 2008-12-18 14:18 Mario Schwalbe
  2008-12-18 17:08 ` Jeff Garzik
  0 siblings, 1 reply; 15+ messages in thread
From: Mario Schwalbe @ 2008-12-18 14:18 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel

This patch fixes ata_id_has_dword_io to return 1 (supported) if
the drive is compliant to ATA2 or newer and evaluates the config
word for older drives.

Signed-off-by: Mario Schwalbe <schwalbe@inf.tu-dresden.de>
---
 include/linux/ata.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/ata.h b/include/linux/ata.h
index a53318b..d0d6a9c 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -700,12 +700,12 @@ static inline int ata_id_has_tpm(const u16 *id)

 static inline int ata_id_has_dword_io(const u16 *id)
 {
-	/* ATA 8 reuses this flag for "trusted" computing */
-	if (ata_id_major_version(id) > 7)
-		return 0;
-	if (id[ATA_ID_DWORD_IO] & (1 << 0))
-		return 1;
-	return 0;
+	/* This flag is defined up to ATA1 and deprecated since then
+	   (ATA 8 reuses this flag for "trusted" computing). */
+	if (ata_id_major_version(id) <= 1)
+		return (id[ATA_ID_DWORD_IO] & (1 << 0)) != 0;
+	/* later revision drives support DWORD I/O just fine */
+	return 1;
 }

 static inline int ata_id_has_unload(const u16 *id)
-- 
1.5.6.3


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

end of thread, other threads:[~2008-12-22 20:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-18 14:18 [PATCH] ide: Fix ata_id_has_dword_io to return DWORD I/O support properly Mario Schwalbe
2008-12-18 17:08 ` Jeff Garzik
2008-12-18 17:24   ` Sergei Shtylyov
2008-12-18 20:42     ` Bartlomiej Zolnierkiewicz
2008-12-18 22:40       ` Alan Cox
2008-12-18 23:13         ` Bartlomiej Zolnierkiewicz
2008-12-19 10:50           ` Alan Cox
2008-12-19 19:30             ` Bartlomiej Zolnierkiewicz
2008-12-20  0:10               ` Alan Cox
2008-12-19 11:31         ` Sergei Shtylyov
2008-12-19 11:34           ` Sergei Shtylyov
2008-12-18 18:10   ` Alan Cox
2008-12-20  1:58     ` Robert Hancock
2008-12-20 13:25       ` Sergei Shtylyov
2008-12-22 20:16         ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox