linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Naresh Kamboju <naresh.kamboju@linaro.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.8 44/85] cpuidle: psci: Fix suspicious RCU usage
Date: Mon,  5 Oct 2020 17:26:40 +0200	[thread overview]
Message-ID: <20201005142116.844451153@linuxfoundation.org> (raw)
In-Reply-To: <20201005142114.732094228@linuxfoundation.org>

From: Ulf Hansson <ulf.hansson@linaro.org>

[ Upstream commit 36050d8984ab743f9990a2eb97a0062fdc3d7bbd ]

The commit eb1f00237aca ("lockdep,trace: Expose tracepoints"), started to
expose us for tracepoints. This lead to the following RCU splat on an ARM64
Qcom board.

[    5.529634] WARNING: suspicious RCU usage
[    5.537307] sdhci-pltfm: SDHCI platform and OF driver helper
[    5.541092] 5.9.0-rc3 #86 Not tainted
[    5.541098] -----------------------------
[    5.541105] ../include/trace/events/lock.h:37 suspicious rcu_dereference_check() usage!
[    5.541110]
[    5.541110] other info that might help us debug this:
[    5.541110]
[    5.541116]
[    5.541116] rcu_scheduler_active = 2, debug_locks = 1
[    5.541122] RCU used illegally from extended quiescent state!
[    5.541129] no locks held by swapper/0/0.
[    5.541134]
[    5.541134] stack backtrace:
[    5.541143] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.9.0-rc3 #86
[    5.541149] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
[    5.541157] Call trace:
[    5.568185] sdhci_msm 7864900.sdhci: Got CD GPIO
[    5.574186]  dump_backtrace+0x0/0x1c8
[    5.574206]  show_stack+0x14/0x20
[    5.574229]  dump_stack+0xe8/0x154
[    5.574250]  lockdep_rcu_suspicious+0xd4/0xf8
[    5.574269]  lock_acquire+0x3f0/0x460
[    5.574292]  _raw_spin_lock_irqsave+0x80/0xb0
[    5.574314]  __pm_runtime_suspend+0x4c/0x188
[    5.574341]  psci_enter_domain_idle_state+0x40/0xa0
[    5.574362]  cpuidle_enter_state+0xc0/0x610
[    5.646487]  cpuidle_enter+0x38/0x50
[    5.650651]  call_cpuidle+0x18/0x40
[    5.654467]  do_idle+0x228/0x278
[    5.657678]  cpu_startup_entry+0x24/0x70
[    5.661153]  rest_init+0x1a4/0x278
[    5.665061]  arch_call_rest_init+0xc/0x14
[    5.668272]  start_kernel+0x508/0x540

Following the path in pm_runtime_put_sync_suspend() from
psci_enter_domain_idle_state(), it seems like we end up using the RCU.
Therefore, let's simply silence the splat by informing the RCU about it
with RCU_NONIDLE.

Note that, this is a temporary solution. Instead we should strive to avoid
using RCU_NONIDLE (and similar), but rather push rcu_idle_enter|exit()
further down, closer to the arch specific code. However, as the CPU PM
notifiers are also using the RCU, additional rework is needed.

Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/cpuidle/cpuidle-psci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c
index 3806f911b61c0..915172e3ec906 100644
--- a/drivers/cpuidle/cpuidle-psci.c
+++ b/drivers/cpuidle/cpuidle-psci.c
@@ -64,7 +64,7 @@ static int psci_enter_domain_idle_state(struct cpuidle_device *dev,
 		return -1;
 
 	/* Do runtime PM to manage a hierarchical CPU toplogy. */
-	pm_runtime_put_sync_suspend(pd_dev);
+	RCU_NONIDLE(pm_runtime_put_sync_suspend(pd_dev));
 
 	state = psci_get_domain_state();
 	if (!state)
@@ -72,7 +72,7 @@ static int psci_enter_domain_idle_state(struct cpuidle_device *dev,
 
 	ret = psci_cpu_suspend_enter(state) ? -1 : idx;
 
-	pm_runtime_get_sync(pd_dev);
+	RCU_NONIDLE(pm_runtime_get_sync(pd_dev));
 
 	cpu_pm_exit();
 
-- 
2.25.1




  parent reply	other threads:[~2020-10-05 15:34 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 15:25 [PATCH 5.8 00/85] 5.8.14-rc1 review Greg Kroah-Hartman
2020-10-05 15:25 ` [PATCH 5.8 01/85] io_uring: always delete double poll wait entry on match Greg Kroah-Hartman
2020-10-05 15:25 ` [PATCH 5.8 02/85] btrfs: fix filesystem corruption after a device replace Greg Kroah-Hartman
2020-10-05 15:25 ` [PATCH 5.8 03/85] mmc: sdhci: Workaround broken command queuing on Intel GLK based IRBIS models Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 04/85] USB: gadget: f_ncm: Fix NDP16 datagram validation Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 05/85] Revert "usbip: Implement a match function to fix usbip" Greg Kroah-Hartman
2020-10-06 13:26   ` M. Vefa Bicakci
2020-10-07  9:13     ` Greg Kroah-Hartman
2020-10-08  8:56       ` M. Vefa Bicakci
2020-10-08  9:25         ` Greg Kroah-Hartman
2020-10-08  9:37           ` M. Vefa Bicakci
2020-10-05 15:26 ` [PATCH 5.8 06/85] usbcore/driver: Fix specific driver selection Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 07/85] usbcore/driver: Fix incorrect downcast Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 08/85] usbcore/driver: Accommodate usbip Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 09/85] gpio: siox: explicitly support only threaded irqs Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 10/85] gpio: mockup: fix resource leak in error path Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 11/85] gpio: tc35894: fix up tc35894 interrupt configuration Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 12/85] gpio: amd-fch: correct logic of GPIO_LINE_DIRECTION Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 13/85] clk: samsung: Keep top BPLL mux on Exynos542x enabled Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 14/85] clk: socfpga: stratix10: fix the divider for the emac_ptp_free_clk Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 15/85] scsi: iscsi: iscsi_tcp: Avoid holding spinlock while calling getpeername() Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 16/85] i2c: i801: Exclude device from suspend direct complete optimization Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 17/85] Input: i8042 - add nopnp quirk for Acer Aspire 5 A515 Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 18/85] iio: adc: qcom-spmi-adc5: fix driver name Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 19/85] ftrace: Move RCU is watching check after recursion check Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 20/85] tracing: Fix trace_find_next_entry() accounting of temp buffer size Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 21/85] memstick: Skip allocating card when removing host Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 22/85] drm/amdgpu: restore proper ref count in amdgpu_display_crtc_set_config Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 23/85] xen/events: dont use chip_data for legacy IRQs Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 24/85] clocksource/drivers/timer-gx6605s: Fixup counter reload Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 25/85] vboxsf: Fix the check for the old binary mount-arguments struct Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 26/85] mt76: mt7915: use ieee80211_free_txskb to free tx skbs Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 27/85] libbpf: Remove arch-specific include path in Makefile Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 28/85] drivers/net/wan/hdlc_fr: Add needed_headroom for PVC devices Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 29/85] Revert "wlcore: Adding suppoprt for IGTK key in wlcore driver" Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 30/85] drm/sun4i: mixer: Extend regmap max_register Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 31/85] hv_netvsc: Cache the current data path to avoid duplicate call and message Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 32/85] net: dec: de2104x: Increase receive ring size for Tulip Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 33/85] rndis_host: increase sleep time in the query-response loop Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 34/85] nvme-pci: disable the write zeros command for Intel 600P/P3100 Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 35/85] nvme-core: get/put ctrl and transport module in nvme_dev_open/release() Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 36/85] fuse: fix the ->direct_IO() treatment of iov_iter Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 37/85] drivers/net/wan/lapbether: Make skb->protocol consistent with the header Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 38/85] drivers/net/wan/hdlc: Set skb->protocol before transmitting Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 39/85] mac80211: Fix radiotap header channel flag for 6GHz band Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 40/85] mac80211: do not allow bigger VHT MPDUs than the hardware supports Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 41/85] tracing: Make the space reserved for the pid wider Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 42/85] tools/io_uring: fix compile breakage Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 43/85] io_uring: mark statx/files_update/epoll_ctl as non-SQPOLL Greg Kroah-Hartman
2020-10-05 15:26 ` Greg Kroah-Hartman [this message]
2020-10-05 15:26 ` [PATCH 5.8 45/85] spi: fsl-espi: Only process interrupts for expected events Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 46/85] net: dsa: felix: fix some key offsets for IP4_TCP_UDP VCAP IS2 entries Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 47/85] nvme-pci: fix NULL req in completion handler Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 48/85] nvme-fc: fail new connections to a deleted host or remote port Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 49/85] scripts/kallsyms: skip ppc compiler stub *.long_branch.* / *.plt_branch.* Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 50/85] gpio: sprd: Clear interrupt when setting the type as edge Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 51/85] phy: ti: am654: Fix a leak in serdes_am654_probe() Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 52/85] pinctrl: mvebu: Fix i2c sda definition for 98DX3236 Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 53/85] nfs: Fix security label length not being reset Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 54/85] NFSv4.2: fix clients attribute cache management for copy_file_range Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 55/85] pNFS/flexfiles: Ensure we initialise the mirror bsizes correctly on read Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 56/85] clk: tegra: Always program PLL_E when enabled Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 57/85] clk: tegra: Fix missing prototype for tegra210_clk_register_emc() Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 58/85] dmaengine: dmatest: Prevent to run on misconfigured channel Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 59/85] clk: samsung: exynos4: mark chipid clock as CLK_IGNORE_UNUSED Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 60/85] scsi: target: Fix lun lookup for TARGET_SCF_LOOKUP_LUN_FROM_TAG case Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 61/85] iommu/exynos: add missing put_device() call in exynos_iommu_of_xlate() Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 62/85] gpio: pca953x: Fix uninitialized pending variable Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 63/85] gpio/aspeed-sgpio: enable access to all 80 input & output sgpios Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 64/85] gpio/aspeed-sgpio: dont enable all interrupts by default Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 65/85] gpio: aspeed: fix ast2600 bank properties Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 66/85] i2c: cpm: Fix i2c_ram structure Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 67/85] i2c: npcm7xx: Clear LAST bit after a failed transaction Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 68/85] Input: trackpoint - enable Synaptics trackpoints Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 69/85] blk-mq: call commit_rqs while list empty but error happen Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 70/85] scripts/dtc: only append to HOST_EXTRACFLAGS instead of overwriting Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 71/85] autofs: use __kernel_write() for the autofs pipe writing Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 72/85] pinctrl: qcom: sm8250: correct sdc2_clk Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 73/85] pinctrl: mediatek: check mtk_is_virt_gpio input parameter Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 74/85] gpio: pca953x: Correctly initialize registers 6 and 7 for PCA957x Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 75/85] iommu/amd: Fix the overwritten field in IVMD header Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 76/85] pipe: remove pipe_wait() and fix wakeup race with splice Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 77/85] random32: Restore __latent_entropy attribute on net_rand_state Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 78/85] gpiolib: Fix line event handling in syscall compatible mode Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 79/85] drm/i915/gvt: Fix port number for BDW on EDID region setup Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 80/85] scsi: sd: sd_zbc: Fix handling of host-aware ZBC disks Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 81/85] scsi: sd: sd_zbc: Fix ZBC disk initialization Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 82/85] epoll: do not insert into poll queues until all sanity checks are done Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 83/85] epoll: replace ->visited/visited_list with generation count Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 84/85] epoll: EPOLL_CTL_ADD: close the race in decision to take fast path Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 85/85] ep_create_wakeup_source(): dentry name can change under you Greg Kroah-Hartman
2020-10-06  0:18 ` [PATCH 5.8 00/85] 5.8.14-rc1 review Shuah Khan
2020-10-07  9:12   ` Greg Kroah-Hartman
2020-10-06  5:27 ` Naresh Kamboju
2020-10-07  9:12   ` Greg Kroah-Hartman
2020-10-06  8:58 ` Jeffrin Jose T
2020-10-06  9:12 ` Jeffrin Jose T
2020-10-06 18:18 ` Guenter Roeck
2020-10-07  9:11   ` Greg Kroah-Hartman

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=20201005142116.844451153@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=paulmck@kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).