linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ide: Fix ATAPI DMA lost irq problem with CDB intr devices
@ 2007-01-18 11:19 Albert Lee
       [not found] ` <58cb370e0701191133m3dd584ffna5b231b00392c13d@mail.gmail.com>
  0 siblings, 1 reply; 23+ messages in thread
From: Albert Lee @ 2007-01-18 11:19 UTC (permalink / raw)
  To: Linux IDE; +Cc: Adam W. Hawks

Problem: IDE ATAPI DMA lost irq with CDB intr devices on Intel ICHx machines.

This patch clears the INTR and ERROR bits of DMA status before starting BMDMA
to fix the problem.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
---
ATAPI DMA irq lost when testing Intel ICHx with CDB-intr CD-ROM drives:

Jan 18 18:08:48 p4ht-s kernel: ide-cd: cmd 0x28 timed out
Jan 18 18:08:48 p4ht-s kernel: hdc: DMA interrupt recovery
Jan 18 18:08:48 p4ht-s kernel: hdc: lost interrupt
Jan 18 18:08:48 p4ht-s kernel: hdc: status timeout: status=0xd0 { Busy }
Jan 18 18:08:48 p4ht-s kernel: ide: failed opcode was: unknown
Jan 18 18:08:48 p4ht-s kernel: hdc: DMA disabled
Jan 18 18:08:48 p4ht-s kernel: hdc: drive not ready for command
Jan 18 18:08:48 p4ht-s kernel: hdc: ATAPI reset complete

The problem is reported by Adam Hawks.
It seems the the INTR bit was set to 1 by the CDB-intr before the DMA is started.
ICHx doesn't like it and causes the DMA irq lost later.

The patch is against 2.6.20-rc5. Tested ok on ICH4.
====================================================================

--- ide-dma.ori/drivers/ide/ide-dma.c	2006-11-30 05:57:37.000000000 +0800
+++ ide-dma/drivers/ide/ide-dma.c	2007-01-18 18:40:18.000000000 +0800
@@ -591,6 +591,12 @@ void ide_dma_start(ide_drive_t *drive)
 {
 	ide_hwif_t *hwif	= HWIF(drive);
 	u8 dma_cmd		= hwif->INB(hwif->dma_command);
+	u8 dma_stat		= hwif->INB(hwif->dma_status);
+
+	/* The intr bit of dma_status might has been set by the CDB interrupt.
+	 * Clear the INTR & ERROR bits here to prevent DMA irq lost later.
+	 */
+	hwif->OUTB(dma_stat|6, hwif->dma_status);
 
 	/* Note that this is done *after* the cmd has
 	 * been issued to the drive, as per the BM-IDE spec.



^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2007-02-02 21:10 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-18 11:19 [PATCH] ide: Fix ATAPI DMA lost irq problem with CDB intr devices Albert Lee
     [not found] ` <58cb370e0701191133m3dd584ffna5b231b00392c13d@mail.gmail.com>
2007-01-19 19:59   ` Bartlomiej Zolnierkiewicz
2007-01-22  7:28     ` Albert Lee
2007-01-22  8:45       ` Albert Lee
2007-01-22 16:05         ` Bartlomiej Zolnierkiewicz
2007-01-24  3:33           ` [PATCH 0/2] ide: clear bmdma status in ide_intr for all commands Albert Lee
2007-01-24  3:36             ` [PATCH 1/2] ide: remove clearing bmdma status from cdrom_decode_status() Albert Lee
2007-01-24  3:42             ` [PATCH 2/2] ide: clear bmdma status in ide_intr() Albert Lee
2007-01-24 13:04               ` Sergei Shtylyov
2007-01-25  9:31                 ` [PATCH 2/2] ide: clear bmdma status in ide_intr() (revised) Albert Lee
2007-01-25 15:17                   ` Sergei Shtylyov
2007-01-25 16:40                     ` Sergei Shtylyov
2007-01-30  2:49                       ` [PATCH 0/2] ide: clear bmdma status in ide_intr for Intel controllers (revised #3) Albert Lee
2007-01-30  2:52                         ` [PATCH 1/2] ide: remove clearing bmdma status from cdrom_decode_status() (rev #3) Albert Lee
2007-01-30  3:02                         ` [PATCH 2/2] ide: clear bmdma status in ide_intr() for Intel controllers (revised #3) Albert Lee
2007-01-30 14:13                           ` Sergei Shtylyov
2007-01-30 14:27                           ` Alan
     [not found]                           ` <58cb370e0701301117n316a9efax1e0b6299a8f8594a@mail.gmail.com>
2007-01-30 20:21                             ` Bartlomiej Zolnierkiewicz
2007-01-31  5:49                               ` [PATCH 0/2] ide: clear bmdma status in ide_intr for Intel controllers (revised #4) Albert Lee
2007-01-31  5:54                                 ` [PATCH 1/2] ide: clear bmdma status in ide_intr() for ICHx " Albert Lee
2007-01-31  5:57                                 ` [PATCH 2/2] ide: remove clearing bmdma status from cdrom_decode_status() (rev #4) Albert Lee
     [not found]                                 ` <58cb370e0702021307i3d275e84qbeb3b44f58ad6b51@mail.gmail.com>
2007-02-02 21:14                                   ` [PATCH 0/2] ide: clear bmdma status in ide_intr for Intel controllers (revised #4) Bartlomiej Zolnierkiewicz
2007-01-22 14:47       ` [PATCH] ide: Fix ATAPI DMA lost irq problem with CDB intr devices Alan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).