mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Yinghai Lu <yinghai@kernel.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, rja@sgi.com, hpa@zytor.com,
	mingo@redhat.com, yinghai@kernel.org, suresh.b.siddha@intel.com,
	tglx@linutronix.de
Subject: [tip:x86/urgent] x86: Check irq_remapped instead of remapping_enabled in destroy_irq()
Date: Sat, 30 Oct 2010 08:36:54 GMT	[thread overview]
Message-ID: <tip-7b79462a20826a7269322113c68ca78d5f67c0bd@git.kernel.org> (raw)
In-Reply-To: <4CCBD511.40607@kernel.org>

Commit-ID:  7b79462a20826a7269322113c68ca78d5f67c0bd
Gitweb:     http://git.kernel.org/tip/7b79462a20826a7269322113c68ca78d5f67c0bd
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Sat, 30 Oct 2010 01:19:29 -0700
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sat, 30 Oct 2010 10:28:31 +0200

x86: Check irq_remapped instead of remapping_enabled in destroy_irq()

Russ Anderson reported:
| There is a regression that is causing a NULL pointer dereference
| in free_irte when shutting down xpc. git bisect narrowed it down
| to git commit d585d06(intr_remap: Simplify the code further), which
| changed free_irte(). Reverse applying the patch fixes the problem.

We need to use irq_remapped() for each irq instead of checking only
intr_remapping_enabled as there might be non remapped irqs even when
remapping is enabled.

[ tglx: use cfg instead of retrieving it again. Massaged changelog ]

Reported-bisected-and-tested-by: Russ Anderson <rja@sgi.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <4CCBD511.40607@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/apic/io_apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 0929191..7cc0a72 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3109,7 +3109,7 @@ void destroy_irq(unsigned int irq)
 
 	irq_set_status_flags(irq, IRQ_NOREQUEST|IRQ_NOPROBE);
 
-	if (intr_remapping_enabled)
+	if (irq_remapped(cfg))
 		free_irte(irq);
 	raw_spin_lock_irqsave(&vector_lock, flags);
 	__clear_irq_vector(irq, cfg);

      parent reply	other threads:[~2010-10-30  8:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-29 22:22 [BUG] intr_remap: Simplify the code further Russ Anderson
2010-10-30  0:37 ` Suresh Siddha
2010-10-30  1:50   ` Russ Anderson
2010-10-30  2:55     ` Yinghai Lu
2010-10-30  3:48       ` Russ Anderson
2010-10-30  8:19         ` [PATCH] x86, uv: Fix uv with destroy_irq() Yinghai Lu
2010-10-30  8:22           ` Thomas Gleixner
2010-10-30  8:36           ` tip-bot for Yinghai Lu [this message]

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=tip-7b79462a20826a7269322113c68ca78d5f67c0bd@git.kernel.org \
    --to=yinghai@kernel.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rja@sgi.com \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome