Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3105278imm; Sun, 7 Oct 2018 20:25:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV61bnnHfygSignwg1RcjYLVi7IQ66zLBUEbqZB6rNjk6pavbjau6kVJPPTGHUmthMW9pilRJ X-Received: by 2002:a65:6409:: with SMTP id a9-v6mr19654970pgv.204.1538969157353; Sun, 07 Oct 2018 20:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538969157; cv=none; d=google.com; s=arc-20160816; b=I3yt7wJV9Op41FVarGM4thJQQyYyZBxQMpaPiWppPQok/0Hc5Ejy/oa+cncrS8Vums mAnF0DtDYndG+22lncSlQJZ2TjXSI+ccdTtNvVPS//WY9Ttje3Xb9e0EP6c/4rvDE+OQ L/5g0zWsldLa5iZ383IZu4B3Jnl8GdK2IEzijC/3QBCzenxBHOdnDe2F84d33GGIl0QS +f09+zjeTWOgLCz0hys0U5QZZWjjdIMAh+KJNhFwCV+M1x7SfOj+gLxieOU3kX0UxZZn ghF/WJgirVLM0YO5j9ZJfAjzZJtzEDQBjGAOTkwSnm0g6yGLenqyjJ9EmWqlq4drTVdp zJqg== 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=+uTIWYr5w31s8vXweR0vnU4oKQLB2aFCMVh8eKFRcRU=; b=Lty4C0H7OMugiGLADEc1HnENMgGuR4rGUXMVLJPBWuTg+GVT545taldnyACDk1RmFO NuPzwRn1byb8VrCGOF8Z8ph49kqhnRCLWwqbZ+y5Es+gXvYLfEKC655dIVhNVS9C47qv ZAAzxPKa/B1s6SOzKldcVhreFmNdMsydYUT5euVldwO5JfMJB5M3yAGJgVzwl3dod1mW mWQl6mPWUqZ4YlD5h8Ob8lnrom6wgp23ojDC3OCKbBXEgSScm3BIpIxOKkCMNLD8rid3 vQQEYwRNIeRjDfthjwPjgdELjDyaph6f+gk0cfjhDBQKH5SXxlJEyZXcvn32nz9Mf2G4 q/6g== 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 e13-v6si15581451pff.272.2018.10.07.20.25.42; Sun, 07 Oct 2018 20:25: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 S1726977AbeJHKes (ORCPT + 99 others); Mon, 8 Oct 2018 06:34:48 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:51367 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726096AbeJHKeq (ORCPT ); Mon, 8 Oct 2018 06:34:46 -0400 X-UUID: cfbfdb52f32a45769458be1293c0586d-20181008 X-UUID: cfbfdb52f32a45769458be1293c0586d-20181008 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 348596383; Mon, 08 Oct 2018 11:25:05 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 8 Oct 2018 11:25: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; Mon, 8 Oct 2018 11:25:03 +0800 From: To: , , , , , , CC: , , , , , , , , , Subject: [PATCH v6 6/9] PCI: mediatek: Fixup enable msi logic by enable msi after clock enabled Date: Mon, 8 Oct 2018 11:24:45 +0800 Message-ID: <1538969088-7136-7-git-send-email-honghui.zhang@mediatek.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1538969088-7136-1-git-send-email-honghui.zhang@mediatek.com> References: <1538969088-7136-1-git-send-email-honghui.zhang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 27C4FDAA8AFF7CAFDB39BEAF31B8E2F43DCC232D8DEB571A7C2EA7A6D481EC6F2000:8 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 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