Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH v4 0/5] x86/hygon: Add Family 0x18 DF node enumeration and SMN access
@ 2026-09-01  7:16 Lin Wang
  2026-09-01  7:16 ` [PATCH v4 1/5] pci_ids: Add Hygon Family 0x18 DF F3/F4 device IDs Lin Wang
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Lin Wang @ 2026-09-01  7:16 UTC (permalink / raw)
  To: Borislav Petkov, yazen.ghannam, mario.limonciello
  Cc: tglx, mingo, dave.hansen, H. Peter Anvin, bhelgaas, x86,
	linux-pci, linux-kernel

This revision addresses the Sashiko comments on v3.

Sashiko noted that v3 disabled AMD NB and SMN initialization on Hygon
while amd64_edac, ATL and k10temp could still call those interfaces. V4
restores the pre-v3 AMD NB behavior and leaves those drivers unchanged.
The broad SMN exclusion is replaced by a model-specific handoff to the
Hygon SMN setup.

However, restoring AMD NB initialization does not make the AMD paths
usable for the Family 0x18 topology covered here. AMD NB maps nodes 0
through 7 to fixed PCI slots. Hygon discovers F3 devices by PCI ID, may
expose more than eight DF nodes, reports sparse CPU NodeIds, and groups
SMN roots by socket.

This series adds the Hygon node and SMN interfaces first so the Hygon
paths in those drivers can be converted separately.

The AMD-side changes check smn_exclusive before accessing amd_roots.
On these models, amd_smn_init() does not reserve the roots needed by
Hygon SMN setup. AMD SMN calls return -ENODEV until their callers use
the Hygon interfaces. The remaining Hygon handling in amd_nb.c and
amd_node.c can then be removed separately.

Sashiko also found that v3 retained pci_get_class() iterator devices
without owning references. The Hygon setup now holds a reference for
every reserved root and releases all references and config regions on
failure.

The corresponding reference and roots_per_node issues in
amd_smn_init() predate this series. Yazen confirmed them and is handling
the AMD fixes separately.

The node and SMN implementation has been tested on a Family 0x18 Model
0x07 system with 2 sockets, 12 CDDs and 4 IODs.

Changes in v4:

  - Drop the v3 AMD NB vendor restriction. (Sashiko)
  - Replace the vendor-wide AMD SMN exclusion with a model-scoped
    handoff. (Sashiko)
  - Hold references for reserved Hygon SMN roots and release all
    resources on setup failure. (Sashiko)
  - Drop the SMN debugfs interface.

Links:

  Sashiko v3 review:
    https://sashiko.dev/#/patchset/20260709075549.626095-1-wanglin%40open-hieco.net

  RFC v1:
    https://lore.kernel.org/all/20260402111515.1155505-1-wanglin@open-hieco.net/

  RFC v2:
    https://lore.kernel.org/all/20260423060420.1785357-1-wanglin@open-hieco.net/

  v3:
    https://lore.kernel.org/all/20260709075549.626095-1-wanglin@open-hieco.net/


Lin Wang (5):
  pci_ids: Add Hygon Family 0x18 DF F3/F4 device IDs
  x86/hygon: Add Family 0x18 DF node enumeration
  x86/hygon: Map CPU NodeIds to DF nodes
  x86/amd_node: Skip SMN setup on Hygon Fam18h models 0x04-0x08
  x86/hygon: Add Family 0x18 SMN access

 MAINTAINERS                       |    3 +
 arch/x86/Kconfig                  |    4 +
 arch/x86/include/asm/hygon/node.h |  207 ++++++
 arch/x86/kernel/Makefile          |    1 +
 arch/x86/kernel/amd_node.c        |   18 +-
 arch/x86/kernel/hygon_node.c      | 1011 +++++++++++++++++++++++++++++
 include/linux/pci_ids.h           |    6 +
 7 files changed, 1247 insertions(+), 3 deletions(-)
 create mode 100644 arch/x86/include/asm/hygon/node.h
 create mode 100644 arch/x86/kernel/hygon_node.c


base-commit: abdf623ddb75b24659018d3952d8f61937306ae5
-- 
2.43.0


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

end of thread, other threads:[~2026-09-04  6:26 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01  7:16 [PATCH v4 0/5] x86/hygon: Add Family 0x18 DF node enumeration and SMN access Lin Wang
2026-09-01  7:16 ` [PATCH v4 1/5] pci_ids: Add Hygon Family 0x18 DF F3/F4 device IDs Lin Wang
2026-09-01  7:34   ` sashiko-bot
2026-09-03 22:10   ` Bjorn Helgaas
2026-09-04  3:18     ` Lin Wang
2026-09-01  7:16 ` [PATCH v4 2/5] x86/hygon: Add Family 0x18 DF node enumeration Lin Wang
2026-09-01  7:29   ` sashiko-bot
2026-09-01  7:16 ` [PATCH v4 3/5] x86/hygon: Map CPU NodeIds to DF nodes Lin Wang
2026-09-01  7:32   ` sashiko-bot
2026-09-01  7:16 ` [PATCH v4 4/5] x86/amd_node: Skip SMN setup on Hygon Fam18h models 0x04-0x08 Lin Wang
2026-09-01  7:34   ` sashiko-bot
2026-09-02  2:48   ` Borislav Petkov
2026-09-02  6:22     ` Lin Wang
2026-09-02 15:13       ` Borislav Petkov
2026-09-03  1:49         ` Lin Wang
2026-09-03 17:34           ` Yazen Ghannam
2026-09-04  2:43             ` Lin Wang
2026-09-04  5:36           ` Borislav Petkov
2026-09-04  6:26             ` Lin Wang
2026-09-01  7:17 ` [PATCH v4 5/5] x86/hygon: Add Family 0x18 SMN access Lin Wang
2026-09-01  7:28   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox