linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Brad Campbell <brad@wasp.net.au>
Cc: linux-ide@vger.kernel.org, Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: libata dev_config call order wrong.
Date: Sun, 29 Aug 2004 14:25:03 -0400	[thread overview]
Message-ID: <41321F7F.7050300@pobox.com> (raw)
In-Reply-To: <4132198B.8000504@pobox.com>

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

Jeff Garzik wrote:
> me either, unless I can figure out a way to detect that a disk is PATA 
> not SATA.  Nothing is obvious from the specs on www.t13.org, but who knows.

According to the Serial ATA docs, IDENTIFY DEVICE word 93 will be zero 
if it's Serial ATA.  Who knows if that's true, given the wierd wild 
world of ATA devices.

So, given the attached patch, you could try and create a generic 
ata_dev_config that all drivers call, that does something like

	/* limit bridge transfers to udma5, 200 sectors */
	if ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(dev))) {
                 printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
                        ap->id, dev->devno);
		ap->udma_mask &= ATA_UDMA5;
                 ap->host->max_sectors = ATA_MAX_SECTORS;
                 ap->host->hostt->max_sectors = ATA_MAX_SECTORS;
                 dev->flags |= ATA_DFLAG_LOCK_SECTORS;
	}

Regards,

	Jeff



[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 484 bytes --]

===== include/linux/ata.h 1.17 vs edited =====
--- 1.17/include/linux/ata.h	2004-08-18 01:47:22 -04:00
+++ edited/include/linux/ata.h	2004-08-29 14:18:02 -04:00
@@ -218,6 +218,7 @@
 };
 
 #define ata_id_is_ata(dev)	(((dev)->id[0] & (1 << 15)) == 0)
+#define ata_id_is_sata(dev)	((dev)->id[93] == 0)
 #define ata_id_rahead_enabled(dev) ((dev)->id[85] & (1 << 6))
 #define ata_id_wcache_enabled(dev) ((dev)->id[85] & (1 << 5))
 #define ata_id_has_flush(dev) ((dev)->id[83] & (1 << 12))

  reply	other threads:[~2004-08-29 18:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-29 17:09 libata dev_config call order wrong Brad Campbell
2004-08-29 17:29 ` Jeff Garzik
2004-08-29 17:47   ` Brad Campbell
2004-08-29 17:59     ` Jeff Garzik
2004-08-29 18:25       ` Jeff Garzik [this message]
2004-08-29 18:59         ` Alan Cox
2004-08-30  9:12           ` Brad Campbell
2004-08-30 13:22             ` Alan Cox
2004-08-30 14:38               ` Brad Campbell
2004-08-30 14:42         ` [PATCH] libata ATA vs SATA detection and workaround Brad Campbell
2004-08-30 14:57           ` Brad Campbell
2004-08-30 16:06             ` Jeff Garzik
2004-08-30 16:34               ` Brad Campbell
2004-08-30 16:37                 ` Jeff Garzik
2004-08-30 17:17                   ` Brad Campbell
2004-08-30 17:59                     ` Jeff Garzik
2004-08-31  7:47                       ` Brad Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41321F7F.7050300@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=brad@wasp.net.au \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).