Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2661464pxj; Mon, 31 May 2021 07:40:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4tKHASj0IPXKbXGc2P6BYMdNHGTi6a41aF/Seuv8EQx/CeshjWG2OsY1i2Hhr7PJbMzJp X-Received: by 2002:a92:d8c3:: with SMTP id l3mr12303631ilo.31.1622472033379; Mon, 31 May 2021 07:40:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622472033; cv=none; d=google.com; s=arc-20160816; b=DuUcxTB+/TT0dEB+unghFH09gfOCS6CuJTnH9Y4eGIOyNr7vbMFhBrfv9eYvQMwEW6 0xCVmgDJlNYBVO590AZqrcYKyYAQ0dYf5Cg9/kkzs0noeG3FzcvgAkKeo4vu9+WI3bP9 3j8kScwugPUT96usXiaNVuhWkzfWedE0dWp61J4oU7bFOPCWgBn4u0zdW66a/rPi0aJB GbnsrFaQIAPgYFl/8YeN/wc7Ir3vDlBX6VfaMGCacCggbA6AeaHY6+CFjivvfQFcV1f1 traPFDRGpUjUWD/J44DWpOQqOAJ+V93S5oJqJl9d92MOwwrcZabXDIqwUUSujqbAuMRn 1qYg== 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=DZ82Q9Z4an/6IPuPZW0SU5Tt1Cn1Cv2JniS6+UsFZpY=; b=S4SqtbYRoA8tw8QS3ulYJ5w7VbOEsaY77vpsZlvtZQI9A7D0HYsVTQCmHZty7hnkf9 gW/XMjoVSxA+BLv2Agvtfiz8i6f/bKrybZEQ021ieBtzzm6ax+YzgYjwXZ2XRNg7KE6/ MMzTrk2RQkFIn+0AvEuXidgSsFP72SiPa0Gpbm5JjHzR4/Cy7D4flh7XUlkzUA8ro9R2 8T9kq5HPfRh4LBE3oBgn0ABVDumAAY+QWxAuZWivi1kInsG68ZmzegLlia5Ohev81qkA GrB0/6gw/dbUgmGnW/15IoJl1jZP77rGSewnr60i9WzOnKx49kUYZaJ3PeEEqJ597TBH SpXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nqHN7jSa; 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 p37si11983666jal.126.2021.05.31.07.40.20; Mon, 31 May 2021 07:40:33 -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=nqHN7jSa; 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 S233004AbhEaOkQ (ORCPT + 99 others); Mon, 31 May 2021 10:40:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:60040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230404AbhEaN5a (ORCPT ); Mon, 31 May 2021 09:57:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C8AFE61930; Mon, 31 May 2021 13:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468111; bh=CeRIDofVhvZpv5JEeCKmJk4g3Jy2hY2p9kBxAR2fB7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nqHN7jSa9xeNvmrRvt1/usnNSff7zx69GbHRwEAujzS3yO5erU2FPiILHuswwa6lG Jlzngl0jPyy2njvYoWRGxgmVUT+Nqh6hEkZcbbdy3Vcyf2pBldEhiXJmsCt5KuEzLF WbYuBP5znwAAIdXS9beuEKV3e0MpD4zMqAK/lzXI= 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.10 085/252] thermal/drivers/intel: Initialize RW trip to THERMAL_TEMP_INVALID Date: Mon, 31 May 2021 15:12:30 +0200 Message-Id: <20210531130700.875742120@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@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 @@ -231,6 +231,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), @@ -241,6 +243,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;