linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ata.h: Don't do a SATA check for 40wire_relaxed
@ 2007-11-19 15:24 Alan Cox
  2007-11-24  1:23 ` Jeff Garzik
  2007-12-04 19:20 ` Jeff Garzik
  0 siblings, 2 replies; 8+ messages in thread
From: Alan Cox @ 2007-11-19 15:24 UTC (permalink / raw)
  To: jeff, linux-ide

Without the valid bits at least one set of TSScorp drives report 0 in
word 93 for PATA 40 wire, which we (and the specs) say actually means
SATA. (The SATA version seems to report 80 wire...)

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.24-rc2-mm1/include/linux/ata.h linux-2.6.24-rc2-mm1/include/linux/ata.h
--- linux.vanilla-2.6.24-rc2-mm1/include/linux/ata.h	2007-11-16 17:55:20.000000000 +0000
+++ linux-2.6.24-rc2-mm1/include/linux/ata.h	2007-11-16 18:42:20.000000000 +0000
@@ -560,8 +560,6 @@
 
 static inline int ata_drive_40wire_relaxed(const u16 *dev_id)
 {
-	if (ata_id_is_sata(dev_id))
-		return 0;	/* SATA */
 	if ((dev_id[93] & 0x2000) == 0x2000)
 		return 0;	/* 80 wire */
 	return 1;

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [PATCH] ata.h: Don't do a SATA check for 40wire_relaxed
@ 2007-12-08 14:55 Peter Missel
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Missel @ 2007-12-08 14:55 UTC (permalink / raw)
  To: Alan Cox, jeff, linux-ide

Hi all!

As the originator of this patch, please let me comment.

Jeff Garzik wrote:
>Alan Cox wrote:
>> Without the valid bits at least one set of TSScorp drives report 0 in
>> word 93 for PATA 40 wire, which we (and the specs) say actually means
>> SATA. (The SATA version seems to report 80 wire...)
>> 
>> Signed-off-by: Alan Cox <alan@redhat.com>

>SATA version on what controller?  Have you verified where the bridge is, 
>if it's not reporting word93==0 ?

>Is this for 2.6.24-rc, considering that we are late in -rc?

The offending drives are native IDE, but their word93 is broken, in that the 
validation bits are missing. Hence, if connected to a 40-wire cable, they 
return word93=0x0000 and make themselves look like a SATA drive.

This makes the 'relaxed' cable check do the exact wrong thing - allow fast 
UDMA modes.

The patch discussed here corrects the 'relaxed' cable check, so that it 
actually does what it's supposed to - look at nothing but the cable type bit 
in word93 and exactly NOT draw any other conclusions from word93. 

Due the dangerous behaviour of the unpatched code, I strongly vote for 
inclusion in 2.6.24.

regards,
Peter

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [PATCH] ata.h: Don't do a SATA check for 40wire_relaxed
@ 2007-12-15 17:35 Peter Missel
  2007-12-15 17:49 ` Alan Cox
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Missel @ 2007-12-15 17:35 UTC (permalink / raw)
  To: Alan Cox, jeff, linux-ide

Pinging ... don't take this personal guys, but are we going to keep the 
original, dangerously broken implementation in 2.6.24, or will my patch go 
upstream in time?

cheers,
Peter

---------------
Hi all!

As the originator of this patch, please let me comment.

Jeff Garzik wrote:
>Alan Cox wrote:
>> Without the valid bits at least one set of TSScorp drives report 0 in
>> word 93 for PATA 40 wire, which we (and the specs) say actually means
>> SATA. (The SATA version seems to report 80 wire...)
>> 
>> Signed-off-by: Alan Cox <alan@redhat.com>

>SATA version on what controller?  Have you verified where the bridge is, 
>if it's not reporting word93==0 ?

>Is this for 2.6.24-rc, considering that we are late in -rc?

The offending drives are native IDE, but their word93 is broken, in that the 
validation bits are missing. Hence, if connected to a 40-wire cable, they 
return word93=0x0000 and make themselves look like a SATA drive.

This makes the 'relaxed' cable check do the exact wrong thing - allow fast 
UDMA modes.

The patch discussed here corrects the 'relaxed' cable check, so that it 
actually does what it's supposed to - look at nothing but the cable type bit 
in word93 and exactly NOT draw any other conclusions from word93. 

Due the dangerous behaviour of the unpatched code, I strongly vote for 
inclusion in 2.6.24.

regards,
Peter

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

end of thread, other threads:[~2007-12-15 17:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-19 15:24 [PATCH] ata.h: Don't do a SATA check for 40wire_relaxed Alan Cox
2007-11-24  1:23 ` Jeff Garzik
2007-11-24 13:46   ` Alan Cox
2007-12-04 19:20 ` Jeff Garzik
2007-12-04 20:29   ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2007-12-08 14:55 Peter Missel
2007-12-15 17:35 Peter Missel
2007-12-15 17:49 ` Alan Cox

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