From patchwork Tue Dec 11 14:35:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 153467 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp689034ljp; Tue, 11 Dec 2018 06:35:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/WwIIUqVtNAOBW74oU0v1AfMMOSU79DCOCtEkS/swoGfp7NQdEX8EB79fTUDhuMZzaQ18Hx X-Received: by 2002:a63:413:: with SMTP id 19mr14623029pge.7.1544538944579; Tue, 11 Dec 2018 06:35:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544538944; cv=none; d=google.com; s=arc-20160816; b=b1UZCJALbdvW9XP5XUflrELMWtkYoSvW7ZvB+c3vXMUR2fKBYPlswQZjnJ/r+UoTFr DBlqQfPemogtmMYELwiU8+ZXFJxlpqDAMFF6K6JmVLucFshDUC6u2ecH9PaJ4hVPsRPz KWbAtQk247v3uUjWM7AKPH8U1DJOwvU/FQtWVHJTBraWQe6MSqqyGGq+B3xRaFg3mlG+ 8xmqYov5OqPqOgWoiEn17DsE2WIp0sp85J19VAqpCnwALHDFaMRmPJjpYENqOELT3gQn tvEeiYxIxfLA6jLcuQ3kvR3wQD/jm93K/dEx9V2YmVjpv4Sg1QoCCN7jZ66EItnjJIhE dtEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=rVTZVwZMfha5OOCw6MUhcvOFlFlRP5qG8N0ALgHN6OQ=; b=hhnvi+fs9VGwS10ZfuTOOC8/fPbr51fkZbz3TFB0aGlW576QhdKbA0XPfGfvUkIFlT PiVO4XPJcyHDaXyMCf3P0WYx+aR2RqzRt2YheUHwlMzVUYViKW4LGwbLUwu+zUu1Kq3k mMRllebFvkeg+Xq+BmEc0YQU3aVDp08LMzgQ1q+yHjI6yZT5om0VAgqnNKx3Nz5pAhbP s6+qLW47Zo8biZXrz7PhJNKgEYFL3P1Q7REh5ah59C1N5aGuZSNGcOQF9gcA/PNLd53r IjTA3e6HG/Nepmj8ozuhaC6PdTLU6t03Qq4pxH8bywTsBnmC19fNDKsishA2gT2LOboF vrUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7si13069678pfb.237.2018.12.11.06.35.44; Tue, 11 Dec 2018 06:35:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726551AbeLKOfn (ORCPT + 31 others); Tue, 11 Dec 2018 09:35:43 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:45019 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726176AbeLKOfm (ORCPT ); Tue, 11 Dec 2018 09:35:42 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPA (Nemesis) id 1MD9Kp-1gfHhj1Z6f-009As2; Tue, 11 Dec 2018 15:35:30 +0100 From: Arnd Bergmann To: Peter De Schrijver , Prashant Gaikwad , Michael Turquette , Stephen Boyd Cc: Arnd Bergmann , Thierry Reding , Jonathan Hunter , Dmitry Osipenko , Aapo Vienamo , linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] clk: tegra: fix SMP build Date: Tue, 11 Dec 2018 15:35:07 +0100 Message-Id: <20181211143528.2024488-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:Yr3PefCHlIiPhTL2RRzUnnSvWzKtAq7GB9ZHq121Zj2swOZ/i7Q Vl0WGVI0DbkaB9jq6r13YWDMxu0CMgNUIqHe2QS8CEmITnyrrzc6tbzoIFZR2yHUYji/hZ8 StAtGjdFXpMiH/PO+l19Wuu6XA1e1JBiXYnrNMGMmky3oDd7+zidzlyY9Ce8W4WoUhQomMY HJ/nwwHZUX77NphkjGvuA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:PrHJ2V1FYIA=:+dIncFvgge7dlAORd3u9bI eArkfmGK4PCk4pFtgJofpH9QNtdEUyJ8ZZxK3fMfyTukNeBh08s19ZK7P4WJk5Eh+iB3RDyPX eXVUmz4k9L3T/cZe+yyeuAiVO6O5QFCrQdmdZO+jSzIKWvAkB7R6dVCbHUaqhzonnC64w6cU1 fM4hxWY1kUBOVYP2ZmbYwhb3B6E4gMAEljvX8aBv3CKD9WZ5uPoJNiWGUOoYmerPjBK5aOKLk W53/QqOwBEJxAOz3B6rXJYtiCET0RppSgwo5ADzXkMCxj5MLv9Zp/O2p3enP7AVqhwoit98nj NqvyNNs5hlWctupAgUdMriWUfu+KQUxaPfkFOA2NwEkj5LHXST0Nizi+iLWUNeeC4XNFa/xhP 3cwAiJvVLpCcpSlx09LlHiT1DY7h1NoXZGbiPnLL1OgnLIHY3AGxgxD/4Qz9XR0twU5o3HMOQ iOtZQ+/+s45e/1FDZsgt6Fo40LkFch9jxbABTkWJx2zT7FLORYeh1gJtHQCMc6anlMirFi16L STYpWESpc1766UEp6AM0UXJKiV1GtiWQr+GTAWRxQiuxp2FFOLLw5EmOPkaWy4xYtM3yF/Ej/ Lb+Ayld0eQH8zJKA0p/UaeI0xgJD6HU7mca2a/tNm4S2eq2zZQu81LiBhyxzAZ05Ns83gEaoK WnZM78wknjdmcAwyZD7enX7RiK0QN72zHqUwuNo/xTAVg8OueD+RQ3XfcMpsx1GlPkJC3SXK9 fNZ9LqDAVVe7edE1rpBKKvRerw72dlrX973SXw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_SMP is disabled, the tegra clk driver now fails to build: drivers/clk/tegra/clk-tegra30.c: In function 'tegra30_cpu_rail_off_ready': drivers/clk/tegra/clk-tegra30.c:1151:19: error: implicit declaration of function 'tegra_pmc_cpu_is_powered'; did you mean 'tegra_powergate_is_powered'? [-Werror=implicit-function-declaration] cpu_pwr_status = tegra_pmc_cpu_is_powered(1) || I don't know if tegra works without CONFIG_SMP, but we can get it to build by making the calls conditional, and removing the pointless ifdef around the declaration. The assumption now is that in a non-SMP system, the secondary CPUs are always disabled. Fixes: 61866523ed6e ("clk: tegra30: Use Tegra CPU powergate helper function") Signed-off-by: Arnd Bergmann --- Not sure if this is the best solution. If you think it's not, please submit a different fix. --- drivers/clk/tegra/clk-tegra30.c | 10 +++++++--- include/soc/tegra/pmc.h | 2 -- 2 files changed, 7 insertions(+), 5 deletions(-) -- 2.20.0 diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-tegra30.c index fa8d573ac626..1505185936f4 100644 --- a/drivers/clk/tegra/clk-tegra30.c +++ b/drivers/clk/tegra/clk-tegra30.c @@ -1148,9 +1148,13 @@ static bool tegra30_cpu_rail_off_ready(void) cpu_rst_status = readl(clk_base + TEGRA30_CLK_RST_CONTROLLER_CPU_CMPLX_STATUS); - cpu_pwr_status = tegra_pmc_cpu_is_powered(1) || - tegra_pmc_cpu_is_powered(2) || - tegra_pmc_cpu_is_powered(3); + + if (IS_ENABLED(CONFIG_SMP)) + cpu_pwr_status = tegra_pmc_cpu_is_powered(1) || + tegra_pmc_cpu_is_powered(2) || + tegra_pmc_cpu_is_powered(3); + else + cpu_pwr_status = 0; if (((cpu_rst_status & 0xE) != 0xE) || cpu_pwr_status) return false; diff --git a/include/soc/tegra/pmc.h b/include/soc/tegra/pmc.h index fd816f6aa9cc..a9db1b501de1 100644 --- a/include/soc/tegra/pmc.h +++ b/include/soc/tegra/pmc.h @@ -26,11 +26,9 @@ struct clk; struct reset_control; -#ifdef CONFIG_SMP bool tegra_pmc_cpu_is_powered(unsigned int cpuid); int tegra_pmc_cpu_power_on(unsigned int cpuid); int tegra_pmc_cpu_remove_clamping(unsigned int cpuid); -#endif /* CONFIG_SMP */ /* * powergate and I/O rail APIs