devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: mediatek: take use of PCI_NUM_INTX
@ 2017-08-30  1:19 honghui.zhang
  2017-08-30  1:44 ` Honghui Zhang
       [not found] ` <1504055954-31545-1-git-send-email-honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
  0 siblings, 2 replies; 3+ messages in thread
From: honghui.zhang @ 2017-08-30  1:19 UTC (permalink / raw)
  To: bhelgaas, matthias.bgg, linux-arm-kernel, linux-mediatek,
	linux-pci, linux-kernel, devicetree, yingjoe.chen, eddie.huang,
	ryder.lee
  Cc: honghui.zhang, hongkun.cao, youlin.pei, yong.wu, yt.shen,
	sean.wang, xinping.qian

From: Honghui Zhang <honghui.zhang@mediatek.com>

Switch from using a custom NUM_INTX macro to the generic PCI_NUM_INTX
definition for the number of INTx interrupts.

Signed-off-by: Honghui Zhang <honghui.zhang@mediatek.com>
---
 drivers/pci/host/pcie-mediatek.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pcie-mediatek.c b/drivers/pci/host/pcie-mediatek.c
index c567996..5c0ce9b 100644
--- a/drivers/pci/host/pcie-mediatek.c
+++ b/drivers/pci/host/pcie-mediatek.c
@@ -77,7 +77,6 @@
 #define PCIE_INT_MASK		0x420
 #define INTX_MASK		GENMASK(19, 16)
 #define INTX_SHIFT		16
-#define INTX_NUM		4
 #define PCIE_INT_STATUS		0x424
 #define MSI_STATUS		BIT(23)
 #define PCIE_IMSI_STATUS	0x42c
@@ -576,7 +575,7 @@ static int mtk_pcie_init_irq_domain(struct mtk_pcie_port *port,
 		return -ENODEV;
 	}
 
