public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiang Liu <jiang.liu@linux.intel.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Alexander Holler <holler@ahsoftware.de>,
	Mark Rustad <mark.d.rustad@intel.com>,
	Alex Deucher <alexdeucher@gmail.com>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, Jiang Liu <jiang.liu@linux.intel.com>
Cc: Tony Luck <tony.luck@intel.com>, linux-kernel@vger.kernel.org
Subject: [Bugfix] x86, irq: Fix an error in building CPU vector to IRQ number mapping for MSI
Date: Tue, 18 Aug 2015 23:20:20 +0800	[thread overview]
Message-ID: <1439911228-9880-1-git-send-email-jiang.liu@linux.intel.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1508172301350.3873@nanos>

Alex Deucher, Mark Rustad and Alexander Holler reported a regression
with the latest v4.2-rc4 kernel, which breaks some SATA controllers.
With multi-MSI capable SATA controllers, only the first port works,
all other ports times out when executing SATA commands.

The regression is caused by b5dc8e6c21e7 ("x86/irq: Use hierarchical
irqdomain to manage CPU interrupt vectors"), which builds wrong CPU
vector to IRQ number mappings for second and subsequent IRQs of multiple
MSIs and causes that all MSI IRQs are handled as the first MSI IRQ.
So fix the regression by building correct CPU vector to IRQ number mappings
for multiple MSIs.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Reported-and-tested-by: Alex Deucher <alexdeucher@gmail.com>
Reported-and-tested-by: Mark Rustad <mrustad@gmail.com>
Reported-and-tested-by: Alexander Holler <holler@ahsoftware.de>
---
 arch/x86/kernel/apic/vector.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index f813261d9740..2683f36e4e0a 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -322,7 +322,7 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq,
 		irq_data->chip = &lapic_controller;
 		irq_data->chip_data = data;
 		irq_data->hwirq = virq + i;
-		err = assign_irq_vector_policy(virq, irq_data->node, data,
+		err = assign_irq_vector_policy(virq + i, irq_data->node, data,
 					       info);
 		if (err)
 			goto error;
-- 
1.7.10.4


  reply	other threads:[~2015-08-18 15:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-09  8:15 [Bugfix] x86, irq: Fix a regression caused by commit b5dc8e6c21e7 Jiang Liu
2015-08-09 10:14 ` Alexander Holler
2015-08-09 14:11   ` Jiang Liu
2015-08-10 15:00 ` Alex Deucher
2015-08-11  1:06   ` Jiang Liu
2015-08-13 19:46     ` Alex Deucher
2015-08-13 20:15       ` Alex Deucher
2015-08-13 22:13         ` Alex Deucher
2015-08-25  4:03           ` Alex Deucher
2015-08-25  4:46             ` Jiang Liu
2015-08-10 16:47 ` Rustad, Mark D
2015-08-17 21:02 ` Alex Deucher
2015-08-18 12:53   ` Thomas Gleixner
2015-08-17 21:11 ` Thomas Gleixner
2015-08-18 15:20   ` Jiang Liu [this message]
2015-08-18 16:21     ` [tip:x86/urgent] x86/irq: Build correct vector mapping for multiple MSI interrupts tip-bot for Jiang Liu

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=1439911228-9880-1-git-send-email-jiang.liu@linux.intel.com \
    --to=jiang.liu@linux.intel.com \
    --cc=alexdeucher@gmail.com \
    --cc=holler@ahsoftware.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.d.rustad@intel.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox