From patchwork Wed Sep 30 11:20:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 1374309 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=oTsz4ztv; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=ZQUJnNOb; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C1YjL67rmz9sSC for ; Wed, 30 Sep 2020 21:21:10 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=kjEOTCsIlDijwcOLt2bIb5oJR9uMctv2qz6puQP/DvU=; b=oTsz4ztvc50AON4V8J4Lm14KcW ywTTO7f6j0SaWDBDFk0tFbhhYT49R9ivC1jHx8Tt1sGFeD8XbXnFLsPXhSR0EM+djsrO/SnOmpZA4 mHu+mHlrXv0qrU9V6bW2EFGsh1suo+3xtr3fYlUhjg2or91H2/2OpWUgZatw6VPQSKfARV+o+f416 vdEcpH4aYPnet+lTJrX+d0aNlWNdMbMfWl43E2QDLuyOmzCH+hZkbCeof3p73wMKt2uBLHgUSG1cD ljBActxLSOiTK3jibwx8p8DKVCVSrAISIYAzrL0E7xZR0QOd8RGtIr+MmphRDcdmg78GAmEi+yzfK MXx1U3/g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNaAB-0002nU-55; Wed, 30 Sep 2020 11:20:47 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNaA8-0002mi-OX for linux-arm-kernel@lists.infradead.org; Wed, 30 Sep 2020 11:20:45 +0000 Received: by mail-lf1-x141.google.com with SMTP id b22so1634813lfs.13 for ; Wed, 30 Sep 2020 04:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JaBYkCpqxdbjLQb1w+KKEU4S8vRsQ/8VWeCdl0OLNmw=; b=ZQUJnNObqdGuqomARat9Rzcy1IMw/qk9+IKE4ijq8mcEnxCUlIYe+Xr0IIVv6LytD8 RPJYRdmjB74vyhEK0C++tvW/9hNpc7pmhmXYzjLY5z9EWt3m1QZkFRwcwjrKdG0ccE3S dvZ0AFvgnYJ3CrPviGAZJ/zrH7Q6Qqh53Rr/c8zh0doO5gCcYlVu2IsH18tLcYF3ewGL DdqGnHJwCW57AmbetW0uftX75VcX/r4rndYX9LMfpuJJcU+F1pPhppZ7dKd5vz34xoSp 27KErU6W1k/hXubW4Qb9DjSZqWrRixJCSmEJ04S5W8TtDa2wDjRWwAv7rTxzBPpLcbWH blkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JaBYkCpqxdbjLQb1w+KKEU4S8vRsQ/8VWeCdl0OLNmw=; b=fZVI/Wrr7+ofo/PLzPY2SDjKqT2nMVjIYr2z53UZEfLqItAHqTnatnhah9wcwqxD/E piDIlEJw52qbyGpHEjmfHmR9U2G/XqgKQHsTikPtPVtcSQWxfTwg8rBMF/+yWc8QDgIe 10Zx0Rqhnss1aReodCZwFqXPbZENUt3/jSrJ5+LjViQU6Uo/mW7p3jqwTUstQllrIkwX Ea0YYkRTJ7MfNyTDMN0tIWeNHq2HCFUdFMY03lG1fG9qpfI732pPgM48kV/IdVL0KCIM jrCavCx35x5oOcwQm0UqYXrAPjj0Tc9HaBCbV3FhNzIySHvVIKSNuXwQcvfFs4P6FM+C G+xg== X-Gm-Message-State: AOAM532UfSpu2jN1Qf261Dv0Y1fChHpX06VEWi+1ut/XxdV4aKamjoo/ xbe7KC2gRHZAkLPPrdE4zi8F1w== X-Google-Smtp-Source: ABdhPJzhbbNwWxMqHCyhim49dAaiswEhhMSkIreW4KtcezyQ5OH951tEGHQ39H7clnjw9VFmPgpQrg== X-Received: by 2002:a05:6512:207:: with SMTP id a7mr670315lfo.127.1601464843110; Wed, 30 Sep 2020 04:20:43 -0700 (PDT) Received: from localhost.localdomain (h-155-4-133-169.NA.cust.bahnhof.se. [155.4.133.169]) by smtp.gmail.com with ESMTPSA id 138sm155770lfl.241.2020.09.30.04.20.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Sep 2020 04:20:42 -0700 (PDT) From: Ulf Hansson To: Shawn Guo , Dong Aisheng , Fabio Estevam , Sascha Hauer Subject: [PATCH] ARM: imx6q: Fixup RCU usage for cpuidle Date: Wed, 30 Sep 2020 13:20:23 +0200 Message-Id: <20200930112023.121821-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200930_072044_862027_C4A09C99 X-CRM114-Status: GOOD ( 14.62 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:141 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , "Paul E . McKenney" , Anson Huang , linux-pm@vger.kernel.org, Peter Zijlstra , Daniel Lezcano , "Rafael J . Wysocki" , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org The commit eb1f00237aca ("lockdep,trace: Expose tracepoints"), started to expose us for tracepoints. For imx6q cpuidle, this leads to an RCU splat according to below. [6.870684] [] (_raw_spin_lock) from [] (imx6q_enter_wait+0x18/0x9c) [6.878846] [] (imx6q_enter_wait) from [] (cpuidle_enter_state+0x168/0x5e4) To fix the problem, let's assign the corresponding idlestate->flags the CPUIDLE_FLAG_RCU_IDLE bit, which enables us to call rcu_idle_enter|exit() at the proper point. Reported-by: Dong Aisheng Suggested-by: Peter Zijlstra Signed-off-by: Ulf Hansson Acked-by: Peter Zijlstra (Intel) --- arch/arm/mach-imx/cpuidle-imx6q.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c index 24dd5bbe60e4..094337dc1bc7 100644 --- a/arch/arm/mach-imx/cpuidle-imx6q.c +++ b/arch/arm/mach-imx/cpuidle-imx6q.c @@ -24,7 +24,9 @@ static int imx6q_enter_wait(struct cpuidle_device *dev, imx6_set_lpm(WAIT_UNCLOCKED); raw_spin_unlock(&cpuidle_lock); + rcu_idle_enter(); cpu_do_idle(); + rcu_idle_exit(); raw_spin_lock(&cpuidle_lock); if (num_idle_cpus-- == num_online_cpus()) @@ -44,7 +46,7 @@ static struct cpuidle_driver imx6q_cpuidle_driver = { { .exit_latency = 50, .target_residency = 75, - .flags = CPUIDLE_FLAG_TIMER_STOP, + .flags = CPUIDLE_FLAG_TIMER_STOP | CPUIDLE_FLAG_RCU_IDLE, .enter = imx6q_enter_wait, .name = "WAIT", .desc = "Clock off",