diff options
author | Tejun Heo <htejun@gmail.com> | 2006-02-12 09:32:58 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-02-12 14:29:10 -0500 |
commit | 8eabd02c246b808e0e27c3ee9ea17d0349efb06d (patch) | |
tree | f628dc88f1ccf37dbab98d32b19af2336baaa210 /drivers/scsi/libata-core.c | |
parent | 61eb066affc02e16c548aef8b876c49c84113f40 (diff) |
[PATCH] libata: make ata_dev_knobble() per-device
ata_dev_knobble() unconditionally used the first device of the port to
determine whether a device is bridged or not. This causes bridge
limit to be incorrectly applied or unapplied for hosts with slave
devices (e.g. ata_piix).
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r-- | drivers/scsi/libata-core.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 21ae752cd95c..5e8a32052a1e 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -1121,9 +1121,10 @@ err_out: | |||
1121 | } | 1121 | } |
1122 | 1122 | ||
1123 | 1123 | ||
1124 | static inline u8 ata_dev_knobble(const struct ata_port *ap) | 1124 | static inline u8 ata_dev_knobble(const struct ata_port *ap, |
1125 | struct ata_device *dev) | ||
1125 | { | 1126 | { |
1126 | return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id))); | 1127 | return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(dev->id))); |
1127 | } | 1128 | } |
1128 | 1129 | ||
1129 | /** | 1130 | /** |
@@ -1137,9 +1138,9 @@ static inline u8 ata_dev_knobble(const struct ata_port *ap) | |||
1137 | void ata_dev_config(struct ata_port *ap, unsigned int i) | 1138 | void ata_dev_config(struct ata_port *ap, unsigned int i) |
1138 | { | 1139 | { |
1139 | /* limit bridge transfers to udma5, 200 sectors */ | 1140 | /* limit bridge transfers to udma5, 200 sectors */ |
1140 | if (ata_dev_knobble(ap)) { | 1141 | if (ata_dev_knobble(ap, &ap->device[i])) { |
1141 | printk(KERN_INFO "ata%u(%u): applying bridge limits\n", | 1142 | printk(KERN_INFO "ata%u(%u): applying bridge limits\n", |
1142 | ap->id, ap->device->devno); | 1143 | ap->id, i); |
1143 | ap->udma_mask &= ATA_UDMA5; | 1144 | ap->udma_mask &= ATA_UDMA5; |
1144 | ap->host->max_sectors = ATA_MAX_SECTORS; | 1145 | ap->host->max_sectors = ATA_MAX_SECTORS; |
1145 | ap->host->hostt->max_sectors = ATA_MAX_SECTORS; | 1146 | ap->host->hostt->max_sectors = ATA_MAX_SECTORS; |