From patchwork Mon Jun 29 10:02:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 191998 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3162027ilg; Mon, 29 Jun 2020 12:27:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx355EniGJkNUaSqACZ2QVYDrc5yypafV/ndkOlDfRZQC/uGdQnmct1Sd6JlCz7qDzm3NIZ X-Received: by 2002:a50:d513:: with SMTP id u19mr18656363edi.241.1593458877134; Mon, 29 Jun 2020 12:27:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593458877; cv=none; d=google.com; s=arc-20160816; b=UlzAN5tknKhi6ZI3JMUNkESqenYxi6DejFKa3Ek9OhtlDmmM2XwMoAEpV0jVj3itK+ MIEtOuDVQyJdBBWKrnvhwwqXFODlg9C470m3+/QwmP/5UITqLAFicuF+tUqiDw4qhtSJ hGYSPNTz1f+YjwjHAmymklQDaDaL53tavfqpRDeGy1G8b9kHgED9FLKUyNDPpRxCMOOO ByFk4WlslHfVjJpR4xseYnFc8gzTneogfL1Rr9TeYEG6Lla8HnaTpWPloyQSeDAuxCur IxeY2Apr6B11CL3BIE8wHUEDWtz78R51YnFpr2UuXA1Amr/6PMAgmPPWgvZJI2HOoVD1 SWQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=okS5KJEik3Mhl0JO7rzq1gAczBX0ZJOrlQAhid5KQSw=; b=bsP/Pckj7QRD+kwtL60NCJ9ocSAF0BMzjAkfabVVVuM4+beldV4Mrlv5YSrODbji1s X2GV8qeYXZ5GePMy0N4Nk2G1oI2VydavYWbDzYbMzpjzRfwPaFSW9ildh79oiDHHgtV/ pcd1ekNP1ym/n8yS0//ZlAyV5LjeriV13+9zO5bnj15k9OqU/LvGuyj5FT59Ns0/mFc9 CxmVt1lqo0HFmlWzXLxR64I9hkM3Fmei3B/jxHUZd2kB5eSnxjByDWdr6jPI4nxFXB5/ 8qdObibPuVtQ0otUWW/ppX+BswYNWJ418qf8Lnz1jKCa8wwR5js6lcz0PcntR5KxBNLF c28w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=FLR5e7pP; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qx22si386965ejb.148.2020.06.29.12.27.56; Mon, 29 Jun 2020 12:27:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@samsung.com header.s=mail20170921 header.b=FLR5e7pP; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731978AbgF2T1z (ORCPT + 3 others); Mon, 29 Jun 2020 15:27:55 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:46382 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732461AbgF2T1y (ORCPT ); Mon, 29 Jun 2020 15:27:54 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200629100232euoutp02c101dc0e9b7afbaf29dc6bdae9604b94~c_40w9yKS2976729767euoutp02O for ; Mon, 29 Jun 2020 10:02:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200629100232euoutp02c101dc0e9b7afbaf29dc6bdae9604b94~c_40w9yKS2976729767euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1593424952; bh=okS5KJEik3Mhl0JO7rzq1gAczBX0ZJOrlQAhid5KQSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FLR5e7pPMFZTMfIAm0SvZOPpgX+jvSfl9nLuDBL71cbD5B/nY/f6Mp6keSG9MnPU/ TAVhV0eLuKM27PqK3ENuWidyWGqyPGY8Bp8wy+XVer+TEWO9QMmPzU9a+dPEndRmbj ZebvIyI8gLfABHHc+xsyGlEcJMp87DqCwJK03CK4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200629100231eucas1p2e0aa31baf3b4ce8608f03c55ba7485cb~c_40bJQHP1896918969eucas1p2B; Mon, 29 Jun 2020 10:02:31 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id A4.8A.06456.73CB9FE5; Mon, 29 Jun 2020 11:02:31 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200629100230eucas1p1bf07ca4c84ba6be1fbdd80c45d077518~c_4zn0Kd_1824218242eucas1p12; Mon, 29 Jun 2020 10:02:30 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200629100230eusmtrp2d3aabf143c37de217069c044b99459e5~c_4znKU1y0124201242eusmtrp2P; Mon, 29 Jun 2020 10:02:30 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-98-5ef9bc379f65 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E0.20.06017.63CB9FE5; Mon, 29 Jun 2020 11:02:30 +0100 (BST) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200629100230eusmtip24c664fc175d77af51f2ff13f8a71baa0~c_4zFV5GQ1379413794eusmtip2D; Mon, 29 Jun 2020 10:02:30 +0000 (GMT) From: Marek Szyprowski To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Lorenzo Pieralisi , Krzysztof Kozlowski , Daniel Lezcano , Lukasz Luba , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 1/4] ARM: exynos: MCPM: Restore big.LITTLE cpuidle support Date: Mon, 29 Jun 2020 12:02:18 +0200 Message-Id: <20200629100218.6267-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200629091343.GA16015@kozik-lap> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkleLIzCtJLcpLzFFi42LZduzneV3zPT/jDObPFLXYOGM9q8W8z7IW 589vYLfY9Pgaq8Xn3iOMFjPO72OyePP7BbvFwqYWdou1R+6yO3B6rJm3htFj06pONo871/aw eWxeUu/Rt2UVo8fnTXIBbFFcNimpOZllqUX6dglcGZ8ftjEW7BeqePrsLnsD41L+LkYODgkB E4krDUZdjFwcQgIrGCUa5vxkhXC+MEr8W3qaBcL5zCixr62PuYuRE6zjxoFj7BCJ5YwSc/+t Y4Jr2fZxNjtIFZuAoUTX2y42EFtEIF3i3t8lYB3MAhOYJN4097OCJIQF/CVufzwK1sAioCqx 9NgMMJtXwEZi+p8pbBDr5CVWbzgAtppTQF/i+rflLBDxdnaJ688kIGwXiQtrnzFB2MISr45v YYewZST+75wPdp2EQDOjxMNza9khnB5GictNMxghqqwl7pz7xQYKDmYBTYn1u/Qhwo4S3Rt/ sUBCiU/ixltBkDAz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Yw7bn1ijpxx UUaoyklzWXFa4227RdV3gq2dXu/v2a535P78O4F/NY4yzyrwmea3gElmica17qyZH7yvrpp9 ZqH72WhL5ZVyMycKPJ62J2tvdZ9S6Y12kQU5N6omPs6a3yw9UXXOPTuxvz4v93bW9ORwa7+5 cXVrTMa8T/W/l34xuLXpml/A/cZCJZbijERDLeai4kQA3CsDzH4CAAA= X-CMS-MailID: 20200629100230eucas1p1bf07ca4c84ba6be1fbdd80c45d077518 X-Msg-Generator: CA X-RootMTR: 20200629100230eucas1p1bf07ca4c84ba6be1fbdd80c45d077518 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200629100230eucas1p1bf07ca4c84ba6be1fbdd80c45d077518 References: <20200629091343.GA16015@kozik-lap> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org 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 --- v2: - adjusted patch subject to better describe the change - added a comment about exynos_cpu_power_up(cpunr) call --- arch/arm/mach-exynos/mcpm-exynos.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.17.1 Reviewed-by: Lukasz Luba diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c index 9a681b421ae1..cd861c57d5ad 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