From: Adrien Thierry <athierry@redhat.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kevin Hilman <khilman@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Sudeep Holla <sudeep.holla@arm.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Brian Masney <bmasney@redhat.com>,
linux-rt-users@vger.kernel.org
Subject: Re: [PATCH v2 0/5] PM: Fixes for Realtime systems
Date: Tue, 20 Dec 2022 16:36:20 -0500 [thread overview]
Message-ID: <Y6Iq1CyHScvZM++Y@fedora> (raw)
In-Reply-To: <20221219151503.385816-1-krzysztof.kozlowski@linaro.org>
Hi Krzysztof,
Thanks for looking into this!
I tested your patchset on the QDrive3 on a CentOS Stream 9 RT kernel (I
couldn't test it on mainline because the latest RT patchset only supports
6.1 which is missing some bits needed to boot QDrive3).
It fixes the PSCI cpuidle issue I was encountering in [1]. However, I may
have found another code path that triggers a similar issue:
BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46
in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 113, name: kworker/4:2
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
4 locks held by kworker/4:2/113:
#0: ffff09b0c2376928 ((wq_completion)pm){+.+.}-{0:0}, at: process_one_work+0x1f4/0x7c0
#1: ffff800008bf3dd0 ((work_completion)(&genpd->power_off_work)){+.+.}-{0:0}, at: process_one_work+0x1f4/0x7c0
#2: ffff09b0c2e44860 (&genpd->rslock){....}-{2:2}, at: genpd_lock_rawspin+0x20/0x30
#3: ffff09b0c6696a20 (&dev->power.lock){+.+.}-{2:2}, at: dev_pm_qos_flags+0x2c/0x60
irq event stamp: 170
hardirqs last enabled at (169): [<ffffa1be822f8a78>] _raw_spin_unlock_irq+0x48/0xc4
hardirqs last disabled at (170): [<ffffa1be822f8df4>] _raw_spin_lock_irqsave+0xb0/0xfc
softirqs last enabled at (0): [<ffffa1be814cfff0>] copy_process+0x68c/0x1500
softirqs last disabled at (0): [<0000000000000000>] 0x0
Preemption disabled at:
[<ffffa1be81d7e620>] genpd_lock_rawspin+0x20/0x30
CPU: 4 PID: 113 Comm: kworker/4:2 Tainted: G X --------- --- 5.14.0-rt14+ #2
Hardware name: Qualcomm SA8540 ADP (DT)
Workqueue: pm genpd_power_off_work_fn
Call trace:
dump_backtrace+0xb4/0x12c
show_stack+0x1c/0x70
dump_stack_lvl+0x98/0xd0
dump_stack+0x14/0x2c
__might_resched+0x180/0x220
rt_spin_lock+0x74/0x11c
dev_pm_qos_flags+0x2c/0x60
genpd_power_off.part.0.isra.0+0xac/0x2d0
genpd_power_off_work_fn+0x68/0x8c
process_one_work+0x2b8/0x7c0
worker_thread+0x15c/0x44c
kthread+0xf8/0x104
ret_from_fork+0x10/0x20
This happens consistently during boot. But on the mainline kernel, this
code path has changed: genpd_power_off no longer calls dev_pm_qos_flags.
So it might not happen on mainline. I hope to be able to test your
patchset again soon on mainline with the next version of the RT patchset
(which should be able to boot the QDrive3).
Best,
Adrien
[1] https://lore.kernel.org/all/20220615203605.1068453-1-athierry@redhat.com/
WARNING: multiple messages have this Message-ID (diff)
From: Adrien Thierry <athierry@redhat.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kevin Hilman <khilman@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Sudeep Holla <sudeep.holla@arm.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Brian Masney <bmasney@redhat.com>,
linux-rt-users@vger.kernel.org
Subject: Re: [PATCH v2 0/5] PM: Fixes for Realtime systems
Date: Tue, 20 Dec 2022 16:36:20 -0500 [thread overview]
Message-ID: <Y6Iq1CyHScvZM++Y@fedora> (raw)
In-Reply-To: <20221219151503.385816-1-krzysztof.kozlowski@linaro.org>
Hi Krzysztof,
Thanks for looking into this!
I tested your patchset on the QDrive3 on a CentOS Stream 9 RT kernel (I
couldn't test it on mainline because the latest RT patchset only supports
6.1 which is missing some bits needed to boot QDrive3).
It fixes the PSCI cpuidle issue I was encountering in [1]. However, I may
have found another code path that triggers a similar issue:
BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46
in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 113, name: kworker/4:2
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
4 locks held by kworker/4:2/113:
#0: ffff09b0c2376928 ((wq_completion)pm){+.+.}-{0:0}, at: process_one_work+0x1f4/0x7c0
#1: ffff800008bf3dd0 ((work_completion)(&genpd->power_off_work)){+.+.}-{0:0}, at: process_one_work+0x1f4/0x7c0
#2: ffff09b0c2e44860 (&genpd->rslock){....}-{2:2}, at: genpd_lock_rawspin+0x20/0x30
#3: ffff09b0c6696a20 (&dev->power.lock){+.+.}-{2:2}, at: dev_pm_qos_flags+0x2c/0x60
irq event stamp: 170
hardirqs last enabled at (169): [<ffffa1be822f8a78>] _raw_spin_unlock_irq+0x48/0xc4
hardirqs last disabled at (170): [<ffffa1be822f8df4>] _raw_spin_lock_irqsave+0xb0/0xfc
softirqs last enabled at (0): [<ffffa1be814cfff0>] copy_process+0x68c/0x1500
softirqs last disabled at (0): [<0000000000000000>] 0x0
Preemption disabled at:
[<ffffa1be81d7e620>] genpd_lock_rawspin+0x20/0x30
CPU: 4 PID: 113 Comm: kworker/4:2 Tainted: G X --------- --- 5.14.0-rt14+ #2
Hardware name: Qualcomm SA8540 ADP (DT)
Workqueue: pm genpd_power_off_work_fn
Call trace:
dump_backtrace+0xb4/0x12c
show_stack+0x1c/0x70
dump_stack_lvl+0x98/0xd0
dump_stack+0x14/0x2c
__might_resched+0x180/0x220
rt_spin_lock+0x74/0x11c
dev_pm_qos_flags+0x2c/0x60
genpd_power_off.part.0.isra.0+0xac/0x2d0
genpd_power_off_work_fn+0x68/0x8c
process_one_work+0x2b8/0x7c0
worker_thread+0x15c/0x44c
kthread+0xf8/0x104
ret_from_fork+0x10/0x20
This happens consistently during boot. But on the mainline kernel, this
code path has changed: genpd_power_off no longer calls dev_pm_qos_flags.
So it might not happen on mainline. I hope to be able to test your
patchset again soon on mainline with the next version of the RT patchset
(which should be able to boot the QDrive3).
Best,
Adrien
[1] https://lore.kernel.org/all/20220615203605.1068453-1-athierry@redhat.com/
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-12-20 21:37 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-19 15:14 [PATCH v2 0/5] PM: Fixes for Realtime systems Krzysztof Kozlowski
2022-12-19 15:14 ` Krzysztof Kozlowski
2022-12-19 15:14 ` [PATCH v2 1/5] PM: domains: Add GENPD_FLAG_RT_SAFE for PREEMPT_RT Krzysztof Kozlowski
2022-12-19 15:14 ` Krzysztof Kozlowski
2023-01-04 15:45 ` Ulf Hansson
2023-01-04 15:45 ` Ulf Hansson
2023-01-06 14:52 ` Krzysztof Kozlowski
2023-01-06 14:52 ` Krzysztof Kozlowski
2023-01-12 10:36 ` Sebastian Andrzej Siewior
2023-01-12 10:36 ` Sebastian Andrzej Siewior
2023-01-12 11:27 ` Krzysztof Kozlowski
2023-01-12 11:27 ` Krzysztof Kozlowski
2023-01-12 10:32 ` Sebastian Andrzej Siewior
2023-01-12 10:32 ` Sebastian Andrzej Siewior
2023-01-12 11:31 ` Krzysztof Kozlowski
2023-01-12 11:31 ` Krzysztof Kozlowski
2022-12-19 15:15 ` [PATCH v2 2/5] cpuidle: psci: Mark as PREEMPT_RT safe Krzysztof Kozlowski
2022-12-19 15:15 ` Krzysztof Kozlowski
2023-01-12 11:00 ` Sebastian Andrzej Siewior
2023-01-12 11:00 ` Sebastian Andrzej Siewior
2023-01-12 11:32 ` Krzysztof Kozlowski
2023-01-12 11:32 ` Krzysztof Kozlowski
2023-01-17 15:27 ` Ulf Hansson
2023-01-17 15:27 ` Ulf Hansson
2023-01-19 15:40 ` Krzysztof Kozlowski
2023-01-19 15:40 ` Krzysztof Kozlowski
2023-01-19 17:06 ` Krzysztof Kozlowski
2023-01-19 17:06 ` Krzysztof Kozlowski
2022-12-19 15:15 ` [PATCH v2 3/5] cpuidle: psci: Do not suspend topology CPUs on PREEMPT_RT Krzysztof Kozlowski
2022-12-19 15:15 ` Krzysztof Kozlowski
2023-01-12 11:09 ` Sebastian Andrzej Siewior
2023-01-12 11:09 ` Sebastian Andrzej Siewior
2023-01-12 11:34 ` Krzysztof Kozlowski
2023-01-12 11:34 ` Krzysztof Kozlowski
2023-01-30 9:51 ` Sebastian Andrzej Siewior
2023-01-30 9:51 ` Sebastian Andrzej Siewior
2022-12-19 15:15 ` [PATCH v2 4/5] PM: Allow calling dev_pm_domain_set() with raw spinlock Krzysztof Kozlowski
2022-12-19 15:15 ` Krzysztof Kozlowski
2023-01-12 11:13 ` Sebastian Andrzej Siewior
2023-01-12 11:13 ` Sebastian Andrzej Siewior
2022-12-19 15:15 ` [PATCH v2 5/5] PM: domains: Do not call device_pm_check_callbacks() when holding genpd_lock() Krzysztof Kozlowski
2022-12-19 15:15 ` Krzysztof Kozlowski
2023-01-12 11:31 ` Sebastian Andrzej Siewior
2023-01-12 11:31 ` Sebastian Andrzej Siewior
2023-01-12 11:37 ` Krzysztof Kozlowski
2023-01-12 11:37 ` Krzysztof Kozlowski
2023-01-17 15:11 ` Ulf Hansson
2023-01-17 15:11 ` Ulf Hansson
2023-01-19 15:58 ` Krzysztof Kozlowski
2023-01-19 15:58 ` Krzysztof Kozlowski
2022-12-20 21:36 ` Adrien Thierry [this message]
2022-12-20 21:36 ` [PATCH v2 0/5] PM: Fixes for Realtime systems Adrien Thierry
2023-01-04 15:15 ` Ulf Hansson
2023-01-04 15:15 ` Ulf Hansson
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=Y6Iq1CyHScvZM++Y@fedora \
--to=athierry@redhat.com \
--cc=bmasney@redhat.com \
--cc=daniel.lezcano@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=khilman@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=len.brown@intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=ulf.hansson@linaro.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.