linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/1] *** PCI: kirin: Add MSI support ***
@ 2018-06-28 12:48 Xiaowei Song
  2018-06-28 12:48 ` [PATCH v5 1/1] PCI: kirin: Add MSI support Xiaowei Song
  0 siblings, 1 reply; 7+ messages in thread
From: Xiaowei Song @ 2018-06-28 12:48 UTC (permalink / raw)
  To: wangbinghui, bhelgaas, robh+dt, linux-pci, linux-kernel, dimitrysh
  Cc: chenyao11, songxiaowei

Before Version Patches
======================
patch v4
https://patchwork.kernel.org/patch/10402399/
patch v3
https://www.spinics.net/lists/linux-pci/msg72322.html
patch v2
https://www.spinics.net/lists/kernel/msg2797610.html

patch v1
https://www.spinics.net/lists/kernel/msg2796410.html

Changes between V5 and V4
=========================
1. rebase the patch based on Linux next-version branch.
2. fix issues according to review comments from Andy Shevchenko and Lorenzo.
   (1) Del MSI irq handler for DW handle it, while Kirin only read the number from DT,
   (2) Use the function dw_pcie_msi_init directly if CONFIG_PCI_MSI is enabled.

Changes between V4 and V3
=========================
1. remove DT binding patch, for Wei Xu had applied it.
2. fix issues according to review comments from Andy Shevchenko.
   (1) Take the msi number get and request as a seperate function,
   (2) Use the result of  platform_get_irq as return val.

Changes between V3 and V2
=========================
1. fix issues according to review comments
   (1)from Bjorn Helgaas: Check for 'pci->pp.msi_irq < 0'.
   (2)from Bjorn Helgaas: Update the message of 'msi irq' in dev_err().

Changes between V2 and V1
=========================
1. seperate DT binding patch.
2. fix issues according to review comments
   (1)from Bjorn Helgaas: Update the style of subject and changelog.
   (2)from Bjorn Helgaas: Add msi irq number in the message.
   (3)from Bjorn Helgaas: Delete unnecessary code 'pci->pp.root_bus_nr = -1'.
   (4)from Dmitry Shmidt: Fix typing error. Replace 'interrupts-names' of 'interrupt-names'.

Xiaowei Song (1):
  PCI: kirin: Add MSI support

 drivers/pci/dwc/pcie-kirin.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

-- 
2.11.GIT


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v5 1/1] PCI: kirin: Add MSI support
  2018-06-28 12:48 [PATCH v5 0/1] *** PCI: kirin: Add MSI support *** Xiaowei Song
@ 2018-06-28 12:48 ` Xiaowei Song
  2018-07-09  1:54   ` 答复: " Songxiaowei (Kirin_DRV)
  0 siblings, 1 reply; 7+ messages in thread
From: Xiaowei Song @ 2018-06-28 12:48 UTC (permalink / raw)
  To: wangbinghui, bhelgaas, robh+dt, linux-pci, linux-kernel, dimitrysh
  Cc: chenyao11, songxiaowei

Add support for MSI.

Signed-off-by: Xiaowei Song <songxiaowei@hisilicon.com>
---
 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;
+
 	pci->pp.ops = &kirin_pcie_host_ops;
 
 	return dw_pcie_host_init(&pci->pp);
-- 
2.11.GIT


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* 答复: [PATCH v5 1/1] PCI: kirin: Add MSI support
  2018-06-28 12:48 ` [PATCH v5 1/1] PCI: kirin: Add MSI support Xiaowei Song
@ 2018-07-09  1:54   ` Songxiaowei (Kirin_DRV)
  2018-07-10 15:40     ` Lorenzo Pieralisi
  0 siblings, 1 reply; 7+ messages in thread
From: Songxiaowei (Kirin_DRV) @ 2018-07-09  1:54 UTC (permalink / raw)
  To: bhelgaas, robh+dt, linux-pci, linux-kernel; +Cc: chenyao (F)

Hi Bjorn Helgaas,

Would you help to review this patch?

Best regards,

Xiaowei.

> -----邮件原件-----
> 发件人: Songxiaowei (Kirin_DRV)
> 发送时间: 2018年6月28日 20:48
> 收件人: Wangbinghui <wangbinghui@hisilicon.com>; bhelgaas@google.com;
> robh+dt@kernel.org; linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org;
> dimitrysh@google.com
> 抄送: chenyao (F) <chenyao11@huawei.com>; Songxiaowei (Kirin_DRV)
> <songxiaowei@hisilicon.com>
> 主题: [PATCH v5 1/1] PCI: kirin: Add MSI support
> 
> Add support for MSI.
> 
> Signed-off-by: Xiaowei Song <songxiaowei@hisilicon.com>
> ---
>  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;
> +
>  	pci->pp.ops = &kirin_pcie_host_ops;
> 
>  	return dw_pcie_host_init(&pci->pp);
> --
> 2.11.GIT


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 答复: [PATCH v5 1/1] PCI: kirin: Add MSI support
  2018-07-09  1:54   ` 答复: " Songxiaowei (Kirin_DRV)
@ 2018-07-10 15:40     ` Lorenzo Pieralisi
  2018-07-11  2:22       ` 答复: " Songxiaowei (Kirin_DRV)
  0 siblings, 1 reply; 7+ messages in thread
From: Lorenzo Pieralisi @ 2018-07-10 15:40 UTC (permalink / raw)
  To: Songxiaowei (Kirin_DRV)
  Cc: bhelgaas, robh+dt, linux-pci, linux-kernel, chenyao (F)

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 <wangbinghui@hisilicon.com>; bhelgaas@google.com;
> > robh+dt@kernel.org; linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org;
> > dimitrysh@google.com
> > 抄送: chenyao (F) <chenyao11@huawei.com>; Songxiaowei (Kirin_DRV)
> > <songxiaowei@hisilicon.com>
> > 主题: [PATCH v5 1/1] PCI: kirin: Add MSI support
> > 
> > Add support for MSI.
> > 
> > Signed-off-by: Xiaowei Song <songxiaowei@hisilicon.com>
> > ---
> >  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
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* 答复: 答复: [PATCH v5 1/1] PCI: kirin: Add MSI support
  2018-07-10 15:40     ` Lorenzo Pieralisi
