Re: local_irq_save()

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

 



On 4/20/07, Christian Boon <c.boon@xxxxxxxxxxxxxxxxxxxx> wrote:
pradeep singh wrote:
> On 4/20/07, Christian Boon <c.boon@xxxxxxxxxxxxxxxxxxxx> wrote:
>> Hello,
>>
>> i've got a question about local_irq_save()
>>
>> When i use this function to disable interrupts, does this mean that when
>> an interrupt occurs
>> when interrupts are disabled, for example from the ethernet chip, this
>> interrupt is lost or does it mean
>> that the interrupt isnt serviced at the moment but serviced when
>> interrupts are enabled again?
> the interrupt is lost, if it maskable and not unmaskable interrupts
> IMHO.Because local_irq_save() macro inturn makes use of cli assembly
> instruction.
> Somebody please CMIIW.
But isnt it bad that i loose for example an ethernet or timer interrupt?

But if you do allow that you may end up into a race condition, because
this means you will have to use a lock to protect a critical section
between interrupt handlers.Or may be you'll beed a recursive lock,
which is bad. Moreover i don't think you usually miss that much
interrupts as it seems.

>>
>> i've got 2 interrupts in my driver which both need to write data in the
>> same buffer so when i keep
>> interrupts enabled, then i get bad behaviour.
> Is the buffer too large.Try writing from different ends on the same
> buffer for each interrupts.Does this helps anyway?
I  need to write on the same location, meaning the next buffer position.
Sad locking is not an option here. RCU mechanism is of any help to
you.Please check, i dont have much idea about it.

HTH
~psr

>>
>> Is there a way to lock a buffer from two interrupt service routines
>> without disabling interrupts?
>>
>> thanks in advance,
>>
>> Chris.





--
play the game

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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