From owner-freebsd-mobile@FreeBSD.ORG Sun Feb 24 08:27:54 2008 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4CFA16A401 for ; Sun, 24 Feb 2008 08:27:54 +0000 (UTC) (envelope-from kline@thought.org) Received: from aristotle.thought.org (dsl231-043-140.sea1.dsl.speakeasy.net [216.231.43.140]) by mx1.freebsd.org (Postfix) with ESMTP id 78ADF13C45D for ; Sun, 24 Feb 2008 08:27:53 +0000 (UTC) (envelope-from kline@thought.org) Received: from tao.thought.org (tao.thought.org [10.47.0.250]) (authenticated bits=0) by aristotle.thought.org (8.14.2/8.14.2) with ESMTP id m1O7wPbF025535; Sat, 23 Feb 2008 23:58:25 -0800 (PST) (envelope-from kline@thought.org) From: Gary Kline To: freebsd-mobile@freebsd.org Date: Sat, 23 Feb 2008 23:58:24 -0800 User-Agent: KMail/1.9.7 References: <47BE9CBC.6010500@gmx.net> <47BED4A6.7040501@gmx.net> <47C08482.4050608@gmx.net> In-Reply-To: <47C08482.4050608@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802232358.25275.kline@thought.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on aristotle.thought.org Cc: Andreas Wetzel Subject: Re: ThinkPad 600 - CardBus inoperative X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2008 08:27:54 -0000 On Saturday 23 February 2008 12:39:30 Andreas Wetzel wrote: > It seems like I have found a workaround for my ThinkPad 600 cardbus > problem. (I wouldn't call it a fix). Here is what I did: > > --- /usr/src/sys/dev/cardbus/cardbus.c.orig 2008-02-23 > 20:44:08.000000000 +0100 > +++ /usr/src/sys/dev/cardbus/cardbus.c 2008-02-23 20:40:07.000000000 +0100 > @@ -460,6 +460,7 @@ > device_t child; > int cardattached = 0; > int bus, slot, func; > + int try; > > cardbus_detach_card(cbdev); /* detach existing cards */ > POWER_ENABLE_SOCKET(brdev, cbdev); > @@ -470,9 +471,17 @@ > for (func = 0; func <= cardbusfunchigh; func++) { > struct cardbus_devinfo *dinfo; > > - dinfo = (struct cardbus_devinfo *) > - pci_read_device(brdev, bus, slot, func, > - sizeof(struct cardbus_devinfo)); > + for(try = 1, dinfo = NULL; !dinfo && try <= 3; > try++) + { > + dinfo = (struct cardbus_devinfo *) > + pci_read_device(brdev, bus, slot, func, > + sizeof(struct cardbus_devinfo)); > + > + printf("cardbus_attach_card(): %d:%d:%d try > %d %s\n", > + bus, slot, func, try, > + dinfo == NULL ? "FAILED" : > "SUCCEEDED"); + } > + > if (dinfo == NULL) > continue; > if (dinfo->pci.cfg.mfdev) > > > > This small patch simply retries up to three times the read during card > attach. The first try fails, and returns NULL. But the second try succeeds, > the card gets initialized and is working properly. Perhaps someone with > more in-depth knowledge of the pci/cardbus stuff has an explanation, why > that is happening. > > As has been confirmed by others, the ThinkPad 600 also has some interrupt > routing issues. As far as I can tell, these can either be fixed by putting > some hw.pci.link.LNK?.irq tunables into /boot/loader.conf, or by using a > fixed ACPI DSDT. Both methods work for me, but the card not being > initialized due to the first read returning NULL, seems to be a different > problem. Possibly sort of timing problem??? > could this be related to the reason that my nic failed on my 600E early in january after a remote upgrade to 7.0-PRE from 6.3-PRE? it was surprising that one moment,everything work, then suddenly, everything but my networking.... [??] Subsequent boot tries with 5.4 failed too, tho, so maybe it was simply a bus failure:: harrdware. > > /boot/loader.conf: > > #acpi_dsdt_load="YES" > #acpi_dsdt_name="/boot/TP600.aml" > cpufreq_load="YES" > hw.cardbus.debug="1" > hw.cardbus.cis_debug="1" > hw.cbb.debug="1" > #hw.acpi.verbose="1" > #hw.cbb.start_memory=0xd8000 > hw.pci.link.LNKA.irq="11" > hw.pci.link.LNKB.irq="10" > hw.pci.link.LNKC.irq="7" > hw.pci.link.LNKD.irq="7" > > > dmesg output: > > Copyright (c) 1992-2008 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 6.3-RELEASE #11: Sat Feb 23 20:45:46 CET 2008 > root@escape.enforcer.cc:/usr/obj/usr/src/sys/ESCAPE > Timecounter "i8254" frequency 1193182 Hz quality 0 > CPU: Pentium II/Pentium II Xeon/Celeron (298.42-MHz 686-class CPU) > Origin = "GenuineIntel" Id = 0x652 Stepping = 2 > > Features=0x183f9ff,PAT,PSE36,MMX,FXSR> real memory = 301793280 (287 MB) > avail memory = 285884416 (272 MB) > ath_hal: 0.9.20.3 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413) > acpi0: on motherboard > acpi0: Power Button (fixed) > Timecounter "ACPI-safe" frequency 3579545 Hz quality 850 > acpi_timer0: <24-bit timer at 3.579545MHz> port 0xef08-0xef0b on acpi0 > acpi_ec0: port 0x62,0x66 on acpi0 > cpu0: on acpi0 > acpi_throttle0: on cpu0 > acpi_lid0: on acpi0 > acpi_button0: on acpi0 > pcib0: port 0xcf8-0xcff on acpi0 > pci0: on pcib0 > cbb0: mem 0x20301000-0x20301fff at device 2.0 > on pci0 cbb0: Found memory at 20301000 > cbb0: Secondary bus is 1 > cardbus0: on cbb0 > pccard0: <16-bit PCCard bus> on cbb0 > cbb1: mem 0x20300000-0x20300fff at device 2.1 > on pci0 cbb1: Found memory at 20300000 > cbb1: Secondary bus is 4 > cardbus1: on cbb1 > pccard1: <16-bit PCCard bus> on cbb1 > pci0: at device 3.0 (no driver attached) > isab0: at device 7.0 on pci0 > isa0: on isab0 > atapci0: port > 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xfcf0-0xfcff at device 7.1 on pci0 > ata0: on atapci0 > ata1: on atapci0 > uhci0: port 0x8400-0x841f irq 7 > at device 7.2 on pci0 > uhci0: [GIANT-LOCKED] > usb0: on uhci0 > usb0: USB revision 1.0 > uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 > uhub0: 2 ports with 2 removable, self powered > intpm0: port 0xefa0-0xefaf irq > 9 at device 7.3 on pci0 > intpm0: I/O mapped efa0 > intpm0: intr IRQ 9 enabled revision 0 > intpm0: [GIANT-LOCKED] > intsmb0: on intpm0 > smbus1: on intsmb0 > smb0: on smbus1 > intpm0: PM I/O mapped ef00 > acpi_tz0: on acpi0 > acpi_tz1: on acpi0 > acpi_tz2: on acpi0 > fdc0: port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on > acpi0 fdc0: [FAST] > fd0: <1440-KB 3.5" drive> on fdc0 drive 0 > sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on > acpi0 sio0: type 16550A > sio1: port 0x2f8-0x2ff irq 3 drq 3 on > acpi0 sio1: type 16550A > speaker0: port 0x61 on acpi0 > atkbdc0: port 0x60,0x64 irq 1 on acpi0 > atkbd0: irq 1 on atkbdc0 > kbd0 at atkbd0 > atkbd0: [GIANT-LOCKED] > psm0: irq 12 on atkbdc0 > psm0: [GIANT-LOCKED] > psm0: model Generic PS/2 mouse, device ID 0 > battery0: on acpi0 > acpi_acad0: on acpi0 > pmtimer0 on isa0 > orm0: at iomem 0xc0000-0xc9fff on isa0 > sc0: at flags 0x100 on isa0 > sc0: VGA <12 virtual consoles, flags=0x300> > vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 > Timecounter "TSC" frequency 298423427 Hz quality 800 > Timecounters tick every 1.000 msec > ipfw2 initialized, divert enabled, rule-based forwarding disabled, default > to deny, logging unlimited > Status is 0x30000106 > Status is 0x30000920 > cbb1: card inserted: event=0x00000000, state=30000920 > cbb1: cbb_power: 3V > cardbus_attach_card(): 4:0:0 try 1 FAILED > cardbus_attach_card(): 4:0:0 try 2 SUCCEEDED > TUPLE: LINKTARGET [3]: 43 49 53 > Manufacturer ID: 71021200 > TUPLE: Unknown(0x04) [6]: 03 01 00 00 00 00 > TUPLE: Unknown(0x05) [14]: 41 b1 39 b5 1e 2d 4e 56 30 ff ff 02 e9 00 > cardbus1: Opening BAR: type=MEM, bar=10, len=10000 > CIS reading done > cardbus1: Non-prefetchable memory at 88000000-8800ffff > ath0: mem 0x88000000-0x8800ffff irq 10 at device 0.0 on > cardbus1 ath0: Ethernet address: 00:19:e0:83:b0:41 > ath0: mac 7.9 phy 4.5 radio 5.6 > ad0: 4887MB at ata0-master UDMA33 > Trying to mount root from ufs:/dev/ad0s2a -- Gary Kline kline@thought.org www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org