Re: Handling PCI interrupts



That makes sense but it also means the 'software interrupts' only occur on
the board and are not sent to the driver. I would suggest that you
determine at some time in the future when you have a close to production
system which of the hardware interrupt sources is the most frequently
received. Check for that interrupt first except if you have an interrupt
that indicates a major failure state that requires immediate attention. If
your device is a fairly slow generator of data and interrupts this is not so
critical, but it you push the ability of the computer to keep the flow
going, it may be critical.

Your driver will probably be in a stack of its own. Not NDIS, HID, Storage,
etc. as defined by Microsoft. This gives you many options for providing the
data to the client program. The simplest is to use IoCtls. First, write
the program to send one, wait for it, process the data, and then repeat the
sequence. Later you can consider having two or more issued to your driver
using some form of sequencing so that your driver can return them in order
and your program can recognize which one was completed. If the volume of
data is great and occurs at high speed, you may want to consider using read
and write calls to handle the data, but IoCtls do have the advantage of
being able to do bidirectional transfers of information - either for the
driver or device on send plus data from the driver or device in the other
direction. Read/Write type logic is best for independent data transfers.

In IoCtls, the use of buffered or direct type requests are another
consideration. Use buffered if the copy time required is not a factor as
with transfers of less than a single 4KB page. The buffered are the easiest
to use and safest from problems with worrying about accessing user buffers
when they are not appropiately locked down.


"Bryan" <Bryan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:67ED2BA3-D1AF-407F-86B5-88C0587989FB@xxxxxxxxxxxxxxxx
Can you explain how a hardware device has 'software interrupts'? I saw
this
posted twice in the last few days and it has confused me. How does a
hardware device execute code in the host processor and generate a
software
interrupt?

The DSP has standard PCI interrupts (parity error, etc.), but in addition
it
also has "four software interrupts"(as the manuals calls them). I believe
they are simply programmable interrupts as they are not controlled by the
DSP's PCI peripheral controller. To trigger the interrupts from the
device
driver to the DSP, the driver just has to flip a bit in a register located
in
one of the memory-mapped spaces presented to the driver. Driver-to-DSP
interrupts do not use PCIINT on the bus; they cause an interrupt inside
the
DSP's core. (This is my understanding at least)

For an application running on the DSP, it can trigger interrupts to the
driver by flipping bits in a separate register. Doing so causes the DSP's
PCI peripheral to generate PCIINT, and that in turns causes Windows to
call
all of the ISR callback routines for the PCI drivers. My driver is able
to
recognize that this interrupt is its responsibility by looking at that
same
register in the DSP (because that register is memory-mapped into the
Kernel).


.



Relevant Pages

  • Re: High resolution timer on kernel mode
    ... The problem I have is that this driver is ... interrupts then do your work in the interrupt handler ... ... timer all of the time ... ... So for me if the packets are coming in very slowly ... ...
    (microsoft.public.development.device.drivers)
  • RE: [patch 1/2] serial: add tsi108 8250 serial support
    ... The following patch fixes the tsi108 port report information. ... UPIO_TSI to handle IIR and IER register in serial_in and serial_out. ... Empty and Transmit buffer Empty interrupts ... driver specific */ ...
    (Linux-Kernel)
  • [RFC/PATCH] Kdump: Disabling PCI interrupts in capture kernel
    ... In kdump, sometimes, general driver initialization issues seems to be cropping ... devices are sending interrupts while second kernel is booting and drivers are ... not expecting any interrupts yet. ... we need something generic which disables interrupt generation from device ...
    (Linux-Kernel)
  • [PATCH] Removal of the deprecated cli() sti() functions.
    ... info on Computone Intelliport II/Plus Multiport Serial Driver. ... -handlers via a cli(), but from now on other, more lightweight methods ... -drivers that want to disable local interrupts (interrupts on the ... -(local_irq_save can save both irqs on and irqs off state, ...
    (Linux-Kernel)
  • Re: [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and IRQ drivers
    ... Asynchronous Display Controller, Image Converter, Post-Filter ... This driver serves IDMAC and IG. ... they also must specify which channels they ... My concern is that of these 137 interrupts only 7 are ...
    (Linux-Kernel)