From patchwork Wed Jun 30 22:56:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12352893 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=-22.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 B01C8C11F66 for ; Wed, 30 Jun 2021 22:57:37 +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 6EED4613D1 for ; Wed, 30 Jun 2021 22:57:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6EED4613D1 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GnJWf+MGkGRGzs3LLX560Rsxbtd4+M3UcEB3liw7rjE=; b=GEoSuslrrr92tW pCroKBeROlVQxyGYyjOc1q/R83qymNOckQ+e1GZ+zR1tILxuEL7BGH45RcKrNUMV2e+YGdEiB4WcR T+J3Yfj0elCyQB1wnfjCdpnDWsuDxoSpJcluT70L8Vjn0P36z8anbYOa+9DeumfM+kfQNtoUR786x 3R3bwjqpBCVca03+OR5tVx2l6AS5vbgCET8XsjFwMlk/SYD1Iu17pJWGps6V7ng0OYapz/QbYoXnL hABlGfKoWu9SliG/QxihfpDAlbbR6i8k1YwHLh9ffHiuFl9M2b3HmtolZKY3L6imk+aFq+0t2SR3R fBqf+jy9n2VzRgsHnXXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyj7r-00FSTE-Ow; Wed, 30 Jun 2021 22:56:11 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyj7n-00FSSl-Te for linux-arm-kernel@lists.infradead.org; Wed, 30 Jun 2021 22:56:09 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id D3F54613D1; Wed, 30 Jun 2021 22:56:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625093767; bh=1XbpMrAHLknLLoDhzLADpsI4YXpwMU7vvfhNLq5DXh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gg1GriXGY/N+rrmX/YSR1NIBzGTRhex6grbfuCbGsS6L6q2SqsXM358PqRyWjLxZ5 BflxoiOroAxRzWQKMbH2C+RkkuTWE3nwdn5WYL/Cz4g6Dz+qmzC/TJ17plQq3iqTM+ 87fQuZOABInlaf0b4jUMep1lOaAv0YzKr4U58J24rScMqI8vUcoZVuQdrz0wMddd3+ bwEeXbhY4NHPISSA8PxEOmlzK5k4/tNzWHijTkB7OgBmzoI9uDu5Wu3hbdtVmGn9PK W1jV216OcTVSPfxfv0is6LuaWRd1I24Wr8Wuok/c9n5S+InXTOqY8MWinIrsB4FqlM MkyTrTnahYjKw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Viresh Kumar , Gregory CLEMENT , Ken Ma , Victor Gu Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , Tomasz Maciej Nowak , Anders Trier Olesen , Philip Soares , linux-pm@vger.kernel.org, Sebastian Hesselbarth , linux-arm-kernel@lists.infradead.org, Konstantin Porotchkin , nnet , Nadav Haklai , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH v2] cpufreq: armada-37xx: forbid cpufreq for 1.2 GHz variant Date: Thu, 1 Jul 2021 00:56:01 +0200 Message-Id: <20210630225601.6372-1-kabel@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210630135942.29730-1-kabel@kernel.org> References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210630_155608_034911_64783C41 X-CRM114-Status: GOOD ( 18.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The 1.2 GHz variant of the Armada 3720 SOC is unstable with DVFS: when the SOC boots, the WTMI firmware sets clocks and AVS values that work correctly with 1.2 GHz CPU frequency, but random crashes occur once cpufreq driver starts scaling. We do not know currently what is the reason: - it may be that the voltage value for L0 for 1.2 GHz variant provided by the vendor in the OTP is simply incorrect when scaling is used, - it may be that some delay is needed somewhere, - it may be something else. The most sane solution now seems to be to simply forbid the cpufreq driver on 1.2 GHz variant. Signed-off-by: Marek BehĂșn Fixes: 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx") --- If someone from Marvell could look into this, it would be great since basically 1.2 GHz variant cannot scale, which is a feature that was claimed to be supported by the SOC. Ken Ma / Victor Gu, you have worked on commit https://github.com/MarvellEmbeddedProcessors/linux-marvell/commit/d6719fdc2b3cac58064f41b531f86993c919aa9a in linux-marvell. Your patch takes away the 1202 mV constant for 1.2 GHz base CPU frequency and instead adds code that computes the voltages from the voltage found in L0 AVS register (which is filled in by WTMI firmware). Do you know why the code does not work correctly for some 1.2 GHz boards? Do we need to force the L0 voltage to 1202 mV if it is lower, or something? --- drivers/cpufreq/armada-37xx-cpufreq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/armada-37xx-cpufreq.c b/drivers/cpufreq/armada-37xx-cpufreq.c index 3fc98a3ffd91..c10fc33b29b1 100644 --- a/drivers/cpufreq/armada-37xx-cpufreq.c +++ b/drivers/cpufreq/armada-37xx-cpufreq.c @@ -104,7 +104,11 @@ struct armada_37xx_dvfs { }; static struct armada_37xx_dvfs armada_37xx_dvfs[] = { - {.cpu_freq_max = 1200*1000*1000, .divider = {1, 2, 4, 6} }, + /* + * The cpufreq scaling for 1.2 GHz variant of the SOC is currently + * unstable because we do not know how to configure it properly. + */ + /* {.cpu_freq_max = 1200*1000*1000, .divider = {1, 2, 4, 6} }, */ {.cpu_freq_max = 1000*1000*1000, .divider = {1, 2, 4, 5} }, {.cpu_freq_max = 800*1000*1000, .divider = {1, 2, 3, 4} }, {.cpu_freq_max = 600*1000*1000, .divider = {2, 4, 5, 6} },