From patchwork Wed Nov 4 20:58:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ryder Lee X-Patchwork-Id: 11882151 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7FEF714B4 for ; Wed, 4 Nov 2020 20:58:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3FA072080D for ; Wed, 4 Nov 2020 20:58:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="tQblVnWx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727013AbgKDU6p (ORCPT ); Wed, 4 Nov 2020 15:58:45 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:34141 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729809AbgKDU6n (ORCPT ); Wed, 4 Nov 2020 15:58:43 -0500 X-UUID: c51d949732d541fe87d0a1a64b2fa5bb-20201105 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=wUuoNNfKE+1eTR8n4GLbokBW3m4NSs3Rt+4Y39MdhxM=; b=tQblVnWx1Ht4vT4hd4tF1VTSqGQHoK3MiQZPcGbuMzscSv5BUnwHOqgvju8hsV5oSVI092r/fs4WrrlZxfD8uKZdpkl6/2dym0Bb6d/n2HaOcPR+78Qh3Qd0ToGH3VKzRZpjdkRrjOR5NlAalexsQSZPzNJl8TwbcShcBs7dJ5Y=; X-UUID: c51d949732d541fe87d0a1a64b2fa5bb-20201105 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 716866443; Thu, 05 Nov 2020 04:58:41 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 5 Nov 2020 04:58:33 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 5 Nov 2020 04:58:33 +0800 From: Ryder Lee To: Bjorn Helgaas CC: , , "Ryder Lee" Subject: [PATCH v3] PCI: mediatek: Configure FC and FTS for functions other than 0 Date: Thu, 5 Nov 2020 04:58:33 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 Reviewed-by: Krzysztof WilczyƄski --- 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;