Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1836014imm; Tue, 10 Jul 2018 08:39:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpekCJlQYE9H4RMvWaSnj+h/+d6w5g4wprKDVcgNCXLd/KwSMoxvv2+ox306EEoP7LWX9CLh X-Received: by 2002:a17:902:b115:: with SMTP id q21-v6mr24834331plr.97.1531237191960; Tue, 10 Jul 2018 08:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531237191; cv=none; d=google.com; s=arc-20160816; b=j1oGGBFU9GzuyZErlZDBFF/CJ5DA80XrYR8hQI2D2mvKXCytXDKE3tqRYz+C19W0qO GcE99s4coXaPYuoCmxIw/KaMx2syX/HfQZj1Mi6a0doImzUXxdhJxaHhW/yRpiQxA+sF VWIPPQbAP1Mx8Z6AFbdEDW73iZ1OYV2ZzSqvml2skPlyjm6wGzqkc3GRYbFWCnTaoRh9 EAz8DwNg3dX3zDzFCuctEZb5qtUQWi7+f0UXUm3HKt5XsLKyHp+jfQyu+b214VvT2JID xt+Fky8gGBh5l1sSeduqaigrFu8TcHxhDi2q3v7YPqkD7AK6BjLFJ582T5t8cZn9/hjP xuOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=gsk99JqnhPAZ0XX2BR4LQywTDiDYECx63P/gzxQk8vY=; b=ZePgMS22NA2GBFceF6piBT1uJ1wojn3FagVBdzas7aXJ+IG4cbdTEruVBBqyYFOX4K lANPjWaaiGgt4998hidJTvcdckjjoFJMwpiVRXgKpcUM+kGUwYN6k1Tjx/6CMwyOIEYF yI2DANNHTskdjvbX4wh82Do1ebeb0rLc/jdZptX0uDeoZNoSV0MrSsJRCsIqoxdkbxUN MTV1ZRtgJDPIMG3Q4nJ26x7DczgOvFubQguUxOERAW5QjB+tebNYXLj86ob2wiIfKVhc ZpXCZlVst9Qs4ggColmQhf3F7PYi/H8gfSvDt/CPeBZ0Xriq5VkPlUgks84ok1HMjvay Zhdg== 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 2-v6si16352131pgq.479.2018.07.10.08.39.36; Tue, 10 Jul 2018 08:39:51 -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 S934282AbeGJPi0 (ORCPT + 99 others); Tue, 10 Jul 2018 11:38:26 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:49100 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933475AbeGJPiZ (ORCPT ); Tue, 10 Jul 2018 11:38:25 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D8BCC80D; Tue, 10 Jul 2018 08:38:24 -0700 (PDT) Received: from red-moon (unknown [10.1.206.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A73823F589; Tue, 10 Jul 2018 08:38:23 -0700 (PDT) Date: Tue, 10 Jul 2018 16:40:17 +0100 From: Lorenzo Pieralisi To: "Songxiaowei (Kirin_DRV)" Cc: "bhelgaas@google.com" , "robh+dt@kernel.org" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "chenyao (F)" Subject: Re: =?utf-8?B?562U5aSN?= =?utf-8?Q?=3A?= [PATCH v5 1/1] PCI: kirin: Add MSI support Message-ID: <20180710154017.GA16825@red-moon> References: <20180628124803.110315-1-songxiaowei@hisilicon.com> <20180628124803.110315-2-songxiaowei@hisilicon.com> <99B4C6BADD9E3241B25E52B02BA737C5412D2511@dggema525-mbx.china.huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <99B4C6BADD9E3241B25E52B02BA737C5412D2511@dggema525-mbx.china.huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 09, 2018 at 01:54:07AM +0000, Songxiaowei (Kirin_DRV) wrote: > Hi Bjorn Helgaas, > > Would you help to review this patch? > > Best regards, > > Xiaowei. > > > -----邮件原件----- > > 发件人: Songxiaowei (Kirin_DRV) > > 发送时间: 2018年6月28日 20:48 > > 收件人: Wangbinghui ; bhelgaas@google.com; > > robh+dt@kernel.org; linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org; > > dimitrysh@google.com > > 抄送: chenyao (F) ; Songxiaowei (Kirin_DRV) > > > > 主题: [PATCH v5 1/1] PCI: kirin: Add MSI support > > > > Add support for MSI. > > > > Signed-off-by: Xiaowei Song > > --- > > drivers/pci/dwc/pcie-kirin.c | 28 ++++++++++++++++++++++++++++ > > 1 file changed, 28 insertions(+) > > > > diff --git a/drivers/pci/dwc/pcie-kirin.c b/drivers/pci/dwc/pcie-kirin.c index > > d2970a009eb5..6997276eb69c 100644 > > --- a/drivers/pci/dwc/pcie-kirin.c > > +++ b/drivers/pci/dwc/pcie-kirin.c > > @@ -430,6 +430,9 @@ static int kirin_pcie_host_init(struct pcie_port *pp) > > { > > kirin_pcie_establish_link(pp); > > > > + if (IS_ENABLED(CONFIG_PCI_MSI)) > > + dw_pcie_msi_init(pp); > > + > > return 0; > > } > > > > @@ -445,9 +448,34 @@ static const struct dw_pcie_host_ops > > kirin_pcie_host_ops = { > > .host_init = kirin_pcie_host_init, > > }; > > > > +static int kirin_pcie_add_msi(struct dw_pcie *pci, > > + struct platform_device *pdev) > > +{ > > + int ret = 0; > > + > > + if (IS_ENABLED(CONFIG_PCI_MSI)) { > > + ret = platform_get_irq(pdev, 0); > > + if (ret < 0) { > > + dev_err(&pdev->dev, > > + "failed to get MSI IRQ (%d)\n", ret); > > + return ret; > > + } > > + > > + pci->pp.msi_irq = ret; > > + } > > + > > + return ret; > > +} > > + > > static int __init kirin_add_pcie_port(struct dw_pcie *pci, > > struct platform_device *pdev) { > > + int ret; > > + > > + ret = kirin_pcie_add_msi(pci, pdev); > > + if (ret) > > + return ret; If kirin_pcie_add_msi() returns an IRQ number we return from this function here, is that what you really want ? Lorenzo > > + > > pci->pp.ops = &kirin_pcie_host_ops; > > > > return dw_pcie_host_init(&pci->pp); > > -- > > 2.11.GIT >