lkml.org 
[lkml]   [2004]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: libata dev_config call order wrong.
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


===== 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))
\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.978 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site