LWN.net Logo

fix IDE init oops on PowerMac

From:  Mikael Pettersson <mikpe@csd.uu.se>
To:  benh@kernel.crashing.org, paulus@samba.org
Subject:  [PATCH][2.5.74] fix IDE init oops on PowerMac
Date:  Fri, 4 Jul 2003 02:16:31 +0200 (MEST)
Cc:  linux-kernel@vger.kernel.org

Booting kernel 2.5.74 on a PowerMac with CONFIG_BLK_DEV_IDE_PMAC=y
results in an oops during IDE init, and the box then reboots.

The call chain at the oops is ideprobe_init() => probe_hwif() =>
__ide_dma_off_quietly() => HWIF(drive)->ide_dma_queued_off().
The HWIF(drive)->ide_dma_queued_off function pointer is NULL for
PMAC, which triggers the oops. Previously this call was conditional
on drive->queue_setup, but 2.5.74 made it unconditional.

The patch below updates drivers/ide/ppc/pmac.c to also set up the
hwif->ide_dma_queued_off and hwif->ide_dma_queued_on function
pointers, which fixes the oops. Tested on my ancient PM4400.

(I apologize for not including a full oops text, but the box has
no serial console.)

/Mikael

diff -ruN linux-2.5.74/drivers/ide/ppc/pmac.c linux-2.5.74.ide-pmac-fixes/drivers/ide/ppc/pmac.c
--- linux-2.5.74/drivers/ide/ppc/pmac.c	2003-05-28 22:16:00.000000000 +0200
+++ linux-2.5.74.ide-pmac-fixes/drivers/ide/ppc/pmac.c	2003-07-04 00:45:05.000000000 +0200
@@ -1514,6 +1514,8 @@
 	ide_hwifs[ix].ide_dma_timeout = &__ide_dma_timeout;
 	ide_hwifs[ix].ide_dma_retune = &__ide_dma_retune;
 	ide_hwifs[ix].ide_dma_lostirq = &pmac_ide_dma_lostirq;
+	ide_hwifs[ix].ide_dma_queued_on = &__ide_dma_queued_on;
+	ide_hwifs[ix].ide_dma_queued_off = &__ide_dma_queued_off;
 
 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO
 	if (!noautodma)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Copyright © 2003, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds