perf/x86/intel/pt: Fix lockdep interaction
diff mbox

Message ID 1433245040-19931-1-git-send-email-tvrtko.ursulin@linux.intel.com
State New
Headers show

Commit Message

Tvrtko Ursulin June 2, 2015, 11:37 a.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Since this drivers creates attributes on the heap, lockdep
gets upset and disabled itself.

Fix by setting ignore_lockdep flags for problematic attributes.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: x86@kernel.org
Cc: Micha? Winiarski <michal.winiarski@intel.com>
---
Not saying this is a right fix but lets say I am trying to force the issue. :)
---
 arch/x86/kernel/cpu/perf_event_intel_pt.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Tvrtko Ursulin June 2, 2015, 11:42 a.m. UTC | #1
Oops, didn't mean to send this here since it is not graphics related.

But it does happen on SKL so maybe it will be useful for someone.

Tvrtko

On 06/02/2015 12:37 PM, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Since this drivers creates attributes on the heap, lockdep
> gets upset and disabled itself.
>
> Fix by setting ignore_lockdep flags for problematic attributes.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
> Cc: x86@kernel.org
> Cc: Micha? Winiarski <michal.winiarski@intel.com>
> ---
> Not saying this is a right fix but lets say I am trying to force the issue. :)
> ---
>   arch/x86/kernel/cpu/perf_event_intel_pt.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/perf_event_intel_pt.c b/arch/x86/kernel/cpu/perf_event_intel_pt.c
> index ffe666c..1cff27b 100644
> --- a/arch/x86/kernel/cpu/perf_event_intel_pt.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel_pt.c
> @@ -153,9 +153,10 @@ static int __init pt_pmu_hw_init(void)
>
>   		sysfs_attr_init(&de_attrs->attr.attr);
>
> -		de_attr->attr.attr.mode		= S_IRUGO;
> -		de_attr->attr.show		= pt_cap_show;
> -		de_attr->var			= (void *)i;
> +		de_attr->attr.attr.mode		  = S_IRUGO;
> +		de_attr->attr.show		  = pt_cap_show;
> +		de_attr->attr.attr.ignore_lockdep = 1;
> +		de_attr->var			  = (void *)i;
>
>   		attrs[i] = &de_attr->attr.attr;
>   	}
>
Shuang He June 2, 2015, 8:10 p.m. UTC | #2
Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 6523
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                                  276/276              276/276
ILK                                  303/303              303/303
SNB                 -1              315/315              314/315
IVB                                  343/343              343/343
BYT                                  287/287              287/287
BDW                                  321/321              321/321
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*SNB  igt@pm_rpm@dpms-mode-unset-non-lpsp      PASS(1)      DMESG_WARN(1)
(dmesg patch applied)WARNING:at_drivers/gpu/drm/i915/intel_uncore.c:#assert_device_not_suspended[i915]()@WARNING:.* at .* assert_device_not_suspended+0x
Note: You need to pay more attention to line start with '*'
Alexander Shishkin June 4, 2015, 1:24 p.m. UTC | #3
Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> writes:

> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Since this drivers creates attributes on the heap, lockdep
> gets upset and disabled itself.
>
> Fix by setting ignore_lockdep flags for problematic attributes.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
> Cc: x86@kernel.org
> Cc: Micha? Winiarski <michal.winiarski@intel.com>
> ---
> Not saying this is a right fix but lets say I am trying to force the issue. :)

You're right, that's not the real problem, but thanks for reporting. :)

> ---
>  arch/x86/kernel/cpu/perf_event_intel_pt.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/perf_event_intel_pt.c b/arch/x86/kernel/cpu/perf_event_intel_pt.c
> index ffe666c..1cff27b 100644
> --- a/arch/x86/kernel/cpu/perf_event_intel_pt.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel_pt.c
> @@ -153,9 +153,10 @@ static int __init pt_pmu_hw_init(void)
>  
>  		sysfs_attr_init(&de_attrs->attr.attr);

The real problem is this ^^^, should be

  		sysfs_attr_init(&de_attr->attr.attr);

Regards,
--
Alex

Patch
diff mbox

diff --git a/arch/x86/kernel/cpu/perf_event_intel_pt.c b/arch/x86/kernel/cpu/perf_event_intel_pt.c
index ffe666c..1cff27b 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_pt.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_pt.c
@@ -153,9 +153,10 @@  static int __init pt_pmu_hw_init(void)
 
 		sysfs_attr_init(&de_attrs->attr.attr);
 
-		de_attr->attr.attr.mode		= S_IRUGO;
-		de_attr->attr.show		= pt_cap_show;
-		de_attr->var			= (void *)i;
+		de_attr->attr.attr.mode		  = S_IRUGO;
+		de_attr->attr.show		  = pt_cap_show;
+		de_attr->attr.attr.ignore_lockdep = 1;
+		de_attr->var			  = (void *)i;
 
 		attrs[i] = &de_attr->attr.attr;
 	}