From patchwork Thu Apr 8 11:42:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12190771 X-Patchwork-Delegate: viresh.linux@gmail.com 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,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 54470C43460 for ; Thu, 8 Apr 2021 11:43:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2955D6113D for ; Thu, 8 Apr 2021 11:43:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229964AbhDHLnT (ORCPT ); Thu, 8 Apr 2021 07:43:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:39686 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230412AbhDHLnS (ORCPT ); Thu, 8 Apr 2021 07:43:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7059A61154; Thu, 8 Apr 2021 11:43:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617882187; bh=UbGXmoXHD1iCUNpX0pqSPxyqGd46kDsL5oYWgRsgpI8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FOkhcSsYqiSFcIN/pHMuHKNgqyBsaadv0iCWKY+b0C2ZomShhnMRAYYCS8r3dSzia mqeSuT2j7RvBjUpZ//4P/+D5gdzx9C+3EAx/UTWgriBmZMkGuybpIjYxfOgL2DbLUY 5F6lVQPg5bob4YsB2ZyV81hOS/rieEhlYKZ9AL0AAsdPOzHKENFlRBeN5rrVgZKryD 12e3DsL8kONgBRfLh6dBK4GQEdwRrJjiiIEGxx8AU3DKo/rGXFnEkGcRXzOv3uuVlZ 20CbYK7v8j3OnOSCYYUsz1Y+BzkyyeYBiNqT4UNW+9Eis9y7UjOH2EdhKlmfoRADBR jm1atsfksVsvg== Received: by pali.im (Postfix) id BC657EDE; Thu, 8 Apr 2021 13:43:05 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: linux-pm@vger.kernel.org, Viresh Kumar Subject: [RESEND PATCH mvebu v3 07/10] cpufreq: armada-37xx: Fix driver cleanup when registration failed Date: Thu, 8 Apr 2021 13:42:20 +0200 Message-Id: <20210408114223.8471-7-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210408114223.8471-1-pali@kernel.org> References: <20210408114223.8471-1-pali@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 Acked-by: Gregory CLEMENT 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); }