+118
−216
+20
−43
Loading
mainline inclusion from mainline-v6.4-rc1 commit ed623d55 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IAU6ZD Reference: https://github.com/torvalds/linux/commit/ed623d55eef46d0ca7557b9665b4693931bfb507 -------------------------------- commit ed623d55 uptream Future AMD systems will support heterogeneous "AMD Node" types, e.g. CPU and GPU types. Therefore, a global family type shared across all AMD nodes is no longer appropriate. Move struct low_ops routines and members of struct amd64_family_type to struct amd64_pvt. Currently, there are many code branches that split between "modern" and "legacy" systems. Another code branch will be needed in order to cover GPU cases. However, rather than introduce another branching case in multiple functions, the current branching code should be switched to a set of function pointers. This change makes the code more readable and simplifies adding support for new families/models. In order to reuse code, define two sets of function pointers. Use one for modern systems (Family 17h and later). This will not change between current CPU families. Use another set of function pointers for legacy systems (before Family 17h). Use the Family 16h versions as default for the legacy ops since these are the latest, and adjust the function pointers as needed for older families. [ Yazen: rebased/reworked patch and reworded commit message. ] [ bp: Fix rev8 or later check. ] [Backport changes] 1. In `drivers/edac/amd64_edac.c` file, in `read_umc_base_mask()` the variable umc_base was retained according to changes done in 55b01665 to maintain code changes done for hygon hardwares. 2. In `if` condition the variable changed from `fam_type` to `pvt` in `determine_memory_type_df()` in `drivers/edac/amd64_edac.c` as per upstream patch and to retain the code changes done for hygon hardwares. 3. In `drivers/edac/amd64_edac.c` file, in `per_family_init()` and in `struct amd64_family_type family_types[]`, changes for the Hygon are done as per the upstream patch. Signed-off-by:Muralidhara M K <muralidhara.mk@amd.com> Co-developed-by:
Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com> Signed-off-by:
Naveen Krishna Chatradhi <naveenkrishna.chatradhi@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> Link: https://lore.kernel.org/r/20230127170419.1824692-11-yazen.ghannam@amd.com Signed-off-by:
PvsNarasimha <PVS.NarasimhaRao@amd.com>