diff options
Diffstat (limited to 'drivers/ata/pata_pdc2027x.c')
-rw-r--r-- | drivers/ata/pata_pdc2027x.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c index 0e1c2c1134d..e94efccaa48 100644 --- a/drivers/ata/pata_pdc2027x.c +++ b/drivers/ata/pata_pdc2027x.c | |||
@@ -281,7 +281,6 @@ static unsigned long pdc2027x_mode_filter(struct ata_device *adev, unsigned long | |||
281 | * pdc2027x_set_piomode - Initialize host controller PATA PIO timings | 281 | * pdc2027x_set_piomode - Initialize host controller PATA PIO timings |
282 | * @ap: Port to configure | 282 | * @ap: Port to configure |
283 | * @adev: um | 283 | * @adev: um |
284 | * @pio: PIO mode, 0 - 4 | ||
285 | * | 284 | * |
286 | * Set PIO mode for device. | 285 | * Set PIO mode for device. |
287 | * | 286 | * |
@@ -326,7 +325,6 @@ static void pdc2027x_set_piomode(struct ata_port *ap, struct ata_device *adev) | |||
326 | * pdc2027x_set_dmamode - Initialize host controller PATA UDMA timings | 325 | * pdc2027x_set_dmamode - Initialize host controller PATA UDMA timings |
327 | * @ap: Port to configure | 326 | * @ap: Port to configure |
328 | * @adev: um | 327 | * @adev: um |
329 | * @udma: udma mode, XFER_UDMA_0 to XFER_UDMA_6 | ||
330 | * | 328 | * |
331 | * Set UDMA mode for device. | 329 | * Set UDMA mode for device. |
332 | * | 330 | * |
@@ -406,23 +404,20 @@ static int pdc2027x_set_mode(struct ata_link *link, struct ata_device **r_failed | |||
406 | if (rc < 0) | 404 | if (rc < 0) |
407 | return rc; | 405 | return rc; |
408 | 406 | ||
409 | ata_link_for_each_dev(dev, link) { | 407 | ata_for_each_dev(dev, link, ENABLED) { |
410 | if (ata_dev_enabled(dev)) { | 408 | pdc2027x_set_piomode(ap, dev); |
411 | 409 | ||
412 | pdc2027x_set_piomode(ap, dev); | 410 | /* |
411 | * Enable prefetch if the device support PIO only. | ||
412 | */ | ||
413 | if (dev->xfer_shift == ATA_SHIFT_PIO) { | ||
414 | u32 ctcr1 = ioread32(dev_mmio(ap, dev, PDC_CTCR1)); | ||
415 | ctcr1 |= (1 << 25); | ||
416 | iowrite32(ctcr1, dev_mmio(ap, dev, PDC_CTCR1)); | ||
413 | 417 | ||
414 | /* | 418 | PDPRINTK("Turn on prefetch\n"); |
415 | * Enable prefetch if the device support PIO only. | 419 | } else { |
416 | */ | 420 | pdc2027x_set_dmamode(ap, dev); |
417 | if (dev->xfer_shift == ATA_SHIFT_PIO) { | ||
418 | u32 ctcr1 = ioread32(dev_mmio(ap, dev, PDC_CTCR1)); | ||
419 | ctcr1 |= (1 << 25); | ||
420 | iowrite32(ctcr1, dev_mmio(ap, dev, PDC_CTCR1)); | ||
421 | |||
422 | PDPRINTK("Turn on prefetch\n"); | ||
423 | } else { | ||
424 | pdc2027x_set_dmamode(ap, dev); | ||
425 | } | ||
426 | } | 421 | } |
427 | } | 422 | } |
428 | return 0; | 423 | return 0; |