All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
Cc: bhelgaas@google.com, soren.brinkmann@xilinx.com,
	christophe.jaillet@wanadoo.fr, grygorii.strashko@ti.com,
	yinghai@kernel.org, lorenzo.pieralisi@arm.com,
	fengguang.wu@intel.com, michal.simek@xilinx.com, arnd@arndb.de,
	Bharat Kumar Gogada <bharatku@xilinx.com>,
	linux-pci@vger.kernel.org, rgummal@xilinx.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/6] PCI: xilinx: Keep both legacy and MSI interrupt references.
Date: Tue, 13 Sep 2016 10:56:41 -0500	[thread overview]
Message-ID: <20160913155641.GB4138@localhost> (raw)
In-Reply-To: <1472724886-28301-1-git-send-email-bharatku@xilinx.com>

On Thu, Sep 01, 2016 at 03:44:41PM +0530, Bharat Kumar Gogada wrote:
> When built with MSI support the legacy domain reference is being
> overwritten with MSI.
> Instead creating two separate domains for MSI and legacy interrupts.
> 
> Signed-off-by: Bharat Kumar Gogada <bharatku@xilinx.com>

Applied all these (except [5/6]) with Michal's ack to pci/host-xilinx for
v4.9, thanks!

I already applied Po Liu's patch ("PCI: xilinx: Relax device number
checking to allow SR-IOV") to pci/virtualization.  This is identical to
[5/6], so I dropped [5/6] to avoid a conflict.

