aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn-Mark Gurney <jmg@FreeBSD.org>2025-12-03 21:19:10 +0000
committerJohn-Mark Gurney <jmg@FreeBSD.org>2025-12-03 21:19:10 +0000
commit1ba6fd3de531a3e731d33e9ad376ce3fa602e866 (patch)
tree29d06f37396958191151cb40a3178561573d8eb4
parent3d71ce92eae9f1417f35a0d07912858fd8f6fa0b (diff)
ichsmb: shutdown interrupts to prevent spurious interrupts after kexec
Obtained from: Hewlett Packard Enterprise Rebiewed by: jhb, jhibbits
-rw-r--r--sys/dev/ichsmb/ichsmb.c11
-rw-r--r--sys/dev/ichsmb/ichsmb_pci.c1
-rw-r--r--sys/dev/ichsmb/ichsmb_var.h1
3 files changed, 13 insertions, 0 deletions
diff --git a/sys/dev/ichsmb/ichsmb.c b/sys/dev/ichsmb/ichsmb.c
index c5e9e2f1b9ed..e40a8a8a3886 100644
--- a/sys/dev/ichsmb/ichsmb.c
+++ b/sys/dev/ichsmb/ichsmb.c
@@ -703,4 +703,15 @@ ichsmb_detach(device_t dev)
return 0;
}
+int
+ichsmb_shutdown(device_t dev)
+{
+ const sc_p sc = device_get_softc(dev);
+
+ /* Disable interrupts */
+ bus_write_1(sc->io_res, ICH_HST_CNT, 0);
+
+ return (0);
+}
+
DRIVER_MODULE(smbus, ichsmb, smbus_driver, 0, 0);
diff --git a/sys/dev/ichsmb/ichsmb_pci.c b/sys/dev/ichsmb/ichsmb_pci.c
index e4d87fe1fed2..9ffb1de62dac 100644
--- a/sys/dev/ichsmb/ichsmb_pci.c
+++ b/sys/dev/ichsmb/ichsmb_pci.c
@@ -243,6 +243,7 @@ static device_method_t ichsmb_pci_methods[] = {
DEVMETHOD(device_probe, ichsmb_pci_probe),
DEVMETHOD(device_attach, ichsmb_pci_attach),
DEVMETHOD(device_detach, ichsmb_detach),
+ DEVMETHOD(device_shutdown, ichsmb_shutdown),
/* SMBus methods */
DEVMETHOD(smbus_callback, ichsmb_callback),
diff --git a/sys/dev/ichsmb/ichsmb_var.h b/sys/dev/ichsmb/ichsmb_var.h
index 7fb14804d3c4..8aeaf403781b 100644
--- a/sys/dev/ichsmb/ichsmb_var.h
+++ b/sys/dev/ichsmb/ichsmb_var.h
@@ -84,6 +84,7 @@ extern void ichsmb_release_resources(sc_p sc);
extern int ichsmb_probe(device_t dev);
extern int ichsmb_attach(device_t dev);
extern int ichsmb_detach(device_t dev);
+extern int ichsmb_shutdown(device_t dev);
#endif /* _DEV_ICHSMB_ICHSMB_VAR_H */