All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/1] mfd: intel_quark_i2c_gpio: enable MSI interrupt
@ 2021-03-24 15:19 Andy Shevchenko
  2021-03-24 15:25 ` Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2021-03-24 15:19 UTC (permalink / raw)
  To: Andy Shevchenko, linux-kernel; +Cc: Lee Jones

Allow interrupts to be MSI if supported by hardware.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v3: added a comment about magic 1s (Lee)

 drivers/mfd/intel_quark_i2c_gpio.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c
index 52728a963c17..7f90e6f022ba 100644
--- a/drivers/mfd/intel_quark_i2c_gpio.c
+++ b/drivers/mfd/intel_quark_i2c_gpio.c
@@ -169,8 +169,8 @@ static int intel_quark_i2c_setup(struct pci_dev *pdev, struct mfd_cell *cell)
 	res[INTEL_QUARK_IORES_MEM].end =
 		pci_resource_end(pdev, MFD_I2C_BAR);
 
-	res[INTEL_QUARK_IORES_IRQ].start = pdev->irq;
-	res[INTEL_QUARK_IORES_IRQ].end = pdev->irq;
+	res[INTEL_QUARK_IORES_IRQ].start = pci_irq_vector(pdev, 0);
+	res[INTEL_QUARK_IORES_IRQ].end = pci_irq_vector(pdev, 0);
 
 	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
 	if (!pdata)
@@ -217,7 +217,7 @@ static int intel_quark_gpio_setup(struct pci_dev *pdev, struct mfd_cell *cell)
 	pdata->properties->idx		= 0;
 	pdata->properties->ngpio	= INTEL_QUARK_MFD_NGPIO;
 	pdata->properties->gpio_base	= INTEL_QUARK_MFD_GPIO_BASE;
-	pdata->properties->irq[0]	= pdev->irq;
+	pdata->properties->irq[0]	= pci_irq_vector(pdev, 0);
 
 	cell->platform_data = pdata;
 	cell->pdata_size = sizeof(*pdata);
@@ -245,22 +245,31 @@ static int intel_quark_mfd_probe(struct pci_dev *pdev,
 	if (ret)
 		return ret;
 
+	pci_set_master(pdev);
+
+	/* This driver only requires 1 IRQ vector */
+	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
+	if (ret < 0)
+		goto err_unregister_i2c_clk;
+
 	ret = intel_quark_i2c_setup(pdev, &intel_quark_mfd_cells[MFD_I2C_BAR]);
 	if (ret)
-		goto err_unregister_i2c_clk;
+		goto err_free_irq_vectors;
 
 	ret = intel_quark_gpio_setup(pdev, &intel_quark_mfd_cells[MFD_GPIO_BAR]);
 	if (ret)
-		goto err_unregister_i2c_clk;
+		goto err_free_irq_vectors;
 
 	ret = mfd_add_devices(&pdev->dev, 0, intel_quark_mfd_cells,
 			      ARRAY_SIZE(intel_quark_mfd_cells), NULL, 0,
 			      NULL);
 	if (ret)
-		goto err_unregister_i2c_clk;
+		goto err_free_irq_vectors;
 
 	return 0;
 
+err_free_irq_vectors:
+	pci_free_irq_vectors(pdev);
 err_unregister_i2c_clk:
 	intel_quark_unregister_i2c_clk(&pdev->dev);
 	return ret;
@@ -269,6 +278,7 @@ static int intel_quark_mfd_probe(struct pci_dev *pdev,
 static void intel_quark_mfd_remove(struct pci_dev *pdev)
 {
 	mfd_remove_devices(&pdev->dev);
+	pci_free_irq_vectors(pdev);
 	intel_quark_unregister_i2c_clk(&pdev->dev);
 }
 
-- 
2.30.2


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

* Re: [PATCH v3 1/1] mfd: intel_quark_i2c_gpio: enable MSI interrupt
  2021-03-24 15:19 [PATCH v3 1/1] mfd: intel_quark_i2c_gpio: enable MSI interrupt Andy Shevchenko
@ 2021-03-24 15:25 ` Lee Jones
  2021-03-24 16:53   ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2021-03-24 15:25 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-kernel

On Wed, 24 Mar 2021, Andy Shevchenko wrote:

> Allow interrupts to be MSI if supported by hardware.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> v3: added a comment about magic 1s (Lee)
> 
>  drivers/mfd/intel_quark_i2c_gpio.c | 22 ++++++++++++++++------
>  1 file changed, 16 insertions(+), 6 deletions(-)

Doesn't apply.  :(

What repo is this based on?

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v3 1/1] mfd: intel_quark_i2c_gpio: enable MSI interrupt
  2021-03-24 15:25 ` Lee Jones
@ 2021-03-24 16:53   ` Andy Shevchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2021-03-24 16:53 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel

On Wed, Mar 24, 2021 at 03:25:02PM +0000, Lee Jones wrote:
> On Wed, 24 Mar 2021, Andy Shevchenko wrote:
> 
> > Allow interrupts to be MSI if supported by hardware.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> > v3: added a comment about magic 1s (Lee)
> > 
> >  drivers/mfd/intel_quark_i2c_gpio.c | 22 ++++++++++++++++------
> >  1 file changed, 16 insertions(+), 6 deletions(-)
> 
> Doesn't apply.  :(
> 
> What repo is this based on?

Sorry. I have an extra patch that messed up with this. I'll rebase and resend
soon a fixed version.

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2021-03-24 16:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-24 15:19 [PATCH v3 1/1] mfd: intel_quark_i2c_gpio: enable MSI interrupt Andy Shevchenko
2021-03-24 15:25 ` Lee Jones
2021-03-24 16:53   ` Andy Shevchenko

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.