From owner-freebsd-mobile@FreeBSD.ORG Mon Mar 7 19:23:22 2005 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E278516A4CE for ; Mon, 7 Mar 2005 19:23:22 +0000 (GMT) Received: from brev.sics.se (brev.sics.se [193.10.64.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C84843D48 for ; Mon, 7 Mar 2005 19:23:22 +0000 (GMT) (envelope-from bengta@P142.sics.se) Received: from P142.sics.se (P142.sics.se [193.10.66.253]) by brev.sics.se (8.12.8/8.12.8) with ESMTP id j27JNHo3015595; Mon, 7 Mar 2005 20:23:18 +0100 env-to () env-from (bengta@P142.sics.se) Received: from P142.sics.se (localhost [127.0.0.1]) by P142.sics.se (8.13.1/8.13.1) with ESMTP id j27JNKaT001475; Mon, 7 Mar 2005 20:23:20 +0100 (CET) (envelope-from bengta@P142.sics.se) Received: (from bengta@localhost) by P142.sics.se (8.13.1/8.13.1/Submit) id j27JNJOU001472; Mon, 7 Mar 2005 20:23:19 +0100 (CET) (envelope-from bengta) To: freebsd-mobile@freebsd.org From: Bengt Ahlgren Date: 07 Mar 2005 20:23:19 +0100 Message-ID: Lines: 72 User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new Subject: pccard0: Card has no functions! OR PCI memory range allocation problem? X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2005 19:23:23 -0000 I don't know where to best start explaining this problem, but I'll start with the symptoms. These are the same for 5.3-R and 5.4-PRERELEASE installed two days ago on an IBM TP X40. After kldunload:ing if_ath, no pccard is recognised. For any pccard (16-bit - cardbus is not affected!) it just says: pccard0: Card has no functions! The system has an Atheros mini-PCI wireless card. (If my theory is right, the particular card is irrelevant. I got the same symptoms with if_ipw earlier when I had an Intel Wireless PRO 2100 in the same box.) I have no device driver for the card compiled into the kernel. At boot the kernel says: pcib1: device (null) requested decoded memory range 0xd0200000-0xd020ffff When the if_ath driver is kldload:ed: ath0: mem 0xd0200000-0xd020ffff irq 11 at device 2.0 on pci2 At this point (and also before loading if_ath), inserting a pccard works: pcib1: device pccard0 requested decoded memory range 0xd0200000-0xdfffffff cis mem map 0xd63ab000 (resource: 0xd0240000) pccard0: check_cis_quirks pccard0: CIS version PC Card Standard 5.0 pccard0: CIS info: Lucent Technologies, WaveLAN/IEEE, Version 01.01, (and so on...) After unloading the if_ath driver, it says the following instead: pcib1: device pccard0 requested decoded memory range 0xd0200000-0xdfffffff cis mem map 0xd63ab000 (resource: 0xd0200000) The "(resource: 0xd0200000)" now points to where the mini-PCI card is! The pccard driver contiues with: pccard0: CIS tuple chain: CISTPL_NONE 00 (the above two lines are repeated in total nine times... then:) TOO MANY CIS_NONE CIS is too long -- truncating CISTPL_END ff cis mem map d63ab000 CISTPL_LINKTARGET expected, code 00 observed pccard0: check_cis_quirks pccard0: Card has no functions! cbb0: PC Card card activation failed If I load the if_ath driver again, pccards are again recognised properly. Now to the bottom line: where is the bug? 1) In the if_ath driver module which deallocated a PCI memory range which it didn't allocate (the kernel did at boot). 2) In the PCI memory allocation/deallocation routines which allowed the loadable driver to deallocate a PCI memory range that was allocated at boot. 3) In cbb/pccard which perhaps shouldn't be allowed to use the memory range? 4) Or is the answer that I should not unload drivers for fixed hardware? Bengt