From patchwork Fri Jan 13 12:31:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 43231 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp243163wrt; Fri, 13 Jan 2023 04:35:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXukmfPPS/cT/YhjWfsstYgV778pV8l+exHHbIjW6DXYAdDyPMSn3rH4/twRZSmaRKRc2z+S X-Received: by 2002:a17:907:9c04:b0:86a:d385:81df with SMTP id ld4-20020a1709079c0400b0086ad38581dfmr2134545ejc.3.1673613317583; Fri, 13 Jan 2023 04:35:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673613317; cv=none; d=google.com; s=arc-20160816; b=r1WvLD148Rb6ErGlfnY9mbl2SudRzq+CvMqkrPgCvooxMG/dXnzWA78j+26d9Jheo9 GBrOJL38Y25QLdW3DiQa9YmAL63Vs2/U4buQQxwf6oXBDY+d2Tls1JjyiIaE8btMliZs YzUoZvF/S96sPI3U/Xv3Hzf0ypNATnon5kPFp2Ms9dRNJq4c6x5L+eEOKbZMz+LIajUE KVS9ufJkKNSOpD/iuYCk8k9s2pIq7FtstRg4Fxv8sWlhP05zJrpoDzlJ/DWP8yr87Qhg zdYDdOvVKAf3u3J2JN4k8WfmUtb6fm5ntw4V61fND9t+mXBu9Y5QuJylJuB3aF+PkcZX kfhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=+TZQbY9fGQnNuTodI5yBhQPxVA/OJ+m0XfCKeSCiIm0=; b=0gvW2kmA+uiefpO9MpptR/rm9Jv190/8xCPPB/4PP+wDPF0/FCbe/29mB1UWc/ViL6 5CbZt8YyCjcVA2fgYrgs0o8qcInxT1GfAZePyEoZBtYLAXC2cNjNpNppuAOfnxNAxFMV WmOWefcKdqTpFVlZfpXl/cuNGBzYK3UatXuN0ObRRtpAL/x3F57An/Ieu2hxu2NkC77x MnzrobMYFzRszEztS4FHdF20HuQtecsJVhBTWCDW3Y/Bg++B0gGrM0ApcywquDt/cgfo m4/oSImwYGcXtjYeMNn7WWfU2Pfx2gEBygIXVrejgxEoOoEPNIQS4rPZoNkpZEuuXJNR 9tBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=p93oxIvV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=14yvmZ+q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp39-20020a1709073e2700b0083b22b31cc2si17718019ejc.370.2023.01.13.04.34.48; Fri, 13 Jan 2023 04:35:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=p93oxIvV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=14yvmZ+q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241585AbjAMMdh (ORCPT + 99 others); Fri, 13 Jan 2023 07:33:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240331AbjAMMcJ (ORCPT ); Fri, 13 Jan 2023 07:32:09 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8A87517E1; Fri, 13 Jan 2023 04:31:10 -0800 (PST) Date: Fri, 13 Jan 2023 12:31:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673613067; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+TZQbY9fGQnNuTodI5yBhQPxVA/OJ+m0XfCKeSCiIm0=; b=p93oxIvVXL/EPtZc7Jj/vQWrfnxe81Q8prgCnPLoFcfOQdtdiMAlCuyTBMCX+TAame6du+ H1v2U4JnTVqALRi3GIJ2K6M7ZKs6g/wsDmikP4nDO+diqu89mE9AeCiEmMZKkX5bet9cOB onsyQf+QhrVGuG5u6IJbsTtIKQt0bqrm7cCISWg0Cd63EjHh7y44xAEFyQHruc2zda01yK es075ak4xq3QQcUNm9pYElhNRazirRUBVzaF1UKD1ngwBOSuHtMcUHptkvrq5gvapQTg8f Dx3ThijwIqG8qwkAoyP1qaiVWgKTmFIAiecU8gTwhcW0E7UurcHlIw7DnVZ4Ww== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673613067; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+TZQbY9fGQnNuTodI5yBhQPxVA/OJ+m0XfCKeSCiIm0=; b=14yvmZ+qvYRS0NFGSHa9Z4p1nlZoZEEu1iE1FZ8qJ2DoaN2skOIpKOJGUCnYmlqs/z2f5O s6Y+2RhnwOF6GOBw== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] arm, OMAP2: Use WFI for omap2_pm_idle() Cc: Tony Lindgren , "Peter Zijlstra (Intel)" , Ingo Molnar , Ulf Hansson , "Rafael J. Wysocki" , Frederic Weisbecker , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230112195541.721697850@infradead.org> References: <20230112195541.721697850@infradead.org> MIME-Version: 1.0 Message-ID: <167361306712.4906.10284730593787878496.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754910757719847663?= X-GMAIL-MSGID: =?utf-8?q?1754910757719847663?= The following commit has been merged into the sched/core branch of tip: Commit-ID: 259c95afac6f2758760f158537e1d28358b4639c Gitweb: https://git.kernel.org/tip/259c95afac6f2758760f158537e1d28358b4639c Author: Peter Zijlstra AuthorDate: Thu, 12 Jan 2023 20:43:53 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 13 Jan 2023 11:48:17 +01:00 arm, OMAP2: Use WFI for omap2_pm_idle() arch_cpu_idle() is a very simple idle interface and exposes only a single idle state and is expected to not require RCU and not do any tracing/instrumentation. As such, omap2_pm_idle() is not a valid implementation. Replace it with a simple (shallow) omap2_do_wfi() call. Omap2 doesn't have a cpuidle driver; but adding one would be the recourse to (re)gain the other idle states. Suggested-by: Tony Lindgren Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Tested-by: Tony Lindgren Tested-by: Ulf Hansson Acked-by: Rafael J. Wysocki Acked-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230112195541.721697850@infradead.org --- arch/arm/mach-omap2/pm24xx.c | 51 +---------------------------------- 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index 6953c47..d52cf73 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c @@ -116,50 +116,12 @@ no_sleep: static int sti_console_enabled; -static int omap2_allow_mpu_retention(void) -{ - if (!omap2xxx_cm_mpu_retention_allowed()) - return 0; - if (sti_console_enabled) - return 0; - - return 1; -} - -static void omap2_enter_mpu_retention(void) +static void omap2_do_wfi(void) { const int zero = 0; - /* The peripherals seem not to be able to wake up the MPU when - * it is in retention mode. */ - if (omap2_allow_mpu_retention()) { - /* REVISIT: These write to reserved bits? */ - omap_prm_clear_mod_irqs(CORE_MOD, PM_WKST1, ~0); - omap_prm_clear_mod_irqs(CORE_MOD, OMAP24XX_PM_WKST2, ~0); - omap_prm_clear_mod_irqs(WKUP_MOD, PM_WKST, ~0); - - /* Try to enter MPU retention */ - pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_RET); - - } else { - /* Block MPU retention */ - pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON); - } - /* WFI */ asm("mcr p15, 0, %0, c7, c0, 4" : : "r" (zero) : "memory", "cc"); - - pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON); -} - -static int omap2_can_sleep(void) -{ - if (omap2xxx_cm_fclks_active()) - return 0; - if (__clk_is_enabled(osc_ck)) - return 0; - - return 1; } static void omap2_pm_idle(void) @@ -169,16 +131,7 @@ static void omap2_pm_idle(void) if (omap_irq_pending()) return; - error = cpu_cluster_pm_enter(); - if (error || !omap2_can_sleep()) { - omap2_enter_mpu_retention(); - goto out_cpu_cluster_pm; - } - - omap2_enter_full_retention(); - -out_cpu_cluster_pm: - cpu_cluster_pm_exit(); + omap2_do_wfi(); } static void __init prcm_setup_regs(void)