aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-02-16 20:40:26 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-02-16 20:40:26 -0500
commit9ef5791e1be91007951477b8ed1530ac1166a8e7 (patch)
tree353f2c04ad2d6c27d9e3744a1507ab8b2830afdf
parentd8f4469d5f2c35e0b8272f254b42737a2b8ce877 (diff)
sgiioc4: fix sgiioc4_ide_dma_check() to enable/disable DMA properly
* use sgiioc4_ide_dma_{on,off_quietly}() instead of changing drive->using_dma directly * fix warning message * add FIXME Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/pci/sgiioc4.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 083c7afe1162..290697e09e55 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -275,21 +275,6 @@ sgiioc4_ide_dma_end(ide_drive_t * drive)
275} 275}
276 276
277static int 277static int
278sgiioc4_ide_dma_check(ide_drive_t * drive)
279{
280 if (ide_config_drive_speed(drive, XFER_MW_DMA_2) != 0) {
281 printk(KERN_INFO
282 "Couldnot set %s in Multimode-2 DMA mode | "
283 "Drive %s using PIO instead\n",
284 drive->name, drive->name);
285 drive->using_dma = 0;
286 } else
287 drive->using_dma = 1;
288
289 return 0;
290}
291
292static int
293sgiioc4_ide_dma_on(ide_drive_t * drive) 278sgiioc4_ide_dma_on(ide_drive_t * drive)
294{ 279{
295 drive->using_dma = 1; 280 drive->using_dma = 1;
@@ -305,6 +290,17 @@ sgiioc4_ide_dma_off_quietly(ide_drive_t * drive)
305 return HWIF(drive)->ide_dma_host_off(drive); 290 return HWIF(drive)->ide_dma_host_off(drive);
306} 291}
307 292
293static int sgiioc4_ide_dma_check(ide_drive_t *drive)
294{
295 /* FIXME: check for available DMA modes */
296 if (ide_config_drive_speed(drive, XFER_MW_DMA_2) != 0) {
297 printk(KERN_WARNING "%s: couldn't set MWDMA2 mode, "
298 "using PIO instead\n", drive->name);
299 return sgiioc4_ide_dma_off_quietly(drive);
300 } else
301 return sgiioc4_ide_dma_on(drive);
302}
303
308/* returns 1 if dma irq issued, 0 otherwise */ 304/* returns 1 if dma irq issued, 0 otherwise */
309static int 305static int
310sgiioc4_ide_dma_test_irq(ide_drive_t * drive) 306sgiioc4_ide_dma_test_irq(ide_drive_t * drive)