Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2177189iof; Tue, 7 Jun 2022 22:16:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCJvm7QCHYVYyYt+Z7TBHvl8Qgg4W3XH7NuLD80nBjADYEmrWpCXSyY43U84i+iKtDyN9d X-Received: by 2002:a05:6a00:130e:b0:51b:c19c:44b0 with SMTP id j14-20020a056a00130e00b0051bc19c44b0mr32915769pfu.21.1654665398149; Tue, 07 Jun 2022 22:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654665398; cv=none; d=google.com; s=arc-20160816; b=gs9SrGlw/9ksG0DrgXwMT4QKXIwuvCfatPClsRzuz3JkfqTH7N1EofWmmACOvkLCbT XmFEp9lahiSftbbVfhR9jLmU/kVtLJnknITkHM9LKx7F5w9ImI/mTJ7lzMoFjETeP52u 4bzrolT+7U8fydCB4+2k2OM5u16ABodyDDXP8ghJVztwLwlXscXz4jAEbIqupipjvw0V SBevHn6TqAvDje7hdjHlKn4HEDFsLGlkNqbowsURPohL/xuYBn9lazkSzXOBAUf6qApq PgzzgS+IRm7aCE8kz7B+6nB1hwpmm9jdlufAsr9eIeqRmm7lL5azuW0r4vuPPs5Sg3f1 Dtlw== 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=tBz0zyMqQ9ReIP2QV7Wd8zvuUNg/ne5DHGgbjjKHHvq8LLnktJ0dTAS5ruHpS1asST qqHh3FoCyJZgrFD/aqtbPkmyxELBrrw8jHogeW/TWoreta5tpWk3oJpL1GhPK6Qe6sBv lsdhTS2oOBGKsw0VUDy5bpfzoSiKbnn8RrVhnbEHPDcJWTjxsvvg9otRWuDskbOrJis3 CI/F6rcyvAYGjjCDuA1Ao0CcjfUep+ujXCdKtyXm2GF76vC7+QPTBOzV/JaUC3SvKsj3 4tlJZ1jAopRPgIEl36AcKPDwNogMLg3iMKOxgupxP3JBejnKrGeAglFMH6/6Y28jss3V SmVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t5wXBdGS; 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 63-20020a630742000000b003f9cde547fasi26672535pgh.631.2022.06.07.22.16.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:16:38 -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=t5wXBdGS; 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 1030741BCDA; Tue, 7 Jun 2022 21:45:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356340AbiFGT1h (ORCPT + 99 others); Tue, 7 Jun 2022 15:27:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351817AbiFGScv (ORCPT ); Tue, 7 Jun 2022 14:32:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CE7317EC26; Tue, 7 Jun 2022 10:57:04 -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 ams.source.kernel.org (Postfix) with ESMTPS id AECD7B81F38; Tue, 7 Jun 2022 17:57:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EA50C385A5; Tue, 7 Jun 2022 17:57:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654624621; bh=InK2P2719+ucxNiXUq5akHXves7w4RjNdOe6zfMyDME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t5wXBdGSPHVHbTQqZjKtfA8TCLrM1mecyXrOyQpbZw19Rxk3+xGqpAf9I4KYntziQ XOMKgIsVdtnFGSBYWTOCuL0kknIAM4XdmyECY/hvOgvO/4GMPlDwFyI9ov0hsjSBX1 W4ie76GnACO8n5AyTGrQXR7LlMae4SL1uJ3lmiKw= 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.15 353/667] thermal/drivers/bcm2711: Dont clamp temperature at zero Date: Tue, 7 Jun 2022 19:00:18 +0200 Message-Id: <20220607164945.345319640@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164934.766888869@linuxfoundation.org> References: <20220607164934.766888869@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