All of lore.kernel.org
 help / color / mirror / Atom feed
* local_irq_save vs raw_local_irq_save
@ 2013-07-04  8:25 Raj Ravi
  2013-07-04  9:15 ` anish singh
  0 siblings, 1 reply; 6+ messages in thread
From: Raj Ravi @ 2013-07-04  8:25 UTC (permalink / raw)
  To: kernelnewbies

Hi,

Please let me know the difference between
local_irq_save  and raw_local_irq_save ?
At which situation one should use raw_local_irq_save?


Also, I read "flags"  is where interrupt state is saved while disabling
interrupts in local cpu (for local_irq_save).

What EXACTLY this  flags contains?  What do you mean by interrupt state
here?

Thanks!
Kavi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130704/317c9de0/attachment.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* local_irq_save vs raw_local_irq_save
  2013-07-04  8:25 local_irq_save vs raw_local_irq_save Raj Ravi
@ 2013-07-04  9:15 ` anish singh
  2013-07-04  9:49   ` Raj Ravi
  0 siblings, 1 reply; 6+ messages in thread
From: anish singh @ 2013-07-04  9:15 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Jul 4, 2013 at 1:55 PM, Raj Ravi <mekaviraj@gmail.com> wrote:
> Hi,
>
> Please let me know the difference between
> local_irq_save  and raw_local_irq_save ?

did you check who calls this raw_local_irq_save?
similarly who calls local_irq_save?
finding out these will answer your questions
> At which situation one should use raw_local_irq_save?
>
>
> Also, I read "flags"  is where interrupt state is saved while disabling
> interrupts in local cpu (for local_irq_save).
>
> What EXACTLY this  flags contains?  What do you mean by interrupt state
> here?

interrupt state meaning: which all interrupts are enabled or disabled at this
instant.If a particular interrupt was enabled at that instant then we don't
do any thing with our locking mechanism which causes it be be disabled.
What we are doing with those flags is nothing but maintaining the state.
>
> Thanks!
> Kavi
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* local_irq_save vs raw_local_irq_save
  2013-07-04  9:15 ` anish singh
@ 2013-07-04  9:49   ` Raj Ravi
  2013-07-04 11:08     ` anish singh
  0 siblings, 1 reply; 6+ messages in thread
From: Raj Ravi @ 2013-07-04  9:49 UTC (permalink / raw)
  To: kernelnewbies

Thanks Anish.

As for  local_irq_save  and raw_local_irq_save, it seems
local_irq_save - called at many different places while raw_local_irq_save
is called in fewer places.

                             local_irq_save - does not disable Hardware
interrupts.
    Whereas,raw_local_irq_save - does DISABLE hardware interrupts.

As per code, raw_local_irq_save is related with timer interrupts.
Please provide your insights on this.

Also, in local_irq_save - how exactly disabling interrupts is achieved ( in
spite of " NOT DISABLING " hardware interrupts) ?





On Thu, Jul 4, 2013 at 2:45 PM, anish singh <anish198519851985@gmail.com>wrote:

> On Thu, Jul 4, 2013 at 1:55 PM, Raj Ravi <mekaviraj@gmail.com> wrote:
> > Hi,
> >
> > Please let me know the difference between
> > local_irq_save  and raw_local_irq_save ?
>
> did you check who calls this raw_local_irq_save?
> similarly who calls local_irq_save?
> finding out these will answer your questions
> > At which situation one should use raw_local_irq_save?
> >
> >
> > Also, I read "flags"  is where interrupt state is saved while disabling
> > interrupts in local cpu (for local_irq_save).
> >
> > What EXACTLY this  flags contains?  What do you mean by interrupt state
> > here?
>
> interrupt state meaning: which all interrupts are enabled or disabled at
> this
> instant.If a particular interrupt was enabled at that instant then we don't
> do any thing with our locking mechanism which causes it be be disabled.
> What we are doing with those flags is nothing but maintaining the state.
> >
> > Thanks!
> > Kavi
> >
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies at kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130704/d17a9c1f/attachment-0001.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* local_irq_save vs raw_local_irq_save
  2013-07-04  9:49   ` Raj Ravi
@ 2013-07-04 11:08     ` anish singh
  2013-07-05  7:50       ` Raj Ravi
  0 siblings, 1 reply; 6+ messages in thread
From: anish singh @ 2013-07-04 11:08 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Jul 4, 2013 at 3:19 PM, Raj Ravi <mekaviraj@gmail.com> wrote:
> Thanks Anish.
>
> As for  local_irq_save  and raw_local_irq_save, it seems
> local_irq_save - called at many different places while raw_local_irq_save is
> called in fewer places.
>
>                              local_irq_save - does not disable Hardware
> interrupts.
>     Whereas,raw_local_irq_save - does DISABLE hardware interrupts.
>
> As per code, raw_local_irq_save is related with timer interrupts.
> Please provide your insights on this.
http://lxr.free-electrons.com/source/include/linux/irqflags.h#L61
read this please.
>
> Also, in local_irq_save - how exactly disabling interrupts is achieved ( in
> spite of " NOT DISABLING " hardware interrupts) ?
>
>
>
>
>
> On Thu, Jul 4, 2013 at 2:45 PM, anish singh <anish198519851985@gmail.com>
> wrote:
>>
>> On Thu, Jul 4, 2013 at 1:55 PM, Raj Ravi <mekaviraj@gmail.com> wrote:
>> > Hi,
>> >
>> > Please let me know the difference between
>> > local_irq_save  and raw_local_irq_save ?
>>
>> did you check who calls this raw_local_irq_save?
>> similarly who calls local_irq_save?
>> finding out these will answer your questions
>> > At which situation one should use raw_local_irq_save?
>> >
>> >
>> > Also, I read "flags"  is where interrupt state is saved while disabling
>> > interrupts in local cpu (for local_irq_save).
>> >
>> > What EXACTLY this  flags contains?  What do you mean by interrupt state
>> > here?
>>
>> interrupt state meaning: which all interrupts are enabled or disabled at
>> this
>> instant.If a particular interrupt was enabled at that instant then we
>> don't
>> do any thing with our locking mechanism which causes it be be disabled.
>> What we are doing with those flags is nothing but maintaining the state.
>> >
>> > Thanks!
>> > Kavi
>> >
>> > _______________________________________________
>> > Kernelnewbies mailing list
>> > Kernelnewbies at kernelnewbies.org
>> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>> >
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* local_irq_save vs raw_local_irq_save
  2013-07-04 11:08     ` anish singh
