[From nobody Tue Jul  8 18:18:22 2003
Return-Path: &lt;rmk@arm.linux.org.uk&gt;
Delivered-To: linux@localhost.dominikbrodowski.de
Received: from localhost (localhost [127.0.0.1])
	by mondschein.dominikbrodowski.de (Postfix) with ESMTP id C6EE0892B9
	for &lt;linux@localhost&gt;; Mon,  7 Jul 2003 14:21:07 +0200 (CEST)
X-Envelope-From: &lt;rmk@arm.linux.org.uk&gt;
X-Envelope-To: &lt;linux@brodo.de&gt;
X-Delivery-Time: 1057528981
Received: from post.strato.de [192.67.198.79]
	by localhost with POP3 (fetchmail-5.9.13)
	for linux@localhost (single-drop);
	Mon, 07 Jul 2003 14:21:07 +0200 (CEST)
Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk
	[212.18.232.186])
	by mailin.webmailer.de (8.12.8/8.8.7) with ESMTP id h66M3038001061
	for &lt;linux@brodo.de&gt;; Mon, 7 Jul 2003 00:03:00 +0200 (MEST)
Received: from flint.arm.linux.org.uk ([3ffe:8260:2002:1:201:2ff:fe14:8fad])
	by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168)
	(Exim 4.14)
	id 19ZHaz-0005gI-KX; Sun, 06 Jul 2003 23:02:57 +0100
Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.14)
	id 19ZHay-0000j5-Ou; Sun, 06 Jul 2003 23:02:56 +0100
Date: Sun, 6 Jul 2003 23:02:56 +0100
From: Russell King &lt;rmk@arm.linux.org.uk&gt;
To: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;,
	Patrick Mochel &lt;mochel@osdl.org&gt;
Cc: Dominik Brodowski &lt;linux@brodo.de&gt;
Subject: Re: Fwd: Re: 2.5.74-mm1
Message-ID: &lt;20030706230256.A16820@flint.arm.linux.org.uk&gt;
References: &lt;20030703233633.H20336@flint.arm.linux.org.uk&gt;
	&lt;1057337904.22538.2.camel@dhcp22.swansea.linux.org.uk&gt;
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5.1i
In-Reply-To: &lt;1057337904.22538.2.camel@dhcp22.swansea.linux.org.uk&gt;;
	from alan@lxorguk.ukuu.org.uk on Fri, Jul 04, 2003 at 05:58:24PM +0100
X-Message-Flag: Your copy of Microsoft Outlook is vulnerable to viruses. See
	www.mutt.org for more details.
Sender: Russell King &lt;rmk@arm.linux.org.uk&gt;

On Fri, Jul 04, 2003 at 05:58:24PM +0100, Alan Cox wrote:
&gt; On Iau, 2003-07-03 at 23:36, Russell King wrote:
&gt; &gt; Dominik,
&gt; &gt; 
&gt; &gt; The patch below seems to be causing some lockups.
&gt; &gt; 
&gt; &gt; Pat Mochel has a TI bridge where irq_mask is zero.  For both sockets,
&gt; &gt; PCI config register 0x8c is 0x00001000 and 0x92 is 0x66.
&gt; &gt; 
&gt; &gt; This seems to mean that we're using PCI serial interrupt mode rather
&gt; &gt; than the hard-wired ISA or PCI INT# mode.  Maybe these laptops can't
&gt; &gt; handle PCI INT# mode?
&gt; &gt; 
&gt; &gt; Also copying Alan since I believe that the patch below came from the -ac
&gt; &gt; tree.
&gt; 
&gt; The diagnosis looks right. I guess someone with docs needs to detect
&gt; this case and avodi pci mode

Ok, looked at the docs for the PCI4450 and the TI1211.  Since there is
only one setting for PCI serial IRQ mode (which is the mode Pat's
laptop is in) we must not switch out of this mode.  Note that serial PCI
IRQ mode includes serial ISA IRQ mode.

So, here's a patch for 2.5.  We basically ignore this if we're using
serial PCI IRQ mode.

--- orig/drivers/pcmcia/ti113x.h	Wed Jul  2 22:44:06 2003
+++ linux/drivers/pcmcia/ti113x.h	Sun Jul  6 22:52:41 2003
@@ -179,21 +179,26 @@
 	/*
 	 * If ISA interrupts don't work, then fall back to routing card
 	 * interrupts to the PCI interrupt of the socket.
+	 *
+	 * Tweaking this when we are using serial PCI IRQs causes hangs
+	 *   --rmk
 	 */
 	if (!socket-&gt;socket.irq_mask) {
-		int irqmux, devctl;
-
-		printk (KERN_INFO &quot;ti113x: Routing card interrupts to PCI\n&quot;);
+		u8 irqmux, devctl;
 
 		devctl = config_readb(socket, TI113X_DEVICE_CONTROL);
-		devctl &amp;= ~TI113X_DCR_IMODE_MASK;
+		if (devctl &amp; TI113X_DCR_IMODE_MASK != TI12XX_DCR_IMODE_ALL_SERIAL) {
+			printk (KERN_INFO &quot;ti113x: Routing card interrupts to PCI\n&quot;);
+
+			devctl &amp;= ~TI113X_DCR_IMODE_MASK;
 
-		irqmux = config_readl(socket, TI122X_IRQMUX);
-		irqmux = (irqmux &amp; ~0x0f) | 0x02; /* route INTA */
-		irqmux = (irqmux &amp; ~0xf0) | 0x20; /* route INTB */
+			irqmux = config_readl(socket, TI122X_IRQMUX);
+			irqmux = (irqmux &amp; ~0x0f) | 0x02; /* route INTA */
+			irqmux = (irqmux &amp; ~0xf0) | 0x20; /* route INTB */
 
-		config_writel(socket, TI122X_IRQMUX, irqmux);
-		config_writeb(socket, TI113X_DEVICE_CONTROL, devctl);
+			config_writel(socket, TI122X_IRQMUX, irqmux);
+			config_writeb(socket, TI113X_DEVICE_CONTROL, devctl);
+		}
 	}
 
 	socket-&gt;socket.ss_entry-&gt;init = ti_init;



-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
]