Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4597815pxj; Wed, 12 May 2021 08:58:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6lUame+MP2sSgZmlBcpbIEphaab+Pw+vK51k1qMHPCfGSqdlC+I9qgrCGhs8hFaWyJXxY X-Received: by 2002:a17:906:604a:: with SMTP id p10mr77768ejj.148.1620835101185; Wed, 12 May 2021 08:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835101; cv=none; d=google.com; s=arc-20160816; b=T5a4nH6ADjKcqtaXuCxIambiBm94F9aciOYd45Ilt07hNoMUOlm/Fv8APL4TTbuxC6 QLfeAnyOSOa3hXYhzmv3QZYgYyymFbH0PuOacC1LXJjHFWWUYirkuTtqoPSpZnD1uBbf WgsXlayzVO8On+HpI5YedXHAZUrZDUI4/ghjx2yyED3h/gEslrpaRbS58Fwm6JjP4N8M UjxB+G5HkuQRaYEWX1/X79AvOxFLLyi9EoTc5qHBv+1HMVEM6GHHyCVFN5K7LTX0O1wC lj8HamVPh0dFDbew4KaeOS7wnu+iuJQxKKvQTYLpf/LQtO+Qt0/7/nHbYxP55TzzSL+e a5Qw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xouSVzwy/Y2M9WbR2wbKeVCl4c5PZNiZgwSNRIzNiVE=; b=Os+5pyBhTtBE5eRY81R6dIVAuLBgCfySVsYmR2niEOn4OE+vMDdPT73C47uo2+FF19 cRc0/YQtoqmN8ZGYLa3hLvHDNTwxKXB5/KxawM1lKbCwFpse2onQzlX01e9M7Q/B0DoH WFh32kmRbmNPBCnFtKK7DhdsI866/psJHQjvUuEG9Kl7P4/C/R43rvjrsR70HNPcjuyz s9s6mIzsjRlf/TrLAGKPvMFt3mhkKjQca2VyiU8qUSRcQu5DsJ1vTQFGiFQPwGmB48Gs ZqV2RAXcVGUUkJnGa+S/hbB1iIrRqD+dDfWgkJkctNohd/vN/wUttx6Dn6l+fNOCG4ow YH2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RxE4zeDK; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b10si303105ejz.608.2021.05.12.08.57.56; Wed, 12 May 2021 08:58:21 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RxE4zeDK; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237788AbhELP4W (ORCPT + 99 others); Wed, 12 May 2021 11:56:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:40396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235261AbhELP1S (ORCPT ); Wed, 12 May 2021 11:27:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A703061A2B; Wed, 12 May 2021 15:12:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832327; bh=uuW8gzK8zFcZuLfuvqIcczsoh4vWIEeC6LDJEvqkMfc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RxE4zeDKp2hpWTjPeWzQi4GIz5AjZ+nE9XGg2aSON+y1N50rIPdPTXzWsbKmEQ4Ix KiSbKuDl+S6iJAQVdalMT7ughXA0yL3oaeO4aH1Vbvl+ynsTRcmG1Z7xGpN6JmaJZV p/n0/npLbNxhzE9Ftxi6eLfcgn0sgBVAd7ZISzik= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , Gregory CLEMENT , Tomasz Maciej Nowak , Anders Trier Olesen , Philip Soares , Viresh Kumar , Sasha Levin Subject: [PATCH 5.10 235/530] cpufreq: armada-37xx: Fix driver cleanup when registration failed Date: Wed, 12 May 2021 16:45:45 +0200 Message-Id: <20210512144827.567257155@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Pali Rohár [ Upstream commit 92963903a8e11b9576eb7249f8e81eefa93b6f96 ] 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") Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- 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 @@ disable_dvfs: 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.30.2