From patchwork Tue Jul 30 17:09:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 11066281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A96D91395 for ; Tue, 30 Jul 2019 17:12:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93A431FE84 for ; Tue, 30 Jul 2019 17:12:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87FCE28801; Tue, 30 Jul 2019 17:12:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1E6C01FE84 for ; Tue, 30 Jul 2019 17:12:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=tLw4JBzRbt23toFvqnRNdZ4wiaXvbsDMXU/vVQYH/rc=; b=hNS5/cKauw0q+n ad/1wQYCN/27HAyufzZ4DNBoWyI3aIczYGjrNbdYCDYZN4NREw6zcUcarakZpUEM7EZyuiP5Z2MC/ qAOthtwZZP4Kx2P151MnbMyXVmvjBLpoad1a6NB1urxGwOPVDH/j22Dc0paqiSmn0I3a7zYFhlegP Jvp8EqUxhJSQijMOWot3kaoai/0ulqIA+W9c1QPYmqK4kQMHse+moR2h/vIh3fo81Lf9XsepU7q/q ptEBCbORwlC7xT0WwzaSEPHTQeoatc9IZC23r1E5mUyRJI2Q4pF9IS7jxUPBfw2vt19Rg0NZo3efN QfbLyaHExtwX/ZKw3tVw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hsVfW-0005jF-MJ; Tue, 30 Jul 2019 17:12:10 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hsVdg-0003zP-QG for linux-arm-kernel@lists.infradead.org; Tue, 30 Jul 2019 17:10:18 +0000 Received: by mail-wr1-x443.google.com with SMTP id x1so16704624wrr.9 for ; Tue, 30 Jul 2019 10:10:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2jx9uRBt6JB5ilMndbuQtI4fuwVo1oth3W6XlcI98xo=; b=H+L0aLW5CdeY4D/XejT1s8llSymAxTF1yyCNR3v7feiNOM83jgP4TZR6O3mV8kKFIa 67C2l0UlaRSBBRAXtFJz6sp9jdzXIuUkuT5EnmR30fIkGNwZ7BBkQaWu3KN8L1J1OD/3 jBqRD7sHA9ALOUxEizou112ro7cotPtzJaXVO+gA72McPD8/59VMG4kNMvyWLFu+vBob OiHc5wDspQX169M6Vxs4kcSxnqAxxYg4UizBgbAlNFrdfP+SM8Sx8x/IVqaIXod/DL+Z Cy51jN1Kp5yI965m9w9emiOfRfnDMViXboa9EPjjZPk4NGZDzXIpAMBddlIeYlP7FWgU JOEw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=2jx9uRBt6JB5ilMndbuQtI4fuwVo1oth3W6XlcI98xo=; b=Adjx7fj0m+xso/yOkwShAx20j7uNfa3rcEj9ZYsptubFS8MjsAul5cgLmGZ3L3tq+D juXGm1PZhzPSIiAkiKuUC0ZV+xRmS7VPaAbm6cCxDTPGxm7YgtHc01tT+gKl7NQ84Ax2 HKr9A9D07E1ImwPDKhNkJ70bwTOtWkRXtVwWcQY5WxuVcVMc9/5UpgpDYOHPHwLRGNsF jdMQGCKqY3hVbGGC1jgB/iMN+LTL/RWDgD7Vyx6zpKqzmiNHCO+1j2XCqNkdK34A9b7t ISM81ms54kc9KA2MLnaGTLFXOz45rsm2Gmm7fVhDeD6v96T0PZMSFkzxAntMMkUY6Kah gGjQ== X-Gm-Message-State: APjAAAW05+9FI/++AfzbqAqcCADtusP5Ixmgi1YMaMNAewLervyedN+B lk0xLVmqTdVpeOhOSjBWfsdem/Qd X-Google-Smtp-Source: APXvYqzycZSrm0esL/eLQiwlzq8G51YnZ68F3nWXoIV0MnnSl5kTIqDLuiFnNM+pV3FbAPx25q7eog== X-Received: by 2002:a5d:4e4d:: with SMTP id r13mr40131142wrt.295.1564506615247; Tue, 30 Jul 2019 10:10:15 -0700 (PDT) Received: from localhost.localdomain (ppp91-78-220-99.pppoe.mtu-net.ru. [91.78.220.99]) by smtp.gmail.com with ESMTPSA id i13sm58897736wrr.73.2019.07.30.10.10.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jul 2019 10:10:14 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Peter De Schrijver , "Rafael J. Wysocki" , Daniel Lezcano Subject: [PATCH v4 07/13] ARM: tegra: Add tegra_pm_park_secondary_cpu() Date: Tue, 30 Jul 2019 20:09:49 +0300 Message-Id: <20190730170955.11987-8-digetx@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190730170955.11987-1-digetx@gmail.com> References: <20190730170955.11987-1-digetx@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190730_101016_906396_C1948E41 X-CRM114-Status: GOOD ( 12.70 ) 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: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This function resembles tegra_cpu_die() of the hotplug code, but this variant is more suitable to be used for CPU PM because it's made specifically to be used by cpu_suspend(). In short this function puts secondary CPU offline, it will be used by the new CPUIDLE driver. Signed-off-by: Dmitry Osipenko --- arch/arm/mach-tegra/pm.c | 14 ++++++++++++++ include/soc/tegra/pm.h | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c index 4cc64a135a3e..7d9ef26e52a7 100644 --- a/arch/arm/mach-tegra/pm.c +++ b/arch/arm/mach-tegra/pm.c @@ -427,4 +427,18 @@ void __init tegra_init_suspend(void) suspend_set_ops(&tegra_suspend_ops); } + +int tegra_pm_park_secondary_cpu(unsigned long cpu) +{ + if (cpu > 0) { + tegra_disable_clean_inv_dcache(TEGRA_FLUSH_CACHE_LOUIS); + + if (tegra_get_chip_id() == TEGRA20) + tegra20_hotplug_shutdown(); + else + tegra30_hotplug_shutdown(); + } + + return -EINVAL; +} #endif diff --git a/include/soc/tegra/pm.h b/include/soc/tegra/pm.h index 2fbee9efda21..08477d7bfab9 100644 --- a/include/soc/tegra/pm.h +++ b/include/soc/tegra/pm.h @@ -27,6 +27,7 @@ int tegra30_pm_secondary_cpu_suspend(unsigned long arg); void tegra_pm_clear_cpu_in_lp2(void); void tegra_pm_set_cpu_in_lp2(void); int tegra_pm_enter_lp2(void); +int tegra_pm_park_secondary_cpu(unsigned long cpu); #else static inline enum tegra_suspend_mode tegra_pm_validate_suspend_mode(enum tegra_suspend_mode mode) @@ -55,6 +56,11 @@ static inline int tegra_pm_enter_lp2(void) { return -ENOTSUPP; } + +static inline int tegra_pm_park_secondary_cpu(unsigned long cpu) +{ + return -ENOTSUPP; +} #endif /* CONFIG_PM_SLEEP */ #endif /* __SOC_TEGRA_PM_H__ */