Network, interrupt, DMA or something problem...

Hi,

I am running QNX 6.2 and i am trying to write a driver for a PCI frame
grabber card. I use DMA for data transfer between the frame grabber and the
PC. The driver is simple. I have one interrupt service routine and an
interrupt thread.



Here is a general description of what actually happens:

  1. I start my driver (application) and initialize the card and setup my ISR
    and the interrupt thread.
  2. I start the frame grabber (by writing to an IO address).
  3. The frame grabber raises an interrupt telling me a frame is ready, and I
    setup and start the DMA transfer.
  4. I get a DMA ready interrupt and I “arm” the frame grabber card so it
    continues rising interrupts when new data frames arrives (25 frames per
    second). Then I return an interrupt event from the ISR enabling
    interruptWait() in my interrupt thread to break. And now I only copy the new
    data frame to another location (buffer) in memory (just for testing), and go
    back to the interruptWait() state, and it starts over from step 3.



    The problem I am having is that when I start the driver (test program) to
    grab some data, the network connection fails. The computer is no longer
    reachable. I can not access the computer by Phindows and I can not access
    the internet or any network connection to and from QNX. I have tried to
    restart io-net and inetd, but nothing helps, I can still run everything else
    on the machine though, and everything seems normal (except TCPIP
    applications). I have to restart the computer in order to fix the problem
    with the network.

Actually the network does not fail at once, sometime it doesn’t fail at all,
but I have noticed that if it run for more than about 20 seconds the problem
occurs (in some cases, it happens sooner). First I thought it could be a
problem with some IRQ sharing, well that was true, but now I have changed
the IRQ and checked that no other devices on the computer share the same IRQ
as the network card or the frame grabber card (they have different IRQs as
well).

Does anyone know what the problem could be? Is there a way to trace or check
the state of the system (device drivers, ISR and so on)? Am I missing
something with the DMA / interrupt handling that can cause this type of
problem?

I am open to any suggestions and ideas.

Regards,
Antoine.

Hi Antoine,

I have a very similar problem with my framegrabber driver Bttvx
(http://argo.lira.dist.unige.it/cbeltran/bttvx.htm) for bt8xx conexant
chips. The syntoms are very similar to those you are describing. In my case
some process is going to use 100% of the cpu and blocking completly the
computer. This is happening just in one of our computers; first I had my
driver sharing the interrupt with the network card, then I moved the card to
another pci slot and still have an interrupt sharing with the video card. I
have always thought that this was a sharing interrupt problem, but when I
have seen your message I suspect it could be another thing. However, as I
have said, this problem appears in just one of the computers we are using,
and precisely this is the one with the sharing interrupt stuff; the other
machines I have with the driver don’t share any interrupt and don’t present
the problem…
I will very much appreciate to see the code of your driver. May be together
we can resolve the problem. I had somehow abandon this issue do to lack of
time and because the driver works ok in the computer I am actually using…

Greetings,

Carlos.
----- Original Message -----
From: “Antoine Haddad” <anthad@foi.se>
Newsgroups: qnx.rtos
Sent: Thursday, July 29, 2004 10:14 AM
Subject: Network, interrupt, DMA or something problem…


Hi,

I am running QNX 6.2 and i am trying to write a driver for a PCI frame
grabber card. I use DMA for data transfer between the frame grabber and
the
PC. The driver is simple. I have one interrupt service routine and an
interrupt thread.



Here is a general description of what actually happens:

  1. I start my driver (application) and initialize the card and setup my
    ISR
    and the interrupt thread.
  2. I start the frame grabber (by writing to an IO address).
  3. The frame grabber raises an interrupt telling me a frame is ready, and
    I
    setup and start the DMA transfer.
  4. I get a DMA ready interrupt and I “arm” the frame grabber card so it
    continues rising interrupts when new data frames arrives (25 frames per
    second). Then I return an interrupt event from the ISR enabling
    interruptWait() in my interrupt thread to break. And now I only copy the
    new
    data frame to another location (buffer) in memory (just for testing), and
    go
    back to the interruptWait() state, and it starts over from step 3.



    The problem I am having is that when I start the driver (test program) to
    grab some data, the network connection fails. The computer is no longer
    reachable. I can not access the computer by Phindows and I can not access
    the internet or any network connection to and from QNX. I have tried to
    restart io-net and inetd, but nothing helps, I can still run everything
    else
    on the machine though, and everything seems normal (except TCPIP
    applications). I have to restart the computer in order to fix the problem
    with the network.

Actually the network does not fail at once, sometime it doesn’t fail at
all,
but I have noticed that if it run for more than about 20 seconds the
problem
occurs (in some cases, it happens sooner). First I thought it could be a
problem with some IRQ sharing, well that was true, but now I have changed
the IRQ and checked that no other devices on the computer share the same
IRQ
as the network card or the frame grabber card (they have different IRQs as
well).

Does anyone know what the problem could be? Is there a way to trace or
check
the state of the system (device drivers, ISR and so on)? Am I missing
something with the DMA / interrupt handling that can cause this type of
problem?

I am open to any suggestions and ideas.

Regards,
Antoine.