From owner-freebsd-mobile@FreeBSD.ORG  Wed Jul 18 02:35:39 2007
Return-Path: <owner-freebsd-mobile@FreeBSD.ORG>
X-Original-To: freebsd-mobile@freebsd.org
Delivered-To: freebsd-mobile@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 0C16516A403
	for <freebsd-mobile@freebsd.org>; Wed, 18 Jul 2007 02:35:39 +0000 (UTC)
	(envelope-from zhangweiwu@realss.com)
Received: from bossdog.realss.com (bossdog.realss.com [211.157.108.128])
	by mx1.freebsd.org (Postfix) with ESMTP id 114B613C441
	for <freebsd-mobile@freebsd.org>; Wed, 18 Jul 2007 02:35:37 +0000 (UTC)
	(envelope-from zhangweiwu@realss.com)
Received: from localhost (unknown [127.0.0.1])
	by bossdog.realss.com (Postfix) with ESMTP id C06D01C0008
	for <freebsd-mobile@freebsd.org>; Wed, 18 Jul 2007 10:35:48 +0800 (CST)
Received: from bossdog.realss.com ([127.0.0.1])
	by localhost (bossdog.realss.com [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 00504-16 for <freebsd-mobile@freebsd.org>;
	Wed, 18 Jul 2007 10:35:47 +0800 (CST)
Received: from [218.193.55.195]
	(166.17.61.59.board.xm.fj.dynamic.163data.com.cn [59.61.17.166])
	by bossdog.realss.com (Postfix) with ESMTP id 4A41A1C0006
	for <freebsd-mobile@freebsd.org>; Wed, 18 Jul 2007 10:35:47 +0800 (CST)
From: Zhang Weiwu <zhangweiwu@realss.com>
To: freebsd-mobile@freebsd.org
In-Reply-To: <200707160756.41133.jhb@freebsd.org>
References: <1183942480.6901.15.camel@joe.realss.com>
	<200707111431.52840.jhb@freebsd.org>
	<1184484990.9138.4.camel@joe.realss.com>
	<200707160756.41133.jhb@freebsd.org>
Content-Type: text/plain
Organization: Real Softservice
Date: Wed, 18 Jul 2007 10:29:33 +0800
Message-Id: <1184725774.27792.24.camel@joe.realss.com>
Mime-Version: 1.0
X-Mailer: Evolution 2.8.2 
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: amavisd-new at bossdog.realss.com
Subject: [SOLVED] Re: unable to map IRQ for my pccard
X-BeenThere: freebsd-mobile@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Mobile computing with FreeBSD <freebsd-mobile.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-mobile>, 
	<mailto:freebsd-mobile-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-mobile>
List-Post: <mailto:freebsd-mobile@freebsd.org>
List-Help: <mailto:freebsd-mobile-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-mobile>,
	<mailto:freebsd-mobile-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Jul 2007 02:35:39 -0000

Dear list

A summary of the issue:
        On Thinkpad 380XD with two PCCARD slots, the second slot (the
        one beneath the first slot) always doesn't work on default
        installation on FreeBSD 6.1. The second slot produce this error
        message in dmesg even with no card inserted:
        
        cbb1: <TI1250 PCI-CardBus Bridge> mem 0x20821000-0x20821fff at
        device 2.1 on pci0
        pccard1: <16-bit PCCard bus> on cbb1
        $PIR: ROUTE_INTERRUPT failed.
        cbb: Unable to map IRQ...
        device_attach: cbb1 attach returned 12
        
        The solution I have tried are re-assign IRQ BIOS reserved for
        PCI devices from 11 to 10 (by using PS2.EXE utility from lenovo
        website) and recompile kernel removing cardbus device. Both
        didn't work. With help from John Baldwin and M. Warner Losh we
        find the working solution is to add this line
        in /boot/device.hints
        
        hw.pci0.2.INTB.irq="10"
        
Although I still don't understand how this works, but now both slots are
usable for both cards.

On Mon, 2007-07-16 at 07:56 -0400, John Baldwin wrote:
> On Sunday 15 July 2007 03:36:30 am Zhang Weiwu wrote:
> > On Wed, 2007-07-11 at 14:31 -0400, John Baldwin wrote:
> > > No, we only route things once.  Look at /sys/i386/pci/pci_pir.c.  It keeps 
> > > track of which IRQ a link is routed to, and we only use the BIOS call if 
> it 
> > > didn't look like the BIOS had already routed it, and we haven't routed it 
> > > before.  I think we are actually trying to route 0x61 btw, not 0x60 since 
> > > it's device 2.1 (and thus probably INTB) that is keeling over.
> > > 
> > > You can try using a hint like 'hw.pci0.2.INTB.irq=11' and seeing if it 
> works.
> > 
> > Thank you for the insight and suggested solution. After having that
> > setting in /boot/device.hints I still cannot make the second card work,
> > just in case you are interested in this issue too, I have attached the
> > dmesg after used suggested hint. This dmesg is obtained by first insert
> > both cards and then boot.
> 
> You got an interrupt storm on IRQ 10, so try setting the hint to 10 rather 
> than 11.
> 
-- 
Zhang Weiwu
Real Softservice
http://www.realss.com
+86 592 2091112