mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Liu Hua <sdu.liu@huawei.com>
To: <tglx@linutronix.de>, <marc.zyngier@arm.com>, <will.deacon@arm.com>
Cc: <peifeiyue@huawei.com>, <liusdu@126.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] irqchip: mark the irq status in handle_percpu_devid_irq
Date: Wed, 28 Jan 2015 17:30:46 +0800	[thread overview]
Message-ID: <1422437446-31909-1-git-send-email-sdu.liu@huawei.com> (raw)

Function handle_percpu_devid_irq lacks of irq's state
changing. The handler may fail. So we should mark this
irq's status. It is very useful when we deploy kdump
and the handler fails with panic. The kdump can deal
with this situaton in machine_kexec_mask_interrupts,
which will do some works to the interrupt controller
(write EOI..).

Without this patch, kdump can not go through if first
kernel panics in per-cpu interrupt handler(like hrtimers).
I can reduce this bugs on ARM SMP platform with per cpu
timers.

I have send a related patchset. But I think that is not the
best way to solve this problem.

  link:lkml.org/lkml/2014/8/4/18

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
---
 kernel/irq/chip.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 6f1c7a5..3328a45 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -710,10 +710,18 @@ void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc)
 	if (chip->irq_ack)
 		chip->irq_ack(&desc->irq_data);
 
+	raw_spin_lock(&desc->lock);
+	irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS);
+	raw_spin_unlock(&desc->lock);
+
 	trace_irq_handler_entry(irq, action);
 	res = action->handler(irq, dev_id);
 	trace_irq_handler_exit(irq, action, res);
 
+	raw_spin_lock(&desc->lock);
+	irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS);
+	raw_spin_unlock(&desc->lock);
+
 	if (chip->irq_eoi)
 		chip->irq_eoi(&desc->irq_data);
 }
-- 
1.9.0


                 reply	other threads:[~2015-01-28 20:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1422437446-31909-1-git-send-email-sdu.liu@huawei.com \
    --to=sdu.liu@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liusdu@126.com \
    --cc=marc.zyngier@arm.com \
    --cc=peifeiyue@huawei.com \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®