[Asterisk-Users] Heads up - AVM C2/C4 on AMD 64 bit processors

John Daragon john at argv.co.uk
Wed Nov 16 03:55:26 MST 2005


I thought I'd just document a problem I've been having in case anyone
else comes across it.

I have an AVM-C2 card which I'm using with chan_capi. capiinit fails to 
load the driver when run under 2.4 or 2.6 kernels on AMD Sempron 
processors with 64 bit cores, and at least some 64 bit Athlons, too.

If I pull out the RAID and put it into a 32 bit Intel based PC,
everything works fine.

jd.


Here's the symptom (C4 is the driver for C2 and C4 cards) :

PCI: Found IRQ 4 for device 0000:00:7.0
c4: PCI BIOS reports AVM-C2 at i/o e400, irq 4 mem 0xe8124000
c4: NO card at e400 error(2)
c4: no AVM-C2 at i/o e400, irq 4 detected, mem 0xe8124000
c4: revision 1.1.2.2


which means that C4_detect() in C4.c has failed in a chunk of code
that is basically resetting the controller.

What it does is to enter a tight loop for ten seconds, looking for a
value of 0xFFFFFFFF from a port on the card:


c4outmeml(card->mbase+DOORBELL, DBELL_RESET_ARM);
stop = jiffies + HZ*10;

while (c4inmeml(card->mbase+DOORBELL) != 0xffffffff) {
      if (!time_before(jiffies, stop))
           return 2;

      c4outmeml(card->membase+DOORBELL, DBELL_ADDR);
      mb();
}


The function fails because it still hasn't read 0xffffffff from
card->mbase+DOORBELL after 10 seconds.

Interestingly, if I insert a KERN_DEBUG statement to record the content
of card->mbase+DOORBELL, I get 0xffffffff, but the comparison still
fails.

I have been able to persuade the driver to load by extending the time at
HZ*10 to HZ*50 and running capiinit start / capiinit stop a few times,
whiich is obviously not ideal as we can't run it in the init.d script
like that... Under 2.4 kernels it loads silently (when it does load)
under 2.6, it produces a really scary kernel error :

c2-e400: C2-card (3.11-06) now active
Debug: sleeping function called from invalid context at
include/asm/semaphore.h:107
  in_atomic():1[expected: 0], irqs_disabled():0
  ..
  ..

-- 
John Daragon                                          john at argv.co.uk
argv[0] limited
Lambs Lawn Cottage,  Staple Fitzpaine,  Taunton,  TA3 5SL,  UK
v +44 (0) 1460 234068   f +44 (0) 1460 234069   m +44 (0) 7836 576127





More information about the asterisk-users mailing list