lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ff3c976e-2e2f-4a95-b53e-e3199f332e23@linux.intel.com>
Date: Mon, 10 Feb 2025 10:11:29 -0800
From: Xi Pardee <xi.pardee@...ux.intel.com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: rajvi0912@...il.com, irenic.rajneesh@...il.com,
 david.e.box@...ux.intel.com, Hans de Goede <hdegoede@...hat.com>,
 platform-driver-x86@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
 linux-pm@...r.kernel.org
Subject: Re: [PATCH v6 5/6] platform/x86:intel/pmc: Move arch specific action
 to init function


On 2/10/2025 3:58 AM, Ilpo Järvinen wrote:
> On Fri, 7 Feb 2025, Xi Pardee wrote:
>
>> Move arch specific action from core.c to the init() function of spt.c.
>>
>> Signed-off-by: Xi Pardee <xi.pardee@...ux.intel.com>
>> ---
>>   drivers/platform/x86/intel/pmc/core.c | 13 -------------
>>   drivers/platform/x86/intel/pmc/spt.c  | 21 +++++++++++++++++++++
>>   2 files changed, 21 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
>> index 628cb22221fbc..06821c41fbeb9 100644
>> --- a/drivers/platform/x86/intel/pmc/core.c
>> +++ b/drivers/platform/x86/intel/pmc/core.c
>> @@ -1416,11 +1416,6 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = {
>>   
>>   MODULE_DEVICE_TABLE(x86cpu, intel_pmc_core_ids);
>>   
>> -static const struct pci_device_id pmc_pci_ids[] = {
>> -	{ PCI_VDEVICE(INTEL, SPT_PMC_PCI_DEVICE_ID) },
>> -	{ }
>> -};
>> -
>>   /*
>>    * This quirk can be used on those platforms where
>>    * the platform BIOS enforces 24Mhz crystal to shutdown
>> @@ -1531,14 +1526,6 @@ static int pmc_core_probe(struct platform_device *pdev)
>>   	if (!pmcdev->pkgc_res_cnt)
>>   		return -ENOMEM;
>>   
>> -	/*
>> -	 * Coffee Lake has CPU ID of Kaby Lake and Cannon Lake PCH. So here
>> -	 * Sunrisepoint PCH regmap can't be used. Use Cannon Lake PCH regmap
>> -	 * in this case.
>> -	 */
>> -	if (pmc_dev_info == &spt_pmc_dev && !pci_dev_present(pmc_pci_ids))
>> -		pmc_dev_info = &cnp_pmc_dev;
>> -
>>   	mutex_init(&pmcdev->lock);
>>   
>>   	if (pmc_dev_info->init)
>> diff --git a/drivers/platform/x86/intel/pmc/spt.c b/drivers/platform/x86/intel/pmc/spt.c
>> index 956b2ec1c7510..9289cd76b0145 100644
>> --- a/drivers/platform/x86/intel/pmc/spt.c
>> +++ b/drivers/platform/x86/intel/pmc/spt.c
>> @@ -8,6 +8,8 @@
>>    *
>>    */
>>   
>> +#include <linux/pci.h>
>> +
>>   #include "core.h"
>>   
>>   const struct pmc_bit_map spt_pll_map[] = {
>> @@ -134,6 +136,25 @@ const struct pmc_reg_map spt_reg_map = {
>>   	.pm_vric1_offset = SPT_PMC_VRIC1_OFFSET,
>>   };
>>   
>> +static const struct pci_device_id pmc_pci_ids[] = {
>> +	{ PCI_VDEVICE(INTEL, SPT_PMC_PCI_DEVICE_ID) },
>> +	{ }
>> +};
>> +
>> +static int spt_core_init(struct pmc_dev *pmcdev, struct pmc_dev_info *pmc_dev_info)
>> +{
>> +	/*
>> +	 * Coffee Lake has CPU ID of Kaby Lake and Cannon Lake PCH. So here
>> +	 * Sunrisepoint PCH regmap can't be used. Use Cannon Lake PCH regmap
>> +	 * in this case.
>> +	 */
>> +	if (!pci_dev_present(pmc_pci_ids))
>> +		return generic_core_init(pmcdev, &cnp_pmc_dev);
>> +
>> +	return generic_core_init(pmcdev, pmc_dev_info);
>> +}
>> +
>>   struct pmc_dev_info spt_pmc_dev = {
>>   	.map = &spt_reg_map,
>> +	.init = spt_core_init,
>>   };
>>
> Hi,
>
> I've applied all but this patch into the review-ilpo-next branch.
>
> This change is good otherwise but I'd prefer the pmc_pci_ids be named
> better such that it actually relates to why it exists :-). So please
> respin this patch.


Hi,

Thanks! I will change the name in next version.

Xi


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