Skip to contentSkip to conversation

PCI driver in userspace

DISCUSSION Pete Zaitcev 2 participants 2 messages Feb 27, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 4 lines
Quoted 3 lines

I think this is a good example to start with. It has all the interresting features. I hope it also has interrupt handling to userspace (by generating SIGIO's).

Quoted 8 lines

It hasn't, it just continually polls the I/O ports for completition.

Quoted 1 line

Although I dont know if this is a good idea in the first place.

I think it depends on the interrupt frequency, and other things.

Stelian.

PCI interrupts must be deactivated in the device before an interrupt driver returns and unmasks interrupt in the CPU. User processes run with interrupts open. This is why purely user level interrupts are IMPOSSIBLE (regardless of interrupt frequency).

Two natural ways to work around this problem are:

1. Run user processes with interrupts closed (or at least one interrupt source disabled, if your architecture allows that). This is what RTOSes often do. I do not think it can be easily done on generic Linux.

2. Write a small driver that deactivates interrupts and queues interrupt events (with SIGIO and some other means). Personally, I think that it is dumb in most cases, because once you wrote that driver stub, it takes very little work to move the rest of the driver into the kernel. The notable exception is XFree86, of course.

We must ask someone to add this to FAQ on tux.org.

Very many people are psychologically afraid of drivers (even though it's quite simple), and they wank those userspace approaches, until they hit some brick wall (interrupts being most common). By that time they invest so much into their code that they are loth to abandon broken userland drivers and start grappling about desperately for a way out.

-- Pete

#2 lore raw
Quoted 26 lines · Pete Zaitcev
Quoted 4 lines
Quoted 3 lines

I think this is a good example to start with. It has all the interresting features. I hope it also has interrupt handling to userspace (by generating SIGIO's).

Quoted 8 lines

It hasn't, it just continually polls the I/O ports for completition.

Quoted 1 line

Although I dont know if this is a good idea in the first place.

I think it depends on the interrupt frequency, and other things.

Stelian.

PCI interrupts must be deactivated in the device before an interrupt driver returns and unmasks interrupt in the CPU. User processes run with interrupts open. This is why purely user level interrupts are IMPOSSIBLE (regardless of interrupt frequency).

Two natural ways to work around this problem are:

1. Run user processes with interrupts closed (or at least one interrupt source disabled, if your architecture allows that). This is what RTOSes often do. I do not think it can be easily done on generic Linux.

Quoted 8 lines

2. Write a small driver that deactivates interrupts and queues interrupt events (with SIGIO and some other means). Personally, I think that it is dumb in most cases, because once you wrote that driver stub, it takes very little work to move the rest of the driver into the kernel. The notable exception is XFree86, of course.

We must ask someone to add this to FAQ on tux.org.

Send me a patch to the HTML file.

				Regards,

					Richard....
Permanent: [email protected]
Current:   [email protected]