Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3631012imm; Mon, 15 Oct 2018 01:11:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV61/PNhax45sZ2AxlwquKjHeoflB36Cbx66gfVMSUy8QgQenfm3FZspIgG7/aV6/2OuSacv1 X-Received: by 2002:a17:902:850b:: with SMTP id bj11-v6mr16408031plb.107.1539591068140; Mon, 15 Oct 2018 01:11:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539591068; cv=none; d=google.com; s=arc-20160816; b=XYWDmp812KNUcHryxgTBLEH5pCjMc2CkaxNLf1bxWLY6dqBtMHuw5XWNF5cwkipv0K sylZ/N/va7WqMp0JFw5YLx08YM++iSYBl1+2CBO9UiUZYygciTbUhjVzs2Cqxk6wLHgz tnYhhIZIOJqch0ZdmOeV2/MgOvBFInkSkFrFoP15mT31wKnAj93FPavOOc3Q1YW5EO8A MI2BLHVvryrUHyQ7Ft+I7TlGKbjE3eG9KqsGaI7MoIqQgCSdIyU/2DwSsxQnhDx1m70s bfiLgDeOMxP9tFGd4qG72oJGhJV+JBZO5x8M0evmkYMkX2VOMsAYLSeBvRg/d2F1d0FN 3B+A== 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=IZ99FZD4MOdDx8QsIN9T4xOBCKrvnf5rkw6w/uraEBA=; b=t/Tr0zrgo5/kbJV6FCG1b9OOCtp5khuFkF14KC7jWu9PqvupyCTB6uge3jaJxQq2rE vshhEaDpmMYJbaY2sLNQ6ZgKFXN9+FRuzZaRCjOvEwtYtCmnuFeVR4SocSNmyhYJpqVb zs9owUgDvk3ucOaPOAZnj652KeFMMYHh5PovsHrv5hhZCS911cdRQrU9PK5c2FQqjkPU 5LMwQCnTZNjaNJXG42eHCeJ/9XBeK3IAW80mRKTA2ZJPMNRUbHDBq8Ri21QladJpysxi g6LQ0KNJZN07KiRdru2MhJTVW907au5QmCw00auy9wbAcnvwlRl+tnr/4m5EFjGQkpq/ ZfEQ== 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 n188-v6si10308524pfn.113.2018.10.15.01.10.53; Mon, 15 Oct 2018 01:11:08 -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 S1726820AbeJOPx1 (ORCPT + 99 others); Mon, 15 Oct 2018 11:53:27 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:37106 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726744AbeJOPx0 (ORCPT ); Mon, 15 Oct 2018 11:53:26 -0400 X-UUID: 5cd56f996d28462fa018b6094a7a7a61-20181015 X-UUID: 5cd56f996d28462fa018b6094a7a7a61-20181015 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 182358454; Mon, 15 Oct 2018 16:09:10 +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; Mon, 15 Oct 2018 16:09:09 +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; Mon, 15 Oct 2018 16:09:08 +0800 From: To: , , , , , , CC: , , , , , , , , , , Subject: [PATCH v8 6/9] PCI: mediatek: Fixup enable MSI logic by enable MSI after clock enabled Date: Mon, 15 Oct 2018 16:08:57 +0800 Message-ID: <1539590940-13355-7-git-send-email-honghui.zhang@mediatek.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1539590940-13355-1-git-send-email-honghui.zhang@mediatek.com> References: <1539590940-13355-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 654a63e..d3f4694 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