All of lore.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-parisc@vger.kernel.org
Subject: Re: [PATCH] parisc: call set_irq_regs() after disabling local irqs
Date: Thu, 10 Oct 2013 10:32:22 +0200	[thread overview]
Message-ID: <52566616.80101@gmx.de> (raw)
In-Reply-To: <1381371477.17669.62.camel@dabdike>

Hi James,

On 10/10/2013 04:17 AM, James Bottomley wrote:
> On Wed, 2013-10-09 at 23:54 +0200, Helge Deller wrote:
>> Signed-off-by: Helge Deller <deller@gmx.de>
>>
>> diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
>> index 2e6443b..c439c05 100644
>> --- a/arch/parisc/kernel/irq.c
>> +++ b/arch/parisc/kernel/irq.c
>> @@ -529,8 +529,8 @@ void do_cpu_irq_mask(struct pt_regs *regs)
>>  	cpumask_t dest;
>>  #endif
>>  
>> -	old_regs = set_irq_regs(regs);
>>  	local_irq_disable();
>> +	old_regs = set_irq_regs(regs);
> 
> I don't quite understand why.  set_irq_regs is just saving the current
> regs pointer.

...and setting a new one...

> The design intent is to call it first thing in the
> interrupt routine but because of the way we use them, it makes no
> difference whether you do it before or after disabling interrupts
> because it's stacked.  What was the reason for wanting to change it to a
> non-standard calling pattern?

Is it really non-standard?

My first intention was to align the set_irq_regs() and entrance and exit 
to the irq_enter() and irq_exit() functions.
With my change above it's now:
	
	old_regs = set_irq_regs(regs);
	irq_enter();
	do_something...();
	irq_exit();
	set_irq_regs(old_regs);

That's the same syntax as all other arches use.

I think the main question is, if we need local_irq_disable() at all?
At least moving the "old_regs = set_irq_regs(regs);" down after local_irq_disable()
ensures that nobody else modifies the irq_regs pointer before we save it into old_regs.

Helge


  reply	other threads:[~2013-10-10  8:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 21:54 [PATCH] parisc: call set_irq_regs() after disabling local irqs Helge Deller
2013-10-10  2:17 ` James Bottomley
2013-10-10  8:32   ` Helge Deller [this message]
2013-10-10 15:05     ` John David Anglin
2013-10-11 11:54     ` James Bottomley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52566616.80101@gmx.de \
    --to=deller@gmx.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-parisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.