linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Marc Zyngier <maz@kernel.org>,
	Frank Wunderlich <frank-w@public-files.de>
Cc: Ryder Lee <ryder.lee@mediatek.com>,
	linux-mediatek@lists.infradead.org,
	Frank Wunderlich <linux@fw-web.de>,
	linux-kernel@vger.kernel.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: Aw: Re: [PATCH] pci: mediatek: fix warning in msi.h
Date: Sun, 01 Nov 2020 23:27:17 +0100	[thread overview]
Message-ID: <87pn4w90hm.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <87k0v4u4uq.wl-maz@kernel.org>

On Sun, Nov 01 2020 at 21:47, Marc Zyngier wrote:
> On Sun, 01 Nov 2020 18:27:13 +0000,
> Frank Wunderlich <frank-w@public-files.de> wrote:
> Thinking of it a bit more, I think this is the wrong solution.
>
> PCI MSIs are optional, and not a requirement. I can trivially spin a
> VM with PCI devices and yet no MSI capability (yes, it is more
> difficult with real HW), and this results in a bunch of warning, none
> of which are actually indicative of anything being wrong.

Well. No. 

The problem is that the device enumerates MSI capability, but the host
bridge is not proving support for MSI. 

The host bridge fails to mark the bus with PCI_BUS_FLAGS_NO_MSI. That's
the reason why this runs into this issue.

Something like the uncompiled hack below. I haven't found a way to hand
that down to the probe function.

Thanks,

        tglx
---
diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
index cf4c18f0c25a..d91bdfea7329 100644
--- a/drivers/pci/controller/pcie-mediatek.c
+++ b/drivers/pci/controller/pcie-mediatek.c
@@ -143,6 +143,7 @@ struct mtk_pcie_port;
  * struct mtk_pcie_soc - differentiate between host generations
  * @need_fix_class_id: whether this host's class ID needed to be fixed or not
  * @need_fix_device_id: whether this host's device ID needed to be fixed or not
+ * @no_msi: Bridge has no MSI support
  * @device_id: device ID which this host need to be fixed
  * @ops: pointer to configuration access functions
  * @startup: pointer to controller setting functions
@@ -151,6 +152,7 @@ struct mtk_pcie_port;
 struct mtk_pcie_soc {
 	bool need_fix_class_id;
 	bool need_fix_device_id;
+	bool no_msi;
 	unsigned int device_id;
 	struct pci_ops *ops;
 	int (*startup)(struct mtk_pcie_port *port);
@@ -1089,6 +1091,9 @@ static int mtk_pcie_probe(struct platform_device *pdev)
 	if (err)
 		goto put_resources;
 
+	if (!pcie->soc->no_msi)
+		host->bus->bus_flags |= PCI_BUS_FLAGS_NO_MSI;
+
 	return 0;
 
 put_resources:
@@ -1173,6 +1178,7 @@ static const struct dev_pm_ops mtk_pcie_pm_ops = {
 };
 
 static const struct mtk_pcie_soc mtk_pcie_soc_v1 = {
+	.no_msi = true,
 	.ops = &mtk_pcie_ops,
 	.startup = mtk_pcie_startup_port,
 };




  reply	other threads:[~2020-11-01 22:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 14:03 [PATCH] pci: mediatek: fix warning in msi.h Frank Wunderlich
2020-10-31 21:49 ` Thomas Gleixner
2020-11-01  9:25   ` Frank Wunderlich
2020-11-01 11:17     ` Thomas Gleixner
2020-11-01 11:43     ` Marc Zyngier
2020-11-01 15:58       ` Aw: " Frank Wunderlich
2020-11-01 17:54       ` Ryder Lee
2020-11-01 18:27         ` Aw: " Frank Wunderlich
2020-11-01 21:47           ` Marc Zyngier
2020-11-01 22:27             ` Thomas Gleixner [this message]
2020-11-02 11:30               ` Marc Zyngier
2020-11-02 11:56                 ` Aw: " Frank Wunderlich
2020-11-02 13:58                   ` Marc Zyngier
2020-11-02 14:27                     ` Aw: " Frank Wunderlich
2020-11-02 16:16                 ` Aw: " Thomas Gleixner
2020-11-02 22:18                   ` Thomas Gleixner
2020-11-03  9:54                     ` Marc Zyngier
2020-11-03 10:16                       ` Thomas Gleixner
2020-11-03 10:29                         ` Marc Zyngier
2020-11-04 16:49                         ` Aw: " Frank Wunderlich
2020-11-04 23:14                           ` Thomas Gleixner
2020-11-05  9:20                             ` Marc Zyngier
2020-11-05 13:59                               ` Aw: " Frank Wunderlich
2020-11-05 23:00                               ` Aw: " Thomas Gleixner
2020-11-06  9:43                                 ` Marc Zyngier
2020-11-21 16:12                                   ` Aw: " Frank Wunderlich
2021-01-03 13:08                                     ` Frank Wunderlich
2021-02-02 16:21                                   ` Frank Wunderlich
2020-11-03 10:31                       ` Aw: " Thomas Gleixner
2020-11-03 11:41                         ` Marc Zyngier
2020-11-03 14:23                           ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pn4w90hm.fsf@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=bhelgaas@google.com \
    --cc=frank-w@public-files.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@fw-web.de \
    --cc=matthias.bgg@gmail.com \
    --cc=maz@kernel.org \
    --cc=ryder.lee@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).