public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Finn Thain <fthain@linux-m68k.org>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-m68k@lists.linux-m68k.org
Subject: Re: spinlock recursion when running q800 emulation in qemu
Date: Sun, 10 Mar 2024 09:56:55 +1300	[thread overview]
Message-ID: <2465c81d-d2dd-320e-cb4c-1c23fd485aed@gmail.com> (raw)
In-Reply-To: <fbc5d581-dcad-8627-3a19-6e2d10614870@linux-m68k.org>

Hi Finn,

Am 09.03.2024 um 18:02 schrieb Finn Thain:
>
> On Sat, 9 Mar 2024, Michael Schmitz wrote:
>
>>
>> I notice legacy_timer_tick() states it must be called with interrupts
>> disabled. We do not explicitly do that in via_timer_handler(), but rely
>> on the IPL remaining high. Maybe adding local_irq_save(flags) /
>> local_irq_restore(flags) around the legacy_timer_tick() call would help
>> debug this?
>>
>
> If legacy_timer_tick() is sensitive to execution context, why not test the
> IPL with an assertion? That way you can catch that problem on Aranym as
> well as Qemu.

Done that, and so far haven't seen the expected BUG message yet.

But I've now got this in ARAnyM:

BUG: spinlock recursion on CPU#0, pool_workqueue_/3
  lock: 0x435670, .magic: dead4ead, .owner: pool_workqueue_/3, .owner_cpu: 0
CPU: 0 PID: 3 Comm: pool_workqueue_ Not tainted 
6.8.0-rc7-atari-fpuemu-spinlocktest+ #1693
Stack from 00835eb4:
         00835eb4 003d5726 003d5726 00000000 0000000d 003273b0 003d5726 
0003a38a
         00435670 003cbec0 00840be0 000330f6 00435670 00814080 0003f5f2 
0004ca60
         00002604 0000714c 00000000 00000000 0003f666 0000000d 00000000 
00000000
         0032b7a6 0032b864 000186e6 00468958 004689b4 00000000 00000000 
0003f716
         00468958 00000000 00468958 0003f76e 00468958 004689b4 00468958 
004689b4
         00468958 00041c8e 00468958 00468958 0002dc58 00000000 0003f21c 
00468958
Call Trace: [<003273b0>] dump_stack+0xc/0x10
  [<0003a38a>] do_raw_spin_lock+0x34/0x58
  [<000330f6>] scheduler_tick+0x18/0x6e
  [<0003f5f2>] __irq_wake_thread+0x0/0x40
  [<0004ca60>] update_process_times+0x5e/0x66
  [<00002604>] trap+0x10/0x28
  [<0000714c>] mfp_timer_c_handler+0x2c/0x3c
  [<0003f666>] __handle_irq_event_percpu+0x34/0xd4
  [<0032b7a6>] _raw_spin_lock+0x0/0xe
  [<0032b864>] _raw_spin_unlock+0x0/0xe
  [<000186e6>] kernel_thread+0x0/0x6c
  [<0003f716>] handle_irq_event_percpu+0x10/0x3a
  [<0003f76e>] handle_irq_event+0x2e/0x54
  [<00041c8e>] handle_simple_irq+0x56/0x66
  [<0002dc58>] kthread+0x0/0xa6
  [<0003f21c>] handle_irq_desc+0x1e/0x28
  [<00002894>] do_IRQ+0x20/0x32
  [<000027c8>] user_irqvec_fixup+0xc/0x14
  [<0032b7a6>] _raw_spin_lock+0x0/0xe
  [<0032b864>] _raw_spin_unlock+0x0/0xe
  [<000186e6>] kernel_thread+0x0/0x6c
  [<0000262c>] ret_from_kernel_thread+0x0/0x14

RCU Tasks Trace: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1.

Happens real early during the boot process.

mfp_timer_c_hander() has a local_irq_save() / local_irq_restore() pair 
around the legacy_timer_tick() invocation so this spinlock recursion 
does appear to work even without reentering the scheduling timer routine ...

Cheers,

	Michael


  reply	other threads:[~2024-03-09 20:57 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 17:58 spinlock recursion when running q800 emulation in qemu Guenter Roeck
2024-03-05  0:33 ` Finn Thain
2024-03-05  0:48   ` Michael Schmitz
     [not found]   ` <fcb506f2-523d-4efc-ae3d-fe3c79c6f09e@gmail.com>
2024-03-05  0:58     ` Guenter Roeck
2024-03-05  1:06       ` Michael Schmitz
2024-03-06  7:14 ` Michael Schmitz
2024-03-06  8:30   ` Brad Boyer
2024-03-06 23:13     ` Finn Thain
2024-03-06 23:46       ` Guenter Roeck
2024-03-07 23:35         ` Finn Thain
2024-03-06 23:42     ` Michael Schmitz
2024-03-06 23:52   ` Finn Thain
2024-03-08  0:20     ` Michael Schmitz
2024-03-08  0:56       ` Finn Thain
2024-03-08  8:06         ` Michael Schmitz
2024-03-08  9:15           ` Finn Thain
2024-03-08  9:33             ` Finn Thain
2024-03-08 20:14               ` Michael Schmitz
2024-03-09  5:02                 ` Finn Thain
2024-03-09 20:56                   ` Michael Schmitz [this message]
2024-03-09 22:18                     ` Finn Thain
2024-03-11  7:06                       ` Michael Schmitz
2024-03-11  8:35                         ` Finn Thain
2024-03-12  0:51                           ` Michael Schmitz
2024-03-12  7:59                             ` Geert Uytterhoeven
2024-03-12 20:14                               ` Michael Schmitz
2024-03-13  0:16                               ` Michael Schmitz
2024-03-13  4:39                                 ` Preemption (was: Re: spinlock recursion when running q800 emulation in qemu) Michael Schmitz
2024-03-13  4:40                                 ` spinlock recursion when running q800 emulation in qemu Finn Thain
2024-03-13  5:34                                   ` Michael Schmitz
2024-03-14  0:59                                   ` Michael Schmitz
2024-03-15  4:32                                     ` Michael Schmitz
2024-03-15  7:24                                       ` Finn Thain
2024-03-18  6:24                                         ` Michael Schmitz
2024-03-18  9:31                                           ` Finn Thain
2024-03-20  1:00                                             ` Michael Schmitz

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=2465c81d-d2dd-320e-cb4c-1c23fd485aed@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=fthain@linux-m68k.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux@roeck-us.net \
    /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