All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Romain Naour <romain.naour@openwide.fr>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] s3c24xx with clocksource/clockevent (kernel 3.2.21)
Date: Mon, 22 Oct 2012 16:05:29 +0200	[thread overview]
Message-ID: <508552A9.7020608@xenomai.org> (raw)
In-Reply-To: <508547AC.7020103@xenomai.org>

On 10/22/2012 03:18 PM, Gilles Chanteperdrix wrote:

> Another candidate would be irq_enable in kernel/irq/chip.c, shut off the
> irqs around the whole section, or move irq_state_clk_masked before the
> call to irq_unmask with a compiler barrier.


Actually, the following patch fixes another bug I had, so, could you 
check if it fixes yours? (and thanks for the explanations, they were 
very helpful).

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index f5d8d5e..cef1e78 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -167,8 +167,10 @@ int irq_startup(struct irq_desc *desc, bool resend)
 	desc->depth = 0;
 
 	if (desc->irq_data.chip->irq_startup) {
+		unsigned long flags = hard_cond_local_irq_save();
 		ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
 		irq_state_clr_masked(desc);
+		hard_cond_local_irq_restore(flags);
 	} else {
 		irq_enable(desc);
 	}
@@ -192,12 +194,14 @@ void irq_shutdown(struct irq_desc *desc)
 
 void irq_enable(struct irq_desc *desc)
 {
+	unsigned long flags = hard_cond_local_irq_save();
 	irq_state_clr_disabled(desc);
 	if (desc->irq_data.chip->irq_enable)
 		desc->irq_data.chip->irq_enable(&desc->irq_data);
 	else
 		desc->irq_data.chip->irq_unmask(&desc->irq_data);
 	irq_state_clr_masked(desc);
+	hard_cond_local_irq_restore(flags);
 }
 
 void irq_disable(struct irq_desc *desc)
@@ -211,11 +215,13 @@ void irq_disable(struct irq_desc *desc)
 
 void irq_percpu_enable(struct irq_desc *desc, unsigned int cpu)
 {
+	unsigned long flags = hard_cond_local_irq_save();
 	if (desc->irq_data.chip->irq_enable)
 		desc->irq_data.chip->irq_enable(&desc->irq_data);
 	else
 		desc->irq_data.chip->irq_unmask(&desc->irq_data);
 	cpumask_set_cpu(cpu, desc->percpu_enabled);
+	hard_cond_local_irq_restore(flags);
 }
 
 void irq_percpu_disable(struct irq_desc *desc, unsigned int cpu)


-- 
                                                                Gilles.


  reply	other threads:[~2012-10-22 14:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19 10:19 [Xenomai] s3c24xx with clocksource/clockevent (kernel 3.2.21) Romain Naour
2012-10-19 12:18 ` Gilles Chanteperdrix
2012-10-20 16:12   ` Romain Naour
2012-10-20 17:26     ` Gilles Chanteperdrix
2012-10-21  1:35       ` Romain Naour
2012-10-21 18:29         ` Gilles Chanteperdrix
2012-10-21 18:43         ` Gilles Chanteperdrix
2012-10-21 23:33           ` Romain Naour
2012-10-22 13:18             ` Gilles Chanteperdrix
2012-10-22 14:05               ` Gilles Chanteperdrix [this message]
2012-10-22 16:26                 ` Romain Naour

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=508552A9.7020608@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=romain.naour@openwide.fr \
    --cc=xenomai@xenomai.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.