[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250728-luo-pci-v1-1-955b078dd653@kernel.org>
Date: Mon, 28 Jul 2025 01:24:31 -0700
From: Chris Li <chrisl@...nel.org>
To: Bjorn Helgaas <bhelgaas@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>, Danilo Krummrich <dakr@...nel.org>,
Len Brown <lenb@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
linux-acpi@...r.kernel.org, David Matlack <dmatlack@...gle.com>,
Pasha Tatashin <tatashin@...gle.com>, Jason Miu <jasonmiu@...gle.com>,
Vipin Sharma <vipinsh@...gle.com>, Saeed Mahameed <saeedm@...dia.com>,
Adithya Jayachandran <ajayachandra@...dia.com>,
Parav Pandit <parav@...dia.com>, William Tu <witu@...dia.com>,
Mike Rapoport <rppt@...nel.org>, Chris Li <chrisl@...nel.org>,
Jason Gunthorpe <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>
Subject: [PATCH RFC 01/25] PCI/LUO: Register with Liveupdate Orchestrator
Register PCI subsystem with the Liveupdate Orchestrator
and provide noop liveupdate callbacks.
Signed-off-by: Chris Li <chrisl@...nel.org>
---
drivers/pci/Makefile | 1 +
drivers/pci/liveupdate.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+)
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 67647f1880fb8fb0629d680398f5b88d69aac660..aa1bac7aed7d12c641a6b55e56176fb3cdde4c91 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_PCI_DOE) += doe.o
obj-$(CONFIG_PCI_DYNAMIC_OF_NODES) += of_property.o
obj-$(CONFIG_PCI_NPEM) += npem.o
obj-$(CONFIG_PCIE_TPH) += tph.o
+obj-$(CONFIG_LIVEUPDATE) += liveupdate.o
# Endpoint library must be initialized before its users
obj-$(CONFIG_PCI_ENDPOINT) += endpoint/
diff --git a/drivers/pci/liveupdate.c b/drivers/pci/liveupdate.c
new file mode 100644
index 0000000000000000000000000000000000000000..86b4f3a2fb44781c6e323ba029db510450556fa9
--- /dev/null
+++ b/drivers/pci/liveupdate.c
@@ -0,0 +1,54 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/*
+ * Copyright (c) 2025, Google LLC.
+ * Chris Li <chrisl@...nel.org>
+ */
+
+#define pr_fmt(fmt) "PCI liveupdate: " fmt
+
+#include <linux/liveupdate.h>
+
+#define PCI_SUBSYSTEM_NAME "pci"
+
+static int pci_liveupdate_prepare(void *arg, u64 *data)
+{
+ pr_info("prepare data[%llx]\n", *data);
+ return 0;
+}
+
+static int pci_liveupdate_freeze(void *arg, u64 *data)
+{
+ pr_info("freeze data[%llx]\n", *data);
+ return 0;
+}
+
+static void pci_liveupdate_cancel(void *arg, u64 data)
+{
+ pr_info("cancel data[%llx]\n", data);
+}
+
+static void pci_liveupdate_finish(void *arg, u64 data)
+{
+ pr_info("finish data[%llx]\n", data);
+}
+
+struct liveupdate_subsystem pci_liveupdate_ops = {
+ .prepare = pci_liveupdate_prepare,
+ .freeze = pci_liveupdate_freeze,
+ .cancel = pci_liveupdate_cancel,
+ .finish = pci_liveupdate_finish,
+ .name = PCI_SUBSYSTEM_NAME,
+};
+
+static int __init pci_liveupdate_init(void)
+{
+ int ret;
+
+ ret = liveupdate_register_subsystem(&pci_liveupdate_ops);
+ if (ret && liveupdate_state_updated())
+ panic("PCI liveupdate: Register subsystem failed: %d", ret);
+ WARN(ret, "PCI liveupdate: Register subsystem failed %d", ret);
+ return 0;
+}
+late_initcall_sync(pci_liveupdate_init);
--
2.50.1.487.gc89ff58d15-goog
Powered by blists - more mailing lists