Received: by 10.192.165.148 with SMTP id m20csp5039321imm; Tue, 8 May 2018 20:43:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpVa6X598+A+ELNF8flQ+nJaZfRqg8stY7zIlTPeJwFGuRXY8BXq/fpJP7sdbPgox9I/y+H X-Received: by 10.98.202.152 with SMTP id y24mr41905423pfk.187.1525837423068; Tue, 08 May 2018 20:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525837423; cv=none; d=google.com; s=arc-20160816; b=v2upUxRrMe26Kuq0gEKdahAt64kUL0tjZvxgpPZmbB1tdVc9iaTX8qbeSpJ1BWfd23 KOjev6vTxDgl4VZ7G+DhUjKR8E1r/co6+cUFIINocAf9YiEZp9Nw8CgmD3NC2p48i8bm 9thAjDMKJFnFa9ykCgPJuWYUSmUfLiojzM9cAU+x2TV7cMOWyndZtDI/Wa9NiIGeTUdT VZpvObxVNln3rnZ/vBKLa5Lc3wt46biGLbVEkGs3MFBfd2Zz9MkXZRE+dEoJWZTCiX9t LewyIm5f8KvPArTz/497e56WyyNj3yri/Wt7EmIakyX3en9R8eeAcTmsuRXtz9/nJ3gy nb/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=WGARdrY44394Q4dW3T1cNvPW9AkOmuGe6xFRVTnvOuw=; b=xF7AII7KohAVlxEXvgNI9aSHJB/7TvsAf1Mgvv5IiDEr3uxEFkmJbKnrpLf9zVFNTT lVEQot3u1EzaNM85HyxEcoS1UnEMFJzA8Cth/6/RBOUb10GxSrHhyREJyvW7edQ4waa8 FMoylUzLOr6HXRa4Yx5FMKUGZijY2KDZ6IR6N9jXYW+BoAmCEnrlnwGre9zBmOwefs0y BoGtXFTivBsq+F9X9nKf8ztTabpwLJlSM10I7a9gJvIcHor5e8fcamuaLDzcishFC8t9 ulFQndBSUFSQP5HDYiQsyXpd11Wbq0bH2z6QyTX99QxrlVYDXUbuvqPV8AWrZ+StoSlD zzSg== 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 g2si6175804pfh.346.2018.05.08.20.43.28; Tue, 08 May 2018 20:43:43 -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 S933658AbeEIDnN (ORCPT + 99 others); Tue, 8 May 2018 23:43:13 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7662 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932115AbeEIDnM (ORCPT ); Tue, 8 May 2018 23:43:12 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 7D474FF20D33D; Wed, 9 May 2018 11:42:58 +0800 (CST) Received: from [127.0.0.1] (10.151.30.91) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.361.1; Wed, 9 May 2018 11:42:50 +0800 Subject: Re: [PATCH] Kirin-PCIe: Add kirin pcie msi feature. To: Dmitry Shmidt CC: songxiaowei , Wangbinghui , , , , , , , , , "" , "" , , "Guodong Xu" References: <1525763028-107417-1-git-send-email-chenyao11@huawei.com> From: Yao Chen Message-ID: Date: Wed, 9 May 2018 11:41:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.151.30.91] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/5/9 5:31, Dmitry Shmidt wrote: > On Tue, May 8, 2018 at 12:03 AM, Yao Chen wrote: >> This patch adds kirin pcie msi feature. >> >> Signed-off-by: Yao Chen >> --- >> arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 2 ++ >> drivers/pci/dwc/pcie-kirin.c | 38 +++++++++++++++++++++++++++++++ >> 2 files changed, 40 insertions(+) >> >> diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi >> index ec3eb8e..4ef684f 100644 >> --- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi >> +++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi >> @@ -872,6 +872,8 @@ >> 0x0 0x02000000>; >> num-lanes = <1>; >> #interrupt-cells = <1>; >> + interrupts = <0 283 4>; >> + interrupts-names = "msi"; > > Possible typo? Should be interrupt-names = "msi"; Yes, you're right. It should be interrupt-names = "msi". I will fix it. Thanks. > >> interrupt-map-mask = <0xf800 0 0 7>; >> interrupt-map = <0x0 0 0 1 >> &gic GIC_SPI 282 IRQ_TYPE_LEVEL_HIGH>, >> diff --git a/drivers/pci/dwc/pcie-kirin.c b/drivers/pci/dwc/pcie-kirin.c >> index d2970a0..2319c9c 100644 >> --- a/drivers/pci/dwc/pcie-kirin.c >> +++ b/drivers/pci/dwc/pcie-kirin.c >> @@ -426,9 +426,28 @@ static int kirin_pcie_establish_link(struct pcie_port *pp) >> return 0; >> } >> >> +static irqreturn_t kirin_pcie_msi_irq_handler(int irq, void *arg) >> +{ >> + struct pcie_port *pp = arg; >> + >> + return dw_handle_msi_irq(pp); >> +} >> + >> +static void kirin_pcie_msi_init(struct pcie_port *pp) >> +{ >> + dw_pcie_msi_init(pp); >> +} >> + >> +static void kirin_pcie_enable_interrupts(struct pcie_port *pp) >> +{ >> + if (IS_ENABLED(CONFIG_PCI_MSI)) >> + kirin_pcie_msi_init(pp); >> +} >> + >> static int kirin_pcie_host_init(struct pcie_port *pp) >> { >> kirin_pcie_establish_link(pp); >> + kirin_pcie_enable_interrupts(pp); >> >> return 0; >> } >> @@ -448,6 +467,25 @@ static int kirin_pcie_host_init(struct pcie_port *pp) >> static int __init kirin_add_pcie_port(struct dw_pcie *pci, >> struct platform_device *pdev) >> { >> + int ret; >> + >> + if (IS_ENABLED(CONFIG_PCI_MSI)) { >> + pci->pp.msi_irq = platform_get_irq(pdev, 0); >> + if (!pci->pp.msi_irq) { >> + dev_err(&pdev->dev, "failed to get msi irq\n"); >> + return -ENODEV; >> + } >> + ret = devm_request_irq(&pdev->dev, pci->pp.msi_irq, >> + kirin_pcie_msi_irq_handler, >> + IRQF_SHARED | IRQF_NO_THREAD, >> + "kirin_pcie_msi", &pci->pp); >> + if (ret) { >> + dev_err(&pdev->dev, "failed to request msi irq\n"); >> + return ret; >> + } >> + } >> + >> + pci->pp.root_bus_nr = -1; >> pci->pp.ops = &kirin_pcie_host_ops; >> >> return dw_pcie_host_init(&pci->pp); >> -- >> 1.9.1 >> > > . >