diff options
author | Akira Iguchi <akira2.iguchi@toshiba.co.jp> | 2007-03-03 11:48:55 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-03-03 11:48:55 -0500 |
commit | 06a9952b8379c48df972023f648014a82582c23a (patch) | |
tree | 54502af21dff2a7a2ec7f7ffe70208e849fd9fad /drivers | |
parent | 846c11abc7934a523a665a3b702358e6f2998e3e (diff) |
scc_pata: bugfix for checking DMA IRQ status
On Tuesday 27 February 2007, Akira Iguchi wrote:
>
> But since I sent the first patch, I found a bug for checking DMA IRQ status.
> (http://www.spinics.net/lists/linux-ide/msg06903.html)
> Then I sent the fixed patch for libata only. So my drivers/ide patch
> still has same bug and I want to fix it, too.
>
> The following patch fixes this bug. Please apply this patch.
From: Akira Iguchi <akira2.iguchi@toshiba.co.jp>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ppc/scc_pata.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/ide/ppc/scc_pata.c b/drivers/ide/ppc/scc_pata.c index de64b022478b..f84bf791f72e 100644 --- a/drivers/ide/ppc/scc_pata.c +++ b/drivers/ide/ppc/scc_pata.c | |||
@@ -509,6 +509,32 @@ static int scc_ide_dma_end(ide_drive_t * drive) | |||
509 | return __ide_dma_end(drive); | 509 | return __ide_dma_end(drive); |
510 | } | 510 | } |
511 | 511 | ||
512 | /* returns 1 if dma irq issued, 0 otherwise */ | ||
513 | static int scc_dma_test_irq(ide_drive_t *drive) | ||
514 | { | ||
515 | ide_hwif_t *hwif = HWIF(drive); | ||
516 | u8 dma_stat = hwif->INB(hwif->dma_status); | ||
517 | |||
518 | /* return 1 if INTR asserted */ | ||
519 | if ((dma_stat & 4) == 4) | ||
520 | return 1; | ||
521 | |||
522 | /* Workaround for PTERADD: emulate DMA_INTR when | ||
523 | * - IDE_STATUS[ERR] = 1 | ||
524 | * - INT_STATUS[INTRQ] = 1 | ||
525 | * - DMA_STATUS[IORACTA] = 1 | ||
526 | */ | ||
527 | if (in_be32((void __iomem *)IDE_ALTSTATUS_REG) & ERR_STAT && | ||
528 | in_be32((void __iomem *)(hwif->dma_base + 0x014)) & INTSTS_INTRQ && | ||
529 | dma_stat & 1) | ||
530 | return 1; | ||
531 | |||
532 | if (!drive->waiting_for_dma) | ||
533 | printk(KERN_WARNING "%s: (%s) called while not waiting\n", | ||
534 | drive->name, __FUNCTION__); | ||
535 | return 0; | ||
536 | } | ||
537 | |||
512 | /** | 538 | /** |
513 | * setup_mmio_scc - map CTRL/BMID region | 539 | * setup_mmio_scc - map CTRL/BMID region |
514 | * @dev: PCI device we are configuring | 540 | * @dev: PCI device we are configuring |
@@ -712,6 +738,7 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif) | |||
712 | hwif->speedproc = scc_tune_chipset; | 738 | hwif->speedproc = scc_tune_chipset; |
713 | hwif->tuneproc = scc_tuneproc; | 739 | hwif->tuneproc = scc_tuneproc; |
714 | hwif->ide_dma_check = scc_config_drive_for_dma; | 740 | hwif->ide_dma_check = scc_config_drive_for_dma; |
741 | hwif->ide_dma_test_irq = scc_dma_test_irq; | ||
715 | 742 | ||
716 | hwif->drives[0].autotune = IDE_TUNE_AUTO; | 743 | hwif->drives[0].autotune = IDE_TUNE_AUTO; |
717 | hwif->drives[1].autotune = IDE_TUNE_AUTO; | 744 | hwif->drives[1].autotune = IDE_TUNE_AUTO; |