Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp233682pxb; Thu, 14 Jan 2021 04:44:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJ2tSUAjwSc/fRT46ZkCovLpyP/xOsMI3NgkEeJtO6JDtrE4fj/0gnHqdSpRq1QNMyqtAp X-Received: by 2002:a17:906:4d52:: with SMTP id b18mr4811184ejv.405.1610628295472; Thu, 14 Jan 2021 04:44:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610628295; cv=none; d=google.com; s=arc-20160816; b=ZjvglRc0QOVDd0G4nfHVPo+u/yxxZ2TfF+PINzRMbRcmIwx0F7scke9ijNU/de9Tbg PXrFc+RiUqwx3DqG1DTcxiMdVjlyr9ZmEgs7B+HjAtv/rsoawQUZR+xQ8ViTuNic6VZs ApkzKVw5STkxvs3+6mPsdDdrq0IIIYMZfOzgquIiEen6V9+gVqlehMdZRSPYcrLL7aCq RYG1YEAp8BIPVNLWLYVoWQ90/4H83fMevAKO0B0+FEihUmeCKKF26RO5+957EMoeObO9 0Zx09Ws8wkspI4Ic3e5AZIYcR+/Un/FcX5ZbaHcx7Syy4QlFvks9MmDpit3WgyCGWmc9 ZjgA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TjXQcUtwB7SehTm4z0HzB+wu0oODOinPP8D4aeHlNwA=; b=1GKVPU3RhOEXp6ranXS26MaNQuz9NvjKamOKWe8VoHzPdmU5HH+dLHbPiGwBOpOlho ZXTV8xkeKen/60RWRLMHdeieG+oO9ZLtaNp0tPexq10rNN1f1XgVtKtdS4x0hNO3SqrN s2ZqgxLR81cPqJctAqO3wR4SmLQ/1QxdENOQMhR82jDUwaCHSYu5aw2MA+oX7h5orw9J 9eKytJrC1zYxrO9atRJekBxnF+YfFLoDU1vIqjm1d1DceFPpXo2H5OOuNcpuYXoxhtVJ 6Gj+bpgZfK+jt9bydVWCi9cos3wncmBzQr4Yqd+fcSg6Ib58iD06cKaELUSi4cksbyAl vOQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T6GwQgVX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s8si2448037edd.534.2021.01.14.04.44.30; Thu, 14 Jan 2021 04:44:55 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T6GwQgVX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729021AbhANMmU (ORCPT + 99 others); Thu, 14 Jan 2021 07:42:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:59372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbhANMmQ (ORCPT ); Thu, 14 Jan 2021 07:42:16 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E57D223A63; Thu, 14 Jan 2021 12:40:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610628057; bh=p2goXKdP7dSbMv3eBsWpLzg7u1iavJGm+TNYJ0mf8w4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T6GwQgVXVVvQtD0fde83yhXpAaXigCk7PG4YpJpbDM73h8e8MXn8DOMVzOGk+9WkZ ISIL7Z5EPiUvlHtv7c8KgWCTRPdYrLCbqrhWG/EM54cjXTHDnU78gT+QprfDlB7Tas /FuXlxxXAccvgP5uiaZJpebl4BiFvp5RWtV7QvwFgN9KeYf3IRxvG8mh1hGc4rD7rj Aws67Nd7Ed4+aknZHDZOqkBuaLNcC20FWXI7iUuEBntCV+8InUMjdr+Uk6t/ftEMSX EhscJ5FrRykagmGB8rR5tHl3+hhqaQl8EL2TKXnHuAYKMgrXgK/G17lFjdfp0EIyWs zljwXz1T/Cefw== Received: by pali.im (Postfix) id BAD1E847; Thu, 14 Jan 2021 13:40:54 +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 v2 07/10] cpufreq: armada-37xx: Fix driver cleanup when registration failed Date: Thu, 14 Jan 2021 13:40:29 +0100 Message-Id: <20210114124032.12765-8-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210114124032.12765-1-pali@kernel.org> References: <20210114124032.12765-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 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 92e531f700f4..002a71775e08 100644 --- a/drivers/cpufreq/armada-37xx-cpufreq.c +++ b/drivers/cpufreq/armada-37xx-cpufreq.c @@ -510,7 +510,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