Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp320145imm; Wed, 11 Jul 2018 03:05:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdlgFKD4ZH/Ykk8KYMKxUkMBx3XoB/g7tl5vhxbulQ5WPfi0bLRLcZ4mVuNYcjlkv1tJQvC X-Received: by 2002:a63:d309:: with SMTP id b9-v6mr12673185pgg.163.1531303530417; Wed, 11 Jul 2018 03:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531303530; cv=none; d=google.com; s=arc-20160816; b=UEUVSoUWV1hx12i8p4Ug3ZpJjzXFtD5kEJoPDvblt3qs57kxSWym//RNcK647JiXQx XRfIFua8H+NrRtCfZsNQ9zGE5XPE0G73sK360+OKTk6mBYUDeSHxBzUohOXGxa6JE31F AXaR9uQC2LsUowZPy3iLhlvOKcZrDsHoc8R4oZv85chUDf1Ou4Kr+7OBRrPMWEecfiQF LoQwb7WH0k40h+I7McapNyebWMWN1Db3G7PWhwFfLpxAQW+nPO+33jAqOqysZCx9fAL9 WeZIf0Jf99aYIBSiOfVg2rgVrDVu1m/GdT5hXk9BEijvCRFqpMVERttpUChfOHkZLeQ6 /w3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=17xYwj2h7YOILVec0d8EmoPBsAaCW7i1nNwINyp1uhA=; b=Dc0RazNVNRBPMQudZ5qBSF3BjTwdkPrlHfEfVCD0OsUngIjWMV2vNxe36a23p5bX7W vlJzBljRf9rT1Pz7YcSqGQQnMd9Bmt4DQLgM8wh9J+bLgLLbsXia9w9oc5VamgWMiHO8 HnuOIXfjiHyDyqxEGkYjUnQobijp53oMPE+XBo8SSRcqFxr5QCdfGx9nwCe6xMTDvaot Tn/S5hj324fEkUaBBxiR/OsYpkJohuhNuRMlGQCCSNYi253dvYO/JIlibgyjmSgj+WXp I4cS9iXJrRq5m+mXERYilvEzp96T/R/Ocsu7OB+G1aHwbwbwfpM2ombIrUvJNOzoZcLW WgLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=izq3EdOy; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16-v6si18418347pll.197.2018.07.11.03.05.14; Wed, 11 Jul 2018 03:05:30 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=izq3EdOy; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732283AbeGKJdr (ORCPT + 99 others); Wed, 11 Jul 2018 05:33:47 -0400 Received: from mail-ua0-f196.google.com ([209.85.217.196]:38304 "EHLO mail-ua0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726368AbeGKJdr (ORCPT ); Wed, 11 Jul 2018 05:33:47 -0400 Received: by mail-ua0-f196.google.com with SMTP id o11-v6so2172952uak.5; Wed, 11 Jul 2018 02:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=17xYwj2h7YOILVec0d8EmoPBsAaCW7i1nNwINyp1uhA=; b=izq3EdOymGS29/Lti6bwsx0o7eGLN0tqOvOgToiHBUizPKPz9c9fB6GlsSiFD41hB/ tUx2gfVrn1rJQpYuCXwbsJy8zb7DVmIZXpKRCpZ5I65inmzBpDLjO47lOp6cr/uWSr0/ vVMbp0RSlC3h0z99vFewbb3rNLrsVqJO57v+WycDspyDdHdje1CntFRPcJntcpeuSCTx vdaR1wYYklocr9wNs1xDhhe7IL8yjvXK7CNQBcf79/ov9m3EBl7a9X/e0P1nI5PcHWsI fZl9+n4cX/x4Qu+dn8EEFxByr785+F9P/mSEKdEMAqsraEA63cD/R68fEq9ZSYZXc8O7 m68Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=17xYwj2h7YOILVec0d8EmoPBsAaCW7i1nNwINyp1uhA=; b=Otu8Yb0muxmfduwBN2NRihqojX4DRkgooUo15ljWcFyMrY82zI0mY5V3xpw+tqTgSe AndCJ/v20sV08s4I9yBDuQCd5QrnxrTR1BQpfSN9WnRHHFSM2t4oTg96SxHL8qWnWaF5 lHm/3Wq/60nH4/YEz+va1nXTXk3bCOwhMLNrxQ+coFu/9RGfYO9QmZXV46DBK83ASRZ9 r7q8M6Gs7EnqS/Pe04HCND6wqeZCZQze1IAd/Kk0mUtHbkCFwM4F2gFVFumTYLkwmsiu FTw+5VcSruBDhx9uKvYFT9aN/U0+6EbkoXXRb4WmyII0o5DjUeaekaqSkmawO1FEQrgZ wN1g== X-Gm-Message-State: APt69E10dFEDP2W7n5eS/ecE4mCH7S3CRi5C3fcygkGEsl7PAcJWaOv/ pp/TsyJs/rrsR0Exn1qurdvlq+oI+q1BFKuFRWo= X-Received: by 2002:ab0:70a9:: with SMTP id q9-v6mr5444612ual.141.1531301422256; Wed, 11 Jul 2018 02:30:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:2149:0:0:0:0:0 with HTTP; Wed, 11 Jul 2018 02:30:21 -0700 (PDT) In-Reply-To: <20180711080946.14942-2-songxiaowei@hisilicon.com> References: <20180711080946.14942-1-songxiaowei@hisilicon.com> <20180711080946.14942-2-songxiaowei@hisilicon.com> From: Andy Shevchenko Date: Wed, 11 Jul 2018 12:30:21 +0300 Message-ID: Subject: Re: [PATCH v7 1/1] PCI: kirin: Add MSI support To: Xiaowei Song Cc: Wangbinghui , Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , linux-pci@vger.kernel.org, Linux Kernel Mailing List , Suzhuangluan , Kongfei , Yao Chen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 11, 2018 at 11:09 AM, Xiaowei Song wrote: > Add support for MSI > FWIW, Reviewed-by: Andy Shevchenko > Signed-off-by: Xiaowei Song > Signed-off-by: Yao Chen > --- > 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..5352e0c3be82 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 irq; > + > + if (IS_ENABLED(CONFIG_PCI_MSI)) { > + irq = platform_get_irq(pdev, 0); > + if (irq < 0) { > + dev_err(&pdev->dev, > + "failed to get MSI IRQ (%d)\n", irq); > + return irq; > + } > + > + pci->pp.msi_irq = irq; > + } > + > + return 0; > +} > + > 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; > + > pci->pp.ops = &kirin_pcie_host_ops; > > return dw_pcie_host_init(&pci->pp); > -- > 2.11.GIT > -- With Best Regards, Andy Shevchenko