Skip to content

Commit

Permalink
[PATCH] libata: make ata_dev_knobble() per-device
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Feb 12, 2006
1 parent 61eb066 commit 8eabd02
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,9 +1121,10 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
}


static inline u8 ata_dev_knobble(const struct ata_port *ap)
static inline u8 ata_dev_knobble(const struct ata_port *ap,
struct ata_device *dev)
{
return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id)));
return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(dev->id)));
}

/**
Expand All @@ -1137,9 +1138,9 @@ static inline u8 ata_dev_knobble(const struct ata_port *ap)
void ata_dev_config(struct ata_port *ap, unsigned int i)
{
/* limit bridge transfers to udma5, 200 sectors */
if (ata_dev_knobble(ap)) {
if (ata_dev_knobble(ap, &ap->device[i])) {
printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
ap->id, ap->device->devno);
ap->id, i);
ap->udma_mask &= ATA_UDMA5;
ap->host->max_sectors = ATA_MAX_SECTORS;
ap->host->hostt->max_sectors = ATA_MAX_SECTORS;
Expand Down

0 comments on commit 8eabd02

Please sign in to comment.