All of lore.kernel.org
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno  <angelogioacchino.delregno@collabora.com>
To: Chen-Yu Tsai <wenst@chromium.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	"Nícolas F . R . A . Prado" <nfraprado@collabora.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH] notifier: Initialize new struct srcu_usage field
Date: Fri, 26 May 2023 10:45:32 +0200	[thread overview]
Message-ID: <23366389-1be5-92ef-7728-ce639d46a0b0@collabora.com> (raw)
In-Reply-To: <20230526073539.339203-1-wenst@chromium.org>

Il 26/05/23 09:35, Chen-Yu Tsai ha scritto:
> In commit 95433f726301 ("srcu: Begin offloading srcu_struct fields to
> srcu_update"), a new struct srcu_usage field was added, but was not
> properly initialized. This led to a "spinlock bad magic" BUG when
> the SRCU notifier was ever used. This was observed in the MediaTek
> CCI devfreq driver on next-20230525. Trimmed stack trace as follows:
> 
>      BUG: spinlock bad magic on CPU#4, swapper/0/1
>       lock: 0xffffff80ff529ac0, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
>      Call trace:
>       spin_bug+0xa4/0xe8
>       do_raw_spin_lock+0xec/0x120
>       _raw_spin_lock_irqsave+0x78/0xb8
>       synchronize_srcu+0x3c/0x168
>       srcu_notifier_chain_unregister+0x5c/0xa0
>       cpufreq_unregister_notifier+0x94/0xe0
>       devfreq_passive_event_handler+0x7c/0x3e0
>       devfreq_remove_device+0x48/0xe8
> 
> Add __SRCU_USAGE_INIT() to SRCU_NOTIFIER_INIT() so that srcu_usage gets
> initialized properly.
> 
> Fixes: 95433f726301 ("srcu: Begin offloading srcu_struct fields to srcu_update")
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>

Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


WARNING: multiple messages have this Message-ID (diff)
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Chen-Yu Tsai <wenst@chromium.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	"Nícolas F . R . A . Prado" <nfraprado@collabora.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH] notifier: Initialize new struct srcu_usage field
Date: Fri, 26 May 2023 10:45:32 +0200	[thread overview]
Message-ID: <23366389-1be5-92ef-7728-ce639d46a0b0@collabora.com> (raw)
In-Reply-To: <20230526073539.339203-1-wenst@chromium.org>

Il 26/05/23 09:35, Chen-Yu Tsai ha scritto:
> In commit 95433f726301 ("srcu: Begin offloading srcu_struct fields to
> srcu_update"), a new struct srcu_usage field was added, but was not
> properly initialized. This led to a "spinlock bad magic" BUG when
> the SRCU notifier was ever used. This was observed in the MediaTek
> CCI devfreq driver on next-20230525. Trimmed stack trace as follows:
> 
>      BUG: spinlock bad magic on CPU#4, swapper/0/1
>       lock: 0xffffff80ff529ac0, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
>      Call trace:
>       spin_bug+0xa4/0xe8
>       do_raw_spin_lock+0xec/0x120
>       _raw_spin_lock_irqsave+0x78/0xb8
>       synchronize_srcu+0x3c/0x168
>       srcu_notifier_chain_unregister+0x5c/0xa0
>       cpufreq_unregister_notifier+0x94/0xe0
>       devfreq_passive_event_handler+0x7c/0x3e0
>       devfreq_remove_device+0x48/0xe8
> 
> Add __SRCU_USAGE_INIT() to SRCU_NOTIFIER_INIT() so that srcu_usage gets
> initialized properly.
> 
> Fixes: 95433f726301 ("srcu: Begin offloading srcu_struct fields to srcu_update")
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>

Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-05-26  8:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26  7:35 [PATCH] notifier: Initialize new struct srcu_usage field Chen-Yu Tsai
2023-05-26  7:35 ` Chen-Yu Tsai
2023-05-26  8:45 ` AngeloGioacchino Del Regno [this message]
2023-05-26  8:45   ` AngeloGioacchino Del Regno
2023-05-27 10:27 ` Paul E. McKenney
2023-05-27 10:27   ` Paul E. McKenney

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=23366389-1be5-92ef-7728-ce639d46a0b0@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=nfraprado@collabora.com \
    --cc=paulmck@kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=wenst@chromium.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.