Re: local_irq_disable()

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

 





Fawad Lateef <fawadlateef@xxxxxxxxx> wrote:
Resending to kernelnewbies due to error !

---------- Forwarded message ----------
From: Fawad Lateef
Date: Jan 12, 2006 8:47 PM
Subject: Re: local_irq_disable()
To: Rajaram Suryanarayanan
Cc: Nauman Tahir , Anupam Kapoor
, Gaurav Dhiman ,
kernelnewbies@xxxxxxxxxxxx


On 1/12/06, Rajaram Suryanarayanan wrote:
> My init_module contains just this
>
> int init_module(void)
> {
> long int flags;
> printk(KERN_INFO "Hello World \n");
> local_irq_disable();
> // disable_irq(169);
> }
>

I don't think its a good idea of disabling irqs while inserting module
:) It might be good for learning/testing puposes only :) (CMIIW)
 
<Raja> Yes, I am only learning now :) <Raja>

> When I inserted this module, nothing happened. But when I tried
> disable_irq(169), the eth0 network card stopped sending/receiving packets.
> So it means disable_irq() worked. But not local_irq_disable(). Why ?

As far as I can get by looking at the code of both local_irq_disable
and disable_irq functions I can say that local_irq_disable actually
disables interrupts on the processor (such that clears interrupt flag
on processor) but disable_irq actually call the disable routine of
interrupt controller (which will already be registered for that
specific irq number) thus disables the interrupt related to the device
only !
 
<Raja> Ok. So when insmod finishes, why only disable_irq() has its effect correctly ( ie that interrupt is disabled even after insmod ), but local_irq_disable() does not have effect ( i.e interrupts are not actually disabled after insmod ) ??
<Raja>

> Is it like when insmod process finishes, the kernel automatically reenables
> the interrupts ? If so why not for disable_irq() ?

I can't say that after insmod completion kernel enabled irq on the
processor, but the disable_irq as I mentioned disables the
controller/device interrupt so the device won't by it-self enables
interrupt.

> Also can anybody let me know what is the IRQ number of the mouse ?
>

I can't tell this ... by the way its depends that what kind of mouse
attached .. like USB, PS/2 etc .....
 
<Raja> I looked in to /proc/interrupts. But could not get any hint on where mouse is mentioned <Raja>

--
Fawad Lateef


--
Fawad Lateef

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/



Yahoo! Photos
Got holiday prints? See all the ways to get quality prints in your hands ASAP.

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux