Message ID | 20240229002659.1416623-1-srinivas.pandruvada@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-85921-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp141873dyb; Wed, 28 Feb 2024 18:56:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWvusEXctEZlZazKA7vcqCfe0DTgh1kYlA+ED5YZ3ckNXOwI4a05GcHLuy3PB59wtzNcaFddFVhgehXL537Sq4zRipZMg== X-Google-Smtp-Source: AGHT+IH3QY5tkVf9y/euSUcM7haN3IIIlqnr+4/U02/s/1p/c5ODwgdrkiEuKkYitp8AGrrrDRfJ X-Received: by 2002:a05:6808:148a:b0:3c1:663e:ceb2 with SMTP id e10-20020a056808148a00b003c1663eceb2mr1026194oiw.24.1709175370111; Wed, 28 Feb 2024 18:56:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709175370; cv=pass; d=google.com; s=arc-20160816; b=pBoNoFkzPYWp2qB4rPAmPyjZXGVkwI0bhfFApQ7dXY89uqTDaHtTUteqs/25P3a1He OmGqTyCVFUBOugWimPisXindWbBUuBfJg6IQlsg9nN/FH9OWtRDf0GDMd0wbudzhIMd+ WOwjzONGMy1r+pOwMWcQZicF2tRrFpyqZdZ5CkDwQlmSCnkxtZ8Uf7gbpmwzUpQvC2rs CCRly3MZXOtM8uLiJ3st1fNdlXOLKSE2dkAeU7MzNmYk8YDqQM7LyFyGVKZ238qYcnr4 OE6eiCNRfWeuA3MAPVsovJqeZXYbeTHkoGFBwStW7+cskHKMwflDePVQTTMzslWBCp+u O+Og== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=0XO1CK19zvVqW0+0sqV6khnN8YAcWDviBwyr99OYBn8=; fh=WxcXzAXi1awalX5nBNdKiu2pCszhVA/a0vtqlN5we7w=; b=akPkd2KKbY8psKiRVBpOf1P+oqfCs9cEYpL0qNzKpReIbBM5nFkj2t/4U0ZD9FeCF5 PpR+N7o2zHG8jj6WHkiGL6Kp81nzhg6nPNKS5UmYFypl9YxlHPPOU9dPoSc3VgB5t0AF 4xvF7CA4tt5VuQdOFcDEdTCyJdJBDtzg3pp9NmLqTlXgNSI9U3N16FnaCSxCTwoiDlIr 9/MXLO8008fW4j49GVT5TrSV569Xty6QlhqEqfXxQwi8JdM1sM8Uu+wtOWkpkSzLMYf1 IDOSZ3BeLxLq0FWBKWe17b3ZUCY4NLR3EtI/jbhNju3Pufm4wGpAUwivS72NMOdLQ/O5 P3Ow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="CjWpyBL/"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85921-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85921-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p44-20020a056a0026ec00b006e57b98991asi358453pfw.137.2024.02.28.18.56.09 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 18:56:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85921-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="CjWpyBL/"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85921-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85921-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 94A21288785 for <ouuuleilei@gmail.com>; Thu, 29 Feb 2024 00:27:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9375F107B3; Thu, 29 Feb 2024 00:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="CjWpyBL/" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 60DF115B1; Thu, 29 Feb 2024 00:27:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709166433; cv=none; b=a3tH/2kyoLlFGg9isR/mU2CBSLuEXPqiFcADsH2OceSOqc5TmxsXBxBovybERYu+N1/qa1ookU1cxRmWIXjAsTXB+8w0/+EFuyhYW5H1y6ExS89O+CQUJ2OoqejdceZDmzfFtgPUmvDiWS3963plFVMLr9cPIJ1mc+w9d2M5VK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709166433; c=relaxed/simple; bh=6dE0XlBWX4tvzDq8lQshCJ55gvJcczOTwWaRKM0Khy0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=R+VSnrfpkAgRncBz3iczpfV+Pq3nu1QC4ehx84JJXa9b3ZS3yxS48gfxCzbQtpe4OoONjj4PujlpdMD9099kjIaziUi6q4ruW4sj/5Pzh5k0ft0Y5/vTe4RlmhTYXr14PQzXHtmJUUWPBbJ4oQPSaIqmrJj3wJSzux6D6UZkRGs= 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=CjWpyBL/; arc=none smtp.client-ip=192.198.163.16 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709166432; x=1740702432; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6dE0XlBWX4tvzDq8lQshCJ55gvJcczOTwWaRKM0Khy0=; b=CjWpyBL/ISc4XLxm1QH7MhR93wbW8/kyDNMzd4JehabyLwGXZyVy+Uhd jJRy/rUIH+YM8m6eYnhWxOyQE7c5Ztt9nUCx4a4u6PMB6gW/Tqta1ISuY IRAN6IxAmFfN8aHJKYXvUYj2W8ZBVayvYoR0B74ix8KsM0OilpdSnxUQ3 Hs35EXFmDLbmTpszGuYT8iXgu9Tih7ky0Bn8mAIK7E79g64M1asVKVPBi s7NfR7YLVudUC9ir7qds5L5xIREng4s6TMq7tym8Ad/MWntiASwfg/1Ha LcTE4wJAA6UYb7WC5GdOmP/osU3mvRWpZI1jSkKtPOQDsFMCQjz47UXT2 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="4188786" X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="4188786" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 16:27:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="7666801" Received: from spandruv-desk.jf.intel.com ([10.54.75.14]) by orviesa009.jf.intel.com with ESMTP; 28 Feb 2024 16:27:11 -0800 From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> To: hdegoede@redhat.com, markgross@kernel.org, ilpo.jarvinen@linux.intel.com, andriy.shevchenko@linux.intel.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Subject: [PATCH] platform/x86: ISST: Allow reading core-power state on HWP disabled systems Date: Wed, 28 Feb 2024 16:26:59 -0800 Message-Id: <20240229002659.1416623-1-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792200272540893381 X-GMAIL-MSGID: 1792200272540893381 |
Series |
platform/x86: ISST: Allow reading core-power state on HWP disabled systems
|
|
Commit Message
srinivas pandruvada
Feb. 29, 2024, 12:26 a.m. UTC
When HWP (Hardware P-states) is disabled, dynamic SST features are
disabled. But user should still be able to read the current core-power
state, with legacy P-states. This will allow users to read current
configuration with static SST enabled from BIOS.
To address this, do not call disable_dynamic_sst_features() when the
request is for reading the state.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Wed, 28 Feb 2024, Srinivas Pandruvada wrote: > When HWP (Hardware P-states) is disabled, dynamic SST features are > disabled. But user should still be able to read the current core-power > state, with legacy P-states. This will allow users to read current > configuration with static SST enabled from BIOS. > > To address this, do not call disable_dynamic_sst_features() when the > request is for reading the state. > > Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Is this a fix? (It's lacking the tag if it is).
On Thu, 2024-02-29 at 14:32 +0200, Ilpo Järvinen wrote: > On Wed, 28 Feb 2024, Srinivas Pandruvada wrote: > > > When HWP (Hardware P-states) is disabled, dynamic SST features are > > disabled. But user should still be able to read the current core- > > power > > state, with legacy P-states. This will allow users to read current > > configuration with static SST enabled from BIOS. > > > > To address this, do not call disable_dynamic_sst_features() when > > the > > request is for reading the state. > > > > Signed-off-by: Srinivas Pandruvada > > <srinivas.pandruvada@linux.intel.com> > > Is this a fix? (It's lacking the tag if it is). This is not a fix. This is a feature request from a customer. Some customer wants to use in certain way. Thanks, Srinivas >
On 2/28/24 4:26 PM, Srinivas Pandruvada wrote: > When HWP (Hardware P-states) is disabled, dynamic SST features are > disabled. But user should still be able to read the current core-power > state, with legacy P-states. This will allow users to read current > configuration with static SST enabled from BIOS. > > To address this, do not call disable_dynamic_sst_features() when the > request is for reading the state. > > Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> > --- Looks good to me. Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> > drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c > index 2662fbbddf0c..1d918000d72b 100644 > --- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c > +++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c > @@ -462,10 +462,10 @@ static long isst_if_core_power_state(void __user *argp) > struct tpmi_per_power_domain_info *power_domain_info; > struct isst_core_power core_power; > > - if (disable_dynamic_sst_features()) > + if (copy_from_user(&core_power, argp, sizeof(core_power))) > return -EFAULT; > > - if (copy_from_user(&core_power, argp, sizeof(core_power))) > + if (core_power.get_set && disable_dynamic_sst_features()) > return -EFAULT; > > power_domain_info = get_instance(core_power.socket_id, core_power.power_domain_id);
On Wed, 28 Feb 2024 16:26:59 -0800, Srinivas Pandruvada wrote: > When HWP (Hardware P-states) is disabled, dynamic SST features are > disabled. But user should still be able to read the current core-power > state, with legacy P-states. This will allow users to read current > configuration with static SST enabled from BIOS. > > To address this, do not call disable_dynamic_sst_features() when the > request is for reading the state. > > [...] Thank you for your contribution, it has been applied to my local review-ilpo branch. Note it will show up in the public platform-drivers-x86/review-ilpo branch only once I've pushed my local branch there, which might take a while. The list of commits applied: [1/1] platform/x86: ISST: Allow reading core-power state on HWP disabled systems commit: 959e640cf7b2d456052b346fa50574242ca56aaa -- i.
diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c index 2662fbbddf0c..1d918000d72b 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c @@ -462,10 +462,10 @@ static long isst_if_core_power_state(void __user *argp) struct tpmi_per_power_domain_info *power_domain_info; struct isst_core_power core_power; - if (disable_dynamic_sst_features()) + if (copy_from_user(&core_power, argp, sizeof(core_power))) return -EFAULT; - if (copy_from_user(&core_power, argp, sizeof(core_power))) + if (core_power.get_set && disable_dynamic_sst_features()) return -EFAULT; power_domain_info = get_instance(core_power.socket_id, core_power.power_domain_id);