<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/arch/cris/include/asm/mmu_context.h, branch v4.3.1</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>CRIS: fix switch_mm() lockdep splat</title>
<updated>2015-09-04T22:56:50+00:00</updated>
<author>
<name>Rabin Vincent</name>
<email>rabin@rab.in</email>
</author>
<published>2015-02-20T18:35:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7f0144e7779a8c62e3177301d4b2179432ce5460'/>
<id>7f0144e7779a8c62e3177301d4b2179432ce5460</id>
<content type='text'>
With lockdep support implemented on CRISv32, we get the following splat.
switch_mm() can be called both from the scheduler() (with interrupts
disabled) and from flush_old_exec (via activate_mm()), with interrupts
enabled.  Fix it by disabling interrupts in activate_mm(), similar to
powerpc and hexagon.

 t======================================================
 [ INFO: HARDIRQ-safe -&gt; HARDIRQ-unsafe lock order detected ]
 3.19.0-08802-g20bc9f1-dirty #323 Not tainted
 ------------------------------------------------------
 init/1 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
  (mmu_context_lock){+.+...}, at: [&lt;c0009290&gt;] switch_mm+0x22/0xc6

 and this task is already holding:
  (&amp;rq-&gt;lock){-.-.-.}, at: [&lt;c01a0756&gt;] __schedule+0x5e/0x648
 which would create a new lock dependency:
  (&amp;rq-&gt;lock){-.-.-.} -&gt; (mmu_context_lock){+.+...}

 but this new dependency connects a HARDIRQ-irq-safe lock:
  (&amp;rq-&gt;lock){-.-.-.}
 ... which became HARDIRQ-irq-safe at:
   [&lt;c002b03c&gt;] scheduler_tick+0x28/0x5e
   [&lt;c0007c6c&gt;] timer_interrupt+0x4e/0x6a
   [&lt;c0043ac4&gt;] handle_irq_event_percpu+0x54/0x13c
   [&lt;c004343c&gt;] generic_handle_irq+0x2a/0x36

 to a HARDIRQ-irq-unsafe lock:
  (mmu_context_lock){+.+...}
 ... which became HARDIRQ-irq-unsafe at:
 ...  [&lt;c0039e60&gt;] __lock_acquire+0x8f8/0x1d9c
   [&lt;c0009290&gt;] switch_mm+0x22/0xc6
   [&lt;c009c260&gt;] flush_old_exec+0x500/0x5d4
   [&lt;c00da4c6&gt;] load_elf_phdrs+0x7a/0x84
   [&lt;c00dbdb0&gt;] load_elf_binary+0x21c/0x13b4
   [&lt;c009cdb6&gt;] do_execve+0x22/0x2c
   [&lt;c001dcf2&gt;] ____call_usermodehelper+0x0/0x154
   [&lt;c000581e&gt;] ret_from_kernel_thread+0xe/0x14

 other info that might help us debug this:

  Possible interrupt unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(mmu_context_lock);
                                local_irq_disable();
                                lock(&amp;rq-&gt;lock);
                                lock(mmu_context_lock);
   &lt;Interrupt&gt;
     lock(&amp;rq-&gt;lock);

  *** DEADLOCK ***

 1 lock held by init/1:
  #0:  (&amp;rq-&gt;lock){-.-.-.}, at: [&lt;c01a0756&gt;] __schedule+0x5e/0x648

 Call Trace:
 [&lt;c019fe9e&gt;] printk+0x0/0x4e
 [&lt;c00368f8&gt;] print_shortest_lock_dependencies+0x0/0x15c
 [&lt;c0048628&gt;] print_stack_trace+0x0/0x88
 [&lt;c0038912&gt;] __lock_is_held+0x3e/0x5e
 [&lt;c003b894&gt;] lock_acquire+0x8a/0xcc
 [&lt;c01a50c4&gt;] _raw_spin_lock+0x44/0x7a
 [&lt;c0009290&gt;] switch_mm+0x22/0xc6
 [&lt;c01a06f8&gt;] __schedule+0x0/0x648
 [&lt;c01a0d76&gt;] schedule+0x36/0x7c
 [&lt;c0037d04&gt;] trace_hardirqs_on+0x0/0x1e
 [&lt;c0004e18&gt;] do_work_pending+0x30/0xd4
 [&lt;c000591a&gt;] _work_pending+0xe/0x12

Signed-off-by: Rabin Vincent &lt;rabin@rab.in&gt;
Signed-off-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With lockdep support implemented on CRISv32, we get the following splat.
switch_mm() can be called both from the scheduler() (with interrupts
disabled) and from flush_old_exec (via activate_mm()), with interrupts
enabled.  Fix it by disabling interrupts in activate_mm(), similar to
powerpc and hexagon.

 t======================================================
 [ INFO: HARDIRQ-safe -&gt; HARDIRQ-unsafe lock order detected ]
 3.19.0-08802-g20bc9f1-dirty #323 Not tainted
 ------------------------------------------------------
 init/1 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
  (mmu_context_lock){+.+...}, at: [&lt;c0009290&gt;] switch_mm+0x22/0xc6

 and this task is already holding:
  (&amp;rq-&gt;lock){-.-.-.}, at: [&lt;c01a0756&gt;] __schedule+0x5e/0x648
 which would create a new lock dependency:
  (&amp;rq-&gt;lock){-.-.-.} -&gt; (mmu_context_lock){+.+...}

 but this new dependency connects a HARDIRQ-irq-safe lock:
  (&amp;rq-&gt;lock){-.-.-.}
 ... which became HARDIRQ-irq-safe at:
   [&lt;c002b03c&gt;] scheduler_tick+0x28/0x5e
   [&lt;c0007c6c&gt;] timer_interrupt+0x4e/0x6a
   [&lt;c0043ac4&gt;] handle_irq_event_percpu+0x54/0x13c
   [&lt;c004343c&gt;] generic_handle_irq+0x2a/0x36

 to a HARDIRQ-irq-unsafe lock:
  (mmu_context_lock){+.+...}
 ... which became HARDIRQ-irq-unsafe at:
 ...  [&lt;c0039e60&gt;] __lock_acquire+0x8f8/0x1d9c
   [&lt;c0009290&gt;] switch_mm+0x22/0xc6
   [&lt;c009c260&gt;] flush_old_exec+0x500/0x5d4
   [&lt;c00da4c6&gt;] load_elf_phdrs+0x7a/0x84
   [&lt;c00dbdb0&gt;] load_elf_binary+0x21c/0x13b4
   [&lt;c009cdb6&gt;] do_execve+0x22/0x2c
   [&lt;c001dcf2&gt;] ____call_usermodehelper+0x0/0x154
   [&lt;c000581e&gt;] ret_from_kernel_thread+0xe/0x14

 other info that might help us debug this:

  Possible interrupt unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(mmu_context_lock);
                                local_irq_disable();
                                lock(&amp;rq-&gt;lock);
                                lock(mmu_context_lock);
   &lt;Interrupt&gt;
     lock(&amp;rq-&gt;lock);

  *** DEADLOCK ***

 1 lock held by init/1:
  #0:  (&amp;rq-&gt;lock){-.-.-.}, at: [&lt;c01a0756&gt;] __schedule+0x5e/0x648

 Call Trace:
 [&lt;c019fe9e&gt;] printk+0x0/0x4e
 [&lt;c00368f8&gt;] print_shortest_lock_dependencies+0x0/0x15c
 [&lt;c0048628&gt;] print_stack_trace+0x0/0x88
 [&lt;c0038912&gt;] __lock_is_held+0x3e/0x5e
 [&lt;c003b894&gt;] lock_acquire+0x8a/0xcc
 [&lt;c01a50c4&gt;] _raw_spin_lock+0x44/0x7a
 [&lt;c0009290&gt;] switch_mm+0x22/0xc6
 [&lt;c01a06f8&gt;] __schedule+0x0/0x648
 [&lt;c01a0d76&gt;] schedule+0x36/0x7c
 [&lt;c0037d04&gt;] trace_hardirqs_on+0x0/0x1e
 [&lt;c0004e18&gt;] do_work_pending+0x30/0xd4
 [&lt;c000591a&gt;] _work_pending+0xe/0x12

Signed-off-by: Rabin Vincent &lt;rabin@rab.in&gt;
Signed-off-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>CRIS: Change DEFINE_PER_CPU of current_pgd to be non volatile.</title>
<updated>2009-06-24T06:13:41+00:00</updated>
<author>
<name>Jesper Nilsson</name>
<email>jesper.nilsson@axis.com</email>
</author>
<published>2009-06-24T06:13:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fe87f94f341a4b4097285b46f003059b26eb59bf'/>
<id>fe87f94f341a4b4097285b46f003059b26eb59bf</id>
<content type='text'>
The DEFINE_PER_CPU of current_pgd was on CRIS defined using volatile,
which is not needed. Remove volatile.

Tested on an ARTPEC-3 (CRISv32) board.

tj: extern DEFINE_PER_CPU() replaced with DECLARE_PER_CPU()

[ Impact: code cleanup ]

Signed-off-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The DEFINE_PER_CPU of current_pgd was on CRIS defined using volatile,
which is not needed. Remove volatile.

Tested on an ARTPEC-3 (CRISv32) board.

tj: extern DEFINE_PER_CPU() replaced with DECLARE_PER_CPU()

[ Impact: code cleanup ]

Signed-off-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[CRIS] Move header files from include to arch/cris/include.</title>
<updated>2008-10-29T16:29:44+00:00</updated>
<author>
<name>Jesper Nilsson</name>
<email>jesper.nilsson@axis.com</email>
</author>
<published>2008-10-21T15:45:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=556dcee7b829e5c350c3ffdbdb87a8b15aa3c5d3'/>
<id>556dcee7b829e5c350c3ffdbdb87a8b15aa3c5d3</id>
<content type='text'>
Change all users of header files to correct path.
Remove some unneeded headers for arch-v32.

Signed-off-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change all users of header files to correct path.
Remove some unneeded headers for arch-v32.

Signed-off-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
