RE: Setting the priority of an IRQ thread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Martin,

> Is there a way for a device driver to set the priority of the 
> IRQ thread that services interrupts from its hardware? I am 
> writing a device driver for a digital I/O board with general 
> purpose interrupt capability, and I would like the 
> application to be able to tell the driver what priority it 
> needs those interrupts to be given.
> 
> Currently it appears that preemp_rt spawns all IRQ threads 
> with priority 50, and that the only way to change the 
> priority of an IRQ is for an application program to execute 
> the chrt program, after the IRQ thread has been created. 
> However this requires that the driver pass back information 
> to the calling program about which IRQ it is using, so that 
> the program can then call popen to first search for the PID 
> of the corresponding thread, and then execute chrt to change 
> its priority. This is possible but messy, and relies on the 
> name of IRQ threads not changing in the future.
> 
> So is there a way for driver code in the kernel to identify 
> the thread of a given IRQ, and then change its priority?


I tried this exercise in a driver for 2.6.26. I succeeded in identifying the
thread for IRQ and its priority. I couldn't do the priority changes.

 #if 1
	struct sched_param param = { 0, };
	struct irq_desc *desc;

	// 2. Raise the priority of ISR thread
	param.sched_priority = 90;

	// get IRQ descriptor from IRQ, it contains pid
	desc = &irq_desc[IRQ_BASIC_TIMER_3_1];
	printk("Thread Priority = %u\n", desc->thread->prio);	
#endif

Along with this, some minor changes ('static' to 'extern' etc) for irq_desc
structure in corresponding files.

For changing the priority, you may try patches sent by Remy Bohmer
[linux@xxxxxxxxxx] on 28-May.

-Suresh

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux