|
@@ -2485,23 +2485,9 @@ static void __trace_hardirqs_on_caller(unsigned long ip)
|
|
{
|
|
{
|
|
struct task_struct *curr = current;
|
|
struct task_struct *curr = current;
|
|
|
|
|
|
- if (DEBUG_LOCKS_WARN_ON(unlikely(early_boot_irqs_disabled)))
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
- if (unlikely(curr->hardirqs_enabled)) {
|
|
|
|
- /*
|
|
|
|
- * Neither irq nor preemption are disabled here
|
|
|
|
- * so this is racy by nature but losing one hit
|
|
|
|
- * in a stat is not a big deal.
|
|
|
|
- */
|
|
|
|
- __debug_atomic_inc(redundant_hardirqs_on);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
/* we'll do an OFF -> ON transition: */
|
|
/* we'll do an OFF -> ON transition: */
|
|
curr->hardirqs_enabled = 1;
|
|
curr->hardirqs_enabled = 1;
|
|
|
|
|
|
- if (DEBUG_LOCKS_WARN_ON(current->hardirq_context))
|
|
|
|
- return;
|
|
|
|
/*
|
|
/*
|
|
* We are going to turn hardirqs on, so set the
|
|
* We are going to turn hardirqs on, so set the
|
|
* usage bit for all held locks:
|
|
* usage bit for all held locks:
|
|
@@ -2529,9 +2515,25 @@ void trace_hardirqs_on_caller(unsigned long ip)
|
|
if (unlikely(!debug_locks || current->lockdep_recursion))
|
|
if (unlikely(!debug_locks || current->lockdep_recursion))
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
+ if (unlikely(current->hardirqs_enabled)) {
|
|
|
|
+ /*
|
|
|
|
+ * Neither irq nor preemption are disabled here
|
|
|
|
+ * so this is racy by nature but losing one hit
|
|
|
|
+ * in a stat is not a big deal.
|
|
|
|
+ */
|
|
|
|
+ __debug_atomic_inc(redundant_hardirqs_on);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (DEBUG_LOCKS_WARN_ON(!irqs_disabled()))
|
|
if (DEBUG_LOCKS_WARN_ON(!irqs_disabled()))
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
+ if (DEBUG_LOCKS_WARN_ON(unlikely(early_boot_irqs_disabled)))
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ if (DEBUG_LOCKS_WARN_ON(current->hardirq_context))
|
|
|
|
+ return;
|
|
|
|
+
|
|
current->lockdep_recursion = 1;
|
|
current->lockdep_recursion = 1;
|
|
__trace_hardirqs_on_caller(ip);
|
|
__trace_hardirqs_on_caller(ip);
|
|
current->lockdep_recursion = 0;
|
|
current->lockdep_recursion = 0;
|