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=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_PASS 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 0A561C43381 for ; Mon, 18 Mar 2019 11:41:00 +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 CD66C20880 for ; Mon, 18 Mar 2019 11:40:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="obr3K1jT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD66C20880 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com 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:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=q/jzqxKEFqmovmcSDa3wxH2MqRiwiVZWMyKgrC8JmaQ=; b=obr3K1jTZW5O4x qUwBcYgJtj0oQ3WcCIQUAjRffx4xhDTHJHxupfJ7RL57ifQuKfM+RurgTcQ1hsi4sMe79Kih3sQny jEHWVrxwharQrjkvuUj8tt9D3KdKdvdMSPPZMEvSDY7Hg7UDiBmAP9hqmF7SWompLWoi3rkSd8bWN s7UV8phLFQoB8pLVobgIUPTT7q4KTkNQ+8Ffb1+wdE4j1eu588PEvgYXbQl8LVN9I2reWJr5kpZID Ic8Gn5wbvoGHa/s/7TyXr5AnEtQs+ehwZCqOfzkZ4orYdubu5Nufg4KSnkjqZZ+PiMaEqgyGYyLir o3FnplYIhlCbnigxj1aw==; 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 1h5qdS-0002DE-Dm; Mon, 18 Mar 2019 11:40:54 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5qdP-0002CZ-Ef for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2019 11:40:52 +0000 X-Originating-IP: 109.213.80.250 Received: from localhost (alyon-652-1-57-250.w109-213.abo.wanadoo.fr [109.213.80.250]) (Authenticated sender: gregory.clement@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id E4646240006; Mon, 18 Mar 2019 11:40:39 +0000 (UTC) From: Gregory CLEMENT To: Ilias Apalodimas Subject: Re: [PATCH] clk: mvebu: armada-37xx-periph: Fix initialization for cpu clocks In-Reply-To: <20190318112844.GA1708@apalos> References: <20190313163558.6705-1-gregory.clement@bootlin.com> <20190314121541.GB19385@apalos> <20190314134428.GA24768@apalos> <874l85v8p6.fsf@FE-laptop> <20190318112844.GA1708@apalos> Date: Mon, 18 Mar 2019 12:40:38 +0100 Message-ID: <87h8c0s955.fsf@FE-laptop> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190318_044051_794461_FB9A2A0A X-CRM114-Status: GOOD ( 15.51 ) 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 , Stephen Boyd , Mike Turquette , linux-pm@vger.kernel.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Maxime Chevallier , =?utf-8?Q?Miqu=C3=A8l?= Raynal , Thomas Petazzoni , Viresh Kumar , linux-clk@vger.kernel.org, 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 Ilias, On lun., mars 18 2019, Ilias Apalodimas wrote: > Hi Gregory, >> Hi Ilias, >> >> On jeu., mars 14 2019, Ilias Apalodimas wrote: >> >> > Hello Christian, >> >> Hi, >> >> >> >> I assume you use the 1000 MHz firmware. This does also not work on my Rev 7 >> >> board. But I'm pretty sure this is not a problem of the patches, because if >> >> I take a newer kernel (4.19.20/27) without the patches it also does not >> >> work. A kernel 4.19.17 does work for me. My opinion on that is that this is >> >> another problem which does just occure now because now the cpu frequency >> >> scaling is working with the right frequencies. >> > I am not sure which firmware i am running, i did all my tests on 5.0.0 and >> > changing between governors worked fine without the patches >> >> Curently my espressobin is broken so I tested the patches on the Armada >> 3700 DB and I didn't observe the issue you had. >> >> The 3700 DB I used is configured to run at 800MHz. >> >> Could you apply the following patch and sent me the boot log? >> >> diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/mvebu/armada-37xx-periph.c >> index 26ed3c18a239..f814ade5cd80 100644 >> --- a/drivers/clk/mvebu/armada-37xx-periph.c >> +++ b/drivers/clk/mvebu/armada-37xx-periph.c >> @@ -452,14 +452,17 @@ static int clk_pm_cpu_set_parent(struct clk_hw *hw, u8 index) >> >> /* Set the parent clock for all the load level */ >> for (load_level = 0; load_level < LOAD_LEVEL_NR; load_level++) { >> - unsigned int reg, mask, val, >> + unsigned int reg, mask, val, old, >> offset = ARMADA_37XX_NB_TBG_SEL_OFF; >> >> armada_3700_pm_dvfs_update_regs(load_level, ®, &offset); >> >> val = index << offset; >> mask = ARMADA_37XX_NB_TBG_SEL_MASK << offset; >> + regmap_read(base, reg, &old); >> regmap_update_bits(base, reg, mask, val); >> + pr_err("%s old=%X -> val=0x%X load_level=%d\n", >> + __func__, old, val, load_level); >> } >> return 0; >> } >> >> >> > [ 14.909524] clk_pm_cpu_set_parent old=28004840 -> val=0x6000000 load_level=0 > [ 14.916424] clk_pm_cpu_set_parent old=2E004840 -> val=0x600 load_level=1 > [ 14.923315] clk_pm_cpu_set_parent old=8880A8C0 -> val=0x6000000 load_level=2 > [ 14.930572] clk_pm_cpu_set_parent old=8E80A8C0 -> val=0x600 load_level=3 > > > Let me know if you need anything else Could you show me the output of "cat /sys/kernel/debug/clk/clk_summary" Also, during this week-end, Christian suggested that the issue might come from the AVS support. Could you disable it and check you still have the issue? For this, you just have to remove the avs node in arch/arm64/boot/dts/marvell/armada-37xx.dtsi and rebuild the dtb. Thanks, Gregory > > Regards > /Ilias -- Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel