Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29223
b: refs/heads/master
c: 565083e
h: refs/heads/master
i:
  29221: 268683b
  29219: a4cb27b
  29215: eeb6a0b
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Apr 2, 2006
1 parent 8ce5e11 commit 9b28244
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 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: 14d2bac1877ed4e2cc940d1680db1a4f29225811
refs/heads/master: 565083e1f14e7771aa6bac2d3d4aae0b08d48d78
34 changes: 23 additions & 11 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2913,23 +2913,34 @@ static void ata_dev_xfermask(struct ata_port *ap, struct ata_device *dev)
unsigned long xfer_mask;
int i;

xfer_mask = ata_pack_xfermask(ap->pio_mask, ap->mwdma_mask,
ap->udma_mask);
xfer_mask = ata_pack_xfermask(ap->pio_mask,
ap->mwdma_mask, ap->udma_mask);

/* Apply cable rule here. Don't apply it early because when
* we handle hot plug the cable type can itself change.
*/
if (ap->cbl == ATA_CBL_PATA40)
xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA);

/* FIXME: Use port-wide xfermask for now */
for (i = 0; i < ATA_MAX_DEVICES; i++) {
struct ata_device *d = &ap->device[i];
if (!ata_dev_enabled(d))

if (ata_dev_absent(d))
continue;

if (ata_dev_disabled(d)) {
/* to avoid violating device selection timing */
xfer_mask &= ata_pack_xfermask(d->pio_mask,
UINT_MAX, UINT_MAX);
continue;
xfer_mask &= ata_pack_xfermask(d->pio_mask, d->mwdma_mask,
d->udma_mask);
}

xfer_mask &= ata_pack_xfermask(d->pio_mask,
d->mwdma_mask, d->udma_mask);
xfer_mask &= ata_id_xfermask(d->id);
if (ata_dma_blacklisted(d))
xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
/* Apply cable rule here. Don't apply it early because when
we handle hot plug the cable type can itself change */
if (ap->cbl == ATA_CBL_PATA40)
xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA);
}

if (ata_dma_blacklisted(dev))
Expand All @@ -2940,11 +2951,12 @@ static void ata_dev_xfermask(struct ata_port *ap, struct ata_device *dev)
if (hs->simplex_claimed)
xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
}

if (ap->ops->mode_filter)
xfer_mask = ap->ops->mode_filter(ap, dev, xfer_mask);

ata_unpack_xfermask(xfer_mask, &dev->pio_mask, &dev->mwdma_mask,
&dev->udma_mask);
ata_unpack_xfermask(xfer_mask, &dev->pio_mask,
&dev->mwdma_mask, &dev->udma_mask);
}

/**
Expand Down

0 comments on commit 9b28244

Please sign in to comment.