@ 2013-07-05  7:50       ` Raj Ravi
  2013-07-05 16:22         ` anish singh
  0 siblings, 1 reply; 6+ messages in thread
From: Raj Ravi @ 2013-07-05  7:50 UTC (permalink / raw)
  To: kernelnewbies

Hi,
I have gone through the code.

Please correct / provide your insights on my understanding.
1. There is no difference between local_irq_save and raw_local_irq_save
with ARM architecture.  ?


2. As per the below code,
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 13 static inline unsigned long arch_local_irq_save(void)
 14 {
 15         unsigned long flags;
 16
 17         asm volatile(
 18                 "       mrs     %0, cpsr        @ arch_local_irq_save\n"
 19                 "       cpsid   i"
 20                 : "=r" (flags) : : "memory", "cc");
 21         return flags;
 22 }
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Here, Flags contain the result of PRIMASK register. before interrupts are
disabled ??

References:
About CPSID instruction :
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/BABHBAAB.html
CPSID i ; Disable all interrupts except NMI (set PRIMASK.PM)
Registers overview :
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/CHDBIBGJ.html
About PRIMASK register:
http://infocenter.arm.com/help/topic/com.arm.doc.dui0662b/CHDBIBGJ.html#BABBBGEA
ARM GCC inline assembly:
http://www.ethernut.de/en/documents/arm-inline-asm.html

Please provide your insights.

Thanks !
Kavi


On Thu, Jul 4, 2013 at 4:38 PM, anish singh <anish198519851985@gmail.com>wrote:

> On Thu, Jul 4, 2013 at 3:19 PM, Raj Ravi <mekaviraj@gmail.com> wrote:
> > Thanks Anish.
> >
> > As for  local_irq_save  and raw_local_irq_save, it seems
> > local_irq_save - called at many different places while
> raw_local_irq_save is
> > called in fewer places.
> >
> >                              local_irq_save - does not disable Hardware
> > interrupts.
> >     Whereas,raw_local_irq_save - does DISABLE hardware interrupts.
> >
> > As per code, raw_local_irq_save is related with timer interrupts.
> > Please provide your insights on this.
> http://lxr.free-electrons.com/source/include/linux/irqflags.h#L61
> read this please.
> >
> > Also, in local_irq_save - how exactly disabling interrupts is achieved (
> in
> > spite of " NOT DISABLING " hardware interrupts) ?
> >
> >
> >
> >
> >
> > On Thu, Jul 4, 2013 at 2:45 PM, anish singh <anish198519851985@gmail.com
> >
> > wrote:
> >>
> >> On Thu, Jul 4, 2013 at 1:55 PM, Raj Ravi <mekaviraj@gmail.com> wrote:
> >> > Hi,
> >> >
> >> > Please let me know the difference between
> >> > local_irq_save  and raw_local_irq_save ?
> >>
> >> did you check who calls this raw_local_irq_save?
> >> similarly who calls local_irq_save?
> >> finding out these will answer your questions
> >> > At which situation one should use raw_local_irq_save?
> >> >
> >> >
> >> > Also, I read "flags"  is where interrupt state is saved while
> disabling
> >> > interrupts in local cpu (for local_irq_save).
> >> >
> >> > What EXACTLY this  flags contains?  What do you mean by interrupt
> state
> >> > here?
> >>
> >> interrupt state meaning: which all interrupts are enabled or disabled at
> >> this
> >> instant.If a particular interrupt was enabled at that instant then we
> >> don't
> >> do any thing with our locking mechanism which causes it be be disabled.
> >> What we are doing with those flags is nothing but maintaining the state.
> >> >
> >> > Thanks!
> >> > Kavi
> >> >
> >> > _______________________________________________
> >> > Kernelnewbies mailing list
> >> > Kernelnewbies at kernelnewbies.org
> >> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130705/98e3b8cf/attachment.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* local_irq_save vs raw_local_irq_save
  2013-07-05  7:50       ` Raj Ravi
@ 2013-07-05 16:22         ` anish singh
  0 siblings, 0 replies; 6+ messages in thread
