linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] PCI: mediatek: Configure FC and FTS for functions other than 0
@ 2020-11-04 20:58 Ryder Lee
  2020-11-05 18:22 ` Frank Wunderlich
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ryder Lee @ 2020-11-04 20:58 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, linux-mediatek, Ryder Lee

PCI_FUNC(port->slot << 3)" is always 0, so previously
mtk_pcie_startup_port() only configured FC credits and FTs for
function 0.

Compute "func" correctly so we also configure functions other than
0. This affects MT2701 and MT7623.

Addresses-Coverity-ID: 1437218 ("Wrong operator used")
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
v2 & v3 - update commit log
---
 drivers/pci/controller/pcie-mediatek.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
index cf4c18f0c25a..1980b01cee35 100644
--- a/drivers/pci/controller/pcie-mediatek.c
+++ b/drivers/pci/controller/pcie-mediatek.c
@@ -760,7 +760,7 @@ static struct pci_ops mtk_pcie_ops = {
 static int mtk_pcie_startup_port(struct mtk_pcie_port *port)
 {
 	struct mtk_pcie *pcie = port->pcie;
-	u32 func = PCI_FUNC(port->slot << 3);
+	u32 func = PCI_FUNC(port->slot);
 	u32 slot = PCI_SLOT(port->slot << 3);
 	u32 val;
 	int err;
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-29 15:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04 20:58 [PATCH v3] PCI: mediatek: Configure FC and FTS for functions other than 0 Ryder Lee
2020-11-05 18:22 ` Frank Wunderlich
2021-02-21 19:29 ` Krzysztof Wilczyński
2021-03-26 15:51   ` Lorenzo Pieralisi
2021-03-26 23:53     ` Krzysztof Wilczyński
2021-03-29 15:03 ` Lorenzo Pieralisi

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).