pccard0: Card has no functions! OR PCI memory range allocation problem?

Bengt Ahlgren bengta at sics.se
Mon Mar 7 11:23:23 PST 2005


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: <Atheros 5212> 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


More information about the freebsd-mobile mailing list