From patchwork Mon Apr 29 23:41:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 793613 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 C835E199EB9; Mon, 29 Apr 2024 23:35:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714433715; cv=none; b=o9+DHBBgRVkSXNDxjjHaRQNPQbQilg7Z3B4mTS4iHONFrPL8dBBfKnMYW/BLslo4YB550V+H8tFHKKbf3ICCu6/Mv9qc8gh2tWBjzdCYNx3g8o+s0qvQrsZG73zGkVdw7P286l5BzkalJzB2RN9t0JvTFMFXbcaQqh9QmuigTkI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714433715; c=relaxed/simple; bh=U0zOPBg06/Ek10lV/P5KRW59pMlND6/3ke+JnVTjiek=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=Hu7pgLBPMx+JnQosvgivoGDk6HqSKrlHzQn6mtFuXsRIP8nsB3LwOamxyTrwUJV9Wnkulf9ST3K4MXgwj5uXTXAl3jBxV+gOQDek+UB3913gd0Uu06/p0+zjvsHERZ8L0kX8JtZNnT97XFfZc6GQvqoxHpL6lZ8uY3IH8H5V4tY= 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=DsvmkLoU; arc=none smtp.client-ip=192.198.163.15 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="DsvmkLoU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714433714; x=1745969714; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=U0zOPBg06/Ek10lV/P5KRW59pMlND6/3ke+JnVTjiek=; b=DsvmkLoUWoAqDowigSrM7YBPO68e/xZTESeM6VKbYvKC3dQjk0H1Xe7/ wvjHC+b1HhjA8UdgU4YHN1DLX+87P42PDggmg2CCRgdZJmeL+y2VGPt2I pLZ7SqVVtvPO8EZfsD5bDdY57E20ZRUejEJYXZI/RqXZruhqO8XxcTcqz LKvhvEBHcgAWfFbH4hOddSonDnaUWMobvq30vLE4JtEP7ofczY7plSo5V 0eSSCP+SF3VyGdKNWtiInlLkq1pZc6Ms0a65tczA36LTSMNdbN5Maheiu 8VCpm6oroOULRtq6ElHiGUxqP9G/QXXVrY2k00g8SMGbA6vtolpXbn5Tc A==; X-CSE-ConnectionGUID: ZuArEuUlRUKHquD1ynocFg== X-CSE-MsgGUID: ON+c4UCGTleTO/I97FhJwA== X-IronPort-AV: E=McAfee;i="6600,9927,11059"; a="10274511" X-IronPort-AV: E=Sophos;i="6.07,240,1708416000"; d="scan'208";a="10274511" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 16:35:09 -0700 X-CSE-ConnectionGUID: oNC+hNXiSnCIa+eGtRA/Zg== X-CSE-MsgGUID: E1i4qlq/QSiv4RamYiSiJg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,240,1708416000"; d="scan'208";a="26200139" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by fmviesa009.fm.intel.com with ESMTP; 29 Apr 2024 16:35:09 -0700 From: Ricardo Neri To: "Rafael J. Wysocki" Cc: Zhang Rui , Srinivas Pandruvada , Len Brown , Stanislaw Gruszka , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Neri Subject: [PATCH 3/4] thermal: intel: hfi: Rename HFI_MAX_THERM_NOTIFY_COUNT Date: Mon, 29 Apr 2024 16:41:51 -0700 Message-Id: <20240429234152.16230-4-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240429234152.16230-1-ricardo.neri-calderon@linux.intel.com> References: <20240429234152.16230-1-ricardo.neri-calderon@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: When processing a hardware update, HFI generates as many thermal netlink events as needed to relay all the updated CPU capabilities to user space. The constant HFI_MAX_THERM_NOTIFY_COUNT is the number of CPU capabilities updated per each of those events. Give this constant a more descriptive name. Signed-off-by: Ricardo Neri --- Cc: Len Brown Cc: Srinivas Pandruvada Cc: Stanislaw Gruszka Cc: Zhang Rui Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/thermal/intel/intel_hfi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c index 24d708268c68..d6d3544509fc 100644 --- a/drivers/thermal/intel/intel_hfi.c +++ b/drivers/thermal/intel/intel_hfi.c @@ -171,7 +171,7 @@ static DEFINE_MUTEX(hfi_instance_lock); static struct workqueue_struct *hfi_updates_wq; #define HFI_UPDATE_DELAY HZ -#define HFI_MAX_THERM_NOTIFY_COUNT 16 +#define HFI_THERMNL_CAPS_PER_EVENT 16 /* Keep this variable 8-byte aligned to get atomic accesses. */ static unsigned long hfi_update_delay = HFI_UPDATE_DELAY; @@ -286,14 +286,14 @@ static void update_capabilities(struct hfi_instance *hfi_instance) get_hfi_caps(hfi_instance, cpu_caps); - if (cpu_count < HFI_MAX_THERM_NOTIFY_COUNT) + if (cpu_count < HFI_THERMNL_CAPS_PER_EVENT) goto last_cmd; - /* Process complete chunks of HFI_MAX_THERM_NOTIFY_COUNT capabilities. */ + /* Process complete chunks of HFI_THERMNL_CAPS_PER_EVENT capabilities. */ for (i = 0; - (i + HFI_MAX_THERM_NOTIFY_COUNT) <= cpu_count; - i += HFI_MAX_THERM_NOTIFY_COUNT) - thermal_genl_cpu_capability_event(HFI_MAX_THERM_NOTIFY_COUNT, + (i + HFI_THERMNL_CAPS_PER_EVENT) <= cpu_count; + i += HFI_THERMNL_CAPS_PER_EVENT) + thermal_genl_cpu_capability_event(HFI_THERMNL_CAPS_PER_EVENT, &cpu_caps[i]); cpu_count = cpu_count - i;