<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>4406</bug_id>
          
          <creation_ts>2013-04-24 07:34:47 +0000</creation_ts>
          <short_desc>Yocto-linux-rt: BUG() warning is triggered in rt kernel when run &apos;perf top&apos; command on ARM/PowerPC</short_desc>
          <delta_ts>2014-04-24 03:21:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>11</classification_id>
          <classification>Runtime</classification>
          <product>General Runtime</product>
          <component>General Runtime</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.5 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Xufeng Zhang">xufeng.zhang</reporter>
          <assigned_to name="Xufeng Zhang">xufeng.zhang</assigned_to>
          <cc>dvhart</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>32564</commentid>
    <comment_count>0</comment_count>
    <who name="Xufeng Zhang">xufeng.zhang</who>
    <bug_when>2013-04-24 07:34:47 +0000</bug_when>
    <thetext>This problem is detected on ARM and PowerPC platforms when run &quot;perf top&quot; command
after CONFIG_DEBUG_ATOMIC_SLEEP is enabled in rt kernel.

Call Trace on ARM:
BUG: sleeping function called from invalid context at linux/kernel/rtmutex.c:658
in_atomic(): 1, irqs_disabled(): 128, pid: 1731, name: perf
[&lt;80017d6c&gt;] (unwind_backtrace+0x0/0x104) from [&lt;806416c4&gt;] (dump_stack+0x20/0x24)
[&lt;806416c4&gt;] (dump_stack+0x20/0x24) from [&lt;80061208&gt;] (__might_sleep+0xf4/0x108)
[&lt;80061208&gt;] (__might_sleep+0xf4/0x108) from [&lt;8064a74c&gt;] (rt_spin_lock+0x2c/0x38)
[&lt;8064a74c&gt;] (rt_spin_lock+0x2c/0x38) from [&lt;800642e8&gt;] (__wake_up+0x34/0x60)
[&lt;800642e8&gt;] (__wake_up+0x34/0x60) from [&lt;800e2610&gt;] (perf_event_wakeup+0x40/0x84)
[&lt;800e2610&gt;] (perf_event_wakeup+0x40/0x84) from [&lt;800e2690&gt;] (perf_pending_event+0x3c/0x60)
[&lt;800e2690&gt;] (perf_pending_event+0x3c/0x60) from [&lt;800dd36c&gt;] (irq_work_run+0x74/0xa4)
[&lt;800dd36c&gt;] (irq_work_run+0x74/0xa4) from [&lt;8001b018&gt;] (armv7pmu_handle_irq+0x12c/0x19c)
[&lt;8001b018&gt;] (armv7pmu_handle_irq+0x12c/0x19c) from [&lt;800a87b0&gt;] (handle_irq_event_percpu+0xf0/0x438)
[&lt;800a87b0&gt;] (handle_irq_event_percpu+0xf0/0x438) from [&lt;800a8b70&gt;] (handle_irq_event+0x78/0xa0)
[&lt;800a8b70&gt;] (handle_irq_event+0x78/0xa0) from [&lt;800abdac&gt;] (handle_fasteoi_irq+0xd4/0x18c)
[&lt;800abdac&gt;] (handle_fasteoi_irq+0xd4/0x18c) from [&lt;800a7e70&gt;] (generic_handle_irq+0x40/0x50)
[&lt;800a7e70&gt;] (generic_handle_irq+0x40/0x50) from [&lt;8000f7a4&gt;] (handle_IRQ+0x68/0xbc)
[&lt;8000f7a4&gt;] (handle_IRQ+0x68/0xbc) from [&lt;800084e8&gt;] (gic_handle_irq+0x38/0x68)
[&lt;800084e8&gt;] (gic_handle_irq+0x38/0x68) from [&lt;8064b100&gt;] (__irq_svc+0x40/0x70)

Call Trace on PowerPC:
BUG: sleeping function called from invalid context at linux/kernel/rtmutex.c:658
in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/0
Call Trace:
[c0c0fd80] [c040a1b4] show_stack+0x10c/0x1c0 (unreliable)
[c0c0fdd0] [c09c3c48] dump_stack+0x24/0x34
[c0c0fde0] [c045f728] __might_sleep+0xd8/0xfc
[c0c0fdf0] [c09bb750] rt_spin_lock+0x34/0x7c
[c0c0fe00] [c0462e44] __wake_up+0x38/0x70
[c0c0fe20] [c04df740] perf_event_wakeup+0x40/0x90
[c0c0fe50] [c04df7d0] perf_pending_event+0x40/0x6c
[c0c0fe60] [c04da4d4] irq_work_run+0x84/0xc4
[c0c0fe80] [c040bd54] timer_interrupt+0x1ec/0x3d0
[c0c0fec0] [c0411728] ret_from_except+0x0/0x18

We can run the irq-work under softirq context to resolve this problemjust like x86 does.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32638</commentid>
    <comment_count>1</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-04-25 14:44:57 +0000</bug_when>
    <thetext>Xufeng if you will be working this, please move the status to &quot;Accepted&quot; and review the Target Milestone. For a change like this, an earlier milestone is preferred to a later one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42959</commentid>
    <comment_count>2</comment_count>
    <who name="Xufeng Zhang">xufeng.zhang</who>
    <bug_when>2014-04-24 03:21:46 +0000</bug_when>
    <thetext>Patch has already been merged.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>