Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2150807iof; Tue, 7 Jun 2022 21:27:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrixmWeDcoS9JN8EMhJG6qj/voEBaUz1szHiicbtnXaAIncwAii/enKQ6DJQc2RiITBB+Z X-Received: by 2002:a05:6a00:e8e:b0:4fa:a52f:59cf with SMTP id bo14-20020a056a000e8e00b004faa52f59cfmr32578898pfb.84.1654662422062; Tue, 07 Jun 2022 21:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654662422; cv=none; d=google.com; s=arc-20160816; b=mYtHru7wIHOLKD9wA20qhyjrZFd5bzYnF2ceN1U9DClJxYBBep2T/lJ82VisoA9zPk hOr+zBhi09ryjnRdDa5IAEy6uLMa81bes7bA2R27XFUC1Z/7SnbxVjfYkn76VAL/DMjy EDv/g0en8gkLKxlq6YV7oceme+flFjd1NS8KY54nFUWcYmWNg4NaVUZJLNI8b64fR8Zu yDpgls7Gv8cVgEJz4tqWx9Q968oqyXE+VH7yebKjFYOZTJL8q/aMbtyBghx4uWI+Cpjp nn1OCw9Lh2L4sSSXMM8/OQl8cqtgEEwq2c0CJbcq8wE6csrGXHN1xwYqju2/QjX6zrdH y2uQ== 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=FIhUXN5uahAESlxr7WtyABuR7DgatHlgpTjzm1GnwNU=; b=DCib4CNjtXBT02CNEousnM/2td65j1sGqNCTwgHPybmAFLBAhdheX5unNrwns+E1rW VFifN4cKMVvYTIWfEYaR7adKlM9MzbncbPnaTIOU8vCRLFylSVihNoJYUJXNXQMJvF7V JsnXinvsUzu5S+9jPhKuEtRBoWozvgGqcUyl/25vhs5YYCeYCeNeOSeLpS7Lf+/eCqBB Jq4iJo76SsH8Y/oUNTu0EshGZuQBMMghVPhHFfNZt72SjHbHEzs2yi8HWX5LgndZOHNQ OWE3l6AjuNwmOZkeREe0kTQPMkh5h35CfHr+392XOSBXSkW33NSr81hH2blt2KK5DqD+ AGHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wAxcXZzh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r20-20020a6560d4000000b003fc919766c2si15075019pgv.746.2022.06.07.21.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:27:02 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wAxcXZzh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1DAFA2346BE; Tue, 7 Jun 2022 20:56:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347873AbiFGRoh (ORCPT + 99 others); Tue, 7 Jun 2022 13:44:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348064AbiFGRbb (ORCPT ); Tue, 7 Jun 2022 13:31:31 -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 EF4E811E1F7; Tue, 7 Jun 2022 10:29:10 -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 8B6B060BC6; Tue, 7 Jun 2022 17:29:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94588C385A5; Tue, 7 Jun 2022 17:29:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622950; bh=Wx7YnWuj9keFIOHhuf82Tmvlop58HW39xxMEACIdscQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wAxcXZzhOahAvRrl0xlJLeh8Fnmq9/UVluyj7gTNTF1VCLQyVlgnh4A7YUniSwRpX QjKJ25fnhol2FbFd2LMDnz1zOtX2XCAK3C257RcBvs41h5LS9rT6Su2UDSVsjhzYCK MwacsEaqBCxUgP34Ex6Vvt+Xm2cAeysMo/yZMciU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Wahren , Florian Fainelli , Daniel Lezcano , Sasha Levin Subject: [PATCH 5.10 239/452] thermal/drivers/bcm2711: Dont clamp temperature at zero Date: Tue, 7 Jun 2022 19:01:36 +0200 Message-Id: <20220607164915.681928564@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Stefan Wahren [ Upstream commit 106e0121e243de4da7d634338089a68a8da2abe9 ] The thermal sensor on BCM2711 is capable of negative temperatures, so don't clamp the measurements at zero. Since this was the only use for variable t, drop it. This change based on a patch by Dom Cobley, who also tested the fix. Fixes: 59b781352dc4 ("thermal: Add BCM2711 thermal driver") Signed-off-by: Stefan Wahren Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220412195423.104511-1-stefan.wahren@i2se.com Signed-off-by: Daniel Lezcano Signed-off-by: Sasha Levin --- drivers/thermal/broadcom/bcm2711_thermal.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/thermal/broadcom/bcm2711_thermal.c b/drivers/thermal/broadcom/bcm2711_thermal.c index 67c2a737bc9d..7b536c8a59dc 100644 --- a/drivers/thermal/broadcom/bcm2711_thermal.c +++ b/drivers/thermal/broadcom/bcm2711_thermal.c @@ -38,7 +38,6 @@ static int bcm2711_get_temp(void *data, int *temp) int offset = thermal_zone_get_offset(priv->thermal); u32 val; int ret; - long t; ret = regmap_read(priv->regmap, AVS_RO_TEMP_STATUS, &val); if (ret) @@ -50,9 +49,7 @@ static int bcm2711_get_temp(void *data, int *temp) val &= AVS_RO_TEMP_STATUS_DATA_MSK; /* Convert a HW code to a temperature reading (millidegree celsius) */ - t = slope * val + offset; - - *temp = t < 0 ? 0 : t; + *temp = slope * val + offset; return 0; } -- 2.35.1