Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2204502iof; Tue, 7 Jun 2022 23:08:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMtpqfv77tXxg8lneJjQYOiR5UMFPoGkgj0TRRYwHtBq+A5B53ELaR0X3p8U7YdlpImsPS X-Received: by 2002:a17:902:e552:b0:163:6a5e:4e08 with SMTP id n18-20020a170902e55200b001636a5e4e08mr32198956plf.130.1654668503531; Tue, 07 Jun 2022 23:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668503; cv=none; d=google.com; s=arc-20160816; b=Uky2UvpR4rRymmcl19vFPmJNmdgPFh1UoEYVIdkvPb0M0l8vv8oY5BgG5YUfs7KCT9 I8Cf1ZWHN6eoaOnXMdS6ObDTkbI+EPMCqHJ9fnOktcLjQW0THCxDzf5xMfcQWNbEXiXL l9D3Yy2R6G4Qm4MrtYB5O0Ug9XqgkDEHCFdgj2eaLbTfy0lLaKagLbUO3ApvYDTeKkJF IWpZt3DGNBmt9i1ME0iMLX/xhyGOh8Ff+yKgYz/VER5eZynvEruayHNIlFSmKR4kZndG hCIM1gmADHn7cbE3NweiDLckrGFEGOA5JhCqoP9bkasQvqTbcT83sW1qo2Uao5kfiEzp BWag== 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=oEgodNW0AebUKXwlKSstMPTjqWTdCbkuX29ZNWcCke4=; b=LpERLavLzWpZp0pbv3sQsH97G9/eUnIknE9H/qApdBPKo1CWC0vz1kA9qWFELyFvtn P/QCFI/3Cu/aXs29moshqsJaUsHtJl8zkZu6Uk8wU5HHSRVNK/vd5WQKU/dup0Uh8LcK N9lBTfOnMeLtzLbo3qZqL2xFk/2eg3mZbNx0JA6LrT0J/rYR6jOiagLWPNTlaYv2qUpc bmS7xB2qvuZ28Gd/ZdHN9R9uM1WwAjoW2vsQr0MBkYNN0F8Q40IMy0YNIeF5VTyzHLF0 A74ph2lVq1K3lGqhXFUEb4QDVVozlNvxqp3dyRMIH+v9ejk/uTrl1IRxSfNMIyquSg1y W0Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=caDUBd4x; 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 l2-20020a17090270c200b00164027788e8si26241119plt.254.2022.06.07.23.08.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:08:23 -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=caDUBd4x; 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 9F01F1C2070; Tue, 7 Jun 2022 22:31:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232340AbiFHBaV (ORCPT + 99 others); Tue, 7 Jun 2022 21:30:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380635AbiFGVrr (ORCPT ); Tue, 7 Jun 2022 17:47:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 792C11900E5; Tue, 7 Jun 2022 12:08:09 -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 B418D61768; Tue, 7 Jun 2022 19:08:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFFA0C385A2; Tue, 7 Jun 2022 19:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628888; bh=InK2P2719+ucxNiXUq5akHXves7w4RjNdOe6zfMyDME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=caDUBd4xVwOT2DeimpyvL9ri4My1VfIbzB7qZo4fk8a/nr+TrJg+9mq/13YOQTqdb iIdIs3zTdtHN3Nsy8udAsnruWAxBPWIbhr4DScElhuvAFofF/tpGlNyIeTFjZIC1xc ZIl9jEr/7FtAvT09WrhnWvuG+shoebEk8C2DFEzg= 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.18 491/879] thermal/drivers/bcm2711: Dont clamp temperature at zero Date: Tue, 7 Jun 2022 19:00:09 +0200 Message-Id: <20220607165017.123408598@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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 1ec57d9ecf53..e9bef5c3414b 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