Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2735291pxj; Mon, 31 May 2021 09:24:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxys1Qb7rILfDSTrOCpBqKCeUJKEZJ5oUiUD50XNbHr6MFhoUP/uJEeApZ4jc8PeugPI3jB X-Received: by 2002:a17:907:2bf4:: with SMTP id gv52mr23496535ejc.271.1622478294392; Mon, 31 May 2021 09:24:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622478294; cv=none; d=google.com; s=arc-20160816; b=hjQWXmhAresiwO48TuRs8c6kxwOjXo95H9d2QsO8sUQAkx/GR0zRYrQV/klAXJI0u+ QXFPV7wd+6cmCW3WQ/zkuf0khsfqD1X2P8B0TD3Nb/e416MRYd/O/y8b3XQYULrdxafZ KflZ5iLZMNlJkkzrhbztAmMs3pyPEXkyskpLLrrN872f1s8rPGrUoLKJ31zLgnWBli3j iIksvOpVBpHRs/OxDmyMc/+mhRu6BOK8AUT6ATR7XCBTRnWYDFtrcVB2+nMvWCNTxyER L1gswU7jO22tPMtv5grvj6BvsGbjSMyVpNykxOnlrUN1o2L3pwJLTUQPCqW7hJ2bKIqK Ua9g== 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=+Bd/akFtomoIn+3KJQ8yhtZVZHfw2HLC5ffOljtWEvM=; b=FEKoPB+C7aRoi0AdBuCu62r37mZAPnuY77PjO9Gay1SpSHj+2Ko7gwWUXSU4avJG2g U3nkEZ9akgvf88DD4CW0gaa/CoIzrg/G99y0u0EHoS1O2aF20VdopxE91F9RoQHM7j2d QlxO0CW96soZTwzp285BGu3dk69OgYS2J5FEaaCo0IcYXIII3s/wQ8zx6hrMFLgAXAFo KGhDPTtv1F56PCzVGGn7RchPIrrE2m3HcYgewpO9IMTB6ow7gJu/eUcKueaR1lG51wYu Atg+xb6vJS/aYqkpEAw3OCF0xWEerPsNQjVw9b8PDCwG5NebOGyafy1ux9TnIaTlpP5a 0fFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JXSmcqki; 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 a4si12445847ejs.331.2021.05.31.09.24.32; Mon, 31 May 2021 09:24:54 -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=JXSmcqki; 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 S233136AbhEaQZI (ORCPT + 99 others); Mon, 31 May 2021 12:25:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:39882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233652AbhEaOnh (ORCPT ); Mon, 31 May 2021 10:43:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2F9E161C72; Mon, 31 May 2021 13:54:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469276; bh=CKHgblGGySsSRCukiqodNq/GwCeFxKa9pKvXZLtX0z4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JXSmcqkiHPdYc3eOoXgZRsVPgR7kP49mF6y/9mvY33WbCrTDkVLfk0lWlyE8gDhXu jbA9glHe0hDCRG5NgBhXCIvEOJRUcvTnQ76DolWztWHK0OTgFjp+PFHI6jAB3B+Uc0 /brSkQDhx4vsWPvTvfSdtV7MtGkvHJLSyNOYDj44= 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.12 102/296] thermal/drivers/intel: Initialize RW trip to THERMAL_TEMP_INVALID Date: Mon, 31 May 2021 15:12:37 +0200 Message-Id: <20210531130707.359084386@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@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 @@ -237,6 +237,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), @@ -247,6 +249,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 @@ -166,7 +166,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;