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: 313888 Delivered-To: patches@linaro.org Received: by 2002:a05:6e02:1081:0:0:0:0 with SMTP id r1csp97512ilj; Wed, 30 Sep 2020 04:20:44 -0700 (PDT) X-Received: by 2002:ac2:53ab:: with SMTP id j11mr680762lfh.470.1601464843567; Wed, 30 Sep 2020 04:20:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601464843; cv=none; d=google.com; s=arc-20160816; b=IoVh1+KWu8tP8snusNfsskkX8hcnrPHxPRGCoDaaV9RfOfulkon7XXqrxLxCUVQwK8 ycZKJgvyKlvJHjKRLOaE0Z34dyWFzIDidxXPfmQWg8xt4RKKmaDh54X+CQqUT0NUPgro VyWskkWyQ6KK5ppxcU5Rrs076s0HDEurmYWNnyya/iRtxG+o9u1iQv3QXh8XHRuDDXnt dDAz4PUkBCErG2VE23yZvAczWqsRwEm1W7hQ8GA2JTbwQ5nxiqoiegpgeRU2a4q877yB uDzlG6+jZvdoe057jTaG02Y+Ou39lEvLh4XWJ576VSii8N37RwVmByknDXQKGJ/tYApf Y5DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=JaBYkCpqxdbjLQb1w+KKEU4S8vRsQ/8VWeCdl0OLNmw=; b=nIiwONWSbRLx3s5RqwCkVUSk367w7LZiN5AOJy51SF3C3WTxR4nWwmJfxt7ctAtZKj suEJ/g9/3gUochryLMVHQZcU7ADZOdfTMvQCb9JkAgJp/q75PCkhMTW6zGLT0/5QgzpG vrR1F/IGyWZkWo4Fz6/UVDd4LZMq4RknINfobpJYN0BnoySeMCsfKt6vj3bkjDmBOzus PvFiWGMP8yNivmbnJ2TpNcSS+djtClR80N9W/wQkqn3CHnyZcL4F+KozzTrTJiBHTWDf igF6eENPcf491EKUSVnhePJoWm1MKxsyxUpu3yGR2OdT7fwpG8c7HpoaUKFYygLdIN3H ticw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZQUJnNOb; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h12sor287793lfp.114.2020.09.30.04.20.43 for (Google Transport Security); Wed, 30 Sep 2020 04:20:43 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZQUJnNOb; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=TgvRIhvyNHqA8DDHbP3LWpFPxdsLEkbDpq8lnrX8hwWOGCDKW6s5WKzJj2ie1DjCtn GO7xW91zPwVw9U40cEn9Lk/37RWMxKa8pclj84WP/2Ql5fJyUFDkYwIQH1xsjVO9gn6P 0sFnaUOZr1Jf63xZ/qfjo57DEwkpEEpT1oQ489hRVctIJIh0vm9MX6yNZCTsrbVDiIzY aJmSRXcMs4VVxoGDfje8dcQnRfrc+fFPPLtbl8i7cMxhN5wNhLuL5+g/lLrky0RiWioA IPwNlqpyDoafVtP7Kz0wltci0HC+Y1r72WZrNIjhTu6n9Su+JHWNvLwLb+bL5/7sUC79 E6RQ== X-Gm-Message-State: AOAM532IVuwA5FJKTEdIbhztrwLpbTDXmB+t0r7K2YPI5JVY0QjvPQ7r mN8jhJh5dgDiKZ84ZVrLEjJE247l 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) Return-Path: 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 Cc: Peter Zijlstra , "Rafael J . Wysocki" , "Paul E . McKenney" , Daniel Lezcano , Anson Huang , Ulf Hansson , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 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 --- arch/arm/mach-imx/cpuidle-imx6q.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.25.1 Acked-by: Peter Zijlstra (Intel) 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",