From patchwork Wed Dec 6 11:50:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 10095683 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1317C60329 for ; Wed, 6 Dec 2017 11:51:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02B3029BA9 for ; Wed, 6 Dec 2017 11:51:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E90C029BAE; Wed, 6 Dec 2017 11:51:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5E75729BA9 for ; Wed, 6 Dec 2017 11:51:11 +0000 (UTC) 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:In-Reply-To: Date:References: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=t1Rch5HQ3lY/SAoXbtOAg86B02gQf39gdyBTI1nMFhg=; b=axqdN1zx6Kq0Pg dYB6MMUFbfhYLFaXDpYu89EuDTs0GUXMWpuOQmDx8BGFp2zIbdY8hmtK+I4JoxUkupkKThf3tNcpI H0bIZmHfdo3YWrOxTEg+akQfUauQz3HUVLLputTRtqYw35j4OM1S63nCW6mDB2IumEOEvidUW/met LGEfgX1MSSmN95So0XuKSEaARFeHLNQegl2R0slLbWaqv7PDOEiAqG4Vpr203obj9//l/eEhpJa4Z tNvROD9kqM2DwDeGJYq4anFyJV1st4MFQClPq4yg1bX3Pzb61bPtYgyPBJcAHWOp0ClToi5Usmlxe APBYKSfeyEiSwet7ACRA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eMYEI-0008Di-65; Wed, 06 Dec 2017 11:51:10 +0000 Received: from mail.free-electrons.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eMYED-000878-E1 for linux-arm-kernel@lists.infradead.org; Wed, 06 Dec 2017 11:51:08 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id A7E8120BF7; Wed, 6 Dec 2017 12:50:41 +0100 (CET) Received: from localhost (unknown [84.199.255.188]) by mail.free-electrons.com (Postfix) with ESMTPSA id 6543F203A2; Wed, 6 Dec 2017 12:50:31 +0100 (CET) From: Gregory CLEMENT To: Andre Heider Subject: Re: [PATCH 0/6] Add CPU Frequency scaling support on Armada 37xx References: <20171201112508.14121-1-gregory.clement@free-electrons.com> Date: Wed, 06 Dec 2017 12:50:31 +0100 In-Reply-To: (Andre Heider's message of "Sun, 3 Dec 2017 13:23:33 +0100") Message-ID: <874lp4ulbs.fsf@free-electrons.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171206_035105_820439_77D6360A X-CRM114-Status: GOOD ( 27.72 ) 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: linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Andre, On dim., déc. 03 2017, Andre Heider wrote: > Hi Gregory, > > I applied this and the dvfs patch set ([PATCH 0/3] Add DVFS support on > CPU clock for Armada 37xx) on top of 4.14.3 and gave it a try on > espressobin. Thanks for testing. > > Upon modprobe I get: > [ 66.231652] freq_table: Duplicate freq-table entries: 0 > [ 66.236967] cpu cpu0: cpufreq_init: invalid frequency table: -22 > [ 66.243534] freq_table: Duplicate freq-table entries: 0 > [ 66.248575] cpu cpu1: cpufreq_init: invalid frequency table: -22 > > Is this supposed to work already? Do I miss something? I did a last rebase before sending the series to remove the avs part not working yet. And during this rebase I introduced an bug. I will send a v2 soon if you are intersected by testing it right now, here it is the fix: iff --git a/drivers/cpufreq/armada-37xx-cpufreq.c b/drivers/cpufreq/armada-37xx-cpufreq.c index 40c9a744cc6e..96c2600009b5 100644 Gregory > > Oh, and on that scenario it's not possible to rmmod the driver again, EBUSY. > > Thanks, > Andre > > On 01/12/17 12:25, Gregory CLEMENT > wrote: >> Hi, >> >> This series adds the CPU Frequency support on Armada 37xx using >> DVFS. It is based on the initial work of Evan Wang and Victor Gu. >> >> DVFS control is done by a set of registers from the North Bridge Power >> Management block. The binding for this block is documented in patch 1. >> >> While adding a new cpufreq driver I found that the Kconfig and >> Makefile were no more in order, so it is fixed by patch 2 and 3. >> >> The 4th patch is just about updating the MAINTAINERS file with the new >> driver. >> >> The next patch is the real purpose of the series. The main goal of >> this driver is to setup the CPU load level in the hardware to >> associate them to CPU frequencies and register a standard cpufreq >> driver. Note that the hardware also capable of doing AVS (Adaptive >> Voltage Scaling), by associating a voltage on each level beside the >> CPU frequency. However, this support is not yet ready, so it is not >> part of this series. >> >> Finally, the last patch is for arm-soc the arm-soc subsystem through >> mvebu and update the device tree to support the CPU frequency scaling. >> >> An update on the CPU clock driver is needed in order to take into >> account the DVFS setting. It's the purpose of an other series already >> sent, but is no dependencies between the series (for building or at >> runtime). >> >> Thanks, >> >> Gregory >> >> Gregory CLEMENT (6): >> dt-bindings: marvell: Add documentation for the North Bridge PM on >> Armada 37xx >> cpufreq: ARM: sort the Kconfig menu >> cpufreq: sort the drivers in ARM part >> MAINTAINERS: add new entries for Armada 37xx cpufreq driver >> cpufreq: Add DVFS support for Armada 37xx >> arm64: dts: marvell: armada-37xx: add nodes allowing cpufreq support >> >> .../bindings/arm/marvell/armada-37xx.txt | 19 ++ >> MAINTAINERS | 1 + >> arch/arm64/boot/dts/marvell/armada-372x.dtsi | 1 + >> arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 7 + >> drivers/cpufreq/Kconfig.arm | 89 ++++---- >> drivers/cpufreq/Makefile | 9 +- >> drivers/cpufreq/armada-37xx-cpufreq.c | 241 +++++++++++++++++++++ >> 7 files changed, 322 insertions(+), 45 deletions(-) >> create mode 100644 drivers/cpufreq/armada-37xx-cpufreq.c >> > Tested-by: Andre Heider --- a/drivers/cpufreq/armada-37xx-cpufreq.c +++ b/drivers/cpufreq/armada-37xx-cpufreq.c @@ -219,7 +219,8 @@ static int __init armada37xx_cpufreq_driver_init(void) */ for (load_level = ARMADA_37XX_DVFS_LOAD_0; load_level < LOAD_LEVEL_NR; load_level++) { - unsigned long freq = dvfs->divider[load_level]; + unsigned long freq = cur_frequency / + dvfs->divider[load_level]; ret = dev_pm_opp_add(cpu_dev, freq, 0); if (ret)