Linux-Hwmon Archive on lore.kernel.org
 help / Atom feed
* [RFC PATCH] hwmon/k10temp: Add Hygon Dhyana support
@ 2018-12-08  6:33 Pu Wen
  2018-12-08 11:13 ` Borislav Petkov
  2018-12-08 15:55 ` Guenter Roeck
  0 siblings, 2 replies; 4+ messages in thread
From: Pu Wen @ 2018-12-08  6:33 UTC (permalink / raw)
  To: clemens, jdelvare, linux, bp; +Cc: linux-hwmon, linux-kernel, Pu Wen

Add support for Hygon Dhyana family 18h processor for k10temp to get the
temperature. As Hygon Dhyana shares the same function interface with AMD
family 17h, so add Hygon PCI Vendor ID and reuse the code path of AMD.

Signed-off-by: Pu Wen <puwen@hygon.cn>
---
 drivers/hwmon/k10temp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
index 2cef0c3..e24ba10 100644
--- a/drivers/hwmon/k10temp.c
+++ b/drivers/hwmon/k10temp.c
@@ -330,7 +330,7 @@ static int k10temp_probe(struct pci_dev *pdev,
 	     (boot_cpu_data.x86_model & 0xf0) == 0x70)) {
 		data->read_htcreg = read_htcreg_nb_f15;
 		data->read_tempreg = read_tempreg_nb_f15;
-	} else if (boot_cpu_data.x86 == 0x17) {
+	} else if (boot_cpu_data.x86 == 0x17 || boot_cpu_data.x86 == 0x18) {
 		data->temp_adjust_mask = 0x80000;
 		data->read_tempreg = read_tempreg_nb_f17;
 		data->show_tdie = true;
@@ -367,6 +367,7 @@ static const struct pci_device_id k10temp_id_table[] = {
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) },
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_DF_F3) },
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F3) },
+	{ PCI_VDEVICE(HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
 	{}
 };
 MODULE_DEVICE_TABLE(pci, k10temp_id_table);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] hwmon/k10temp: Add Hygon Dhyana support
  2018-12-08  6:33 [RFC PATCH] hwmon/k10temp: Add Hygon Dhyana support Pu Wen
@ 2018-12-08 11:13 ` Borislav Petkov
  2018-12-08 15:55 ` Guenter Roeck
  1 sibling, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2018-12-08 11:13 UTC (permalink / raw)
  To: Pu Wen; +Cc: clemens, jdelvare, linux, linux-hwmon, linux-kernel

On Sat, Dec 08, 2018 at 02:33:28PM +0800, Pu Wen wrote:
> Add support for Hygon Dhyana family 18h processor for k10temp to get the
> temperature. As Hygon Dhyana shares the same function interface with AMD
> family 17h, so add Hygon PCI Vendor ID and reuse the code path of AMD.
> 
> Signed-off-by: Pu Wen <puwen@hygon.cn>
> ---
>  drivers/hwmon/k10temp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
> index 2cef0c3..e24ba10 100644
> --- a/drivers/hwmon/k10temp.c
> +++ b/drivers/hwmon/k10temp.c
> @@ -330,7 +330,7 @@ static int k10temp_probe(struct pci_dev *pdev,
>  	     (boot_cpu_data.x86_model & 0xf0) == 0x70)) {
>  		data->read_htcreg = read_htcreg_nb_f15;
>  		data->read_tempreg = read_tempreg_nb_f15;
> -	} else if (boot_cpu_data.x86 == 0x17) {
> +	} else if (boot_cpu_data.x86 == 0x17 || boot_cpu_data.x86 == 0x18) {
>  		data->temp_adjust_mask = 0x80000;
>  		data->read_tempreg = read_tempreg_nb_f17;
>  		data->show_tdie = true;
> @@ -367,6 +367,7 @@ static const struct pci_device_id k10temp_id_table[] = {
>  	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) },
>  	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_DF_F3) },
>  	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F3) },
> +	{ PCI_VDEVICE(HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(pci, k10temp_id_table);
> -- 

Acked-by: Borislav Petkov <bp@suse.de>

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] hwmon/k10temp: Add Hygon Dhyana support
  2018-12-08  6:33 [RFC PATCH] hwmon/k10temp: Add Hygon Dhyana support Pu Wen
  2018-12-08 11:13 ` Borislav Petkov
@ 2018-12-08 15:55 ` Guenter Roeck
  2018-12-09  6:39   ` Pu Wen
  1 sibling, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2018-12-08 15:55 UTC (permalink / raw)
  To: Pu Wen; +Cc: clemens, jdelvare, bp, linux-hwmon, linux-kernel

On Sat, Dec 08, 2018 at 02:33:28PM +0800, Pu Wen wrote:
> Add support for Hygon Dhyana family 18h processor for k10temp to get the
> temperature. As Hygon Dhyana shares the same function interface with AMD
> family 17h, so add Hygon PCI Vendor ID and reuse the code path of AMD.
> 
> Signed-off-by: Pu Wen <puwen@hygon.cn>
> Acked-by: Borislav Petkov <bp@suse.de>

Applied to hwmon-next.

If the Hygon CPUs have Tctl/Tdie temperature offsets similar to some
of the AMD CPUs, please submit follow-up patches as necessary to add
support for it.

Thanks,
Guenter

> ---
>  drivers/hwmon/k10temp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
> index 2cef0c3..e24ba10 100644
> --- a/drivers/hwmon/k10temp.c
> +++ b/drivers/hwmon/k10temp.c
> @@ -330,7 +330,7 @@ static int k10temp_probe(struct pci_dev *pdev,
>  	     (boot_cpu_data.x86_model & 0xf0) == 0x70)) {
>  		data->read_htcreg = read_htcreg_nb_f15;
>  		data->read_tempreg = read_tempreg_nb_f15;
> -	} else if (boot_cpu_data.x86 == 0x17) {
> +	} else if (boot_cpu_data.x86 == 0x17 || boot_cpu_data.x86 == 0x18) {
>  		data->temp_adjust_mask = 0x80000;
>  		data->read_tempreg = read_tempreg_nb_f17;
>  		data->show_tdie = true;
> @@ -367,6 +367,7 @@ static const struct pci_device_id k10temp_id_table[] = {
>  	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) },
>  	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_DF_F3) },
>  	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F3) },
> +	{ PCI_VDEVICE(HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(pci, k10temp_id_table);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] hwmon/k10temp: Add Hygon Dhyana support
  2018-12-08 15:55 ` Guenter Roeck
@ 2018-12-09  6:39   ` Pu Wen
  0 siblings, 0 replies; 4+ messages in thread
From: Pu Wen @ 2018-12-09  6:39 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: clemens, jdelvare, bp, linux-hwmon, linux-kernel

On 2018/12/8 23:56, Guenter Roeck wrote:
> On Sat, Dec 08, 2018 at 02:33:28PM +0800, Pu Wen wrote:
>> Add support for Hygon Dhyana family 18h processor for k10temp to get the
>> temperature. As Hygon Dhyana shares the same function interface with AMD
>> family 17h, so add Hygon PCI Vendor ID and reuse the code path of AMD.
>>
>> Signed-off-by: Pu Wen <puwen@hygon.cn>
>> Acked-by: Borislav Petkov <bp@suse.de>
> 
> Applied to hwmon-next.

Thanks a lot.

> If the Hygon CPUs have Tctl/Tdie temperature offsets similar to some
> of the AMD CPUs, please submit follow-up patches as necessary to add
> support for it.

Right now Hygon Dhyana CPUs do not have temperature offsets. Of course
I'll submit follow-up patches if necessary in the future.

-- 
Regards,
Pu Wen

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-08  6:33 [RFC PATCH] hwmon/k10temp: Add Hygon Dhyana support Pu Wen
2018-12-08 11:13 ` Borislav Petkov
2018-12-08 15:55 ` Guenter Roeck
2018-12-09  6:39   ` Pu Wen

Linux-Hwmon Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hwmon/0 linux-hwmon/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hwmon linux-hwmon/ https://lore.kernel.org/linux-hwmon \
		linux-hwmon@vger.kernel.org linux-hwmon@archiver.kernel.org
	public-inbox-index linux-hwmon


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hwmon


AGPL code for this site: git clone https://public-inbox.org/ public-inbox