public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Xi Pardee <xi.pardee@linux.intel.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: irenic.rajneesh@gmail.com, david.e.box@linux.intel.com,
	Hans de Goede <hdegoede@redhat.com>,
	platform-driver-x86@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v2 11/11] platform/x86:intel/pmc: Get LPM information for Lunar Lake
Date: Mon, 9 Sep 2024 17:49:51 -0700	[thread overview]
Message-ID: <cd2a5552-0ab5-4d85-a419-7af3e97ffcb7@linux.intel.com> (raw)
In-Reply-To: <d270b60b-f136-a520-1703-efa4cbfb0aba@linux.intel.com>


On 8/29/2024 5:13 AM, Ilpo Järvinen wrote:
> On Wed, 28 Aug 2024, Xi Pardee wrote:
>
>> Add support to find and read the requirements from the telemetry
>> entries for Lunar Lake platforms.
>>
>> Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
>> ---
>>   drivers/platform/x86/intel/pmc/lnl.c | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git a/drivers/platform/x86/intel/pmc/lnl.c b/drivers/platform/x86/intel/pmc/lnl.c
>> index 109b08d43fc8..f5fee9e105e2 100644
>> --- a/drivers/platform/x86/intel/pmc/lnl.c
>> +++ b/drivers/platform/x86/intel/pmc/lnl.c
>> @@ -13,8 +13,13 @@
>>   
>>   #include "core.h"
>>   
>> +#define SOCM_LPM_REQ_GUID	0x15099748
>> +
>> +static const u8 LNL_LPM_REG_INDEX[] = {0, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20};
>> +
>>   static struct pmc_info lnl_pmc_info_list[] = {
>>   	{
>> +		.guid	= SOCM_LPM_REQ_GUID,
>>   		.devid	= PMC_DEVID_LNL_SOCM,
>>   		.map	= &lnl_socm_reg_map,
>>   	},
>> @@ -536,6 +541,7 @@ const struct pmc_reg_map lnl_socm_reg_map = {
>>   	.lpm_live_status_offset = MTL_LPM_LIVE_STATUS_OFFSET,
>>   	.s0ix_blocker_maps = lnl_blk_maps,
>>   	.s0ix_blocker_offset = LNL_S0IX_BLOCKER_OFFSET,
>> +	.lpm_reg_index = LNL_LPM_REG_INDEX,
>>   };
>>   
>>   #define LNL_NPU_PCI_DEV		0x643e
>> @@ -561,6 +567,8 @@ static int lnl_resume(struct pmc_dev *pmcdev)
>>   
>>   int lnl_core_init(struct pmc_dev *pmcdev)
>>   {
>> +	bool ssram_init = true;
>> +	int func = 2;
>>   	int ret;
>>   	struct pmc *pmc = pmcdev->pmcs[PMC_IDX_SOC];
>>   
>> @@ -578,6 +586,7 @@ int lnl_core_init(struct pmc_dev *pmcdev)
>>   
>>   	/* If regbase not assigned, set map and discover using legacy method */
>>   	if (ret) {
>> +		ssram_init = false;
>>   		pmc->map = &lnl_socm_reg_map;
>>   		ret = get_primary_reg_base(pmc);
>>   		if (ret)
>> @@ -586,5 +595,11 @@ int lnl_core_init(struct pmc_dev *pmcdev)
>>   
>>   	pmc_core_get_low_power_modes(pmcdev);
>>   
>> +	if (ssram_init)	{
>> +		ret = pmc_core_ssram_get_lpm_reqs(pmcdev, func);
>> +		if (ret)
>> +			return ret;
> There's quite much duplication related to this legacy/ssram init in
> the per arch core init functions. And some inconsistencies too which
> seem incidental such as mtl.c using return directly here.
I will try to extract the duplicate code to a common function and remove 
the
inconsistencies between different architecture in next version.

Xi


      reply	other threads:[~2024-09-10  0:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 22:29 [PATCH v2 00/11] Create Intel PMC SSRAM Telemetry driver Xi Pardee
2024-08-28 22:29 ` [PATCH v2 01/11] platform/x86:intel/pmc: Move PMC Core related functions Xi Pardee
2024-08-29 10:49   ` Ilpo Järvinen
2024-08-28 22:29 ` [PATCH v2 02/11] platform/x86:intel/pmc: Rename core_ssram to ssram_telemetry Xi Pardee
2024-08-29 10:50   ` Ilpo Järvinen
2024-08-28 22:29 ` [PATCH v2 03/11] platform/x86:intel/pmc: Move PMC devid to core.h Xi Pardee
2024-08-29 10:52   ` Ilpo Järvinen
2024-09-10  6:55     ` Xi Pardee
2024-08-28 22:29 ` [PATCH v2 04/11] platform/x86:intel/pmc: Convert index variables to be unsigned Xi Pardee
2024-08-29 10:54   ` Ilpo Järvinen
2024-08-28 22:29 ` [PATCH v2 05/11] platform/x86:intel/pmc: Remove unneeded h file inclusion Xi Pardee
2024-08-29 11:02   ` Ilpo Järvinen
2024-09-10  7:08     ` Xi Pardee
2024-08-28 22:29 ` [PATCH v2 06/11] platform/x86:intel/pmc: Remove unneeded io operations Xi Pardee
2024-08-28 22:29 ` [PATCH v2 07/11] platform/x86:intel/pmc: Check return value of ioremap Xi Pardee
2024-08-29 11:06   ` Ilpo Järvinen
2024-09-10  6:53     ` Xi Pardee
2024-08-28 22:29 ` [PATCH v2 08/11] platform/x86:intel/pmc: Create Intel PMC SSRAM Telemetry driver Xi Pardee
2024-08-29 12:02   ` Ilpo Järvinen
2024-09-10 19:57     ` Xi Pardee
2024-08-28 22:29 ` [PATCH v2 09/11] platform/x86:intel/pmc: Add Lunar Lake SSRAM devid Xi Pardee
2024-08-29 12:03   ` Ilpo Järvinen
2024-08-28 22:29 ` [PATCH v2 10/11] platform/x86:intel/pmt: Get PMC from SSRAM for Lunar Lake Xi Pardee
2024-08-28 22:29 ` [PATCH v2 11/11] platform/x86:intel/pmc: Get LPM information " Xi Pardee
2024-08-29 12:13   ` Ilpo Järvinen
2024-09-10  0:49     ` Xi Pardee [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd2a5552-0ab5-4d85-a419-7af3e97ffcb7@linux.intel.com \
    --to=xi.pardee@linux.intel.com \
    --cc=david.e.box@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=irenic.rajneesh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox