Commit Graph

873808 Commits

Author SHA1 Message Date
Xingui Yang 34579739f9 scsi: libsas: Fix the failure of adding phy with zero-address to port
commit 06036a0a5db34642c5dbe22021a767141f010b7a upstream.

As of commit 7d1d865181 ("[SCSI] libsas: fix false positive 'device
attached' conditions"), reset the phy->entacted_sas_addr address to a
zero-address when the link rate is less than 1.5G.

Currently we find that when a new device is attached, and the link rate is
less than 1.5G, but the device type is not NO_DEVICE, for example: the link
rate is SAS_PHY_RESET_IN_PROGRESS and the device type is stp. After setting
the phy->entacted_sas_addr address to the zero address, the port will
continue to be created for the phy with the zero-address, and other phys
with the zero-address will be tried to be added to the new port:

[562240.051197] sas: ex 500e004aaaaaaa1f phy19:U:0 attached: 0000000000000000 (no device)
// phy19 is deleted but still on the parent port's phy_list
[562240.062536] sas: ex 500e004aaaaaaa1f phy0 new device attached
[562240.062616] sas: ex 500e004aaaaaaa1f phy00:U:5 attached: 0000000000000000 (stp)
[562240.062680] port-7:7:0: trying to add phy phy-7:7:19 fails: it's already part of another port

Therefore, it should be the same as sas_get_phy_attached_dev(). Only when
device_type is SAS_PHY_UNUSED, sas_address is set to the 0 address.

Fixes: 7d1d865181 ("[SCSI] libsas: fix false positive 'device attached' conditions")
Signed-off-by: Xingui Yang <yangxingui@huawei.com>
Link: https://lore.kernel.org/r/20240312141103.31358-5-yangxingui@huawei.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:54:10 +08:00
Xingui Yang 4db1d55bf3 scsi: libsas: Fix exp-attached device scan after probe failure scanned in again after probe failed
commit ab2068a6fb84751836a84c26ca72b3beb349619d upstream.

The expander phy will be treated as broadcast flutter in the next
revalidation after the exp-attached end device probe failed, as follows:

[78779.654026] sas: broadcast received: 0
[78779.654037] sas: REVALIDATING DOMAIN on port 0, pid:10
[78779.654680] sas: ex 500e004aaaaaaa1f phy05 change count has changed
[78779.662977] sas: ex 500e004aaaaaaa1f phy05 originated BROADCAST(CHANGE)
[78779.662986] sas: ex 500e004aaaaaaa1f phy05 new device attached
[78779.663079] sas: ex 500e004aaaaaaa1f phy05:U:8 attached: 500e004aaaaaaa05 (stp)
[78779.693542] hisi_sas_v3_hw 0000:b4:02.0: dev[16:5] found
[78779.701155] sas: done REVALIDATING DOMAIN on port 0, pid:10, res 0x0
[78779.707864] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
...
[78835.161307] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0 tries: 1
[78835.171344] sas: sas_probe_sata: for exp-attached device 500e004aaaaaaa05 returned -19
[78835.180879] hisi_sas_v3_hw 0000:b4:02.0: dev[16:5] is gone
[78835.187487] sas: broadcast received: 0
[78835.187504] sas: REVALIDATING DOMAIN on port 0, pid:10
[78835.188263] sas: ex 500e004aaaaaaa1f phy05 change count has changed
[78835.195870] sas: ex 500e004aaaaaaa1f phy05 originated BROADCAST(CHANGE)
[78835.195875] sas: ex 500e004aaaaaaa1f rediscovering phy05
[78835.196022] sas: ex 500e004aaaaaaa1f phy05:U:A attached: 500e004aaaaaaa05 (stp)
[78835.196026] sas: ex 500e004aaaaaaa1f phy05 broadcast flutter
[78835.197615] sas: done REVALIDATING DOMAIN on port 0, pid:10, res 0x0

The cause of the problem is that the related ex_phy's attached_sas_addr was
not cleared after the end device probe failed, so reset it.

Signed-off-by: Xingui Yang <yangxingui@huawei.com>
Link: https://lore.kernel.org/r/20240619091742.25465-1-yangxingui@huawei.com
Reviewed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:54:09 +08:00
Jason Yan dac780b912 scsi: libsas: Abort all in-flight requests when device is gone
commit 0e4b1791d9 upstream.

When a disk is removed with in-flight I/O, the application needs to wait
for 30 seconds (depending on the timeout configuration) to hear back from
the kernel. Xingui tried to fix this issue by aborting the ATA link for
SATA devices[1], however this approach left the SAS devices unresolved.

Try to fix this issue by aborting all in-flight requests when the device is
gone. This is implemented by iterating over the tagset.

[1] https://lore.kernel.org/lkml/234e04db-7539-07e4-a6b8-c6b05f78193d@opensource.wdc.com/T/

Cc: Xingui Yang <yangxingui@huawei.com>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Cc: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20230330110930.175539-1-yanaijie@huawei.com
Reviewed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:54:09 +08:00
yuehongwu b5ff085781 config: enable CONFIG_IMA for aarch64/x86 platform
This commit is made to align the kernel config with the 0009-kabi branch.

Conflicts:
	arch/arm64/configs/tencent.config

Signed-off-by: yuehongwu <yuehongwu@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:49:56 +08:00
mengensun d1539b3a33 net: add FOU support for arm
[tapd]
https://tapd.woa.com/tapd_fe/20422414/bug/detail/1020422414132816169

compile FOU module in tree

Reviewed-by: Hui Li <caelli@tencent.com>
Signed-off-by: mengensun <mengensun@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:47:33 +08:00
mengensun 160090b763 net: add MPLS_IPTUNNEL for arm64
[tapd]
https://tapd.woa.com/tapd_fe/20422414/bug/detail/1020422414132816799

compile mpls ip tunnel module in tree

Reviewed-by: Hui Li <caelli@tencent.com>
Signed-off-by: mengensun <mengensun@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:47:14 +08:00
mengensun 9f3c0949e3 crypto: add cast5 and cast6
Open CONFIG_CRYPTO_CAST5 and CONFIG_CRYPTO_CAST6

[tapd]
https://tapd.woa.com/tapd_fe/20422414/bug/detail/1020422414132825831

Reviewed-by: Hui Li <caelli@tencent.com>
Signed-off-by: mengensun <mengensun@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:47:04 +08:00
caelli ff9fa99f29 config: enable arm64 CONFIG_TASKSTATS
enabel arm64 CONFIG_TASKSTATS to meet with x86.

Reviewed-by: Mengen Sun <mengensun@tencent.com>
Signed-off-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:46:22 +08:00
yilingjin f9e88e5991 arm64: change config for performance
change some config for performance

Conflicts:
	arch/arm64/configs/tencent.config

Signed-off-by: yilingjin <yilingjin@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:44:56 +08:00
caelli 8e0c271e59 arm64: change config for performance
change some config for performance

Signed-off-by: caelli <caelli@tencent.com>
Reviewed-by: yilingjin <yilingjin@tencent.com>
Reviewed-by: yuehongwu <yuehongwu@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:43:08 +08:00
caelli f7c05e9930 alinux: arm64: adjust tk_core memory layout
to #29722367

On some specific hardware with 128 bytes LLC cacheline, tk_core may
cause false sharing problem. We can align it to 128 bytes so that
it won't be affected by other global variables.

This change will make a bit waste on cache utilization but get good
number of performance improvement. So for both 64 and 128 bytes aligned
LLC cacheline, we adjust tk_core memory layout to avoid potential cacheline
contention.

Signed-off-by: Peng Wang <rocking@linux.alibaba.com>
Acked-by: Shanpei Chen <shanpeic@linux.alibaba.com>
Reviewed-by: Shile Zhang <shile.zhang@linux.alibaba.com>
Signed-off-by: caelli <caelli@tencent.com>
Reviewed-by: yilingjin <yilingjin@tencent.com>
Reviewed-by: yuehongwu <yuehongwu@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:42:38 +08:00
yilingjin 0af6134c5d arm64/configs: turn CONFIG_RTC_DRV_EFI on
Signed-off-by: yilingjin <yilingjin@tencent.com>
Reviewed-by: Hui Li <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:41:56 +08:00
sumiyawang 423a05aff9 driver: update hisilicon hardware crypto engine
keep the hisilicon crypto driver up to 1.3.11, autoprobe
the modules when hardware enabled.

Signed-off-by: sumiyawang <sumiyawang@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Chun Liu <kaicliu@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:27:11 +08:00
Jinliang Zheng 3f292f4946 Revert "crypto: hisilicon - Kunpeng916 crypto driver don't sleep when in softirq"
This reverts commit cf411bcc65.

Revert to facilitate integration of higher version drivers: 1.3.11

Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Chun Liu <kaicliu@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:27:00 +08:00
yuehongwu a5d4379c97 config: Enabled some configs to fix hinic errors at arm64.
- CONFIG_PCI_PF_STUB=m
- CONFIG_PCI_IOV=y
- CONFIG_THIRDPARTY_HINIC=m
- CONFIG_THIRDPARTY_DRM_AST=m
delete CONFIG_DRM_AST=m
delete CONFIG_HINIC=m

Conflicts:
	arch/arm64/configs/tencent.config

Signed-off-by: yuehongwu <yuehongwu@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:25:05 +08:00
MengEn Sun 0f790584f3 ice: add ice driver for arm64
PTP feature of ice NIC is depend on x86 cpu feature of known
Constant TSC frequency there is no tsc on arm64, so do not
init the PTP callback function on arm64.

btw: we compile the ice driver as modules from now on

Reviewed-by: yuehongwu <yuehongwu@tencent.com>
Signed-off-by: MengEn Sun <mengensun@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: mengensun <mengensun@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:22:34 +08:00
Jinliang Zheng a2936f347e ice: update thirdparty ice nic driver to 1.10.1.2
Conflicts:
	drivers/thirdparty/ice/ice_ethtool.c

Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: mengensun <mengensun@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:22:04 +08:00
caelli 9660939fa0 config: enable vcan
enable vcan config.

Signed-off-by: caelli <caelli@tencent.com>
Reviewed-by: JinLiang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Mengen Sun <mengensun@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:06:28 +08:00
yuehongwu c24f9e1156 config: open config CONFIG_SND_SEQUENCER
[tapd:https://tapd.woa.com/tapd_fe/20422414/story/detail/1020422414117305849]

Signed-off-by: yuehongwu <yuehongwu@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:06:12 +08:00
caelli d9153e6d8f config: enable CONFIG_RDS
enabel CONFIG_RDS to support Reliable Datagram Sockets.

Reviewed-by: Mengen Sun <mengensun@tencent.com>
Signed-off-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:06:01 +08:00
yuehongwu 1565f043da x86:Disable the CONFIG_PSI (Pressure Stall Information) feature
by default to potentially improve performance metrics in UnixBench tests

Signed-off-by: yuehongwu <yuehongwu@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:05:49 +08:00
yuehongwu e5504ab2cd hygon: The feature of Hygon SSE2 accelerated memory copy is disabled by default.
nt_cpy_mini_len is used by get_nt_block_copy_mini_len function,and return
to nt_blk_cpy_mini_len variable. nt_blk_cpy_mini_len will be used in
arch/x86/include/asm/uaccess_64.h, if it is 0, kernel will not call
copy_user_large_memory_generic_string function.

Signed-off-by: yuehongwu <yuehongwu@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:04:27 +08:00
yuehongwu 8c1095515a hygon: Open config for support hygon sse2 instruction to accelerate memory copy.
enable: CONFIG_USING_FPU_IN_KERNEL_NONATOMIC=y
        CONFIG_USING_SSE2_FOR_LARGE_MEMORY_COPY=y

Conflicts:
	arch/x86/configs/tencent.config

Signed-off-by: yuehongwu <yuehongwu@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:03:23 +08:00
yuehongwu 183ff542e7 hygon: newfeature Support sse2 instruction to accelerate memory copy.
Add using fpu in kernel nonatomic context function and using sse2
memcpy for copy_user_generic_string

Signed-off-by: yuehongwu <yuehongwu@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:01:44 +08:00
yuehongwu 949978bef2 x86: NOMWAIT HLT C1 as the default idle state at hygon platform.
For performance considerations, the hygon platform defaults to using HLT as the C1 state.

Signed-off-by: yuehognwu yuehongwu@tencent.com
Reviewed-by: caelli caelli@tencent.com
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:01:30 +08:00
Jinliang Zheng 9d1d946a72 hygon: turn CONFIG_MICROCODE_HYGON on
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:00:32 +08:00
fuhao 1ff035c011 x86/resctrl: Add Hygon QoS support
Add support for Hygon QoS feature.

Signed-off-by: fuhao <fuh@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:00:32 +08:00
Pu Wen d7b445324e anolis: perf/x86/uncore: Add L3 PMU support for Hygon family 18h model 6h
ANBZ: #5455

Adjust the L3 PMU slicemask and threadmask for Hygon family 18h
model 6h processor.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Reviewed-by: Artie Ding <artie.ding@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/2536
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:00:32 +08:00
fuhao e45c93c358 ALSA: hda: Fix single byte writing issue for Hygon family 18h model 5h
On Hygon family 18h model 5h controller, some registers such as
GCTL, SD_CTL and SD_CTL_3B should be accessed in dword, or the
writing will fail.

Conflicts:
	sound/pci/hda/hda_intel.c

Signed-off-by: fuhao <fuh@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 19:00:07 +08:00
fuhao eaad4d0de2 ALSA: hda: Add support for Hygon family 18h model 5h HD-Audio
Add the new PCI ID 0x1d94 0x14a9 for Hygon family 18h model 5h
HDA controller.

Conflicts:
	sound/pci/hda/hda_intel.c

Signed-off-by: fuhao <fuh@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 18:56:59 +08:00
fuhao 768858da65 EDAC/amd64: Adjust UMC channel for Hygon family 18h model 6h
Hygon family 18h model 6h has 2 cs mapped to 1 umc, so adjust for it.

Fixes: 6cf6141e
 ("EDAC/amd64: Add support for Hygon family 18h model 6h")

Signed-off-by: fuhao <fuh@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:30 +08:00
fuhao af62cfaf8b x86/amd_nb: Get DF ID from F5 device for Hygon family 18h model 6h
The DF ID should be get from DF F5 device for Hygon family 18h
model 6h processor.

Fixes: 3e980dd8
 ("x86/amd_nb: Add support for Hygon family 18h model 6h")

Signed-off-by: fuhao <fuh@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:30 +08:00
fuhao 6aaeaee473 EDAC/amd64: Fix intlv_num_chan for Hygon family 18h model 4h
Make the modification in commit 0ac06d63 to intlv_num_chan only
for Hygon family 18h model 4h.

Fixes: 0ac06d63
 ("EDAC/amd64: Adjust address translation for Hygon family 18h model 4h")

Signed-off-by: fuhao <fuh@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:30 +08:00
fuhao f687e8b76a EDAC/amd64: Revert hi_addr_offset for Hygon family 18h model 4h
The HiAddrOffset is always the top 4 bits of normalized address,
so revert the modification in commit 0ac06d63 to the original
implementation.

Fixes: 0ac06d63
 ("EDAC/amd64: Adjust address translation for Hygon family 18h model 4h")

Signed-off-by: fuhao <fuh@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:30 +08:00
Pu Wen b799eb7121 EDAC/amd64: Add support for Hygon family 18h model 6h
Add F0/F6 device IDs for Hygon family 18h model 6h processor.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:30 +08:00
Pu Wen 2bf609d3dd x86/amd_nb: Add support for Hygon family 18h model 6h
Hygon family 18h model 6h processor has the same DF F1 device ID
as M05H_DF_F1.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:30 +08:00
Pu Wen 17704da187 x86/cpu: Get CPU topology for Hygon family 18h model 6h
Add support to derive CPU topology for Hygon family 18h model 6h
processor.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:30 +08:00
Pu Wen 735e1788da hwmon/k10temp: Add support for Hygon family 18h model 5h
Add 18H_M05H DF F3 device ID to get the temperature for Hygon
family 18h model 5h processor.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:29 +08:00
Pu Wen 24e1f7cdda EDAC/amd64: Add support for Hygon family 18h model 5h
Hygon family 18h model 5h processor has the same F0/F6 device IDs as
F17h_M30h, and the syndrome size is the same as model 4h processor.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:29 +08:00
Pu Wen 2c598bc5d1 x86/amd_nb: Add support for Hygon family 18h model 5h
Add root and DF F1/F3/F4 device IDs for Hygon family 18h model
5h processors. But some model 5h processors have the legacy(M04H)
DF devices, so add a if conditional to read the df1 register.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:29 +08:00
Pu Wen 9c869204b2 x86/cpu: Get CPU topology and LLC ID for Hygon family 18h model 5h
Add support to derive CPU topology for Hygon family 18h model 5h
processor, and calculate LLC ID for it from the number of threads
sharing the cache.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:29 +08:00
Pu Wen 6b45f25208 i2c-piix4: Remove the IMC detecting for Hygon SMBus
Remove IMC detecting path for Hygon processors.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:29 +08:00
Pu Wen 35c1b7081e hwmon/k10temp: Add support for Hygon family 18h model 4h
The DF F3 device ID used to get the temperature for Hygon family 18h
model 4h processor is the same as 17H_M30H, but with different offsets,
which may span two distributed ranges. The second offset range can be
considered as private for Hygon, so use struct hygon_private to describe
it.

Add a pointer priv in k10temp_data to point to the private data.
Add functions k10temp_get_ccd_support_2nd() and hygon_read_temp()
to support reading the second offset range.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:29 +08:00
Pu Wen 9680d833c1 EDAC/mce_amd: Use struct cpuinfo_x86.logical_die_id for Hygon NodeId
The cpuinfo_x86.cpu_die_id is get from CPUID or MSR in the commit
028c221ed1 ("x86/CPU/AMD: Save AMD NodeId as cpu_die_id"). But the
value may not be continuous for Hygon model 4h~6h processors.

Use cpuinfo_x86.logical_die_id will always format continuous die
(or node) IDs, because it will convert the physical die ID to logical
die ID.

So use topology_logical_die_id() instead of topology_die_id() to
decode UMC ECC errors for Hygon processors.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:29 +08:00
Pu Wen 2c453f4b4e EDAC/amd64: Adjust address translation for Hygon family 18h model 4h
Add Hygon family 18h model 4h processor support for DramOffset and
HiAddrOffset, and get the socket interleaving number from DramBase-
Address(D18F0x110).

Update intlv_num_chan and num_intlv_bits support for Hygon family 18h
model 4h processor.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:29 +08:00
Pu Wen 36d1aba7a1 EDAC/amd64: Add support for Hygon family 18h model 4h
Hygon family 18h model 4h processor has the same F0/F6 device IDs
as F17h_M30h.

Add support to determine which DDR memory types it supports, but
determine syndrome sizes from different bits of the DRAM ECC control
reg.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:29 +08:00
Pu Wen 98cb40237c EDAC/amd64: Get UMC channel from the 6th nibble for Hygon
On Hygon family 18h platforms, we look at the 6th nibble(bit 20~23)
in the instance_id to derive the channel number.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:29 +08:00
Pu Wen 038d8bb6ce iommu/hygon: Add support for Hygon family 18h model 4h IOAPIC
The SB IOAPIC is on the device 0xb from Hygon family 18h model 4h.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:28 +08:00
Pu Wen 2336e8989a x86/amd_nb: Add northbridge support for Hygon family 18h model 4h
Add dedicated functions to initialize the northbridge for Hygon family
18h model 4h processors.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:28 +08:00
Pu Wen 88dbf4a46d x86/amd_nb: Add Hygon family 18h model 4h PCI IDs
Add the PCI device IDs for Hygon family 18h model 4h processors.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-14 17:48:28 +08:00