gemini: In-flight ethernet patches
[openwrt/openwrt.git] / target / linux / generic / backport-5.10 / 822-v5.13-advertise-lack-of-built-in-msi-handling.patch
1 From 645e9c38383d7fcde2784ee537fa18ec9bed54d9 Mon Sep 17 00:00:00 2001
2 From: Thomas Gleixner <tglx@linutronix.de>
3 Date: Tue, 30 Mar 2021 16:11:43 +0100
4 Subject: PCI: mediatek: Advertise lack of built-in MSI handling
5
6 Some Mediatek host bridges cannot handle MSIs, which is sad.
7 This also results in an ugly warning at device probe time,
8 as the core PCI code wasn't told that MSIs were not available.
9
10 Advertise this fact to the rest of the core PCI code by
11 using the 'msi_domain' attribute, which still opens the possibility
12 for another block to provide the MSI functionnality.
13
14 [maz: commit message, switched over to msi_domain attribute]
15
16 Link: https://lore.kernel.org/r/20210330151145.997953-13-maz@kernel.org
17 Reported-by: Frank Wunderlich <frank-w@public-files.de>
18 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
19 Signed-off-by: Marc Zyngier <maz@kernel.org>
20 Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
21 Acked-by: Bjorn Helgaas <bhelgaas@google.com>
22 ---
23 drivers/pci/controller/pcie-mediatek.c | 4 ++++
24 1 file changed, 4 insertions(+)
25
26 --- a/drivers/pci/controller/pcie-mediatek.c
27 +++ b/drivers/pci/controller/pcie-mediatek.c
28 @@ -143,6 +143,7 @@ struct mtk_pcie_port;
29 * struct mtk_pcie_soc - differentiate between host generations
30 * @need_fix_class_id: whether this host's class ID needed to be fixed or not
31 * @need_fix_device_id: whether this host's device ID needed to be fixed or not
32 + * @no_msi: Bridge has no MSI support, and relies on an external block
33 * @device_id: device ID which this host need to be fixed
34 * @ops: pointer to configuration access functions
35 * @startup: pointer to controller setting functions
36 @@ -151,6 +152,7 @@ struct mtk_pcie_port;
37 struct mtk_pcie_soc {
38 bool need_fix_class_id;
39 bool need_fix_device_id;
40 + bool no_msi;
41 unsigned int device_id;
42 struct pci_ops *ops;
43 int (*startup)(struct mtk_pcie_port *port);
44 @@ -1087,6 +1089,7 @@ static int mtk_pcie_probe(struct platfor
45
46 host->ops = pcie->soc->ops;
47 host->sysdata = pcie;
48 + host->msi_domain = pcie->soc->no_msi;
49
50 err = pci_host_probe(host);
51 if (err)
52 @@ -1176,6 +1179,7 @@ static const struct dev_pm_ops mtk_pcie_
53 };
54
55 static const struct mtk_pcie_soc mtk_pcie_soc_v1 = {
56 + .no_msi = true,
57 .ops = &mtk_pcie_ops,
58 .startup = mtk_pcie_startup_port,
59 };