linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH libata-dev#upstream-fixes] libata: fix drive side 80c cable check
@ 2007-02-05  7:45 Tejun Heo
  2007-02-05 10:57 ` Alan
  0 siblings, 1 reply; 10+ messages in thread
From: Tejun Heo @ 2007-02-05  7:45 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide, Alan Cox; +Cc: stable

The 80c wire bit is bit 13, not 14.  Bit 14 is always 1 if word93 is
implemented.  This increases the chance of incorrect wire detection
especially because host side cable detection is often unreliable and
we sometimes soley depend on drive side cable detection.  Fix it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
Please consider for -stable.  This bug has been copied from ide and
it's just amazing how long this has gone unnoticed.  Will post
separate patch for ide.

 include/linux/ata.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: work/include/linux/ata.h
===================================================================
--- work.orig/include/linux/ata.h
+++ work/include/linux/ata.h
@@ -347,7 +347,7 @@ static inline int ata_drive_40wire(const
 {
 	if (ata_id_major_version(dev_id) >= 5 && ata_id_is_sata(dev_id))
 		return 0;	/* SATA */
-	if (dev_id[93] & 0x4000)
+	if (dev_id[93] & (1 << 13))
 		return 0;	/* 80 wire */
 	return 1;
 }

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

end of thread, other threads:[~2007-07-13  4:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-05  7:45 [PATCH libata-dev#upstream-fixes] libata: fix drive side 80c cable check Tejun Heo
2007-02-05 10:57 ` Alan
2007-02-05 12:41   ` [PATCH libata-dev#upstream-fixes] libata: fix drive side 80c cable check, take 2 Tejun Heo
2007-02-05 13:27     ` Alan
2007-02-05 14:21       ` [PATCH libata-dev#upstream-fixes] libata: fix drive side 80c cable check, take 3 Tejun Heo
2007-02-05 14:36         ` Alan
2007-02-15 23:08         ` Jeff Garzik
2007-07-12 18:40         ` Sergei Shtylyov
2007-07-12 18:50           ` Sergei Shtylyov
2007-07-13  4:12             ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).