diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-06-11 05:40:07 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-06-20 19:56:21 -0400 |
commit | 374abf2cb16a9df8be96675c606996458872e8b3 (patch) | |
tree | 7d82b5165a8d6bca8569ed6722413ef5688a294f /drivers | |
parent | 9f7897554eeca34ec23dd877cc27402bd327a1ce (diff) |
pata_it821x: (partially) fix DMA in RAID mode
Code intended to check DMA status was checking DMA command register.
Moreover firmware seems to "forget" to set DMA capable bit for the
slave device (at least in RAID mode but without ITE RAID volumes) so
check device ID for DMA capable bit when deciding whether to use DMA
and remove DMA status check completely.
Thanks to Pavol Simo for the bugreport and testing the initial fix.
This change unfortunately still doesn't fix DMA in RAID mode (which
works fine with IDE it821x) but Alan is working on the missing pieces
(pata_it821x vs libata EH issues).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/pata_it821x.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index b3456d7a592c..525c9c142891 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * pata_it821x.c - IT821x PATA for new ATA layer | 2 | * pata_it821x.c - IT821x PATA for new ATA layer |
3 | * (C) 2005 Red Hat Inc | 3 | * (C) 2005 Red Hat Inc |
4 | * Alan Cox <alan@redhat.com> | 4 | * Alan Cox <alan@redhat.com> |
5 | * (C) 2007 Bartlomiej Zolnierkiewicz | ||
5 | * | 6 | * |
6 | * based upon | 7 | * based upon |
7 | * | 8 | * |
@@ -79,7 +80,7 @@ | |||
79 | 80 | ||
80 | 81 | ||
81 | #define DRV_NAME "pata_it821x" | 82 | #define DRV_NAME "pata_it821x" |
82 | #define DRV_VERSION "0.3.6" | 83 | #define DRV_VERSION "0.3.7" |
83 | 84 | ||
84 | struct it821x_dev | 85 | struct it821x_dev |
85 | { | 86 | { |
@@ -460,14 +461,8 @@ static unsigned int it821x_passthru_qc_issue_prot(struct ata_queued_cmd *qc) | |||
460 | 461 | ||
461 | static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device **unused) | 462 | static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device **unused) |
462 | { | 463 | { |
463 | int dma_enabled = 0; | ||
464 | int i; | 464 | int i; |
465 | 465 | ||
466 | /* Bits 5 and 6 indicate if DMA is active on master/slave */ | ||
467 | /* It is possible that BMDMA isn't allocated */ | ||
468 | if (ap->ioaddr.bmdma_addr) | ||
469 | dma_enabled = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_CMD); | ||
470 | |||
471 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | 466 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
472 | struct ata_device *dev = &ap->device[i]; | 467 | struct ata_device *dev = &ap->device[i]; |
473 | if (ata_dev_enabled(dev)) { | 468 | if (ata_dev_enabled(dev)) { |
@@ -476,7 +471,7 @@ static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device **unused | |||
476 | dev->dma_mode = XFER_MW_DMA_0; | 471 | dev->dma_mode = XFER_MW_DMA_0; |
477 | /* We do need the right mode information for DMA or PIO | 472 | /* We do need the right mode information for DMA or PIO |
478 | and this comes from the current configuration flags */ | 473 | and this comes from the current configuration flags */ |
479 | if (dma_enabled & (1 << (5 + i))) { | 474 | if (ata_id_has_dma(dev->id)) { |
480 | ata_dev_printk(dev, KERN_INFO, "configured for DMA\n"); | 475 | ata_dev_printk(dev, KERN_INFO, "configured for DMA\n"); |
481 | dev->xfer_mode = XFER_MW_DMA_0; | 476 | dev->xfer_mode = XFER_MW_DMA_0; |
482 | dev->xfer_shift = ATA_SHIFT_MWDMA; | 477 | dev->xfer_shift = ATA_SHIFT_MWDMA; |