From patchwork Tue Oct 27 13:54:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 289808 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6625C55178 for ; Tue, 27 Oct 2020 15:11:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BAF321D41 for ; Tue, 27 Oct 2020 15:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811480; bh=uZxgvXsTuZEVeZJFJRaqPTQhvh18DilCfGbVejeewDM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=oq0sZ0Qrp6W/an/PeVbuOyc++SwPrHmzxyjCbRyim04OcdH++f/XPQbg3pfOgTjUI yeLKUht2FqQiT7D9VKIqdHZALImhYCHjK+qm1wJPeEXA7oOEjKwg1OxMUzdrHjJuxr KTwRf4+KKOwmINRlYOsp9n1AAewQu+SD0S3/W/b4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1794336AbgJ0PLR (ORCPT ); Tue, 27 Oct 2020 11:11:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:47076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756863AbgJ0PLQ (ORCPT ); Tue, 27 Oct 2020 11:11:16 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D8DCA21D24; Tue, 27 Oct 2020 15:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811476; bh=uZxgvXsTuZEVeZJFJRaqPTQhvh18DilCfGbVejeewDM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ql6yFgAPKYB/nk7Hi3poHn2+TSdVWkNJQsTrAO6lFGMp1A0qPlpEhDOTtuTWTtELu LCTrD6USeSr3ZVkMDywV/K7N40H5+Tc8u9sd7x5J0w1ui+IkHXNqgeH7WBdNi0iOnc IyVC5D8CA1ZNGlI86uYaRTyR8eM31aiNZ92kOy0I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Lindgren , Sasha Levin Subject: [PATCH 5.8 506/633] ARM: OMAP2+: Restore MPU power domain if cpu_cluster_pm_enter() fails Date: Tue, 27 Oct 2020 14:54:09 +0100 Message-Id: <20201027135546.467504506@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tony Lindgren [ Upstream commit 8f04aea048d56f3e39a7e543939450246542a6fc ] If cpu_cluster_pm_enter() fails, we need to set MPU power domain back to enabled to prevent the next WFI from potentially triggering an undesired MPU power domain state change. We already do this for omap_enter_idle_smp() but are missing it for omap_enter_idle_coupled(). Fixes: 55be2f50336f ("ARM: OMAP2+: Handle errors for cpu_pm") Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin --- arch/arm/mach-omap2/cpuidle44xx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c index 6f5f89711f256..a92d277f81a08 100644 --- a/arch/arm/mach-omap2/cpuidle44xx.c +++ b/arch/arm/mach-omap2/cpuidle44xx.c @@ -174,8 +174,10 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, */ if (mpuss_can_lose_context) { error = cpu_cluster_pm_enter(); - if (error) + if (error) { + omap_set_pwrdm_state(mpu_pd, PWRDM_POWER_ON); goto cpu_cluster_pm_out; + } } }