Problems with IRQs when connecting two digium card in and asterisk box
Question
I have two Digium Wildcard TDM800P with 8 FXO ports each. When I connect both at the same time IRQ misses start showing up making my computer unresponsive and unusable.
One card works fine but I need all 16 FXO ports to work to receive calls from my Telco. Is there a way for the cards to communicate with each other so they don't generate as many interrupts. Or a way to tweak Linux to dedicate separate IRQ's for each card.
I have tried disabling Audio, ACPI and USB ports. Still too many IRQ misses.
Solution
This question would be better posted at serverfault, as this is a pure hardware problem.
The problem you are experiencing is typical of high interrupt PCI cards in general, and Digium telephony cards in particular. Please keep in mind that the problem stems from having both cards in the same PCI bus, your objective is to not have them share IRQ interrupts.
There are a couple of things you can try that can resolve your problem:
1) Upgrade to DAHDI drivers. They have better IRQ contention.
2) Change one of the cards to another PCI slot. Some PCI slots on the motherboard share lanes. You want to avoid this. Check your motherboards manual. Also, you can execute the following
cat /proc/interrupts
You should receive output like this
CPU0 CPU1 CPU2 CPU3
0: 37 2 5 8 IO-APIC-edge timer
1: 1 1 0 0 IO-APIC-edge i8042
8: 0 0 1 0 IO-APIC-edge rtc0
9: 0 0 0 0 IO-APIC-fasteoi acpi
12: 1 0 0 3 IO-APIC-edge i8042
14: 33 35 31 30 IO-APIC-edge ide0
20: 0 0 0 0 IO-APIC-fasteoi uhci_hcd:usb2
21: 37 37 41 38 IO-APIC-fasteoi uhci_hcd:usb1, uhci_hcd:usb3, ehci_hcd:usb4
1269: 14357 14387 14387 14372 PCI-MSI-edge eth0
1270: 2523 2490 2489 2503 PCI-MSI-edge ioc0
NMI: 0 0 0 0 Non-maskable interrupts
LOC: 487635 236288 376032 88504 Local timer interrupts
RES: 507 516 571 701 Rescheduling interrupts
CAL: 205 281 237 201 function call interrupts
TLB: 2835 2190 2221 1737 TLB shootdowns
TRM: 0 0 0 0 Thermal event interrupts
THR: 0 0 0 0 Threshold APIC interrupts
SPU: 0 0 0 0 Spurious interrupts
ERR: 0
See how in interrupt 21 is shared by usb1, usb3, and usb4? You don't want that to happen to your Digium cards. By the way, Digium cards ususaly show up as TDPXXX.
3) Load balance interrupts between CPU's - If your PC has more than one CPU and your kernel and motherboard support IO-APIC, you can load balance interrupts between different CPU's. This will also ease greatly the interrupt load on your CPU's. If you check my previously posted code, you can see that Local timer interrupts are spread evenly between CPU's. If your Digium cards hammer only one CPU (this happens) you can spread out the load by trying the following. Say we wanted to change IRQ 21 (the aforementioned USB's)
cat /proc/irq/21/smp_affinity
ffffffff
All those 'f' tell us that the interrupt load from IRQ 21 is load balanced between all CPU's. If you want to assign it to a certain CPU, add that nuber to the right in hexadecimal. For example, lets say I want the USB's to only interrupt CPU0.
echo 1 > /proc/irq/21/smp_affinity
cat /proc/irq/21/smp_affinity
00000001
So now only the first CPU (CPU0) is enabled to receive these interrupts.
Good luck!
OTHER TIPS
PCI Digium cards do not work well when you try to have more than one in the same computer. I had a similar problem with 2 TE405 cards in the same computer and had to switch to a Sangoma card (I only needed 1 Sangoma because they support up to 8 E1's in the same card and that's what I needed). Or you can try the AEX800 which is like the TDM800 but it's PCI-X instead of plain old PCI. IIRC the problem is PCI-related.
JorgeO: Sounds to me like you need to update your drivers. The latest zaptel and DAHDI releases include drivers for the TDM800P that configure the board in a way that allows the system to be more tolerant of host system interrupt latencies.
I have Debian and not work, change irq eth0 -> cpu0 a cpu2 cat /proc/irq/xxx/smp_affinity 00000003 but dont work the procees continue cpu0