LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-22-2021, 12:24 PM   #1
zvivered
Member
 
Registered: Sep 2007
Posts: 294

Rep: Reputation: 23
Handling several interrupts in linux kernel driver


Hello,

I'm developing a kernel driver for a PCIe based card.

The card has one interrupt (legacy, not MSI)

Upon interrupt, a status register is read.

According to this register, N channels (out of 8) received a 4MB packet.

As you can see in line 15, a wait queue is declared.

I have to declare 8 queues.

Is it possible to declare an "array" of wait queues ?

Currently I have to write this line 8 times.

Is there a nicer way ?

The interrupt handler calls: sInterruptFlagPacket=1.
The application send an IOCTL request which is blocked (with timeout) till an interrupt received:

wait_event_interruptible(sWaitQueuePacket, sInterruptFlagPacket != 0);
sInterruptFlagPacket = 0;

Thank you,
Zvika
Attached Files
File Type: txt Fio.txt (2.4 KB, 36 views)
 
Old 05-22-2021, 01:37 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,655

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by zvivered View Post
Hello,
I'm developing a kernel driver for a PCIe based card. The card has one interrupt (legacy, not MSI) Upon interrupt, a status register is read. According to this register, N channels (out of 8) received a 4MB packet. As you can see in line 15, a wait queue is declared. I have to declare 8 queues. Is it possible to declare an "array" of wait queues ?

Currently I have to write this line 8 times. Is there a nicer way ? The interrupt handler calls: sInterruptFlagPacket=1. he application send an IOCTL request which is blocked (with timeout) till an interrupt received:

wait_event_interruptible(sWaitQueuePacket, sInterruptFlagPacket != 0);
sInterruptFlagPacket = 0;
This sounds VERY familiar:
https://www.linuxquestions.org/quest...-a-4175685514/
https://www.linuxquestions.org/quest...el-4175682807/
https://www.linuxquestions.org/quest...ng-4175671805/
https://www.linuxquestions.org/quest...ly-4175671763/

...where you've been working on this since last year. Again, as you were told before (several times):
  • We don't have your custom kernel
  • We don't have your hardware
  • We don't have your custom code
So what, exactly, do you think we'll be able to tell you??? It seems like you want us to be free consultants for you, and debug your code.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel driver: Handling interrupts from multiple sources zvivered Linux - Kernel 2 09-23-2013 05:46 AM
Mouse event handling and interrupts in linux. skyte Programming 1 03-02-2010 02:45 PM
Can anyone please explain about "Function call interrupts" entry in /proc/interrupts? cyclops.xmen Linux - Software 2 12-09-2009 12:13 PM
Userspace handling of driver interrupts AustinMarton Linux - Kernel 12 01-14-2009 08:48 PM
Handling of Interrupts in thread context asurya Linux - Newbie 1 04-05-2006 09:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration