From patchwork Wed Oct 19 08:23:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4571 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp205009wrs; Wed, 19 Oct 2022 01:48:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM73d+iMhtl/ZXisWBieBu7Brx5MOdyzfcgUx1f/S/NiZm9Or0tIGN45S4+oUc4ydHHjaL89 X-Received: by 2002:a17:90b:1f86:b0:205:d3d0:1931 with SMTP id so6-20020a17090b1f8600b00205d3d01931mr8570242pjb.211.1666169288056; Wed, 19 Oct 2022 01:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666169288; cv=none; d=google.com; s=arc-20160816; b=PAmt2Vgya6usvto3wYaJXu22U3Zwk4nVLkQg+ol57eazOTqVZdTH4u44r/OGjMbEDS /jtMMgU8e9ZOt/30HeKoxX3D5TZ+GwX/KZLG59XX52aHVFZjk1ALKHMvrYxH7uIyFkkB Ai6FjFyeWx7bZz4RWRs3hg3mFR8KX6PC+Qzvwjfht0sev4QAFfcCqymBfkl67qQ05T2t QpxNZViHZZ8L68rUoSHXBKRtXlIGg2Q6uleo9bNHZJTY8yx/c/8DoAPKofTHyr2/PRYP YJqqyO7fF1FO0+wUwX8IHGHAYVgs4FuAai51OuScuzb4xJOx0Igi7p7VX/3Y2XZTYmNZ HJTQ== 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=OZGnzfHsDALCPUTT/zT8M1F4hurlkfVYtnSLk6ncnGI=; b=gxCYJHsG1ztz7DBd9TO0vEpE0I8vaIimo1j7KByXltnNOlMD1l0ET48EoWdm0LQGzz V9lmSgYkThSDIt8RT25dE40VIkNWHm53m+K4Q2D/H3RBGVtN8RcErur3Zsn9+yvGEomA Ip1P58X0+SuDINQ3Um8WbhFP3VJB6mCXdiw5UtDpRapctyMIKvbzpUGMzlmfT6MxacwW ZiTWluJSIjGkDNzTMqkiFTViXJL1pnacT5tJ/gpnea9unkWVUAXlH3jwLgA4lox4IQbz LrsKbN392mrkVIlZiKBjbUCeDBSnvr55lhq8de+d/8sHaI6z/Qc/OXBJ79NcvMrYuCTM B6HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aiZEOP6l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h132-20020a636c8a000000b0045ceb2c2eb7si14801035pgc.760.2022.10.19.01.47.55; Wed, 19 Oct 2022 01:48:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aiZEOP6l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229920AbiJSIrV (ORCPT + 99 others); Wed, 19 Oct 2022 04:47:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231165AbiJSIqk (ORCPT ); Wed, 19 Oct 2022 04:46:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2DEC22288; Wed, 19 Oct 2022 01:44:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 83225617FF; Wed, 19 Oct 2022 08:42:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93C3CC433D6; Wed, 19 Oct 2022 08:42:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666168926; bh=VlsoAZyMNoWaMW908pM9s6G3OfDrD2WYDrbzgNPWB8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aiZEOP6lyouuZp3Iei/Y8cwMnmlpFKN5Xf7OEyIm1zfz7FeB6nMAAvJ83qC3vjnl/ aKkgxsfmI8og6G8jpdvdM26g7e+ebT5VkLyHuloBSJn3h6glyEy/GnlS932dsQqqMe 85SMvueYiRDYUS0DmaE6j+UKZKdU5kTIiEDURvYI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Dan Carpenter , Neil Armstrong , Viresh Kumar Subject: [PATCH 6.0 099/862] cpufreq: qcom-cpufreq-hw: Fix uninitialized throttled_freq warning Date: Wed, 19 Oct 2022 10:23:06 +0200 Message-Id: <20221019083254.293177390@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747105127448704612?= X-GMAIL-MSGID: =?utf-8?q?1747105127448704612?= From: Viresh Kumar commit 91dc90fdb8b8199519a3aac9c46a433b02223c5b upstream. Commit 6240aaad75e1 was supposed to drop the reference count to the OPP, instead it avoided more stuff if the OPP isn't found. This isn't entirely correct. We already have a frequency value available, we just couldn't align it with an OPP in case of IS_ERR(opp). Lets continue with updating thermal pressure, etc, even if we aren't able to find an OPP here. This fixes warning generated by the 'smatch' tool. Fixes: 6240aaad75e1 ("cpufreq: qcom-hw: fix the opp entries refcounting") Cc: v5.18+ # v5.18+ Reported-by: kernel test robot Reported-by: Dan Carpenter Reviewed-by: Neil Armstrong Signed-off-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/cpufreq/qcom-cpufreq-hw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -316,14 +316,14 @@ static void qcom_lmh_dcvs_notify(struct if (IS_ERR(opp)) { dev_warn(dev, "Can't find the OPP for throttling: %pe!\n", opp); } else { - throttled_freq = freq_hz / HZ_PER_KHZ; - - /* Update thermal pressure (the boost frequencies are accepted) */ - arch_update_thermal_pressure(policy->related_cpus, throttled_freq); - dev_pm_opp_put(opp); } + throttled_freq = freq_hz / HZ_PER_KHZ; + + /* Update thermal pressure (the boost frequencies are accepted) */ + arch_update_thermal_pressure(policy->related_cpus, throttled_freq); + /* * In the unlikely case policy is unregistered do not enable * polling or h/w interrupt