Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3524901imm; Sun, 14 Oct 2018 22:46:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV60qd5CJTRqs/Lh6iu/sWFa/Kzt9ushZGN8sEequaPaHFTQWNDIoTiAndyrE9vLE95XNKgc7 X-Received: by 2002:a62:b87:: with SMTP id 7-v6mr16137613pfl.67.1539582417401; Sun, 14 Oct 2018 22:46:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539582417; cv=none; d=google.com; s=arc-20160816; b=GXjEUiyx2kcFyW1CVPv6sZ3crs8PMEA6HVuLCFjaF81E6MuYgjj15ctxHGA1pCssyP 6ypW1BHm4QLrGttZlYhuqTRp4eNA9s8WkQB3s8/VJhscVkOxOIDfnxrtoI2az8rqamZA LWmtOack2Zbl93S64YazP2SuXdxHG0JM+mTk6xOorsA0kmzbkbWXVdWx9eKUJmmhWutF DuQze1H+OljMb+pdVEYwj9iw3GAxSfnjqC/N49qx2myBS6qYsy1LxPB1HwKJBZwoRoIx Kl9fJAgOQfIdDmW8ekTPFZkLIJzLr4B6cxais1Ud8wv6kf5hQThkktlMQT9Ewi9b2x5W dcfA== 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=mDVL9bB2JgY92UB38gD3IWaF63Wg/AIYhJuS03KgbZ8=; b=jiusPrGykUK7kL3qJK0OUBp3tPX8ABC0qt+yiv8iBcVAZ9GVF5GvLEyG0W6uG1U9SA TJ0JVEV0NUvu9de1qHdRGc57bNLQJ5VUwKvjbWPMMxb5s0jg78jCa9THuLECp5ZPEkTI DVvm9MWrXXoXWdhJAMoC2bSB3O9ikNrizKfet5u/eM9pcC3RLAzNjhJXnz2Iy9IVu3la N0xNwZSMVtPZQcu8wfTZelM3ur9HpZ00NN0ZCP/oWgQc+21ksNHLFgLE/YNJW3o4nKHo tVTgcpXslnOMpcF9sPD7Jx9y74eoSB0EDk3bUp5uFy0L2VgC+k1DKUVrErsAwEmcfzhS 3P7w== 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 t33-v6si9616421pgk.141.2018.10.14.22.46.42; Sun, 14 Oct 2018 22:46:57 -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 S1726856AbeJON2t (ORCPT + 99 others); Mon, 15 Oct 2018 09:28:49 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:57825 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726539AbeJON2s (ORCPT ); Mon, 15 Oct 2018 09:28:48 -0400 X-UUID: bbb1fb3ae658432ea6ce3861f86ff71b-20181015 X-UUID: bbb1fb3ae658432ea6ce3861f86ff71b-20181015 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 820911976; Mon, 15 Oct 2018 13:44:56 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 15 Oct 2018 13:44:55 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 15 Oct 2018 13:44:54 +0800 From: To: , , , , , , CC: , , , , , , , , , Subject: [PATCH v7 6/9] PCI: mediatek: Fixup enable MSI logic by enable MSI after clock enabled Date: Mon, 15 Oct 2018 13:44:44 +0800 Message-ID: <1539582287-9171-7-git-send-email-honghui.zhang@mediatek.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1539582287-9171-1-git-send-email-honghui.zhang@mediatek.com> References: <1539582287-9171-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. Signed-off-by: Honghui Zhang --- 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