<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Return-Path: &lt;linuxppc-dev-bounces@ozlabs.org&gt;
X-Original-To: colinomail@colino.net
Delivered-To: colinomail@colino.net
Received: by paperstreet.colino.net (Postfix, from userid 1015)
	id 67A57101D9; Wed, 13 Apr 2005 06:41:32 +0200 (CEST)
Received: from ozlabs.org (ozlabs.org [203.10.76.45])
	by paperstreet.colino.net (Postfix) with ESMTP id B5836101DB
	for &lt;colin@colino.net&gt;; Wed, 13 Apr 2005 06:41:05 +0200 (CEST)
Received: from ozlabs.org (localhost [127.0.0.1])
	by ozlabs.org (Postfix) with ESMTP id 8AA7D67B58;
	Wed, 13 Apr 2005 14:40:59 +1000 (EST)
X-Original-To: linuxppc-dev@ozlabs.org
Delivered-To: linuxppc-dev@ozlabs.org
Received: from gate.crashing.org (gate.crashing.org [63.228.1.57])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client did not present a certificate)
	by ozlabs.org (Postfix) with ESMTP id C250567B56
	for &lt;linuxppc-dev@ozlabs.org&gt;; Wed, 13 Apr 2005 14:40:57 +1000 (EST)
Received: from gaston (localhost [127.0.0.1])
	by gate.crashing.org (8.12.8/8.12.8) with ESMTP id j3D4aMgJ011111;
	Tue, 12 Apr 2005 23:36:23 -0500
From: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
To: Andrew Morton &lt;akpm@osdl.org&gt;
Content-Type: text/plain
Date: Wed, 13 Apr 2005 14:40:38 +1000
Message-Id: &lt;1113367238.5515.5.camel@gaston&gt;
Mime-Version: 1.0
X-Mailer: Evolution 2.0.4 
Content-Transfer-Encoding: 7bit
Cc: linuxppc-dev list &lt;linuxppc-dev@ozlabs.org&gt;,
	"debian-powerpc@lists.debian.org" &lt;debian-powerpc@lists.debian.org&gt;
Subject: [PATCH] ppc32: Fix IDE related crash on wakeup
X-BeenThere: linuxppc-dev@ozlabs.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Linux on PowerPC Developers Mail List &lt;linuxppc-dev.ozlabs.org&gt;
List-Unsubscribe: &lt;https://ozlabs.org/mailman/listinfo/linuxppc-dev&gt;,
	&lt;mailto:linuxppc-dev-request@ozlabs.org?subject=unsubscribe&gt;
List-Archive: &lt;http://ozlabs.org/pipermail/linuxppc-dev&gt;
List-Post: &lt;mailto:linuxppc-dev@ozlabs.org&gt;
List-Help: &lt;mailto:linuxppc-dev-request@ozlabs.org?subject=help&gt;
List-Subscribe: &lt;https://ozlabs.org/mailman/listinfo/linuxppc-dev&gt;,
	&lt;mailto:linuxppc-dev-request@ozlabs.org?subject=subscribe&gt;
Sender: linuxppc-dev-bounces@ozlabs.org
Errors-To: linuxppc-dev-bounces@ozlabs.org
X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on 
	paperstreet.colino.net
X-Spam-Level: 
X-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00 autolearn=no 
	version=2.64
X-UIDL: p=m"!9!G"!ngU"!PJI!!
Status: RO

Hi !

I noticed an occasional crash on wakeup from sleep on my powerbook
(strangly never happened before, probably timing related) that appears
to be due to a dangling interrupt while the chip is put to sleep and
beeing reset on wakeup.

This patch fixes is by disabling the irq in the ide pmac driver while
asleep and only re-enable it after the chip has been fully reset. This
is safe to do so as the interrupt of these apple IDE cells is never
shared.

Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;

Index: linux-work/drivers/ide/ppc/pmac.c
===================================================================
--- linux-work.orig/drivers/ide/ppc/pmac.c	2005-04-13 10:53:39.000000000 +1000
+++ linux-work/drivers/ide/ppc/pmac.c	2005-04-13 14:17:41.000000000 +1000
@@ -1204,6 +1204,8 @@
 	}
 #endif /* CONFIG_BLK_DEV_IDE_PMAC_BLINK */
 
+	disable_irq(pmif-&gt;irq);
+
 	/* The media bay will handle itself just fine */
 	if (pmif-&gt;mediabay)
 		return 0;
@@ -1236,7 +1238,6 @@
 		ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, pmif-&gt;node, pmif-&gt;aapl_bus_id, 1);
 		msleep(10);
 		ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif-&gt;node, pmif-&gt;aapl_bus_id, 0);
-		msleep(jiffies_to_msecs(IDE_WAKEUP_DELAY));
 
 		/* Kauai has it different */
 		if (pmif-&gt;kauai_fcr) {
@@ -1244,11 +1245,15 @@
 			fcr |= KAUAI_FCR_UATA_RESET_N | KAUAI_FCR_UATA_ENABLE;
 			writel(fcr, pmif-&gt;kauai_fcr);
 		}
+
+		msleep(jiffies_to_msecs(IDE_WAKEUP_DELAY));
 	}
 
 	/* Sanitize drive timings */
 	sanitize_timings(pmif);
 
+	enable_irq(pmif-&gt;irq);
+
 	return 0;
 }
 


_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

</pre></body></html>