@ 2018-07-11  2:22       ` Songxiaowei (Kirin_DRV)
  0 siblings, 0 replies; 7+ messages in thread
From: Songxiaowei (Kirin_DRV) @ 2018-07-11  2:22 UTC (permalink / raw)
  To: Lorenzo Pieralisi; +Cc: bhelgaas, robh+dt, linux-pci, linux-kernel, chenyao (F)



> -----邮件原件-----
> 发件人: Lorenzo Pieralisi [mailto:lorenzo.pieralisi@arm.com]
> 发送时间: 2018年7月10日 23:40
> 收件人: Songxiaowei (Kirin_DRV) <songxiaowei@hisilicon.com>
> 抄送: bhelgaas@google.com; robh+dt@kernel.org; linux-pci@vger.kernel.org;
> linux-kernel@vger.kernel.org; chenyao (F) <chenyao11@huawei.com>
> 主题: Re: 答复: [PATCH v5 1/1] PCI: kirin: Add MSI support
> 
> 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 <wangbinghui@hisilicon.com>;
> bhelgaas@google.com;
> > > robh+dt@kernel.org; linux-pci@vger.kernel.org;
> > > robh+linux-kernel@vger.kernel.org;
> > > dimitrysh@google.com
> > > 抄送: chenyao (F) <chenyao11@huawei.com>; Songxiaowei (Kirin_DRV)
> > > <songxiaowei@hisilicon.com>
> > > 主题: [PATCH v5 1/1] PCI: kirin: Add MSI support
> > >
> > > Add support for MSI.
> > >
> > > Signed-off-by: Xiaowei Song <songxiaowei@hisilicon.com>
> > > ---
> > >  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 ?
[songxiaowei]  Sorry about this issue, I'll check the patch carefully and test it on Hikey960 Board.
			 Thanks a lot for your time.

Best regards,
Xiaowei.
> 
> Lorenzo
> 
> > > +
> > >  	pci->pp.ops = &kirin_pcie_host_ops;
> > >
> > >  	return dw_pcie_host_init(&pci->pp);
> > > --
> > > 2.11.GIT
> >

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v5 1/1] PCI: kirin: Add MSI support
  2018-05-31  9:06 [PATCH v5 0/1] *** PCI: kirin: Add MSI support *** Xiaowei Song
@ 2018-05-31  9:06 ` Xiaowei Song
  0 siblings, 0 replies; 7+ messages in thread
From: Xiaowei Song @ 2018-05-31  9:06 UTC (permalink / raw)
  To: wangbinghui, bhelgaas, xuwei5, robh+dt, linux-pci, linux-kernel,
	dimitrysh, guodong.xu, suzhuangluan, andy.shevchenko,
	songxiaowei
  Cc: kongfei, chenyao11

Add support for MSI.

Signed-off-by: Xiaowei Song <songxiaowei@hisilicon.com>
---
 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;
+
 	pci->pp.ops = &kirin_pcie_host_ops;
 
 	return dw_pcie_host_init(&pci->pp);
-- 
2.11.GIT

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v5 1/1] PCI: kirin: Add MSI support
  2018-05-25  3:58 [PATCH v5 0/1] *** PCI: kirin: Add MSI support *** Xiaowei Song
@ 2018-05-25  3:58 ` Xiaowei Song
  0 siblings, 0 replies; 7+ messages in thread
From: Xiaowei Song @ 2018-05-25  3:58 UTC (permalink / raw)
  To: wangbinghui, bhelgaas, xuwei5, robh+dt, linux-pci, linux-kernel,
	dimitrysh, guodong.xu, suzhuangluan, andy.shevchenko
  Cc: kongfei, chenyao11

Add support for MSI.

Signed-off-by: Xiaowei Song <songxiaowei@hisilicon.com>
---
 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;
+
 	pci->pp.ops = &kirin_pcie_host_ops;
 
 	return dw_pcie_host_init(&pci->pp);
-- 
2.11.GIT

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-07-11  2:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-28 12:48 [PATCH v5 0/1] *** PCI: kirin: Add MSI support *** Xiaowei Song
2018-06-28 12:48 ` [PATCH v5 1/1] PCI: kirin: Add MSI support Xiaowei Song
2018-07-09  1:54   ` 答复: " Songxiaowei (Kirin_DRV)
2018-07-10 15:40     ` Lorenzo Pieralisi
2018-07-11  2:22       ` 答复: " Songxiaowei (Kirin_DRV)
  -- strict thread matches above, loose matches on Subject: below --
2018-05-31  9:06 [PATCH v5 0/1] *** PCI: kirin: Add MSI support *** Xiaowei Song
2018-05-31  9:06 ` [PATCH v5 1/1] PCI: kirin: Add MSI support Xiaowei Song
2018-05-25  3:58 [PATCH v5 0/1] *** PCI: kirin: Add MSI support *** Xiaowei Song
2018-05-25  3:58 ` [PATCH v5 1/1] PCI: kirin: Add MSI support Xiaowei Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).