Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3653578pxf; Mon, 29 Mar 2021 08:00:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOF4orZUmZ34Bha2PU6Hy6k2xWbomKIEt5vCGki0IJhlAdGFdjCsMCMN2qW+wkkR9lUYo8 X-Received: by 2002:a17:906:cb87:: with SMTP id mf7mr28298526ejb.81.1617030013394; Mon, 29 Mar 2021 08:00:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617030013; cv=none; d=google.com; s=arc-20160816; b=F1A1NHYyONBkEntdg+4WUx+nBjCLPFvA3B8inT8/Vb0cdzWg1F4/2st56yVv+U+JLn 3PqTURigNUmmnxFfoBYInnf0uJN/xMV8n3apQCbgA3MBEimOTQX9s+BwRfO1MWn3WRMu GBR7twZtjOjD21AAYzwhsvrpO4ujnXsTc69Ix1k/5CNTbD9QV45rZgP7Yb8G+OPzvFU8 uUyixY7pdDIbYJ9TnmGTIv5UWsSCHKhnJWz5mkxLzzmYRX/iHeVzwFerux9P5i6qUdE5 SoH1jZbtfdjJ6iX1AZS1G8aNNnHv8liQaGw2XqL40XEXYTQZ+oWNBFGdT7X3saIvIiM0 zRGQ== 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:references:in-reply-to:subject:cc:to:from; bh=J4ixvSvWklsH3BN5guP7YBqR9RsAqITzUfIahdmo1a0=; b=du4SjMIU428DPuefKPEcu/S8VAyEYIT2PIyRQS67XUD298sn1qbFNFZeFtSkG4p+zk bc2NfeWAW61TbgM9KiWLPKOnvQrKYzSLv3JRSjr/8b1pjXPsp4ewhT4AkNLPIqe0xkXm 9j+1PQtMW4atzPjtOuXftkWldNVsif9H/ZC708Bgs7860oCKQePQouU5EYVPimdCAH2P vG2m3v/r0yfpUfjZpEQ6moMP46z7L8eArULpe/hHWn1A5YRohRqbhbgw6g2InMfBplvD fOtshK4q9e1XFdXc30044jdTi9tzpHihDD1R8LkoigWSxNbe7QY8Jz/fxkFOfhshX93B aeHw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e9si12995981ejr.278.2021.03.29.07.59.50; Mon, 29 Mar 2021 08:00:13 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230282AbhC2O62 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 29 Mar 2021 10:58:28 -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