CardBus (PCI ?) resource allocation problem report.

From: Hiroyuki Aizu <eyes_at_navi.org>
Date: Sun, 16 May 2004 18:52:18 +0900
Hi

I have trouble with IEEE1394 CardBus card on 5-current. I think it is
CardBus(PCI ?) resource allocation problem. I'll figure out this.

The card cannot attached on 5-current as below message.

(with hw.cardbus.debug=1 and hw.cardbus.cis_debug=1)
-------------------------------------------------------------------------
cardbus1: Expecting link target, got 0x42
cardbus1: Resource not specified in CIS: id=10, size=800
cardbus1: Resource not specified in CIS: id=14, size=4000
cardbus1: Resource not specified in CIS: id=18, size=800
cardbus1: Non-prefetchable memory at 88008000-8800cfff
fwohci0: <Texas Instruments TSB43AB22/A> mem 0x8800c000-0x8800c7ff,0x88008000-0x8800bfff,0x8800c800-0x8800cfff irq 10 at device 0.0 on cardbus1
fwohci0: [GIANT-LOCKED]
fwohci0: OHCI version ff.ff (ROM=1)
fwohci0: invalid OHCI version
fwohci0: fwohci_init failed with err=6
device_probe_and_attach: fwohci0 attach returned 5
cbb1: CardBus card activation failed
-------------------------------------------------------------------------

Next, I was patched to /sys/dev/cardbus/cardbus_cis.c like below.
(Yes, this is very dirty hack. Just for trouble shooting.)
-------------------------------------------------------------------------
--- cardbus_cis.c.orig	Mon Apr 12 04:22:25 2004
+++ cardbus_cis.c	Sun May 16 17:23:03 2004
_at__at_ -993,6 +993,9 _at__at_ cardbus_add_map(device_t cbdev, device_t
 static void
 cardbus_pickup_maps(device_t cbdev, device_t child)
 {
+#if 1
+	cardbus_add_map(cbdev, child, PCIR_BAR(0));
+#else
 	struct cardbus_devinfo *dinfo = device_get_ivars(child);
 	int reg;
 
_at__at_ -1003,6 +1006,7 _at__at_ cardbus_pickup_maps(device_t cbdev, devi
 	 */
 	for (reg = 0; reg < dinfo->pci.cfg.nummaps; reg++)
 		cardbus_add_map(cbdev, child, PCIR_BAR(reg));
+#endif
 }
 
 int
-------------------------------------------------------------------------


The card works fine on patched kernel like below.
-------------------------------------------------------------------------
cardbus1: Expecting link target, got 0x42
cardbus1: Resource not specified in CIS: id=10, size=800
cardbus1: Non-prefetchable memory at 88001000-880017ff
fwohci0: <Texas Instruments TSB43AB22/A> mem 0x88001000-0x880017ff irq 10 at device 0.0 on cardbus1
fwohci0: [GIANT-LOCKED]
fwohci0: OHCI version 1.10 (ROM=1)
fwohci0: No. of Isochronous channel is 4.
fwohci0: EUI64 00:40:26:01:04:04:4e:ef
fwohci0: Phy 1394a available S400, 2 ports.
fwohci0: Link S400, max_rec 2048 bytes.
firewire0: <IEEE1394(FireWire) bus> on fwohci0
sbp0: <SBP-2/SCSI over FireWire> on firewire0
fwohci0: Initiate bus reset
fwohci0: node_id=0xc000ffc0, gen=1, CYCLEMASTER mode
firewire0: 1 nodes, maxhop <= 0, cable IRM = 0 (me)
firewire0: bus manager 0 (me)
-------------------------------------------------------------------------

>From difference between two debug messages, I think it is problem that
kernel allocate non-requested resource from driver.
It has side effects in this case.

In the PCI firewire driver reqests I/O memory that specified with
rid = 0x10 like this.

(from /sys/dev/firewire/fwohci_pci.c)
    rid = PCI_CBMEM;   /* (= PCIR_BAR(0) = 0x10) */
    sc->bsr = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE);

But 5-curret kernel allocates all memory resource (rid = 0x10, 0x14, 0x18).

    fwohci0: <Texas Instruments TSB43AB22/A> mem 0x8800c000-0x8800c7ff,0x88008000-0x8800bfff,0x8800c800-0x8800cfff irq 10 at device 0.0 on cardbus1

With my patch, it prevent add surplus resource to resource list.
(Yes I know, this is not real solution.)

# And, I don't know why the IEEE1394 card does not works with all memory
#  resouces allocated...
Received on Sun May 16 2004 - 00:50:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:54 UTC