> ---
>  drivers/pci/host/pcie-xilinx.c | 26 +++++++++++++++-----------
>  1 file changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
> index a30e016..bd64677 100644
> --- a/drivers/pci/host/pcie-xilinx.c
> +++ b/drivers/pci/host/pcie-xilinx.c
> @@ -101,7 +101,8 @@
>   * @msi_pages: MSI pages
>   * @root_busno: Root Bus number
>   * @dev: Device pointer
> - * @irq_domain: IRQ domain pointer
> + * @msi_domain: MSI IRQ domain pointer
> + * @leg_domain: Legacy IRQ domain pointer
>   * @resources: Bus Resources
>   */
>  struct xilinx_pcie_port {
> @@ -110,7 +111,8 @@ struct xilinx_pcie_port {
>  	unsigned long msi_pages;
>  	u8 root_busno;
>  	struct device *dev;
> -	struct irq_domain *irq_domain;
> +	struct irq_domain *msi_domain;
> +	struct irq_domain *leg_domain;
>  	struct list_head resources;
>  };
>  
> @@ -281,7 +283,7 @@ static int xilinx_pcie_msi_setup_irq(struct msi_controller *chip,
>  	if (hwirq < 0)
>  		return hwirq;
>  
> -	irq = irq_create_mapping(port->irq_domain, hwirq);
> +	irq = irq_create_mapping(port->msi_domain, hwirq);
>  	if (!irq)
>  		return -EINVAL;
>  
> @@ -443,7 +445,7 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
>  			/* Handle INTx Interrupt */
>  			val = ((val & XILINX_PCIE_RPIFR1_INTR_MASK) >>
>  				XILINX_PCIE_RPIFR1_INTR_SHIFT) + 1;
> -			generic_handle_irq(irq_find_mapping(port->irq_domain,
> +			generic_handle_irq(irq_find_mapping(port->leg_domain,
>  							    val));
>  		}
>  	}
> @@ -526,12 +528,14 @@ static void xilinx_pcie_free_irq_domain(struct xilinx_pcie_port *port)
>  	}
>  
>  	for (i = 0; i < num_irqs; i++) {
> -		irq = irq_find_mapping(port->irq_domain, i);
> +		irq = irq_find_mapping(port->leg_domain, i);
>  		if (irq > 0)
>  			irq_dispose_mapping(irq);
>  	}
> -
> -	irq_domain_remove(port->irq_domain);
> +	if (port->leg_domain)
> +		irq_domain_remove(port->leg_domain);
> +	if (port->msi_domain)
> +		irq_domain_remove(port->msi_domain);
>  }
>  
>  /**
> @@ -553,21 +557,21 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
>  		return -ENODEV;
>  	}
>  
> -	port->irq_domain = irq_domain_add_linear(pcie_intc_node, 4,
> +	port->leg_domain = irq_domain_add_linear(pcie_intc_node, 4,
>  						 &intx_domain_ops,
>  						 port);
> -	if (!port->irq_domain) {
> +	if (!port->leg_domain) {
>  		dev_err(dev, "Failed to get a INTx IRQ domain\n");
>  		return -ENODEV;
>  	}
>  
>  	/* Setup MSI */
>  	if (IS_ENABLED(CONFIG_PCI_MSI)) {
> -		port->irq_domain = irq_domain_add_linear(node,
> +		port->msi_domain = irq_domain_add_linear(node,
>  							 XILINX_NUM_MSI_IRQS,
>  							 &msi_domain_ops,
>  							 &xilinx_pcie_msi_chip);
> -		if (!port->irq_domain) {
> +		if (!port->msi_domain) {
>  			dev_err(dev, "Failed to get a MSI IRQ domain\n");
>  			return -ENODEV;
>  		}
> -- 
> 2.1.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: helgaas@kernel.org (Bjorn Helgaas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/6] PCI: xilinx: Keep both legacy and MSI interrupt references.
Date: Tue, 13 Sep 2016 10:56:41 -0500	[thread overview]
Message-ID: <20160913155641.GB4138@localhost> (raw)
In-Reply-To: <1472724886-28301-1-git-send-email-bharatku@xilinx.com>

On Thu, Sep 01, 2016 at 03:44:41PM +0530, Bharat Kumar Gogada wrote:
> When built with MSI support the legacy domain reference is being
> overwritten with MSI.
> Instead creating two separate domains for MSI and legacy interrupts.
> 
> Signed-off-by: Bharat Kumar Gogada <bharatku@xilinx.com>

Applied all these (except [5/6]) with Michal's ack to pci/host-xilinx for
v4.9, thanks!

I already applied Po Liu's patch ("PCI: xilinx: Relax device number
checking to allow SR-IOV") to pci/virtualization.  This is identical to
[5/6], so I dropped [5/6] to avoid a conflict.

> ---
>  drivers/pci/host/pcie-xilinx.c | 26 +++++++++++++++-----------
>  1 file changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
> index a30e016..bd64677 100644
> --- a/drivers/pci/host/pcie-xilinx.c
> +++ b/drivers/pci/host/pcie-xilinx.c
> @@ -101,7 +101,8 @@
>   * @msi_pages: MSI pages
>   * @root_busno: Root Bus number
>   * @dev: Device pointer
> - * @irq_domain: IRQ domain pointer
> + * @msi_domain: MSI IRQ domain pointer
> + * @leg_domain: Legacy IRQ domain pointer
>   * @resources: Bus Resources
>   */
>  struct xilinx_pcie_port {
> @@ -110,7 +111,8 @@ struct xilinx_pcie_port {
>  	unsigned long msi_pages;
>  	u8 root_busno;
>  	struct device *dev;
> -	struct irq_domain *irq_domain;
> +	struct irq_domain *msi_domain;
> +	struct irq_domain *leg_domain;
>  	struct list_head resources;
>  };
>  
> @@ -281,7 +283,7 @@ static int xilinx_pcie_msi_setup_irq(struct msi_controller *chip,
>  	if (hwirq < 0)
>  		return hwirq;
>  
> -	irq = irq_create_mapping(port->irq_domain, hwirq);
> +	irq = irq_create_mapping(port->msi_domain, hwirq);
>  	if (!irq)
>  		return -EINVAL;
>  
> @@ -443,7 +445,7 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
>  			/* Handle INTx Interrupt */
>  			val = ((val & XILINX_PCIE_RPIFR1_INTR_MASK) >>
>  				XILINX_PCIE_RPIFR1_INTR_SHIFT) + 1;
> -			generic_handle_irq(irq_find_mapping(port->irq_domain,
> +			generic_handle_irq(irq_find_mapping(port->leg_domain,
>  							    val));
>  		}
>  	}
> @@ -526,12 +528,14 @@ static void xilinx_pcie_free_irq_domain(struct xilinx_pcie_port *port)
>  	}
>  
>  	for (i = 0; i < num_irqs; i++) {
> -		irq = irq_find_mapping(port->irq_domain, i);
> +		irq = irq_find_mapping(port->leg_domain, i);
>  		if (irq > 0)
>  			irq_dispose_mapping(irq);
>  	}
> -
> -	irq_domain_remove(port->irq_domain);
> +	if (port->leg_domain)
> +		irq_domain_remove(port->leg_domain);
> +	if (port->msi_domain)
> +		irq_domain_remove(port->msi_domain);
>  }
>  
>  /**
> @@ -553,21 +557,21 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
>  		return -ENODEV;
>  	}
>  
> -	port->irq_domain = irq_domain_add_linear(pcie_intc_node, 4,
> +	port->leg_domain = irq_domain_add_linear(pcie_intc_node, 4,
>  						 &intx_domain_ops,
>  						 port);
> -	if (!port->irq_domain) {
> +	if (!port->leg_domain) {
>  		dev_err(dev, "Failed to get a INTx IRQ domain\n");
>  		return -ENODEV;
>  	}
>  
>  	/* Setup MSI */
>  	if (IS_ENABLED(CONFIG_PCI_MSI)) {
> -		port->irq_domain = irq_domain_add_linear(node,
> +		port->msi_domain = irq_domain_add_linear(node,
>  							 XILINX_NUM_MSI_IRQS,
>  							 &msi_domain_ops,
>  							 &xilinx_pcie_msi_chip);
> -		if (!port->irq_domain) {
> +		if (!port->msi_domain) {
>  			dev_err(dev, "Failed to get a MSI IRQ domain\n");
>  			return -ENODEV;
>  		}
> -- 
> 2.1.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2016-09-13 15:56 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01 10:14 [PATCH 1/6] PCI: xilinx: Keep both legacy and MSI interrupt references Bharat Kumar Gogada
2016-09-01 10:14 ` Bharat Kumar Gogada
2016-09-01 10:14 ` Bharat Kumar Gogada
2016-09-01 10:14 ` [PATCH 2/6] PCI: Xilinx : Clear interrupt register for invalid interrupt Bharat Kumar Gogada
2016-09-01 10:14   ` Bharat Kumar Gogada
2016-09-01 10:14 ` [PATCH 3/6] PCI: Xilinx: Clear correct msi set bit Bharat Kumar Gogada
2016-09-01 10:14   ` Bharat Kumar Gogada
2016-09-01 10:14   ` Bharat Kumar Gogada
2016-09-01 10:14 ` [PATCH 4/6] PCI: Xilinx: Dispose MSI virtual irq Bharat Kumar Gogada
2016-09-01 10:14   ` Bharat Kumar Gogada
2016-09-01 10:14   ` Bharat Kumar Gogada
2016-09-01 10:14 ` [PATCH 5/6] PCI: Xilinx: Read more than one function per device Bharat Kumar Gogada
2016-09-01 10:14   ` Bharat Kumar Gogada
2016-09-01 10:14   ` Bharat Kumar Gogada
2016-09-01 10:14 ` [PATCH 6/6] Microblaze: Modify microblaze pci specific code to support multidomain Bharat Kumar Gogada
2016-09-01 10:14   ` Bharat Kumar Gogada
2016-09-01 10:14   ` Bharat Kumar Gogada
2016-09-12 22:21 ` [PATCH 1/6] PCI: xilinx: Keep both legacy and MSI interrupt references Bjorn Helgaas
2016-09-12 22:21   ` Bjorn Helgaas
2016-09-13  8:27   ` Michal Simek
2016-09-13 15:56 ` Bjorn Helgaas [this message]
2016-09-13 15:56   ` Bjorn Helgaas
2016-09-14 15:32   ` Bharat Kumar Gogada
2016-09-14 15:32     ` Bharat Kumar Gogada
2016-09-14 15:32     ` Bharat Kumar Gogada
2016-09-14 19:17     ` Bjorn Helgaas
2016-09-14 19:17       ` Bjorn Helgaas
2016-09-15  5:09       ` Bharat Kumar Gogada
2016-09-15  5:09         ` Bharat Kumar Gogada
2016-09-15  5:09         ` Bharat Kumar Gogada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160913155641.GB4138@localhost \
    --to=helgaas@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bharat.kumar.gogada@xilinx.com \
    --cc=bharatku@xilinx.com \
    --cc=bhelgaas@google.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=fengguang.wu@intel.com \
    --cc=grygorii.strashko@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=michal.simek@xilinx.com \
    --cc=rgummal@xilinx.com \
    --cc=soren.brinkmann@xilinx.com \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.