All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ide-dma blacklist behaviour broken
@ 2004-10-05 14:20 Jens Axboe
  2004-10-05 15:37 ` Christoph Hellwig
  2004-10-10  0:42 ` Bartlomiej Zolnierkiewicz
  0 siblings, 2 replies; 12+ messages in thread
From: Jens Axboe @ 2004-10-05 14:20 UTC (permalink / raw)
  To: Linux Kernel, Bartlomiej Zolnierkiewicz

Hi,

The blacklist stuff is broken. When set_using_dma() calls into
ide_dma_check(), it returns ide_dma_off() for a blacklisted drive. This
of course succeeds, returning success to the caller of ide_dma_check().
Not so good... It then uncondtionally calls ide_dma_on(), which turns on
dma for the drive.

This moves the check to ide_dma_on() so we also catch the buggy
->ide_dma_check() defined by various chipset drivers.

--- drivers/ide/ide-dma.c~	2004-10-05 16:11:49.631910586 +0200
+++ drivers/ide/ide-dma.c	2004-10-05 16:21:58.828330845 +0200
@@ -354,11 +355,13 @@
 	struct hd_driveid *id = drive->id;
 	ide_hwif_t *hwif = HWIF(drive);
 
-	if ((id->capability & 1) && hwif->autodma) {
-		/* Consult the list of known "bad" drives */
-		if (__ide_dma_bad_drive(drive))
-			return __ide_dma_off(drive);
+	/* Consult the list of known "bad" drives */
+	if (__ide_dma_bad_drive(drive)) {
+		__ide_dma_off(drive);
+		return 1;
+	}
 
+	if ((id->capability & 1) && hwif->autodma) {
 		/*
 		 * Enable DMA on any drive that has
 		 * UltraDMA (mode 0/1/2/3/4/5/6) enabled
@@ -512,6 +515,9 @@
  
 int __ide_dma_on (ide_drive_t *drive)
 {
+	if (__ide_dma_bad_drive(drive))
+		return 1;
+
 	drive->using_dma = 1;
 	ide_toggle_bounce(drive, 1);
 

-- 
Jens Axboe


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

end of thread, other threads:[~2004-10-10  8:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-05 14:20 [PATCH] ide-dma blacklist behaviour broken Jens Axboe
2004-10-05 15:37 ` Christoph Hellwig
2004-10-05 15:46   ` Jens Axboe
2004-10-05 22:46     ` Alan Cox
2004-10-06  5:45       ` Jens Axboe
2004-10-06 13:27         ` Alan Cox
2004-10-06 14:41           ` Jens Axboe
2004-10-06 13:58             ` Alan Cox
2004-10-06 15:01               ` Jens Axboe
2004-10-05 19:30   ` Juri Haberland
2004-10-10  0:42 ` Bartlomiej Zolnierkiewicz
2004-10-10  8:14   ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.