-	port->irq_domain = irq_domain_add_linear(pcie_intc_node, INTX_NUM,
+	port->irq_domain = irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX,
 						 &intx_domain_ops, port);
 	if (!port->irq_domain) {
 		dev_err(dev, "failed to get INTx IRQ domain\n");
@@ -594,7 +593,7 @@ static irqreturn_t mtk_pcie_intr_handler(int irq, void *data)
 	u32 bit = INTX_SHIFT;
 
 	while ((status = readl(port->base + PCIE_INT_STATUS)) & INTX_MASK) {
-		for_each_set_bit_from(bit, &status, INTX_NUM + INTX_SHIFT) {
+		for_each_set_bit_from(bit, &status, PCI_NUM_INTX + INTX_SHIFT) {
 			/* Clear the INTx */
 			writel(1 << bit, port->base + PCIE_INT_STATUS);
 			virq = irq_find_mapping(port->irq_domain,
-- 
2.6.4

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

* Re: [PATCH] PCI: mediatek: take use of PCI_NUM_INTX
  2017-08-30  1:19 [PATCH] PCI: mediatek: take use of PCI_NUM_INTX honghui.zhang
@ 2017-08-30  1:44 ` Honghui Zhang
       [not found] ` <1504055954-31545-1-git-send-email-honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Honghui Zhang @ 2017-08-30  1:44 UTC (permalink / raw)
  To: bhelgaas
  Cc: matthias.bgg, linux-arm-kernel, linux-mediatek, linux-pci,
	linux-kernel, devicetree, yingjoe.chen, eddie.huang, ryder.lee,
	hongkun.cao, youlin.pei, yong.wu, yt.shen, sean.wang,
	xinping.qian

On Wed, 2017-08-30 at 09:19 +0800, honghui.zhang@mediatek.com wrote:
> From: Honghui Zhang <honghui.zhang@mediatek.com>
> 
> Switch from using a custom NUM_INTX macro to the generic PCI_NUM_INTX
> definition for the number of INTx interrupts.
> 
> Signed-off-by: Honghui Zhang <honghui.zhang@mediatek.com>
> ---
>  drivers/pci/host/pcie-mediatek.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 

Hi, Bjorn, Ryder,
	this patch is based on Paul's v7 version of patch[1]("Move enum
pci_interrupt_pin to linux/pci.h").
[1]http://www.spinics.net/lists/linux-pci/msg63891.html

Thanks.

> diff --git a/drivers/pci/host/pcie-mediatek.c b/drivers/pci/host/pcie-mediatek.c
> index c567996..5c0ce9b 100644
> --- a/drivers/pci/host/pcie-mediatek.c
> +++ b/drivers/pci/host/pcie-mediatek.c
> @@ -77,7 +77,6 @@
>  #define PCIE_INT_MASK		0x420
>  #define INTX_MASK		GENMASK(19, 16)
>  #define INTX_SHIFT		16
> -#define INTX_NUM		4
>  #define PCIE_INT_STATUS		0x424
>  #define MSI_STATUS		BIT(23)
>  #define PCIE_IMSI_STATUS	0x42c
> @@ -576,7 +575,7 @@ static int mtk_pcie_init_irq_domain(struct mtk_pcie_port *port,
>  		return -ENODEV;
>  	}
>  
> -	port->irq_domain = irq_domain_add_linear(pcie_intc_node, INTX_NUM,
> +	port->irq_domain = irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX,
>  						 &intx_domain_ops, port);
>  	if (!port->irq_domain) {
>  		dev_err(dev, "failed to get INTx IRQ domain\n");
> @@ -594,7 +593,7 @@ static irqreturn_t mtk_pcie_intr_handler(int irq, void *data)
>  	u32 bit = INTX_SHIFT;
>  
>  	while ((status = readl(port->base + PCIE_INT_STATUS)) & INTX_MASK) {
> -		for_each_set_bit_from(bit, &status, INTX_NUM + INTX_SHIFT) {
> +		for_each_set_bit_from(bit, &status, PCI_NUM_INTX + INTX_SHIFT) {
>  			/* Clear the INTx */
>  			writel(1 << bit, port->base + PCIE_INT_STATUS);
>  			virq = irq_find_mapping(port->irq_domain,

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

* Re: [PATCH] PCI: mediatek: take use of PCI_NUM_INTX
       [not found] ` <1504055954-31545-1-git-send-email-honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
@ 2017-08-30 13:24   ` Bjorn Helgaas
  0 siblings, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2017-08-30 13:24 UTC (permalink / raw)
  To: honghui.zhang-NuS5LvNUpcJWk0Htik3J/w
  Cc: bhelgaas-hpIqsD4AKlfQT0dZR+AlfA,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w,
	eddie.huang-NuS5LvNUpcJWk0Htik3J/w,
	ryder.lee-NuS5LvNUpcJWk0Htik3J/w,
	youlin.pei-NuS5LvNUpcJWk0Htik3J/w,
	hongkun.cao-NuS5LvNUpcJWk0Htik3J/w,
	sean.wang-NuS5LvNUpcJWk0Htik3J/w,
	xinping.qian-NuS5LvNUpcJWk0Htik3J/w,
	yt.shen-NuS5LvNUpcJWk0Htik3J/w, yong.wu-NuS5LvNUpcJWk0Htik3J/w

On Wed, Aug 30, 2017 at 09:19:14AM +0800, honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org wrote:
> From: Honghui Zhang <honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> 
> Switch from using a custom NUM_INTX macro to the generic PCI_NUM_INTX
> definition for the number of INTx interrupts.
> 
> Signed-off-by: Honghui Zhang <honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>

I rebased pci/host-mediatek on top of pci/irq-intx (which adds
PCI_NUM_INTX) and applied this for v4.14, thanks!

> ---
>  drivers/pci/host/pcie-mediatek.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-mediatek.c b/drivers/pci/host/pcie-mediatek.c
> index c567996..5c0ce9b 100644
> --- a/drivers/pci/host/pcie-mediatek.c
> +++ b/drivers/pci/host/pcie-mediatek.c
> @@ -77,7 +77,6 @@
>  #define PCIE_INT_MASK		0x420
>  #define INTX_MASK		GENMASK(19, 16)
>  #define INTX_SHIFT		16
> -#define INTX_NUM		4
>  #define PCIE_INT_STATUS		0x424
>  #define MSI_STATUS		BIT(23)
>  #define PCIE_IMSI_STATUS	0x42c
> @@ -576,7 +575,7 @@ static int mtk_pcie_init_irq_domain(struct mtk_pcie_port *port,
>  		return -ENODEV;
>  	}
>  
> -	port->irq_domain = irq_domain_add_linear(pcie_intc_node, INTX_NUM,
> +	port->irq_domain = irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX,
>  						 &intx_domain_ops, port);
>  	if (!port->irq_domain) {
>  		dev_err(dev, "failed to get INTx IRQ domain\n");
> @@ -594,7 +593,7 @@ static irqreturn_t mtk_pcie_intr_handler(int irq, void *data)
>  	u32 bit = INTX_SHIFT;
>  
>  	while ((status = readl(port->base + PCIE_INT_STATUS)) & INTX_MASK) {
> -		for_each_set_bit_from(bit, &status, INTX_NUM + INTX_SHIFT) {
> +		for_each_set_bit_from(bit, &status, PCI_NUM_INTX + INTX_SHIFT) {
>  			/* Clear the INTx */
>  			writel(1 << bit, port->base + PCIE_INT_STATUS);
>  			virq = irq_find_mapping(port->irq_domain,
> -- 
> 2.6.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2017-08-30 13:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-30  1:19 [PATCH] PCI: mediatek: take use of PCI_NUM_INTX honghui.zhang
2017-08-30  1:44 ` Honghui Zhang
     [not found] ` <1504055954-31545-1-git-send-email-honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-08-30 13:24   ` Bjorn Helgaas

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).