From patchwork Sat Apr 6 01:04:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 786657 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D80C65695; Sat, 6 Apr 2024 00:58:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712365095; cv=none; b=Ka7WXxIiZ45k8wSo//RlNFOxdew6cGJjyNgnqOKkO1kCb3PVReA1JSkgE7dbL9iMImVludMHpntNs/0vJ6VQmi5/h52rC4QnqysyU/yujLt9Ni8QC9UH4ZAEbYA/Lf0AuolekLy7fogHYwwWl/NMyoRMYvp1CuQbG+N3dA5VDXg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712365095; c=relaxed/simple; bh=KCAYWXnfTfIof0z3ccXzlxFYy3XY+yZ85HhlAqLhXHc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=DtuFOrWCltaBL8uBraJov0nAUeSZYrHDdsYQeS7rYugJ8kMTJlSk8gTy7QQad2yxgrieuKiY6h1H6gQF5UasJRKETkBCcPqLqeswR075qkbey5Jq9aVy0XamZczxtqDdceP+o0wCf2/9ekuNepWEWTvWIwiXNFdPWlKtV047u30= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UpX3lwKI; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UpX3lwKI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712365094; x=1743901094; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=KCAYWXnfTfIof0z3ccXzlxFYy3XY+yZ85HhlAqLhXHc=; b=UpX3lwKIJZMqQu7GEcSBxmHMuP9BMorZ9xz0pcBY+260V3q4uJMYhajt xaGkS+ebEViei+JzNYmCrUYMIo07Dem5OjvRINz7NMxuGKYIiMHi8gHUv S3oXusRjrKK7HxB+rqLfTcJn+bqZyOT2DKMLTYa972fHSr8gZj2rjwISG gq1u/KK0RFsUIzXWL9t2uYyurbFZmvyFZj4GrOUW/mjxmjUojjGNX6o/+ M22CqUCxPKuLR1W96ksjhDekh8mUj9LWSN5Nl9DyJqUY1pI/2FHZwENaL d9lVIW7fjmjEAvGvsFOfCCZZdDUYNCYVdMWSZObzyQiSm4R56Kja0DiGT g==; X-CSE-ConnectionGUID: T8cX7N7wTJexSsaZYiaR8g== X-CSE-MsgGUID: zP9PIpUyS66hufb1wHwokQ== X-IronPort-AV: E=McAfee;i="6600,9927,11035"; a="25153878" X-IronPort-AV: E=Sophos;i="6.07,182,1708416000"; d="scan'208";a="25153878" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2024 17:58:12 -0700 X-CSE-ConnectionGUID: 7oUEoezVS+uoDoEUGK9v7w== X-CSE-MsgGUID: LIl4jerqRay0FJkOJbMslQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,182,1708416000"; d="scan'208";a="19252366" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orviesa009.jf.intel.com with ESMTP; 05 Apr 2024 17:58:12 -0700 From: Ricardo Neri To: "Rafael J. Wysocki" , Zhang Rui , Jean Delvare , Guenter Roeck Cc: Srinivas Pandruvada , Lukasz Luba , Daniel Lezcano , linux-pm@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Neri Subject: [PATCH 2/3] thermal: intel: intel_tcc_cooling: Use a model-specific bitmask for TCC offset Date: Fri, 5 Apr 2024 18:04:15 -0700 Message-Id: <20240406010416.4821-3-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240406010416.4821-1-ricardo.neri-calderon@linux.intel.com> References: <20240406010416.4821-1-ricardo.neri-calderon@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The TCC offset field in the register MSR_TEMPERATURE_TARGET is not architectural. The TCC library provides a model-specific bitmask. Use it to determine the maximum TCC offset. Suggested-by: Zhang Rui Signed-off-by: Ricardo Neri --- Cc: Daniel Lezcano Cc: Lukasz Luba Cc: Srinivas Pandruvada Cc: linux-hwmon@vger.kernel.org Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org # v6.7+ --- drivers/thermal/intel/intel_tcc_cooling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/intel/intel_tcc_cooling.c b/drivers/thermal/intel/intel_tcc_cooling.c index 6c392147e6d1..308946853cdd 100644 --- a/drivers/thermal/intel/intel_tcc_cooling.c +++ b/drivers/thermal/intel/intel_tcc_cooling.c @@ -20,7 +20,7 @@ static struct thermal_cooling_device *tcc_cdev; static int tcc_get_max_state(struct thermal_cooling_device *cdev, unsigned long *state) { - *state = 0x3f; + *state = get_tcc_offset_mask(); return 0; }