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=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 B0C45C433E0 for ; Mon, 22 Feb 2021 19:45:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C08064E15 for ; Mon, 22 Feb 2021 19:45:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233354AbhBVTo7 (ORCPT ); Mon, 22 Feb 2021 14:44:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:55064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233269AbhBVTnk (ORCPT ); Mon, 22 Feb 2021 14:43:40 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DA23664E6B; Mon, 22 Feb 2021 19:42:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614022941; bh=oWt7ErhnmfnnXaBPbupsHdZENFTiCLpTVx1ck7Qsfpw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gPMLgU/nLUABrP69uQotuxSpiaaahvz5H9FohqsR0NYr+7/wJ6s+BMEjLXLpU5eB9 E4VDt+V6G9yBgqC96/f0IWcDiHe74FeIV7+0n/lJuS88DhFi+Pa4FsvFlKjNU1Nlm0 U9clGFkod049ji/fmSpp82MYExRWbrnJct9tNtPMb31uQB2gkB6o6k//XksimwDUUI 6UaSPqgp1q2B1lcDMGgqX5MlfR/iCTqRuO1WFwWbQah8YY0KSqClZFfRlWetIdAKIq yNdOua3MKl7bCmCAT+9uqxFrOJK/DrE+0VsKj5MwYUf1FVT1dxCepo1Xn+VmPNK7Hl S0hiPUKZN+bCA== Received: by pali.im (Postfix) id 24DAD1034; Mon, 22 Feb 2021 20:42:18 +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 v3 07/10] cpufreq: armada-37xx: Fix driver cleanup when registration failed Date: Mon, 22 Feb 2021 20:41:55 +0100 Message-Id: <20210222194158.12342-8-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210222194158.12342-1-pali@kernel.org> References: <20210114124032.12765-1-pali@kernel.org> <20210222194158.12342-1-pali@kernel.org> 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 Commit 8db82563451f ("cpufreq: armada-37xx: fix frequency calculation for opp") changed calculation of frequency passed to the dev_pm_opp_add() function call. But the code for dev_pm_opp_remove() function call was not updated, so the driver cleanup phase does not work when registration fails. This fixes the issue by using the same frequency in both calls. Signed-off-by: Pali Rohár Tested-by: Tomasz Maciej Nowak Tested-by: Anders Trier Olesen Tested-by: Philip Soares Fixes: 8db82563451f ("cpufreq: armada-37xx: fix frequency calculation for opp") Cc: stable@vger.kernel.org --- drivers/cpufreq/armada-37xx-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/armada-37xx-cpufreq.c b/drivers/cpufreq/armada-37xx-cpufreq.c index c7683d447b11..1ab2113daef5 100644 --- a/drivers/cpufreq/armada-37xx-cpufreq.c +++ b/drivers/cpufreq/armada-37xx-cpufreq.c @@ -521,7 +521,7 @@ static int __init armada37xx_cpufreq_driver_init(void) remove_opp: /* clean-up the already added opp before leaving */ while (load_lvl-- > ARMADA_37XX_DVFS_LOAD_0) { - freq = cur_frequency / dvfs->divider[load_lvl]; + freq = base_frequency / dvfs->divider[load_lvl]; dev_pm_opp_remove(cpu_dev, freq); } -- 2.20.1