public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@google.com>
To: linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, ak@linux.intel.com, kan.liang@intel.com,
	mingo@elte.hu, sonnyrao@chromium.org
Subject: [PATCH] perf/x86/intel/uncore: fix IMC missing box initialization
Date: Thu, 23 Apr 2015 07:47:38 +0200	[thread overview]
Message-ID: <20150423054738.GA3722@thinkpad> (raw)


This patch fixes a bug introduced by:

commit c05199e5a57a579fea1e8fa65e2b511ceb524ffc
Author: Kan Liang <kan.liang@intel.com>
Date:   Tue Jan 20 04:54:25 2015 +0000

    perf/x86/intel/uncore: Move uncore_box_init() out of driver initialization

It moves uncore_box_init() out of place but this meant that for desktop memory
controller (IMC) PCI-based PMU, the intialization was now missing causing a
crash at first access. This patch fixes the issue by adding the call to the
uncore_enable_box() in snb_uncore_imc_read_counter() to ensure the box
is initialized and the PCI BAR is io-remapped.

Signed-off-by: Stephane Eranian <eranian@google.com>
--

diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore_snb.c b/arch/x86/kernel/cpu/perf_event_intel_uncore_snb.c
index 4562e9e..755ec05 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore_snb.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore_snb.c
@@ -329,6 +329,9 @@ static void snb_uncore_imc_event_start(struct perf_event *event, int flags)
 
 	list_add_tail(&event->active_entry, &box->active_list);
 
+	if (box->n_active == 1)
+		uncore_enable_box(box);
+
 	count = snb_uncore_imc_read_counter(box, event);
 	local64_set(&event->hw.prev_count, count);
 

             reply	other threads:[~2015-04-23  5:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23  5:47 Stephane Eranian [this message]
2015-04-24 13:38 ` [PATCH] perf/x86/intel/uncore: fix IMC missing box initialization Vince Weaver
2015-04-24 14:03   ` Vince Weaver
2015-04-24 14:38     ` Stephane Eranian
2015-04-24 19:22       ` Bjorn Helgaas
2015-04-24 19:29         ` Stephane Eranian
2015-04-25  4:38           ` Andi Kleen
2015-04-27  3:43             ` Liang, Kan
2015-04-28  6:23               ` Stephane Eranian
2015-04-28 10:52               ` Peter Zijlstra
2015-05-11 10:00                 ` Ingo Molnar
2015-06-08 17:45                   ` Vince Weaver
2015-06-09  7:20                     ` Ingo Molnar
2015-06-09  8:33                   ` Peter Zijlstra

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=20150423054738.GA3722@thinkpad \
    --to=eranian@google.com \
    --cc=ak@linux.intel.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=sonnyrao@chromium.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