From owner-freebsd-hackers Sun May 26 19:19:31 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from dignus.com (sdsl-64-32-254-102.dsl.iad.megapath.net [64.32.254.102]) by hub.freebsd.org (Postfix) with ESMTP id 9BBB837B403 for ; Sun, 26 May 2002 19:19:24 -0700 (PDT) Received: from lakes.dignus.com (lakes.dignus.com [10.0.0.3]) by dignus.com (8.11.6/8.11.3) with ESMTP id g4R2Dth18844; Sun, 26 May 2002 22:13:55 -0400 (EDT) (envelope-from rivers@dignus.com) Received: (from rivers@localhost) by lakes.dignus.com (8.11.6/8.11.3) id g4R2Ef483353; Sun, 26 May 2002 22:14:41 -0400 (EDT) (envelope-from rivers) Date: Sun, 26 May 2002 22:14:41 -0400 (EDT) From: Thomas David Rivers Message-Id: <200205270214.g4R2Ef483353@lakes.dignus.com> To: freebsd-hackers@freebsd.org, imp@village.org, rivers@dignus.com Subject: more info on pccard insertion hang... Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG OK - after *many* additional printf()s, and following the control flow through several twisty passages (all alike), I've figured out _where_ the hang is happening.... but, not why... First - the card is inserted, and the various callbacks occur... pccardd gets involved and reads the CIS to determine the kind of card that was inserted. We actually get through the pcic stuff, and through the device probe and attach. It's determined that the card is an ed-compatible ethernet card. Then, we try to set the interrupt for that card. (apparently, it's being set as an ISA interrupt number, even though pcic is using PCI interrupts.) This then hangs in pci_cfgdisable(). I'm hand-typing in the ddb trace results here, so forgive any obvious typo: --- interrupt, eip = 0xc0350d24, sp=0xc635eb14, ebp = 0xc635eb1c --- pci_cfgdisable(c0cc1808,2,c635eb4c,c03506ae,0) at pci_cfgdisable+0x1c pcireg_cfgwrite(0,c,0,3e,420) at pcireg_cfgwrite+0x54 pci_cfgregwrite(0,c,0,3e,420) at pci_cfgregwrite+0x1a pci_cfgwrite(c0cc1808,3e,420,2,c0396702,c0396630,c0cc1780,c03966c0,c0396697) at pci_cfgwrite+0x23 pci_write_config_method(c0cbd180,c0cc1780,3e,420,2) at pci_write_config_method+0x4e PCI_WRITE_CONFIG(c0cbd180,c0cc1780,3e,420,2) at PCI_WRITE_CONFIG+0x3a pcic_pci_gen_func(c0cc0a3c,2,c038d300,2,9) at pcic_pci_gen_func+0xa6 pcic_pci_ricoh_func(c0cc0a3c,2,c038d7e0,c0cc0a00,4) at pcic_pci_ricoh_fun+0x1d pcic_pci_gen_mapirq(c0cc0a3c,9,c0e03000,c0ccac00,c0df2680) at pcic_pci_gen_mapirq+0x56 pcic_pci_setup_intr(c0cc1780,c0df2680,c0ded8c0,4,c031898c) at pcic_pci_setup_intr+0xc1 BUS_SETUP_ITR(c0cc1780,c0df2680,c0ded8c0,4,c031898c) at BUS_SETUP_INTR+0x40 bus_generic_setup_intr(c0ccac00,c0df2680,c0ded8c0,4,c031898c) at bus_generic_setup_intr+0x2e BUS_SETUP_INTR(c0ccac00,c0df2680,c0ded8c0,4,c031898c) at BUS_SETUP_INTR+0x40 bus_setup_intr(c0df2680,c0ded8c0,4,c031898c,c0e03000) at bus_setup_intr+0x24 ed_pccard_attach(c0df2680,c635ed44,c01cdc05,c0df2680,c037ff53) at ed_pccard_attach+0x85 DEVICE_ATTACH(c0df2680,c037ff53,0,c0df2680,c0d4de00) at DEVICE_ATTACH+0x2e device_probe_and_attach(c0df2680,c038c0e0,c0cc0800,c0ac5006,c59ef60) at dvice_probe_and_attach+0x8d allocate_driver(c0cc0800,c0d4de00,c635ede4,c0ccab80,c595ef60) at allocate_driver+0x223 crdioctrl(c0ccab80,c0ac5006,c0d4de00,3,c595ef60) at crdioctl+0x3ca spec_ioctl(c635ede4,c635edcc,c02db1fd,c635ede4,c635ee74) at spec_ioctl+0x26 spec_vnoperate(c635ede4,c635ee74,c01fabab,c635ede4,c0d10180) at spec_vnoperate+0x15 ufs_vnoperatespec(c635ede4,c0d10180,0,ac,a03bbf00) at ufs_vnoperatespec+0x15 vn_ioctl(c0d10180,c0ac5006,c0d4de00,c595ef60,c595ef60) at vn_ioctl+0x10f ioctl(c595ef60,c635ef80,8072140,8072100,0) at ioctl+0x20a syscall2(2f,2f,2f,0,8072100) at syscall2+0x1f5 Xin0x80_syscall(0 at Xint0x80_syscall+0x25 db> So - it seems the "hang" is occuring when trying to set up interrupts in the pcic_pci_gen_func() function. Using liberal printf()s - I've determined that `way' is pcic_iw_pci. So - it would seem that the following should be executed: bcr = pci_read_config(...) // bcr is 0x4a0 bcr &= ~CB_BCR_INT_EXCA; // bcr becomes 0x420 pci_write_config(..., bcr,2); <<<< hangs Warner - any ideas? I'm wondering - it seems we're trying to set the ethernet's irq to #9 - which was also used for the pcic card... could there be some non-obvious interrupt confusion here? - Thanks! - - Dave Rivers - -- rivers@dignus.com Work: (919) 676-0847 Get your mainframe programming tools at http://www.dignus.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message