From: anish singh @ 2013-07-05 16:22 UTC (permalink / raw)
  To: kernelnewbies

On Jul 5, 2013 1:20 PM, "Raj Ravi" <mekaviraj@gmail.com> wrote:
>
> Hi,
> I have gone through the code.
>
> Please correct / provide your insights on my understanding.
> 1. There is no difference between local_irq_save and raw_local_irq_save
with ARM architecture.  ?
Yes,mostly there is no difference except in
local_irq_save we enable some tracing options.
>
> 2. As per the below code,
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>  13 static inline unsigned long arch_local_irq_save(void)
>  14 {
>  15         unsigned long flags;
>  16
>  17         asm volatile(
>  18                 "       mrs     %0, cpsr        @
arch_local_irq_save\n"
>  19                 "       cpsid   i"
>  20                 : "=r" (flags) : : "memory", "cc");
>  21         return flags;
>  22 }
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> Here, Flags contain the result of PRIMASK register. before interrupts are
disabled ??
Well that is assembly and my weakness
so my best answer would be that it just stores the previous state of
interrupt status register and we restore it back when we call
restore function.
>
> References:
> About CPSID instruction :
>
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/BABHBAAB.html
> CPSID i ; Disable all interrupts except NMI (set PRIMASK.PM)
> Registers overview :
>
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/CHDBIBGJ.html
> About PRIMASK register:
>
http://infocenter.arm.com/help/topic/com.arm.doc.dui0662b/CHDBIBGJ.html#BABBBGEA
> ARM GCC inline assembly:
> http://www.ethernut.de/en/documents/arm-inline-asm.html
>
> Please provide your insights.
>
> Thanks !
> Kavi
>
>
>
> On Thu, Jul 4, 2013 at 4:38 PM, anish singh <anish198519851985@gmail.com>
wrote:
>>
>> On Thu, Jul 4, 2013 at 3:19 PM, Raj Ravi <mekaviraj@gmail.com> wrote:
>> > Thanks Anish.
>> >
>> > As for  local_irq_save  and raw_local_irq_save, it seems
>> > local_irq_save - called at many different places while
raw_local_irq_save is
>> > called in fewer places.
>> >
>> >                              local_irq_save - does not disable Hardware
>> > interrupts.
>> >     Whereas,raw_local_irq_save - does DISABLE hardware interrupts.
>> >
>> > As per code, raw_local_irq_save is related with timer interrupts.
>> > Please provide your insights on this.
>> http://lxr.free-electrons.com/source/include/linux/irqflags.h#L61
>> read this please.
>> >
>> > Also, in local_irq_save - how exactly disabling interrupts is achieved
( in
>> > spite of " NOT DISABLING " hardware interrupts) ?
>> >
>> >
>> >
>> >
>> >
>> > On Thu, Jul 4, 2013 at 2:45 PM, anish singh <
anish198519851985@gmail.com>
>> > wrote:
>> >>
>> >> On Thu, Jul 4, 2013 at 1:55 PM, Raj Ravi <mekaviraj@gmail.com> wrote:
>> >> > Hi,
>> >> >
>> >> > Please let me know the difference between
>> >> > local_irq_save  and raw_local_irq_save ?
>> >>
>> >> did you check who calls this raw_local_irq_save?
>> >> similarly who calls local_irq_save?
>> >> finding out these will answer your questions
>> >> > At which situation one should use raw_local_irq_save?
>> >> >
>> >> >
>> >> > Also, I read "flags"  is where interrupt state is saved while
disabling
>> >> > interrupts in local cpu (for local_irq_save).
>> >> >
>> >> > What EXACTLY this  flags contains?  What do you mean by interrupt
state
>> >> > here?
>> >>
>> >> interrupt state meaning: which all interrupts are enabled or disabled
at
>> >> this
>> >> instant.If a particular interrupt was enabled at that instant then we
>> >> don't
>> >> do any thing with our locking mechanism which causes it be be
disabled.
>> >> What we are doing with those flags is nothing but maintaining the
state.
>> >> >
>> >> > Thanks!
>> >> > Kavi
>> >> >
>> >> > _______________________________________________
>> >> > Kernelnewbies mailing list
>> >> > Kernelnewbies at kernelnewbies.org
>> >> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>> >> >
>> >
>> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130705/45465d3e/attachment.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-07-05 16:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-04  8:25 local_irq_save vs raw_local_irq_save Raj Ravi
2013-07-04  9:15 ` anish singh
2013-07-04  9:49   ` Raj Ravi
2013-07-04 11:08     ` anish singh
2013-07-05  7:50       ` Raj Ravi
2013-07-05 16:22         ` anish singh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.