Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5004933imm; Tue, 16 Oct 2018 03:46:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV63e8rrx8RgBfaN7D53LxTzP5bIlo9XkEn2uz1/iWEb+uDzJVyNOUY2cd30spO5NtLE+EkJM X-Received: by 2002:a17:902:3041:: with SMTP id u59-v6mr8057403plb.279.1539686807963; Tue, 16 Oct 2018 03:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539686807; cv=none; d=google.com; s=arc-20160816; b=vA7D5LCiUw95QXfxb9pq9AR8+RlD6gUit5S+dTCcgI2oJgm0iHUXZdn/0Zt3aSUWno T06Gogj9ch3CGDuI8+y7aSDHHB/F7VnDJ5l2Qz9+hfxhxuJ4BfNPB9fDSm4mgvgkZcX6 TjZuxnfE7Y5H9kEFaeTaU1M+5rgg3X77F9fJ8Q/z7qSrCrEm5EhE7+JWlPN92nqL1u9j R9by2TCEtPKtDD82kFqXnqxibnv3pfn7OPLkEmirMtv7xwdtZYrTxU/BU9mDukOf5UJr J1otVP6wxfOY5p5a6dslJTk60md1xApq7zo+Hv37NYRFY/xrWJuheF4SXKJByDY0xzhS /+Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=Zl6CaQ/bsxKz768UnhJ5aoMhXC/A20fZVqpkNSIUO/g=; b=Bp3k4XP0wZ/9WgcoE+g9JvsG3PLmK58iiWlYCWmLkGlfmO6WMnVK36KNFVUV5+zsPL 75oBBZPqPhG6nySDxxQ/jyYruUZPRvaz+jMPJRcHszujwAAZGdo2b193wXvNBU2moCwe NVUEkdzr0dyFqQ2xjWyb6fwnQU+uFj8mfjucT8+ConmhQtbJiPW6gmZmMFaIO6fJ0PQe 4NnE4XXGOYdDxYW1wVx60TiR1eul09VqAcswuYarPDVFHCmtNs7BnPvL9Uo/7eSHXLWZ FeKfy4TjPxAdRekgGWtJE/S2QOg5/ViUgv1sqGbW9547n3O0dgtglidlFnC6+eRshcMo gVNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c89-v6si14258844pfe.60.2018.10.16.03.46.32; Tue, 16 Oct 2018 03:46:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727233AbeJPSfA (ORCPT + 99 others); Tue, 16 Oct 2018 14:35:00 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:44875 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727051AbeJPSe7 (ORCPT ); Tue, 16 Oct 2018 14:34:59 -0400 X-UUID: 19b2a88564fc4911b0f23efd0632d4be-20181016 X-UUID: 19b2a88564fc4911b0f23efd0632d4be-20181016 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1573313564; Tue, 16 Oct 2018 18:45:06 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 16 Oct 2018 18:45:04 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 16 Oct 2018 18:44:57 +0800 From: To: , , , , , , CC: , , , , , , , , , Subject: [PATCH v9 6/9] PCI: mediatek: Fixup enable MSI logic by enable MSI after clock enabled Date: Tue, 16 Oct 2018 18:44:47 +0800 Message-ID: <1539686690-24068-7-git-send-email-honghui.zhang@mediatek.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1539686690-24068-1-git-send-email-honghui.zhang@mediatek.com> References: <1539686690-24068-1-git-send-email-honghui.zhang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Honghui Zhang The commit 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622") added MSI support but enable MSI in wrong place, clocks was not enabled when enable MSI. This patch fix this issue by calling mtk_pcie_enable_msi in mtk_pcie_startup_port_v2 since the clock was all enabled at that time. Fixes: 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622") Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c index 6967bb7..82d3d85 100644 --- a/drivers/pci/controller/pcie-mediatek.c +++ b/drivers/pci/controller/pcie-mediatek.c @@ -568,8 +568,6 @@ static int mtk_pcie_init_irq_domain(struct mtk_pcie_port *port, ret = mtk_pcie_allocate_msi_domains(port); if (ret) return ret; - - mtk_pcie_enable_msi(port); } return 0; @@ -690,6 +688,9 @@ static int mtk_pcie_startup_port_v2(struct mtk_pcie_port *port) val &= ~INTX_MASK; writel(val, port->base + PCIE_INT_MASK); + if (IS_ENABLED(CONFIG_PCI_MSI)) + mtk_pcie_enable_msi(port); + /* Set AHB to PCIe translation windows */ size = mem->end - mem->start; val = lower_32_bits(mem->start) | AHB2PCIE_SIZE(fls(size)); -- 2.6.4