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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,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 C8F53C433E4 for ; Mon, 29 Mar 2021 14:58:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9EF5C61968 for ; Mon, 29 Mar 2021 14:58:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230298AbhC2O63 convert rfc822-to-8bit (ORCPT ); Mon, 29 Mar 2021 10:58:29 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:56671 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230374AbhC2O6S (ORCPT ); Mon, 29 Mar 2021 10:58:18 -0400 Received: from localhost (91-175-115-186.subs.proxad.net [91.175.115.186]) (Authenticated sender: gregory.clement@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 4E187100008; Mon, 29 Mar 2021 14:58:12 +0000 (UTC) From: Gregory CLEMENT To: Pali =?utf-8?Q?Roh=C3=A1r?= , Andrew Lunn , Michael Turquette , Stephen Boyd , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Cc: Marek =?utf-8?Q?Beh=C3=BAn?= , Miquel Raynal , Tomasz Maciej Nowak , Luka Perkov , Andre Heider , Vladimir Vid , Russell King , =?utf-8?Q?G=C3=A9rald?= Kerma , Konstantin Porotchkin Subject: Re: [PATCH mvebu v3 07/10] cpufreq: armada-37xx: Fix driver cleanup when registration failed In-Reply-To: <20210222194158.12342-8-pali@kernel.org> References: <20210114124032.12765-1-pali@kernel.org> <20210222194158.12342-1-pali@kernel.org> <20210222194158.12342-8-pali@kernel.org> Date: Mon, 29 Mar 2021 16:58:11 +0200 Message-ID: <87sg4edn24.fsf@BL-laptop> 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 Pali Rohár writes: > 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 Acked-by: Gregory CLEMENT Thanks, Gregory > --- > 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 > -- Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com