summaryrefslogtreecommitdiffstats
path: root/patches/jailhouse/jailhouse_0005.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/jailhouse/jailhouse_0005.patch')
-rw-r--r--patches/jailhouse/jailhouse_0005.patch64
1 files changed, 0 insertions, 64 deletions
diff --git a/patches/jailhouse/jailhouse_0005.patch b/patches/jailhouse/jailhouse_0005.patch
deleted file mode 100644
index cafff2b..0000000
--- a/patches/jailhouse/jailhouse_0005.patch
+++ /dev/null
@@ -1,64 +0,0 @@
1From d921eb56b4b0516a0bd46e9337c3deb773146faf Mon Sep 17 00:00:00 2001
2From: Jan Kiszka <jan.kiszka@siemens.com>
3Date: Tue, 21 Jun 2016 19:58:08 +0200
4Subject: [PATCH] pci: Add support for unbinding the generic PCI host
5 controller
6
7Particularly useful when working in virtual environments where the
8controller may come and go, but possibly not only there.
9
10NOTE: leaks memory, see lkml thread!
11---
12 drivers/pci/host/pci-host-common.c | 13 +++++++++++++
13 drivers/pci/host/pci-host-generic.c | 1 +
14 include/linux/pci-ecam.h | 1 +
15 3 files changed, 15 insertions(+)
16
17diff --git a/drivers/pci/host/pci-host-common.c b/drivers/pci/host/pci-host-common.c
18index 44a47d4..e0da836 100644
19--- a/drivers/pci/host/pci-host-common.c
20+++ b/drivers/pci/host/pci-host-common.c
21@@ -176,5 +176,18 @@ int pci_host_common_probe(struct platform_device *pdev,
22 }
23
24 pci_bus_add_devices(bus);
25+ platform_set_drvdata(pdev, bus);
26+ return 0;
27+}
28+
29+int pci_host_common_remove(struct platform_device *pdev)
30+{
31+ struct pci_bus *bus = platform_get_drvdata(pdev);
32+
33+ pci_lock_rescan_remove();
34+ pci_stop_root_bus(bus);
35+ pci_remove_root_bus(bus);
36+ pci_unlock_rescan_remove();
37+
38 return 0;
39 }
40diff --git a/drivers/pci/host/pci-host-generic.c b/drivers/pci/host/pci-host-generic.c
41index 7d709a7..b35057e 100644
42--- a/drivers/pci/host/pci-host-generic.c
43+++ b/drivers/pci/host/pci-host-generic.c
44@@ -63,5 +63,6 @@ static struct platform_driver gen_pci_driver = {
45 .suppress_bind_attrs = true,
46 },
47 .probe = gen_pci_probe,
48+ .remove = pci_host_common_remove,
49 };
50 builtin_platform_driver(gen_pci_driver);
51diff --git a/include/linux/pci-ecam.h b/include/linux/pci-ecam.h
52index 809c2f1..36c9ddb 100644
53--- a/include/linux/pci-ecam.h
54+++ b/include/linux/pci-ecam.h
55@@ -73,5 +73,6 @@ extern struct pci_ecam_ops xgene_v2_pcie_ecam_ops; /* APM X-Gene PCIe v2.x */
56 /* for DT-based PCI controllers that support ECAM */
57 int pci_host_common_probe(struct platform_device *pdev,
58 struct pci_ecam_ops *ops);
59+int pci_host_common_remove(struct platform_device *pdev);
60 #endif
61 #endif
62--
632.1.4
64