From patchwork Mon Aug 17 15:13:38 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: 247845 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp2866728ilo; Mon, 17 Aug 2020 11:32:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIsUEx5gorrXGtT26TxrW4qej/iUpbCq9u0vS2ppOAv76ZmGTeWoLyHySv5VzTgp8gyA+Y X-Received: by 2002:a17:906:e2d6:: with SMTP id gr22mr16147158ejb.455.1597689172565; Mon, 17 Aug 2020 11:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597689172; cv=none; d=google.com; s=arc-20160816; b=pny1cGEY8IZLu5cTTDgGQSwUCIZMz62pPGJUPyrEkvdeQRY19MJaclzcBvNht8hTzx zlwmFRU92XmlItXZbMCDnETVyfAqRfrEaoPXCrvoaOKmDWx0+3ePC92Y+Hx2/8j/Lg9D VeQpf6byW2R0OKFBKCMF8DDuMighxuXXsuM4QJETNQBFyzPAEcW89NHM/a3qL329eYLO Hl1xyWeuma7CHX3+nSlH2GlTGQJos1b1ggWtHahzk9MKuKc0QN/f5mDmk/yxbcrveFOk 2oMQZiePZIF2jT6driPY9pnWPWHun634YxmYHE0RgIkFRZ0KO+hCVIRB3wnH8ixu3mT7 8lIw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nD5aRyLapCYKG0q0Ukf5EQrYIQWwhykCl0u72Wp1UWI=; b=JmkaYSyQ+xkaTMsXjdX+dzgiZ2jeD4ZbPr6bSj7ZXU6Hc9KZfOieuwrvLEvNz8ZX6L Ndl1oNw9cUVuzX4EmUA1MhAQE/H0lvAZFCIfobzOBMf+HB3DRD5XQGv+NLvNZ8fAU/eC H7Cllcrlcu1knMsfpQnoQIonEOMytHdgxTO/We/kSP50TwEbcLspF9FY6f/UNq4noLpz xaRt56dFcxtzH1TNJbcamNOV/IB5oeOkyMP4AkxNuv5AdOL4uat1xRINp1ZSD9qWnN+w rBGwPlXfMfkCzochJqHYWFM0OM9sXVkcDEbVoc+sSSuTRa4YnCThMPgrcJY94oFyNeUN P7Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="UQO/3PZd"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si12624314ejq.39.2020.08.17.11.32.52; Mon, 17 Aug 2020 11:32:52 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="UQO/3PZd"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731024AbgHQQAf (ORCPT + 15 others); Mon, 17 Aug 2020 12:00:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:47470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731000AbgHQQAH (ORCPT ); Mon, 17 Aug 2020 12:00:07 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 E2DB520825; Mon, 17 Aug 2020 16:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680006; bh=drw5bpymsEmzse0AQE94EHwiijtRpGBgXRZNsFvsyBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UQO/3PZdFqVKr+iNr/Ng+tB8iRc3cfhJYxiT9DnBm6rnehWO9m9mXSQ2eZ14g6I6I MQ+hZcWhPTSQD9kgrX4PxEH4QlNu/KEwqYmFeKmqUZPGs6zTS18x9+R4LbcqXGImrj jbFuJMbLLsW0dan3VdhZOIr3/7HFoaLH8tvxinOM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Lukasz Luba , Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 5.4 017/270] ARM: exynos: MCPM: Restore big.LITTLE cpuidle support Date: Mon, 17 Aug 2020 17:13:38 +0200 Message-Id: <20200817143756.652529501@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143755.807583758@linuxfoundation.org> References: <20200817143755.807583758@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Marek Szyprowski [ Upstream commit ea9dd8f61c8a890843f68e8dc0062ce78365aab8 ] Call exynos_cpu_power_up(cpunr) unconditionally. This is needed by the big.LITTLE cpuidle driver and has no side-effects on other code paths. The additional soft-reset call during little core power up has been added to properly boot all cores on the Exynos5422-based boards with secure firmware (like Odroid XU3/XU4 family). This however broke big.LITTLE CPUidle driver, which worked only on boards without secure firmware (like Peach-Pit/Pi Chromebooks). Apply the workaround only when board is running under secure firmware. Fixes: 833b5794e330 ("ARM: EXYNOS: reset Little cores when cpu is up") Signed-off-by: Marek Szyprowski Reviewed-by: Lukasz Luba Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sasha Levin --- arch/arm/mach-exynos/mcpm-exynos.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c index 9a681b421ae11..cd861c57d5adf 100644 --- a/arch/arm/mach-exynos/mcpm-exynos.c +++ b/arch/arm/mach-exynos/mcpm-exynos.c @@ -26,6 +26,7 @@ #define EXYNOS5420_USE_L2_COMMON_UP_STATE BIT(30) static void __iomem *ns_sram_base_addr __ro_after_init; +static bool secure_firmware __ro_after_init; /* * The common v7_exit_coherency_flush API could not be used because of the @@ -58,15 +59,16 @@ static void __iomem *ns_sram_base_addr __ro_after_init; static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) { unsigned int cpunr = cpu + (cluster * EXYNOS5420_CPUS_PER_CLUSTER); + bool state; pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster); if (cpu >= EXYNOS5420_CPUS_PER_CLUSTER || cluster >= EXYNOS5420_NR_CLUSTERS) return -EINVAL; - if (!exynos_cpu_power_state(cpunr)) { - exynos_cpu_power_up(cpunr); - + state = exynos_cpu_power_state(cpunr); + exynos_cpu_power_up(cpunr); + if (!state && secure_firmware) { /* * This assumes the cluster number of the big cores(Cortex A15) * is 0 and the Little cores(Cortex A7) is 1. @@ -258,6 +260,8 @@ static int __init exynos_mcpm_init(void) return -ENOMEM; } + secure_firmware = exynos_secure_firmware_available(); + /* * To increase the stability of KFC reset we need to program * the PMU SPARE3 register