watchdog: sp5100_tco: Use EFCH MMIO for newer Hygon FCH
cover watchdog: sp5100_tco: Use EFCH MMIO for newer Hygon FCH
This series contains a single patch that fixes sp5100_tco device selection on newer Hygon FCH/SCH platforms.
Background
On some recent Hygon platforms (PCI vendor 0x1d94, device 0x790b), the sp5100_tco driver may select the legacy "efch" initialization path instead of using the EFCH MMIO access method (efch_mmio). When firmware leaves the EFCH_PM_DECODEEN WDT_TMREN bit cleared the legacy path falls back to an alternate window and the driver fails with the runtime message "Watchdog hardware is disabled".
Root cause
commit 009637de1f65 ("watchdog: sp5100_tco: support Hygon FCH/SCH (Server Controller Hub)") added Hygon vendor matching for the efch layout, but newer Hygon SMBus devices require the efch_mmio path (the same behavior used for recent AMD SMBus controllers). The efch_mmio path performs the EFCH MMIO probe that enables EFCH_PM_DECODEEN_WDT_TMREN before probing the watchdog MMIO block; without it the primary WDT MMIO window is not enabled and the watchdog appears disabled.
This patch
Selects efch_mmio for Hygon devices in the same place the driver does for AMD when the SMBus PCI revision supports the MMIO method. The change is intentionally minimal: it extends the existing efch_mmio selection condition to include PCI_VENDOR_ID_HYGON alongside PCI_VENDOR_ID_AMD.
Test and verification
- Before this change the problematic host printed in dmesg:
"Using 0xfed80b00 ... Watchdog hardware is disabled"
After loading the patched module dmesg shows:
"Using 0xfeb00000 for watchdog MMIO address"
"sp5100-tco ... initialized. heartbeat=60 sec (nowayout=0)" and /sys/class/watchdog/watchdog0 appears as expected.
Yingjie Gao (1):
watchdog: sp5100_tco: Use EFCH MMIO for newer Hygon FCH
drivers/watchdog/sp5100_tco.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.20.1
PATCH 1/1 watchdog: sp5100_tco: Use EFCH MMIO for newer Hygon FCH
Commit 009637de1f65 ("watchdog: sp5100_tco: support Hygon FCH/SCH (Server Controller Hub)") added Hygon vendor matching to the efch layout selection, but newer Hygon 0x790b SMBus devices still need the efch_mmio path.
The efch_mmio path enables EFCH_PM_DECODEEN_WDT_TMREN before probing the watchdog MMIO block. If firmware leaves that bit clear and the driver picks the legacy efch path instead, probe falls back to the alternate window and fails with "Watchdog hardware is disabled".
Select efch_mmio for Hygon 0x790b devices with revision 0x51 or later, matching the equivalent AMD behavior and allowing the watchdog to initialize on those systems.
--- drivers/watchdog/sp5100_tco.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/watchdog/sp5100_tco.c +2 -1
@@ -92,7 +92,8 @@ static enum tco_reg_layout tco_reg_layout(struct pci_dev *dev) dev->device == PCI_DEVICE_ID_ATI_SBX00_SMBUS && dev->revision < 0x40) {return sp5100; - } else if (dev->vendor == PCI_VENDOR_ID_AMD && + } else if ((dev->vendor == PCI_VENDOR_ID_AMD || + dev->vendor == PCI_VENDOR_ID_HYGON) && sp5100_tco_pci->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS && sp5100_tco_pci->revision >= AMD_ZEN_SMBUS_PCI_REV) {return efch_mmio;
Signature · 1 line
2.20.1
Quoted 10 lines · Yingjie Gao
Commit
009637de1f65("watchdog:sp5100_tco: support Hygon FCH/SCH (Server Controller Hub)") added Hygon vendor matching to the efch layout selection, but newer Hygon0x790bSMBus devices still need theefch_mmiopath.The
efch_mmiopath enablesEFCH_PM_DECODEEN_WDT_TMRENbefore probing the watchdog MMIO block. If firmware leaves that bit clear and the driver picks the legacy efch path instead, probe falls back to the alternate window and fails with "Watchdog hardware is disabled".
Quoted 6 lines
Select
efch_mmiofor Hygon0x790bdevices with revision0x51or later, matching the equivalent AMD behavior and allowing the watchdog to initialize on those systems.Fixes 009637de1f65 ("watchdog: sp5100_tco: support Hygon FCH/SCH (Server Controller Hub)")Signed-off-by Yingjie Gao <[email protected]>
Quoted 18 lines
--- drivers/watchdog/sp5100_tco.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/watchdog/sp5100_tco.c +2
-1@@ -92,7 +92,8 @@ static enum tco_reg_layout tco_reg_layout(struct pci_dev *dev) dev->device == PCI_DEVICE_ID_ATI_SBX00_SMBUS && dev->revision < 0x40) {return sp5100; - } else if (dev->vendor == PCI_VENDOR_ID_AMD && + } else if ((dev->vendor == PCI_VENDOR_ID_AMD || + dev->vendor == PCI_VENDOR_ID_HYGON) && sp5100_tco_pci->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS && sp5100_tco_pci->revision >= AMD_ZEN_SMBUS_PCI_REV) {return efch_mmio;