Skip to content

VeLinux: 6.6: Backport Venice essential additional patch for Hwmon and AMD_NB#112

Open
PvsNarasimha wants to merge 1 commit intoopenvelinux:6.6-velinuxfrom
PvsNarasimha:Venice_hwmon_additional_patch
Open

VeLinux: 6.6: Backport Venice essential additional patch for Hwmon and AMD_NB#112
PvsNarasimha wants to merge 1 commit intoopenvelinux:6.6-velinuxfrom
PvsNarasimha:Venice_hwmon_additional_patch

Conversation

@PvsNarasimha
Copy link
Copy Markdown

  • x86/amd_nb, hwmon: (k10temp): Simplify amd_pci_dev_to_node_id()

Unit test Results:

Without patch: Warning is triggered in dmesg

root@venice-hostos:/home/amd# dmesg | grep k10temp
[  966.092660] WARNING: CPU: 129 PID: 9665 at arch/x86/include/asm/amd_nb.h:94 read_tempreg_nb_zen+0x79/0xb0 [k10temp]
[  966.092674] Modules linked in: binfmt_misc nls_ascii nls_cp437 vfat fat ipmi_ssif joydev hid_generic usbhid hid intel_rapl_msr intel_rapl_common amd64_edac edac_mce_amd ghash_clmulni_intel aesni_intel crypto_simd cryptd cdc_ether usbnet mii evdev kvm_amd snd_pcm ast snd_timer drm_shmem_helper acpi_ipmi snd drm_kms_helper ipmi_si soundcore sp5100_tco rapl ipmi_devintf i2c_algo_bit acpi_cpufreq pcspkr dax_hmem ccp watchdog k10temp ipmi_msghandler button drm fuse loop configfs efivarfs ip_tables x_tables autofs4 ext4 crc32c_generic crc16 mbcache jbd2 dm_mod xhci_pci nvme ehci_pci xhci_hcd ehci_hcd nvme_core tg3 t10_pi usbcore crc32c_intel libphy usb_common crc64_rocksoft i2c_piix4
[  966.092725] RIP: 0010:read_tempreg_nb_zen+0x79/0xb0 [k10temp]
[  966.092761]  k10temp_read+0x102/0x290 [k10temp]
root@venice-hostos:/home/amd# dmesg | grep -i "AMD Northbridge"
[  966.092638] Unable to find AMD Northbridge id for 0000:00:19.3
root@venice-hostos:/home/amd#

With patch: No warnings in dmesg

commit 7dd57db495d49c004fffc77265ffbaccf340aa20 upstream.

amd_pci_dev_to_node_id() tries to find the AMD node ID of a device by
searching and counting devices.

The AMD node ID of an AMD node device is simply its slot number minus
the AMD node 0 slot number.

Simplify this function and move it to k10temp.c.

  [ Yazen: Update commit message and simplify function. ]

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Co-developed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20241206161210.163701-10-yazen.ghannam@amd.com
Signed-off-by: PvsNarasimha <PVS.NarasimhaRao@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants