All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Thomas Gleixner <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jiang.liu@linux.intel.com, mingo@kernel.org,
	sergey.senozhatsky@gmail.com, bp@alien8.de, hpa@zytor.com,
	tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: [tip:x86/apic] x86/hpet: Use proper hpet device number for MSI allocation
Date: Sun, 21 Jun 2015 07:43:23 -0700	[thread overview]
Message-ID: <tip-cb17b2a674f2059343f997599b4b001e64eec516@git.kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.11.1506211635010.4107@nanos>

Commit-ID:  cb17b2a674f2059343f997599b4b001e64eec516
Gitweb:     http://git.kernel.org/tip/cb17b2a674f2059343f997599b4b001e64eec516
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Sun, 21 Jun 2015 16:21:50 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sun, 21 Jun 2015 16:38:40 +0200

x86/hpet: Use proper hpet device number for MSI allocation

hpet_assign_irq() is called with hpet_device->num as "hardware
interrupt number", but hpet_device->num is initialized after the
interrupt has been assigned, so it's always 0. As a consequence only
the first MSI allocation succeeds, the following ones fail because the
"hardware interrupt number" already exists.

Move the initialization of dev->num and other fields before the call
to hpet_assign_irq(), which is the ordering before the offending
commit which introduced that regression.

Fixes: "3cb96f0c9733 x86/hpet: Enhance HPET IRQ to support hierarchical irqdomains"
Reported-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1506211635010.4107@nanos
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
---
 arch/x86/kernel/hpet.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index c47aab3..10757d0 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -577,16 +577,17 @@ static void hpet_msi_capability_lookup(unsigned int start_timer)
 		if (!(cfg & HPET_TN_FSB_CAP))
 			continue;
 
+		hdev->flags = 0;
+		if (cfg & HPET_TN_PERIODIC_CAP)
+			hdev->flags |= HPET_DEV_PERI_CAP;
+		sprintf(hdev->name, "hpet%d", i);
+		hdev->num = i;
+
 		irq = hpet_assign_irq(hpet_domain, hdev, hdev->num);
 		if (irq <= 0)
 			continue;
 
-		sprintf(hdev->name, "hpet%d", i);
-		hdev->num = i;
 		hdev->irq = irq;
-		hdev->flags = 0;
-		if (cfg & HPET_TN_PERIODIC_CAP)
-			hdev->flags |= HPET_DEV_PERI_CAP;
 		hdev->flags |= HPET_DEV_FSB_CAP;
 		hdev->flags |= HPET_DEV_VALID;
 		num_timers_used++;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2015-06-21 14:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19  7:11 [-next] !irqd_can_balance() WARNINGs at irq_move_masked_irq() Sergey Senozhatsky
2015-06-19  9:25 ` Thomas Gleixner
2015-06-19 12:21   ` Thomas Gleixner
2015-06-19 13:11     ` Sergey Senozhatsky
2015-06-19 16:09     ` Jiang Liu
2015-06-19 16:12       ` Jiang Liu
2015-06-19 16:15         ` Thomas Gleixner
2015-06-19 16:21           ` Jiang Liu
2015-06-19 16:30             ` Thomas Gleixner
2015-06-19 16:47               ` Jiang Liu
2015-06-19 17:14                 ` Sergey Senozhatsky
2015-06-20  4:32                 ` Sergey Senozhatsky
2015-06-20 10:07                 ` [tip:x86/apic] x86/hpet: Check for irq== 0 when allocating hpet MSI interrupts tip-bot for Jiang Liu
2015-06-19 16:23           ` [-next] !irqd_can_balance() WARNINGs at irq_move_masked_irq() Sergey Senozhatsky
2015-06-20  4:31     ` Sergey Senozhatsky
2015-06-20  7:52       ` Thomas Gleixner
2015-06-20  7:57         ` Sergey Senozhatsky
2015-06-20  8:13           ` Thomas Gleixner
2015-06-20  8:27             ` Sergey Senozhatsky
2015-06-20  9:12               ` Thomas Gleixner
2015-06-20 17:53                 ` Sergey Senozhatsky
2015-06-21  4:15                 ` Sergey Senozhatsky
2015-06-21 14:37                   ` Thomas Gleixner
2015-06-21 14:43                     ` tip-bot for Thomas Gleixner [this message]
2015-06-20 17:20             ` [tip:irq/core] genirq: Remove bogus restriction in irq_move_mask_irq() tip-bot for Thomas Gleixner

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-cb17b2a674f2059343f997599b4b001e64eec516@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jiang.liu@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=sergey.senozhatsky@gmail.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 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.