Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp233405pxb; Thu, 14 Jan 2021 04:44:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvXl7lyQPsrqtUMEIouHKOEbKssYOcEgMqdTcrHFPHCgId6nBtnJU+1iOY493pBqxjNLiV X-Received: by 2002:a17:906:90d6:: with SMTP id v22mr5088379ejw.88.1610628258733; Thu, 14 Jan 2021 04:44:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610628258; cv=none; d=google.com; s=arc-20160816; b=DnIUvXK86iez41JJjZLqxfwdLpL0Fy+rcWjRPahlZi6DnLJTpQ1ogx7I5tY6XNgzZC +2py9OdHBaQj1cU5RFQa6M+0yPIW1DmPXU3gNncbC1mKaus+LImHLygyzcZszB2ddiaJ M/oQAHr3H7x2pBDnWjlrWpccTxnhBIrRkErk7CWv865JEDMTPD7U1MQq373cs9mGS+6y ixhdQksho36Ddhuc46JVgnKAaM+YAlqILMqpJQMLk14VUyuIydatokrikttNwD1g8N83 JVV6QvUwrsJ4GvVEztMK4OoqDstvtQoQ4siuWSWG8/JTyGb1+OxruODp4IBEonBVJEdK X8Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Hzb49/y2iEY95xG0AcecyAyc1bo41l8v0GTgYMnLwn4=; b=uMj3tKl+0QhthVy0M9NZJ6WN3kEwRHR4WZw3Mh9rBY6aPye+O3lsdm4JW6scugJhdx AJw8BiDQBTn7vKQyGzCePt1DDTCJP/dfNQiZnKl1eP+xuaFwM+wvmvumy4mCHEt7gtZp SLLQGX7tSsgYJw0BQRW2nld6YgGFz1W5mZ2m0D+iaAkiWEcfne0u9gl+0FP4hdqVX25+ RM9wwcQPmrZhoUplCHMOc722QEHJGbcXQeH6WvMLJnJEK0yFbfEzmasu7ahrIvpVJQkm C9Y1mk69nyc0s+tf8Pqvswfhp0CdcFGupEwB5rMPHmLnPhu59LtJAFu+MtI8SCa/Kmwa 27bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=orgFjgQL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a8si2658436ejx.247.2021.01.14.04.43.53; Thu, 14 Jan 2021 04:44:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=k20201202 header.b=orgFjgQL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727883AbhANMld (ORCPT + 99 others); Thu, 14 Jan 2021 07:41:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:58966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726740AbhANMld (ORCPT ); Thu, 14 Jan 2021 07:41:33 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2C8F623A53; Thu, 14 Jan 2021 12:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610628052; bh=OxL9TuHjbQbPuPcAueI8mkcZ4/hHYeRATV5+Snzg2sg=; h=From:To:Cc:Subject:Date:From; b=orgFjgQL/Kn0lbejYzUJ0LUwxm1/SMaYz2krykGO0uxLsaSmgJPJgwWiezS7Mpz+V gTD97L8ou/pJL+BcGSYjUiWNUpcp51hfx3/icX5GaP3MHEobVyM1/duQeYPIJ1aj0f NzBZvUwh13mqZrz/CzyVdUYJH2McU8lzNNed9LEnk7v4bdw9VlsAy0hggA73/FV4UC kmyHd3/UQ5d7DSUU2fYvobCg9rUU+qeF1knJMVEE5/v67q7s44wOtZsOSRxsCG9HSb 6Ll1DKQYiGKr0hl7vRpd090BPAAkviVUKz7sw4KRSrsQhdn+q4/gQ/borKL6/FL5WN 3yIHNDxiC5jzw== Received: by pali.im (Postfix) id 9D0CF621; Thu, 14 Jan 2021 13:40:49 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Gregory Clement , Andrew Lunn , Michael Turquette , Stephen Boyd , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Cc: =?UTF-8?q?Marek=20Beh=C3=BAn?= , "Miquel Raynal" , "Tomasz Maciej Nowak" , "Luka Perkov" , "Andre Heider" , "Vladimir Vid" , "Russell King" , =?UTF-8?q?G=C3=A9rald=20Kerma?= , "Konstantin Porotchkin" Subject: [PATCH mvebu v2 00/10] Armada 37xx: Fix cpufreq changing base CPU speed to 800 MHz from 1000 MHz Date: Thu, 14 Jan 2021 13:40:22 +0100 Message-Id: <20210114124032.12765-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! The armada-37xx-cpufreq driver changes base CPU speed from 1000 MHz to 800 MHz on EspressoBIN and Turris MOX. The commit message in patch 2/10 explains why and how can this be discovered. That patch 2/10 led us to discover another bug, in the SOC itself, that causes the CPU to behave weirdly when frequency changes to 1 GHz. A similar erratum is documented by Marvell but only for systems where base frequency is 1.2 GHz. We've discovered that to make cpufreq scaling stable on Armada 3720 systems with base frequency 1 GHz, we also have to set voltage levels for L0 and L1 loads to at least 1108 mV. We were led to this by patch we found in Marvell kernel fork. Fix is in the patch 4/10. https://github.com/MarvellEmbeddedProcessors/linux-marvell/commit/dc33b62c90696afb6adc7dbcc4ebbd48bedec269 During fixing this voltage issue for 1 GHz we discovered another bug in armada-37xx-cpufreq driver that causes CPU instability. Erratum for VDD stabilization was improperly implemented, details are in patch 6/10. This patch series is also available in my git tree in branch a3720-cpufreq-issues: https://git.kernel.org/pub/scm/linux/kernel/git/pali/linux.git/log/?h=a3720-cpufreq-issues We have tested this patch series on Espressobin v5 and Turris MOX boards. If you have other Armada 3720 boards (Espressobin v5/v7, uDPU, Devel Board, ...) then it will be nice to do an additional tests and check if instability issues are finally fixed. There is a discussion on armbian forum that Espressobin v7 is unstable when running at 1 GHz and in this thread was also mentioned above voltage patch from Marvell kernel fork: https://forum.armbian.com/topic/10429-how-to-make-espressobin-v7-stable/ Marek & Pali Marek Behún (3): arm64: dts: marvell: armada-37xx: add syscon compatible to NB clk node cpufreq: armada-37xx: Fix setting TBG parent for load levels clk: mvebu: armada-37xx-periph: remove .set_parent method for CPU PM clock Pali Rohár (7): cpufreq: armada-37xx: Fix the AVS value for loads L0 and L1 clk: mvebu: armada-37xx-periph: Fix switching CPU freq from 250 Mhz to 1 GHz clk: mvebu: armada-37xx-periph: Fix workaround for switching from L1 to L0 cpufreq: armada-37xx: Fix driver cleanup when registration failed cpufreq: armada-37xx: Fix determining base CPU frequency cpufreq: armada-37xx: Remove cur_frequency variable cpufreq: armada-37xx: Fix module unloading arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 3 +- drivers/clk/mvebu/armada-37xx-periph.c | 83 ++++++++------- drivers/cpufreq/armada-37xx-cpufreq.c | 100 ++++++++++++++----- 3 files changed, 124 insertions(+), 62 deletions(-) -- 2.20.1