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=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 D2998C433DF for ; Mon, 29 Jun 2020 09:15:25 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 991192339E for ; Mon, 29 Jun 2020 09:15:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vOtC4WIf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 991192339E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3FngpbxIuR4ai0PQszDqKmPTMZTTleuyh7malIrK/lo=; b=vOtC4WIfTY2NPEjjP3Yr10YA3 GLiQuBpNwAZluHyU04FZCng/sX1uDklqdY8VUiK8XmCwCWzVTM5EuDtntql8jKCsw+YpwexF3X8+Y OyrBqYAAHQjvIKDHjwLDrIhHAUjZ46Fza1uDTuLci28LZWSU4o2cb3WBUbuRCZ4uAZKTXECPkVj/1 4lGKh+d53/GzriZ0Evrp3QdY3MohcuNiQHt3x7Uizfa2+hzKM16C9IpKj+sglCXnOmK1OKw0dIU8j pb6ugORbei8iy5WP6vGnDE0z5xIszBPZdAmUtRcCLBeaJOdaIy2xf2ibh99IT+d2UGE85jLca+CTi ZSwetcL/A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpprM-0005Jb-2E; Mon, 29 Jun 2020 09:13:52 +0000 Received: from mail-ej1-f67.google.com ([209.85.218.67]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpprI-0005Is-E8 for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 09:13:49 +0000 Received: by mail-ej1-f67.google.com with SMTP id o18so11363456eje.7 for ; Mon, 29 Jun 2020 02:13:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3y8JQhJxn3CQlaKZteqal2/97kZCmMBM7dtDyKGGv64=; b=J7INommIfkYA1SXvjkqGXruBiSPxjQ5ysGs3bG68HvNKWNZ156Oyf1sRuQNAjQLMxz Nb9GibD8/4yhxiSQ3ffxHq6fYhVUq8N5G1mRVpIZRyAJSYyJhPeaNBTmbLXojYtDY3Ar 9Aa6ajSXmwrzDOPkue5c1WyhN6Rtk2ejKs1sSWQHrH/bsKi6xRvf02zp0LYGZg+U3jha 862eubAmdemwd1BS9DUDN+snE26VudgNJd+T4zqtZ9+BJjaFaPyRfW6V/3HKRjdhF0aT KLblAA6gVycHxhkk3LftmCoABDDcl3og2qCITEnNXNQxGvbLz/xgjafU1kuqT06W5IYu 1eCg== X-Gm-Message-State: AOAM5318JK5HAVzsZpRwExjbDaKlS2ZPZx4LCk0uZWgze6eJmO1jvmsZ mCic+VmW/xtlcIome5YRAXw= X-Google-Smtp-Source: ABdhPJyUgK9GSbdCJz/BUuE5Y9gd62uMCDp7R4PGI83oXcm73c/vzRhudmdjK8/T6BUfn6qrxsCr9g== X-Received: by 2002:a17:906:3e84:: with SMTP id a4mr12493437ejj.372.1593422027202; Mon, 29 Jun 2020 02:13:47 -0700 (PDT) Received: from kozik-lap ([194.230.155.195]) by smtp.googlemail.com with ESMTPSA id f17sm28318273edj.32.2020.06.29.02.13.45 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Jun 2020 02:13:46 -0700 (PDT) Date: Mon, 29 Jun 2020 11:13:43 +0200 From: Krzysztof Kozlowski To: Marek Szyprowski Subject: Re: [PATCH 1/4] ARM: exynos: Apply little core workaround only under secure firmware Message-ID: <20200629091343.GA16015@kozik-lap> References: <20200616081230.31198-1-m.szyprowski@samsung.com> <20200616081230.31198-2-m.szyprowski@samsung.com> <1f59ab26-94e8-6ee8-48f9-568cf1a0edfa@arm.com> <20200622171904.GA4174@kozik-lap> <96d7f0f2-63c0-8c8d-5a79-ba27295b389a@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <96d7f0f2-63c0-8c8d-5a79-ba27295b389a@samsung.com> User-Agent: Mutt/1.9.4 (2018-02-28) 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: Lorenzo Pieralisi , linux-pm@vger.kernel.org, Daniel Lezcano , Bartlomiej Zolnierkiewicz , linux-samsung-soc@vger.kernel.org, Lukasz Luba , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 29, 2020 at 10:54:27AM +0200, Marek Szyprowski wrote: > Hi Krzysztof, > > On 22.06.2020 19:19, Krzysztof Kozlowski wrote: > > On Wed, Jun 17, 2020 at 05:26:58PM +0100, Lukasz Luba wrote: > >> I've give it a try with hotplug torture tests and has only one a minor > >> comment. > >> > >> On 6/16/20 9:12 AM, Marek Szyprowski wrote: > >>> The additional soft-reset call during little core power up was needed > >>> 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: 833b 5794 e330 ("ARM: EXYNOS: reset Little cores when cpu is up") > > Fix the Fixes tag (in case of resend, otherwise I'll do it). > > > >>> Signed-off-by: Marek Szyprowski > >>> --- > >>> arch/arm/mach-exynos/mcpm-exynos.c | 10 +++++++--- > >>> 1 file changed, 7 insertions(+), 3 deletions(-) > >>> > >>> 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); > >> I can see that you have moved this call up, probably to avoid more > >> 'if-else' stuff. I just wanted to notify you that this function > >> 'exynos_cpu_powerup' is called twice when cpu is going up: > >> 1. by the already running cpu i.e. CPU0 and the 'state' is 0 for i.e. > >> CPU2 > >> 2. by the newly starting cpu i.e. CPU2 by running > >> 'secondary_start_kernel' and the state is 3. > >> > >> In this scenario the 'exynos_cpu_power_up' will be called twice. > >> I have checked in hotplug that this is not causing any issues, but > >> thought maybe it's worth share it with you. Maybe you can double check > >> in TRM that this is not causing anything. > > This brings the old code, before 833b5794e33. I wonder why? I understood > > that only soft-reset should be skipped. > > Because otherwise the Peach boards hangs during the cpuidle. I didn't > analyze the code that much to judge if it is really necessary in all > cases, I only restored what worked initially. I can add a comment about > that to the commit log if needed. Yes, please mention this in commit msg. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel