Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2698874pxj; Mon, 31 May 2021 08:32:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOVbwdV1OR/Y/vWgC6KtvlAZa6pxiDcPq3DxlbigGhdlBvCKrMxWFq7aHGL2H+o40MiKZ1 X-Received: by 2002:a17:906:518b:: with SMTP id y11mr16578501ejk.178.1622475130622; Mon, 31 May 2021 08:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622475130; cv=none; d=google.com; s=arc-20160816; b=QQP2aS9Fnx5p2zrrPM4VimgBG74HEQP4e2o3oB6L591vJeKz4GYfvCu9qjkDsUmqs/ +FA4OcgwYqGaMQaKF7hhcQJuFrV0IY+4Zmk3EZQ+hRC6bap5MV4SUhANWhiXxKm1iz32 0chvIixqC91GfIOg0dBPjBVHZysWui3kYa8QF8AKSbUC8bN0MI09c8Fma4hOt/cOMebc Wxpk4Kc5abf8VXAODmWE11CZWziKmUIItd8QxqFxbsbfq3gQFrFwQCal3a1HJCTFGmH1 hWms8vqjuw3MSxsNgXxoYehrXKU9QBtgqhZuePVk+jwW3YYO0ZMX8tnNY3IVVaWqF+D0 BzKQ== 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=DCpqEOwbBENshJYqr4CNUsajRiPu6aLQL/WqRQJyVcI=; b=SVTBnAU+gdv6sH3aQwepmykPwSzDK3O/TdD4QhifB0ittOt45gTdZgd7he7FhzaHK6 z1X2JG7infbkRTyqdGkmROgrvAfsat3vPr+78ha8pCSeLHOl79UQ/RdYkyNpjTM9GNU9 VYeyo59XPBclLo625GCzhXbF1KopUZryq+iyOjxDBq/+5W2xiLhSs1Lwa3gXOd+24yKd G05GuiHR8gxuN8Z8viwdlpP1+8r/prwfR0KHGXGIb1fqW4fEYoNTl5jMyuQho8vCXyJD ZbRu9mcrSb1wKpF/zYXATcxsR4JVgnnHCYVtt8MRHb5adHyxXZwXxhQLmR9UYkvAu0dQ 7f3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="z/WjIszX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si15138698ejb.702.2021.05.31.08.31.47; Mon, 31 May 2021 08:32:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="z/WjIszX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232837AbhEaPcC (ORCPT + 99 others); Mon, 31 May 2021 11:32:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:43166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232842AbhEaORd (ORCPT ); Mon, 31 May 2021 10:17:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4A968619B2; Mon, 31 May 2021 13:43:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468616; bh=RzFbbpwa7Yp8R+q5O798s43vbcoxm8pztewk0n6GN6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z/WjIszXHjFuWJgwusOirBnREICJweMOjQ99V7vx4Fc6WDMcvGIV9uyGTwLp5H1cA J8gRym7ZMNb/sjWWceCtCyuJf4lSNK6y4V0mY9hJbkknzu5Kxz/eniTYoCkZ6eiHEz NCdv4GzPirJ2tD+Xazad6V88XG2G47Q7Uk0q239Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Pandruvada , Daniel Lezcano Subject: [PATCH 5.4 060/177] thermal/drivers/intel: Initialize RW trip to THERMAL_TEMP_INVALID Date: Mon, 31 May 2021 15:13:37 +0200 Message-Id: <20210531130649.984180458@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Pandruvada commit eb8500b874cf295971a6a2a04e14eb0854197a3c upstream. After commit 81ad4276b505 ("Thermal: Ignore invalid trip points") all user_space governor notifications via RW trip point is broken in intel thermal drivers. This commits marks trip_points with value of 0 during call to thermal_zone_device_register() as invalid. RW trip points can be 0 as user space will set the correct trip temperature later. During driver init, x86_package_temp and all int340x drivers sets RW trip temperature as 0. This results in all these trips marked as invalid by the thermal core. To fix this initialize RW trips to THERMAL_TEMP_INVALID instead of 0. Cc: Signed-off-by: Srinivas Pandruvada Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210430122343.1789899-1-srinivas.pandruvada@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c | 4 ++++ drivers/thermal/intel/x86_pkg_temp_thermal.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) --- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c +++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c @@ -230,6 +230,8 @@ struct int34x_thermal_zone *int340x_ther if (ACPI_FAILURE(status)) trip_cnt = 0; else { + int i; + int34x_thermal_zone->aux_trips = kcalloc(trip_cnt, sizeof(*int34x_thermal_zone->aux_trips), @@ -240,6 +242,8 @@ struct int34x_thermal_zone *int340x_ther } trip_mask = BIT(trip_cnt) - 1; int34x_thermal_zone->aux_trip_nr = trip_cnt; + for (i = 0; i < trip_cnt; ++i) + int34x_thermal_zone->aux_trips[i] = THERMAL_TEMP_INVALID; } trip_cnt = int340x_thermal_read_trips(int34x_thermal_zone); --- a/drivers/thermal/intel/x86_pkg_temp_thermal.c +++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c @@ -164,7 +164,7 @@ static int sys_get_trip_temp(struct ther if (thres_reg_value) *temp = zonedev->tj_max - thres_reg_value * 1000; else - *temp = 0; + *temp = THERMAL_TEMP_INVALID; pr_debug("sys_get_trip_temp %d\n", *temp); return 0;