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 X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 55BEBC7618F for ; Mon, 15 Jul 2019 17:32:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B91C2083D for ; Mon, 15 Jul 2019 17:32:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sEbxV4Tk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cDT1znoq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B91C2083D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=sEbxV4TkunM35c Jq3oYadk0k1hUn/Rn1L1WvNkwju6R8xul9StTYA9vrNwNm5DfMbSlxWvoSYMlbGfgkyc74LZp8MCv 7074UAAQsKCJY8AhF7n+YgwsPJJZHWid2Js72lh3rrj/IpcvfZHhF3xgu2ZXbHWF4UxG3gy91pnAJ uo9e1JpKesp1bxwac6q+4euz1usnxjGL8BjCWpKjxAtCcK1WMohBHHk+teuVahHBgS22i9vd16fAc qsJPWy8nVkhqBtiYx9WqLIZbtbRXjYl0s4q51inyQ7eSKvaindjdsGSHtK6XkbF5zjm0QENzx0wUj x7p1oPRP2YAJPpm0mwNQ==; 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 1hn4pm-0002sf-K9; Mon, 15 Jul 2019 17:32:18 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hn4nR-0008Gl-T1 for linux-arm-kernel@lists.infradead.org; Mon, 15 Jul 2019 17:29:55 +0000 Received: by mail-lj1-x244.google.com with SMTP id m8so17081556lji.7 for ; Mon, 15 Jul 2019 10:29:53 -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=cDT1znoqQWzRJFOuhr0qRvKpnWLvvS4JZtHOJ0pnhS2O4VqXGT2we1djhYEtlUYLtw RNpBqAHAKF/FLRHo+2oNA+TrWzuzzqiHAv2XxirbKykExj06nGx0BRhcy4ynrSoI1U2u IKj1sdMEyahxMJKA9wlyu7Wgrw2BCgvlivEr3/2iYcqwvapa5ooouf0WwhiOREEA8FIi nJBjLtfvmRHnzDAZj8tYyNzHhf34bmGl7mELLt1bgSdx6RsdWfuWoLIm1vJnqiGmhvET XDnZQZgcOVaz8Y5GVFFUkQ8vQIa8+9TCgPangt4RfTc6qjf1CO/J6kumoqhMBkVmPqCM 8cVA== 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=CzS2N7kzx3NQqz2pVoMtijaU+BUkFtfpEgWEQ6oCUJKu8MyMNCKaNbHGJg3CQzsys1 n/9JOjeJ/LuJuqEqV6Iecymrc6Z9agSAVBC/Vf/sQMfMLLMILYsGZLb2TbSn+/3kZeeE yJ5QgAJhESivh+93xnMDi/s8wc6SAtDeYVArDitBAYBRysHy/bEmLU+hATfZ8thfGwXk 2JmDtKxC8xvWiVZh8kM7m1HQTWMsMclPcytpGG85xeo5Grp0PxMZWWk9lLxiylXhA4Es QfPDumBDr6TirEMewXDFSX+RNP4eqneZkWUKHtLBar1VpsyAnxHMPVPtb+IPkV64Jyyp Zq5Q== X-Gm-Message-State: APjAAAVLUZWD3fYXr0bsFx75CYAGLYndWh9PbQ81HfDE09hiHoUSDoTn T5IAUeV6h2dte4RbdV5LY0w= X-Google-Smtp-Source: APXvYqze+EZiOztxVZvleQZu2rs5ndgzoFDphhDcPCAcS1ClN92DcBQASC9SZaVqn3r9Bzb3uJXCuA== X-Received: by 2002:a2e:730d:: with SMTP id o13mr13837571ljc.81.1563211791659; Mon, 15 Jul 2019 10:29:51 -0700 (PDT) Received: from localhost.localdomain (ppp79-139-233-208.pppoe.spdop.ru. [79.139.233.208]) by smtp.gmail.com with ESMTPSA id b17sm3248765ljf.34.2019.07.15.10.29.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 10:29:51 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Peter De Schrijver , "Rafael J. Wysocki" , Daniel Lezcano Subject: [PATCH v3 07/13] ARM: tegra: Add tegra_pm_park_secondary_cpu() Date: Mon, 15 Jul 2019 20:26:23 +0300 Message-Id: <20190715172629.4437-8-digetx@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190715172629.4437-1-digetx@gmail.com> References: <20190715172629.4437-1-digetx@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190715_102953_952736_3273F132 X-CRM114-Status: GOOD ( 13.43 ) 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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__ */ -- 2.22.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel