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,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=unavailable 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 C35C5C43381 for ; Thu, 14 Mar 2019 12:14:14 +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 947142184C for ; Thu, 14 Mar 2019 12:14:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bAdkRUn6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="illF9kj0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 947142184C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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: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=HKoLUbD9BYt80wn4I877KiInsvqqgjppHh0LabhT1zo=; b=bAdkRUn6+jNBAm 712zKPepKEts+O6TYiKf0iWJl3Q4x/aZtGasYefqGSEYRpf2o6ROX4+TixuB7vP5248AJ/wRYtFvo ZIIADDsN5SehqZh5Hx2ny7GGeqSIV1iZpkMkwGxB+GKnRf2ERTyL3vCpCITwd2uhKsHLdd/C6uETJ z8kX/x0oiXTgdblLbp5e9KUuhNN58buZlrEmXpgnqWzOQZhvlnAUK44DMKUMF73rQ4vjob8ai/uju eNWpc45ojGGGZ2neaWO9DMft57Chj8vkPh13Akm7tG8CSa8rxqAp5CtgLseOcFeOChvez8CX55NL7 /1J8Q1sABN1MpjlinteA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4PFQ-0006Jc-Ck; Thu, 14 Mar 2019 12:14:08 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4PFM-0006Ie-Bi for linux-arm-kernel@lists.infradead.org; Thu, 14 Mar 2019 12:14:06 +0000 Received: by mail-wr1-x441.google.com with SMTP id y15so5605708wro.4 for ; Thu, 14 Mar 2019 05:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=g4s2vP608w4BYUINt5jyN6fBpaCQmtHIKqgtJ2QnaYs=; b=illF9kj060sqJoiNYMswilE87JJDs+PvBZ3nrqths2RoslF3jGNSz43Y4ssHdboAIf qsN/k9K4ycDqGhCUhXgt9FoTHvRbMlY2LqFjXVOMCDrKwHpkljCdUafyHiseOUM+dypx qxOsbpbp5pKAQuH8DzGL2IGGUCAUOo2U2WtnhfJLY6M2G/civGzR2XFjTXolC8+Jfldg iv3WHexr6rDpNG3aRP4PuxIQlox9AjD0YtLKw+kLVoNIFZGG0DEFaY6dAdaTs6z8gwN6 UKYb4PUpYE6/sxCTsj+Av24ms3yWtOfy3iroPISPBF8RoAmEfQOFdXjFIR+0XkffdCJo RKXA== 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=g4s2vP608w4BYUINt5jyN6fBpaCQmtHIKqgtJ2QnaYs=; b=OYq4Oug6Mmey3FoNcZuMxH2onEzh2AMHVTJEj1LIGyljDGyvIyeE84S1+Xql0AH2EG R3aj5b5B6xPfRkD3zeZqmNROjbaR1KI1vnV0zC+9TRqaPA9L8BoE0UVRirnxall8NWcb cSAI6rFzQe3l8VC6M09VrgGuRI7Oig+nXwGEl8OaklCLaIZJpb/SfTPXA5su9DOJDMyX f9WFFdof8oruOe7oTIqd1jw0ATqnhDwrPaLVCkFjx3Pc58X8UTbETNtVkTi76UZ0PSQk v44GBw1Ci1jJASZu/OKHelQT78xwRs2tR0kvjSldJ2A7uPePYT1VbVyo3JP/9N1Ij3xi iKTg== X-Gm-Message-State: APjAAAWZegn/0EiwkIjXKv/sWvwZXidT+b93W95+z/3DNSKYZivxDUQ2 /R1q3uDYTkE4a4mFjcSXRazCuP2qLk0= X-Google-Smtp-Source: APXvYqzbjiD94W0rTCssqWmTdNO2mjrka2R81YjZ/7tRO3GAyqiNORpeYT8n9VIN/Ij3xjRpKt+1cw== X-Received: by 2002:adf:f548:: with SMTP id j8mr21424874wrp.321.1552565641920; Thu, 14 Mar 2019 05:14:01 -0700 (PDT) Received: from apalos (ppp-94-64-206-130.home.otenet.gr. [94.64.206.130]) by smtp.gmail.com with ESMTPSA id v4sm2886851wmg.1.2019.03.14.05.13.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 05:14:01 -0700 (PDT) Date: Thu, 14 Mar 2019 14:13:58 +0200 From: Ilias Apalodimas To: Gregory CLEMENT Subject: Re: [PATCH 1/2] cpufreq: armada-37xx: fix clock parenting Message-ID: <20190314121358.GA19385@apalos> References: <20190308164710.10597-1-gregory.clement@bootlin.com> <20190308164710.10597-2-gregory.clement@bootlin.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190308164710.10597-2-gregory.clement@bootlin.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190314_051404_465832_951CE25B X-CRM114-Status: GOOD ( 24.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Vincent Guittot , Jason Cooper , Christian Neubert , Antoine Tenart , Viresh Kumar , linux-pm@vger.kernel.org, "Rafael J. Wysocki" , stable@vger.kernel.org, Maxime Chevallier , Thomas Petazzoni , =?iso-8859-1?Q?Miqu=E8l?= Raynal , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth 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 Hi Christian, Gregory, > From: Christian Neubert > > The clock parenting was not setup properly when DVFS was enabled. It was > expected that the same clock source was used with and without DVFS which > was not the case. > > This patch fixes this issue, allowing to make the cpufreq support work > when the CPU clock source are not the default ones. > > Fixes: 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx") > Cc: > [gregory: extract from a larger patch, modify comments and commit log] > Signed-off-by: Christian Neubert > Signed-off-by: Gregory CLEMENT > --- > drivers/cpufreq/armada-37xx-cpufreq.c | 20 +++++++++++++++++--- > 1 file changed, 17 insertions(+), 3 deletions(-) > > diff --git a/drivers/cpufreq/armada-37xx-cpufreq.c b/drivers/cpufreq/armada-37xx-cpufreq.c > index 75491fc841a6..ad4463e4266e 100644 > --- a/drivers/cpufreq/armada-37xx-cpufreq.c > +++ b/drivers/cpufreq/armada-37xx-cpufreq.c > @@ -162,11 +162,25 @@ static void __init armada37xx_cpufreq_dvfs_setup(struct regmap *base, > } > > /* > - * Set cpu clock source, for all the level we keep the same > - * clock source that the one already configured. For this one > - * we need to use the clock framework > + * Set CPU clock source, for all the level we keep the same > + * clock source that the one already configured with DVS > + * disabled. For this one we need to use the clock framework > */ > parent = clk_get_parent(clk); > + > + /* > + * Unset parent clock to force the clock framework setting again > + * the clock parent > + */ > + clk_set_parent(clk, NULL); > + > + /* > + * For the Armada 37xx CPU clocks, setting the parent will > + * actually configure the parent when DVFS is enabled. At > + * hardware level it will be a different register from the one > + * read when doing clk_get_parent that will be set with > + * clk_set_parent. > + */ > clk_set_parent(clk, parent); > } > > -- > 2.20.1 > I applied this and selected only CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_POWERSAVE=y The board boots up with 'powersave' instead of 'performance' (maybe some init script?) When i tried changing to 'performance' i got this: [ 164.134589] Internal error: synchronous parity or ECC error: 96000018 [#1] PREEMPT SMP [ 164.139899] Modules linked in: mvneta mvmdio phylink crct10dif_ce ip_tables x_tables ipv6 [ 164.148321] CPU: 1 PID: 2485 Comm: bash Not tainted 5.0.0espressobin+ #68 [ 164.155305] Hardware name: Globalscale Marvell ESPRESSOBin Board (DT) [ 164.161938] pstate: 000003c5 (nzcv DAIF -PAN -UAO) [ 164.166873] pc : do_mem_abort+0x48/0xb0 [ 164.170808] lr : el1_da+0x20/0x88 [ 164.174210] sp : ffff000011b5b1f0 [ 164.177614] x29: ffff000011b5b1f0 x28: ffff80003a0ab800 [ 164.183080] x27: 0000000000000000 x26: 0000000000000000 [ 164.188545] x25: 0000000000000000 x24: 0000000000000025 [ 164.194012] x23: 00000000000003c5 x22: ffff000010c37318 [ 164.199477] x21: ffff000010c371f0 x20: ffff000011b5b220 [ 164.204942] x19: 000000009600004f x18: 0000000000000000 [ 164.210408] x17: 0000000000000000 x16: 0000000000000005 [ 164.215873] x15: 0000000000000000 x14: 0000000000000000 [ 164.221339] x13: ffff80003ac55168 x12: ffff80003ac55168 [ 164.226805] x11: 0000000000000026 x10: 0101010101010101 [ 164.232270] x9 : 0000000000000000 x8 : 0000000000000000 [ 164.237735] x7 : 0000000000000000 x6 : 0000000000000000 [ 164.243201] x5 : 0000000000000000 x4 : 0000000000000000 [ 164.248667] x3 : 0000000000000000 x2 : 0000000000000000 [ 164.254133] x1 : 0000000000000000 x0 : 0000000000000000 [ 164.259601] Process bash (pid: 2485, stack limit = 0x00000000eb09c765) [ 164.266318] Call trace: [ 164.268830] do_mem_abort+0x48/0xb0 [ 164.272413] el1_da+0x20/0x88 [ 164.275460] el1_error+0x14/0xe4 [ 164.278778] Code: 2a1303e1 9ba07c63 aa1603e0 8b030095 (f8636883) [ 164.285053] ---[ end trace 78a878c96fcb4581 ]--- [ 164.289795] Kernel panic - not syncing: Fatal exception [ 164.295171] SMP: stopping secondary CPUs [ 164.299211] Kernel Offset: disabled [ 164.302788] CPU features: 0x002,2000200c [ 164.306817] Memory Limit: none [ 164.309961] ---[ end Kernel panic - not syncing: Fatal exception ]--- Cheers /Ilias _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel