From patchwork Sat Oct 22 07:19:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7333 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1094748wrr; Sat, 22 Oct 2022 01:00:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ehGpCwGVOggVkOwUXpWdTxPYalt7qyob0dlehiUQUc2FMFicTv6OIDzSkKB1ig7yFKdmn X-Received: by 2002:a05:6a00:cc4:b0:566:87c:53de with SMTP id b4-20020a056a000cc400b00566087c53demr22906528pfv.19.1666425655278; Sat, 22 Oct 2022 01:00:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425655; cv=none; d=google.com; s=arc-20160816; b=DZmye4zagQJTnTkFjF1O4Dft13fHC2fzRejgPmMbsuSoQZE7sNyAbz3S483rkO7d6f CrHW1joZ5KJlUHq4c77hH2WdhV5XSOAhYrrD79kOrvVNeXvOUA6f2fw8pwWNWNr3I9yg mEcqtowUIMYL+2FHEquxE+xL5mR7zgKpiP6xK1ZPwAE1KPDCdG+fnBez6dkECZVi0IjL Fr+X6WoRUzTzEWW1fC8w38V4304nEgupxuq5tWsozqpmGHywlUGPBMnuLj3x3pkCAXHd 7FwLkl2TJFBANclkCBEaGv7agtmCRi0E/bVRPMUIwRMGO5+mqCsrOGI0DjM/bzOtpgH4 +cTw== 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=PkjOYu1sRZ41cM2ftc84bFIHzzBc7KizG0WnOCs4x7I=; b=FFbA938na6f2XONyySzNJCEEbrByRoJkuK2Ff3WmSdzB93jyo8l+ezyTdfq0vVui6a K9UIEZ5+zKLo2GINeIQ2jukDjaBabj0AiebiqThi90aIZOj3wOt3+3PTwnkR8tkU55oj dYy9FhVGTsJM+6XAceCYrO8KfqPWbvxF35WKAnDG50PYL9DlwItOwOjKzt14Z5CHdoki wirBV9e+NbBimqSgVSmUzXT9vH073CgMKlFlE32cyuiqzH6FF622edEAHt2TGVzAJtPm piJSVkj6ztNzcJ0uLO8+T+4YCD3eazCo/nJwbbEI1rrZubLn72avl5ch9aAPXHH39teR 3DiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LoxpChLb; 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 u10-20020a170903124a00b001780ba83636si34270932plh.612.2022.10.22.01.00.39; Sat, 22 Oct 2022 01:00:55 -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=LoxpChLb; 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 S232418AbiJVH66 (ORCPT + 99 others); Sat, 22 Oct 2022 03:58:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232126AbiJVHyH (ORCPT ); Sat, 22 Oct 2022 03:54:07 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3DB7951C5; Sat, 22 Oct 2022 00:47:22 -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 sin.source.kernel.org (Postfix) with ESMTPS id C78BCCE2C98; Sat, 22 Oct 2022 07:38:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5A78C433C1; Sat, 22 Oct 2022 07:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424286; bh=zhPUD++s41ALFKJlkWcRVcaro7JOAzgATab/HtGbOz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LoxpChLbtaq9P/LtSTQ8SUWX76tJkN3fAcCSRY0RJUlVQbMEfMepBVxP83ZgfESbp lRK+I0OVJ6q/0eHh0SCBOuMlwK/WMzaGuftPwYaCtTpKJPNYn7T4FmL2MI5PRy3FQm pzVWGTC0UU/hxwckCLZ0ZWN2BCwRnyz7OVo6/wHc= 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 5.19 089/717] cpufreq: qcom-cpufreq-hw: Fix uninitialized throttled_freq warning Date: Sat, 22 Oct 2022 09:19:28 +0200 Message-Id: <20221022072431.091471458@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747373947450930499?= X-GMAIL-MSGID: =?utf-8?q?1747373947450930499?= 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 @@ -317,14 +317,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