Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21873
b: refs/heads/master
c: 4b2f3ed
h: refs/heads/master
i:
  21871: 475bd89
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Mar 3, 2006
1 parent 9e6967a commit e076089
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ffeae418c12a304f6a9b6468043954d4e67a2b1e
refs/heads/master: 4b2f3ededc035525038a7a9247074243dac6b351
48 changes: 17 additions & 31 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,12 @@ static int ata_dev_read_id(struct ata_port *ap, struct ata_device *dev,
return rc;
}

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(dev->id)));
}

/**
* ata_dev_configure - Configure the specified ATA/ATAPI device
* @ap: Port on which target device resides
Expand Down Expand Up @@ -1167,6 +1173,17 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev)
ap->host->max_cmd_len,
ap->device[i].cdb_len);

/* limit bridge transfers to udma5, 200 sectors */
if (ata_dev_knobble(ap, dev)) {
printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
ap->id, dev->devno);
ap->udma_mask &= ATA_UDMA5;
dev->max_sectors = ATA_MAX_SECTORS;
}

if (ap->ops->dev_config)
ap->ops->dev_config(ap, dev);

DPRINTK("EXIT, drv_stat = 0x%x\n", ata_chk_status(ap));
return 0;

Expand All @@ -1177,35 +1194,6 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev)
return rc;
}


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(dev->id)));
}

/**
* ata_dev_config - Run device specific handlers & check for SATA->PATA bridges
* @ap: Bus
* @i: Device
*
* LOCKING:
*/

void ata_dev_config(struct ata_port *ap, unsigned int i)
{
/* limit bridge transfers to udma5, 200 sectors */
if (ata_dev_knobble(ap, &ap->device[i])) {
printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
ap->id, i);
ap->udma_mask &= ATA_UDMA5;
ap->device[i].max_sectors = ATA_MAX_SECTORS;
}

if (ap->ops->dev_config)
ap->ops->dev_config(ap, &ap->device[i]);
}

/**
* ata_bus_probe - Reset and probe ATA bus
* @ap: Bus to probe
Expand Down Expand Up @@ -1266,7 +1254,6 @@ static int ata_bus_probe(struct ata_port *ap)
continue;
}

ata_dev_config(ap, i);
found = 1;
}

Expand Down Expand Up @@ -4967,7 +4954,6 @@ EXPORT_SYMBOL_GPL(ata_host_intr);
EXPORT_SYMBOL_GPL(ata_dev_classify);
EXPORT_SYMBOL_GPL(ata_id_string);
EXPORT_SYMBOL_GPL(ata_id_c_string);
EXPORT_SYMBOL_GPL(ata_dev_config);
EXPORT_SYMBOL_GPL(ata_scsi_simulate);
EXPORT_SYMBOL_GPL(ata_eh_qc_complete);
EXPORT_SYMBOL_GPL(ata_eh_qc_retry);
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ extern void ata_id_string(const u16 *id, unsigned char *s,
unsigned int ofs, unsigned int len);
extern void ata_id_c_string(const u16 *id, unsigned char *s,
unsigned int ofs, unsigned int len);
extern void ata_dev_config(struct ata_port *ap, unsigned int i);
extern void ata_bmdma_setup (struct ata_queued_cmd *qc);
extern void ata_bmdma_start (struct ata_queued_cmd *qc);
extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
Expand Down

0 comments on commit e076089

Please sign in to comment.