From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43892C433EF for ; Wed, 24 Nov 2021 13:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354991AbhKXNxn (ORCPT ); Wed, 24 Nov 2021 08:53:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:41092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354234AbhKXNtC (ORCPT ); Wed, 24 Nov 2021 08:49:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 29E116335F; Wed, 24 Nov 2021 13:02:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637758974; bh=3rmI0HOjS667eg5AE/qvuawOwCyc1f9XfLR7kyTPiEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pGqTgUZvnPicHVLyegLuEF7YeLyFBgqR2Rs1RFfleho8w0wxS83DSpesihES+7yDF kiFmVqxxp6nXjI0HtWkmUXEcRtL4N8C7RFOLSRi7ZsAcyFExfhGQFC1McAD5sHUKEu 3P2KEv0dB7yFstjuuOEeRo9ok/8+CPfTbJXcn4+E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Lezcano , Dmitry Osipenko , Thierry Reding , Sasha Levin Subject: [PATCH 5.15 049/279] cpuidle: tegra: Check whether PMC is ready Date: Wed, 24 Nov 2021 12:55:36 +0100 Message-Id: <20211124115720.426435953@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115718.776172708@linuxfoundation.org> References: <20211124115718.776172708@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Osipenko [ Upstream commit bdb1ffdad3b73e4d0538098fc02e2ea87a6b27cd ] Check whether PMC is ready before proceeding with the cpuidle registration. This fixes racing with the PMC driver probe order, which results in a disabled deepest CC6 idling state if cpuidle driver is probed before the PMC. Acked-by: Daniel Lezcano Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding Signed-off-by: Sasha Levin --- drivers/cpuidle/cpuidle-tegra.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/cpuidle/cpuidle-tegra.c b/drivers/cpuidle/cpuidle-tegra.c index 508bd9f237929..9845629aeb6d4 100644 --- a/drivers/cpuidle/cpuidle-tegra.c +++ b/drivers/cpuidle/cpuidle-tegra.c @@ -337,6 +337,9 @@ static void tegra_cpuidle_setup_tegra114_c7_state(void) static int tegra_cpuidle_probe(struct platform_device *pdev) { + if (tegra_pmc_get_suspend_mode() == TEGRA_SUSPEND_NOT_READY) + return -EPROBE_DEFER; + /* LP2 could be disabled in device-tree */ if (tegra_pmc_get_suspend_mode() < TEGRA_SUSPEND_LP2) tegra_cpuidle_disable_state(TEGRA_CC6); -- 2.33.0