From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41A50C6FA82 for ; Wed, 21 Sep 2022 07:14:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbiIUHOI (ORCPT ); Wed, 21 Sep 2022 03:14:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbiIUHOG (ORCPT ); Wed, 21 Sep 2022 03:14:06 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF17276966 for ; Wed, 21 Sep 2022 00:14:03 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id n15so1384902wrq.5 for ; Wed, 21 Sep 2022 00:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date; bh=b3R9DZoCrYArCpmU71BmWGHj2dQq4IcyzDjXj86ttQs=; b=wrleY46bAvW9orcPdmhsGXsqIOZo6+mJ/aKl/qobRPfSARZkDXHDIXKaDWEJgSh1BF gjsbQU3f6mA7OZXAGqWtJ2jkHfyYGj9+pFPa5154c+wSrXeDe3h4OiRUwwXK9L0XtTvh GioFbERE3aUbAlm1ElAXoYAPzF77rSiS+RzxHyREkrpFBOqjOLim+QHj7pTnK/oRAs6k gUKdfJb1sbqFydZrZ7uQA3HqhV25QkUBd0yQGVPnrQ1lie7yDKaQwn8RDcxBOkLKuvef CDdYGCTsYbLO/4boTiaWto7J6H06j6+Kasj2nSeNdAQUouPhPcOjjQCOVmAB0oTe8A1P XBWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=b3R9DZoCrYArCpmU71BmWGHj2dQq4IcyzDjXj86ttQs=; b=R4w5ZoAahbZDHHj3OHZTnskfiC4H77qRsCAz9u74tjvwRPOHxvIMuJHXJK3ef/ka6Z JJp5KNZBlCyiPCJddQMfEldiC6TovQKEDubUNhZrAvhiJlaw6Olm0Ksk4gAU3rmjHWI6 E6ZQeLV30nxq+ADeSmCJcpz5gCyW2gKKySWjxxHEH6rErq6Y10pBbbi98MNQTAzX10ab 0clrj8xemXuKYk9KA9SpVy8r1RfTTtGtR/oWa7eT7Xy7c+vgJaDcnXY3gfG+xgwzmkMG vICwGUN+M3SlSZZU2SlLG5iCac1jMIRmpneUom/CRPU9xqmjehDbDKXcakOYXoJxt9za Lxtw== X-Gm-Message-State: ACrzQf3YwOdXYfCWWGfTyldE8gO39XD+Ajh73h0SlhL02qxOscg2YUzu j63XKDTYIONO+mGVEgdpc74Jpw== X-Google-Smtp-Source: AMsMyM7zmNVSeMitft5m1bCKwdxJeXe8VrB5miovFwS9K97uh3EJKfGQh5sjBYY25eWcRqfGh4opKA== X-Received: by 2002:a5d:47a4:0:b0:226:e547:b602 with SMTP id 4-20020a5d47a4000000b00226e547b602mr16834338wrb.406.1663744441866; Wed, 21 Sep 2022 00:14:01 -0700 (PDT) Received: from ?IPV6:2a01:e0a:982:cbb0:8ce3:ff4e:ae9b:55f3? ([2a01:e0a:982:cbb0:8ce3:ff4e:ae9b:55f3]) by smtp.gmail.com with ESMTPSA id q63-20020a1c4342000000b003b4bd18a23bsm1866139wma.12.2022.09.21.00.14.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Sep 2022 00:14:01 -0700 (PDT) Message-ID: <18097f21-0c19-926a-2242-0aed1fb229b5@linaro.org> Date: Wed, 21 Sep 2022 09:14:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] cpufreq: qcom-cpufreq-hw: Fix uninitialized throttled_freq warning Content-Language: en-US To: Viresh Kumar , "Rafael J. Wysocki" , Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , Vladimir Zapolskiy Cc: linux-pm@vger.kernel.org, Vincent Guittot , "v5 . 18+" , kernel test robot , Dan Carpenter , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <8342b10a2716ec267ab89ea827f851b78b68470a.1663744088.git.viresh.kumar@linaro.org> From: Neil Armstrong Organization: Linaro In-Reply-To: <8342b10a2716ec267ab89ea827f851b78b68470a.1663744088.git.viresh.kumar@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 21/09/2022 09:10, Viresh Kumar wrote: > 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 > Signed-off-by: Viresh Kumar > --- > drivers/cpufreq/qcom-cpufreq-hw.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c > index d5ef3c66c762..bb32659820ce 100644 > --- 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 qcom_cpufreq_data *data) > 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 Reviewed-by: Neil Armstrong