Re: local_irq_disable()

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

 





On 1/13/06, Rajaram Suryanarayanan <rajaram_linux@xxxxxxxxx> wrote:


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>

you won't see the word "mouse", rather than you'll see the controller to which the mouse has been plugged
here is the result of my /proc/interrupts:

tayseer@IDOIT:~> cat /proc/interrupts
           CPU0
  0:     454174          XT-PIC  timer
  1:        773          XT-PIC  i8042
  2:          0          XT-PIC  cascade
  4:     133208          XT-PIC  serial
  5:          0          XT-PIC  uhci_hcd:usb1
  7:          1          XT-PIC  parport0
  8:          2          XT-PIC  rtc
  9:        513          XT-PIC  acpi, uhci_hcd:usb2, CMI8738, eth0
 12:      55300          XT-PIC  i8042
 14:     141196          XT-PIC  ide0
 15:       7843          XT-PIC  ide1

my mouse is serial connected so it's connected to interrupt line 4
if my mouse was connected using usb1 then you're looking for interrupt 5 and if it was connected to usb2 then it's the interrupt 9 .. but in this case (mouse connected to usb2 interface) disabling interrupt 9 will disable acpi, sound card, ethernet also, right ? CMIIW please

MHD.Tayseer
--
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