linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors()
@ 2021-02-26 15:50 Dejin Zheng
  2021-02-26 15:50 ` [PATCH v5 1/4] PCI: " Dejin Zheng
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Dejin Zheng @ 2021-02-26 15:50 UTC (permalink / raw)
  To: corbet, jarkko.nikula, andriy.shevchenko, mika.westerberg, rric,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci
  Cc: linux-kernel, Dejin Zheng

Introduce pcim_alloc_irq_vectors(), a device-managed version of
pci_alloc_irq_vectors(), In some i2c drivers, If pcim_enable_device()
has been called before, then pci_alloc_irq_vectors() is actually a
device-managed function. It is used as a device-managed function, So
replace it with pcim_alloc_irq_vectors().

Changelog
---------
v4 -> v5:
	- Remove the check of enable device in pcim_alloc_irq_vectors()
	  and make it as a static line function.
	- Modify the subject name in patch 3 and patch 4.
v3 -> v4:
	- add some commit comments for patch 3
v2 -> v3:
	- Add some commit comments for replace some codes in
	  pcim_release() by pci_free_irq_vectors().
	- Simplify the error handling path in i2c designware
	  driver.
v1 -> v2:
	- Use pci_free_irq_vectors() to replace some code in
	  pcim_release().
	- Modify some commit messages.

Dejin Zheng (4):
  PCI: Introduce pcim_alloc_irq_vectors()
  Documentation: devres: Add pcim_alloc_irq_vectors()
  i2c: designware: Use pcim_alloc_irq_vectors() to allocate IRQ vectors
  i2c: thunderx: Use pcim_alloc_irq_vectors() to allocate IRQ vectors

 .../driver-api/driver-model/devres.rst        |  1 +
 drivers/i2c/busses/i2c-designware-pcidrv.c    | 15 ++++--------
 drivers/i2c/busses/i2c-thunderx-pcidrv.c      |  2 +-
 drivers/pci/pci.c                             |  5 +---
 include/linux/pci.h                           | 24 +++++++++++++++++++
 5 files changed, 31 insertions(+), 16 deletions(-)

-- 
2.25.0


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

* [PATCH v5 1/4] PCI: Introduce pcim_alloc_irq_vectors()
  2021-02-26 15:50 [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors() Dejin Zheng
@ 2021-02-26 15:50 ` Dejin Zheng
  2021-02-26 16:23   ` Andy Shevchenko
  2021-03-23 22:47   ` Bjorn Helgaas
  2021-02-26 15:50 ` [PATCH v5 2/4] Documentation: devres: Add pcim_alloc_irq_vectors() Dejin Zheng
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 17+ messages in thread
From: Dejin Zheng @ 2021-02-26 15:50 UTC (permalink / raw)
  To: corbet, jarkko.nikula, andriy.shevchenko, mika.westerberg, rric,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci
  Cc: linux-kernel, Dejin Zheng

Introduce pcim_alloc_irq_vectors(), a device-managed version of
pci_alloc_irq_vectors(). Introducing this function can simplify
the error handling path in many drivers.

And use pci_free_irq_vectors() to replace some code in pcim_release(),
they are equivalent, and no functional change. It is more explicit
that pcim_alloc_irq_vectors() is a device-managed function.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---
v4 -> v5:
	- Remove the check of enable device in pcim_alloc_irq_vectors()
	  and make it as a static line function.
v3 -> v4:
	- No change
v2 -> v3:
	- Add some commit comments for replace some codes in
	  pcim_release() by pci_free_irq_vectors().
v1 -> v2:
	- Use pci_free_irq_vectors() to replace some code in
	  pcim_release().
	- Modify some commit messages.

 drivers/pci/pci.c   |  5 +----
 include/linux/pci.h | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 16a17215f633..fecfdc0add2f 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1969,10 +1969,7 @@ static void pcim_release(struct device *gendev, void *res)
 	struct pci_devres *this = res;
 	int i;
 
-	if (dev->msi_enabled)
-		pci_disable_msi(dev);
-	if (dev->msix_enabled)
-		pci_disable_msix(dev);
+	pci_free_irq_vectors(dev);
 
 	for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
 		if (this->region_mask & (1 << i))
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 86c799c97b77..5cafd7d65fd7 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1818,6 +1818,30 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
 					      NULL);
 }
 
+/**
+ * pcim_alloc_irq_vectors - a device-managed pci_alloc_irq_vectors()
+ * @dev:		PCI device to operate on
+ * @min_vecs:		minimum number of vectors required (must be >= 1)
+ * @max_vecs:		maximum (desired) number of vectors
+ * @flags:		flags or quirks for the allocation
+ *
+ * Return the number of vectors allocated, (which might be smaller than
+ * @max_vecs) if successful, or a negative error code on error. If less
+ * than @min_vecs interrupt vectors are available for @dev the function
+ * will fail with -ENOSPC.
+ *
+ * It depends on calling pcim_enable_device() to make IRQ resources
+ * manageable.
+ */
+static inline int
+pcim_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
+			unsigned int max_vecs, unsigned int flags)
+{
+	if (!pci_is_managed(dev))
+		return -EINVAL;
+	return pci_alloc_irq_vectors(dev, min_vecs, max_vecs, flags);
+}
+
 /* Include architecture-dependent settings and functions */
 
 #include <asm/pci.h>
-- 
2.25.0


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

* [PATCH v5 2/4] Documentation: devres: Add pcim_alloc_irq_vectors()
  2021-02-26 15:50 [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors() Dejin Zheng
  2021-02-26 15:50 ` [PATCH v5 1/4] PCI: " Dejin Zheng
@ 2021-02-26 15:50 ` Dejin Zheng
  2021-02-26 15:50 ` [PATCH v5 3/4] i2c: designware: Use pcim_alloc_irq_vectors() to allocate IRQ vectors Dejin Zheng
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 17+ messages in thread
From: Dejin Zheng @ 2021-02-26 15:50 UTC (permalink / raw)
  To: corbet, jarkko.nikula, andriy.shevchenko, mika.westerberg, rric,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci
  Cc: linux-kernel, Dejin Zheng

Add pcim_alloc_irq_vectors(), a device-managed version of
pci_alloc_irq_vectors(). introducing this function can simplify
the error handling path in many drivers.

Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---
v4 -> v5:
	- No change
v3 -> v4:
	- No change
v2 -> v3:
	- No change
v1 -> v2:
	- Modify some commit messages.

 Documentation/driver-api/driver-model/devres.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index cd8b6e657b94..a52f65b6352f 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -380,6 +380,7 @@ PCI
   devm_pci_alloc_host_bridge()  : managed PCI host bridge allocation
   devm_pci_remap_cfgspace()	: ioremap PCI configuration space
   devm_pci_remap_cfg_resource()	: ioremap PCI configuration space resource
+  pcim_alloc_irq_vectors()      : managed IRQ vectors allocation
   pcim_enable_device()		: after success, all PCI ops become managed
   pcim_pin_device()		: keep PCI device enabled after release
 
-- 
2.25.0


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

* [PATCH v5 3/4] i2c: designware: Use pcim_alloc_irq_vectors() to allocate IRQ vectors
  2021-02-26 15:50 [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors() Dejin Zheng
  2021-02-26 15:50 ` [PATCH v5 1/4] PCI: " Dejin Zheng
  2021-02-26 15:50 ` [PATCH v5 2/4] Documentation: devres: Add pcim_alloc_irq_vectors() Dejin Zheng
@ 2021-02-26 15:50 ` Dejin Zheng
  2021-03-03  9:27   ` Jarkko Nikula
  2021-02-26 15:50 ` [PATCH v5 4/4] i2c: thunderx: " Dejin Zheng
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Dejin Zheng @ 2021-02-26 15:50 UTC (permalink / raw)
  To: corbet, jarkko.nikula, andriy.shevchenko, mika.westerberg, rric,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci
  Cc: linux-kernel, Dejin Zheng

The pcim_alloc_irq_vectors() function, an explicit device-managed version
of pci_alloc_irq_vectors(). If pcim_enable_device() has been called
before, then pci_alloc_irq_vectors() is actually a device-managed
function. It is used here as a device-managed function, So replace it
with pcim_alloc_irq_vectors(). At the same time, Remove the
pci_free_irq_vectors() function to simplify the error handling path.
the freeing resources will take automatically when device is gone.

Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---
v4 -> v5:
	- Modify the subject name.
v3 -> v4:
	- add some commit comments.
v2 -> v3:
	- simplify the error handling path.
v1 -> v2:
	- Modify some commit messages.

 drivers/i2c/busses/i2c-designware-pcidrv.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index 55c83a7a24f3..620b41e373b6 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -219,7 +219,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
 	if (!dev)
 		return -ENOMEM;
 
-	r = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
+	r = pcim_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
 	if (r < 0)
 		return r;
 
@@ -234,10 +234,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
 
 	if (controller->setup) {
 		r = controller->setup(pdev, controller);
-		if (r) {
-			pci_free_irq_vectors(pdev);
+		if (r)
 			return r;
-		}
 	}
 
 	i2c_dw_adjust_bus_speed(dev);
@@ -246,10 +244,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
 		i2c_dw_acpi_configure(&pdev->dev);
 
 	r = i2c_dw_validate_speed(dev);
-	if (r) {
-		pci_free_irq_vectors(pdev);
+	if (r)
 		return r;
-	}
 
 	i2c_dw_configure(dev);
 
@@ -269,10 +265,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
 	adap->nr = controller->bus_num;
 
 	r = i2c_dw_probe(dev);
-	if (r) {
-		pci_free_irq_vectors(pdev);
+	if (r)
 		return r;
-	}
 
 	pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
 	pm_runtime_use_autosuspend(&pdev->dev);
@@ -292,7 +286,6 @@ static void i2c_dw_pci_remove(struct pci_dev *pdev)
 
 	i2c_del_adapter(&dev->adapter);
 	devm_free_irq(&pdev->dev, dev->irq, dev);
-	pci_free_irq_vectors(pdev);
 }
 
 /* work with hotplug and coldplug */
-- 
2.25.0


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

* [PATCH v5 4/4] i2c: thunderx: Use pcim_alloc_irq_vectors() to allocate IRQ vectors
  2021-02-26 15:50 [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors() Dejin Zheng
                   ` (2 preceding siblings ...)
  2021-02-26 15:50 ` [PATCH v5 3/4] i2c: designware: Use pcim_alloc_irq_vectors() to allocate IRQ vectors Dejin Zheng
@ 2021-02-26 15:50 ` Dejin Zheng
  2021-02-26 19:19   ` Robert Richter
  2021-02-26 19:20 ` [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors() Robert Richter
  2021-04-21 15:23 ` Andy Shevchenko
  5 siblings, 1 reply; 17+ messages in thread
From: Dejin Zheng @ 2021-02-26 15:50 UTC (permalink / raw)
  To: corbet, jarkko.nikula, andriy.shevchenko, mika.westerberg, rric,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci
  Cc: linux-kernel, Dejin Zheng

The pcim_alloc_irq_vectors() function, an explicit device-managed version
of pci_alloc_irq_vectors(). If pcim_enable_device() has been called
before, then pci_alloc_irq_vectors() is actually a device-managed
function. It is used here as a device-managed function, So replace it
with pcim_alloc_irq_vectors().

Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---
v4 -> v5:
	- Modify the subject name.
v3 -> v4:
	- No change.
v2 -> v3:
	- No change.
v1 -> v2:
	- Modify some commit messages.
 drivers/i2c/busses/i2c-thunderx-pcidrv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
index 12c90aa0900e..63354e9fb726 100644
--- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c
+++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
@@ -192,7 +192,7 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev,
 	i2c->hlc_int_enable = thunder_i2c_hlc_int_enable;
 	i2c->hlc_int_disable = thunder_i2c_hlc_int_disable;
 
-	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX);
+	ret = pcim_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX);
 	if (ret < 0)
 		goto error;
 
-- 
2.25.0


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

* Re: [PATCH v5 1/4] PCI: Introduce pcim_alloc_irq_vectors()
  2021-02-26 15:50 ` [PATCH v5 1/4] PCI: " Dejin Zheng
@ 2021-02-26 16:23   ` Andy Shevchenko
  2021-02-28 11:16     ` Dejin Zheng
  2021-03-23 22:47   ` Bjorn Helgaas
  1 sibling, 1 reply; 17+ messages in thread
From: Andy Shevchenko @ 2021-02-26 16:23 UTC (permalink / raw)
  To: Dejin Zheng
  Cc: corbet, jarkko.nikula, mika.westerberg, rric, bhelgaas, wsa,
	linux-doc, linux-i2c, linux-pci, linux-kernel

On Fri, Feb 26, 2021 at 11:50:53PM +0800, Dejin Zheng wrote:
> Introduce pcim_alloc_irq_vectors(), a device-managed version of
> pci_alloc_irq_vectors(). Introducing this function can simplify
> the error handling path in many drivers.
> 
> And use pci_free_irq_vectors() to replace some code in pcim_release(),
> they are equivalent, and no functional change. It is more explicit
> that pcim_alloc_irq_vectors() is a device-managed function.

Thanks!

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
> ---
> v4 -> v5:
> 	- Remove the check of enable device in pcim_alloc_irq_vectors()
> 	  and make it as a static line function.
> v3 -> v4:
> 	- No change
> v2 -> v3:
> 	- Add some commit comments for replace some codes in
> 	  pcim_release() by pci_free_irq_vectors().
> v1 -> v2:
> 	- Use pci_free_irq_vectors() to replace some code in
> 	  pcim_release().
> 	- Modify some commit messages.
> 
>  drivers/pci/pci.c   |  5 +----
>  include/linux/pci.h | 24 ++++++++++++++++++++++++
>  2 files changed, 25 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 16a17215f633..fecfdc0add2f 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1969,10 +1969,7 @@ static void pcim_release(struct device *gendev, void *res)
>  	struct pci_devres *this = res;
>  	int i;
>  
> -	if (dev->msi_enabled)
> -		pci_disable_msi(dev);
> -	if (dev->msix_enabled)
> -		pci_disable_msix(dev);
> +	pci_free_irq_vectors(dev);
>  
>  	for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
>  		if (this->region_mask & (1 << i))
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 86c799c97b77..5cafd7d65fd7 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1818,6 +1818,30 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
>  					      NULL);
>  }
>  
> +/**
> + * pcim_alloc_irq_vectors - a device-managed pci_alloc_irq_vectors()
> + * @dev:		PCI device to operate on
> + * @min_vecs:		minimum number of vectors required (must be >= 1)
> + * @max_vecs:		maximum (desired) number of vectors
> + * @flags:		flags or quirks for the allocation
> + *
> + * Return the number of vectors allocated, (which might be smaller than
> + * @max_vecs) if successful, or a negative error code on error. If less
> + * than @min_vecs interrupt vectors are available for @dev the function
> + * will fail with -ENOSPC.
> + *
> + * It depends on calling pcim_enable_device() to make IRQ resources
> + * manageable.
> + */
> +static inline int
> +pcim_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
> +			unsigned int max_vecs, unsigned int flags)
> +{
> +	if (!pci_is_managed(dev))
> +		return -EINVAL;
> +	return pci_alloc_irq_vectors(dev, min_vecs, max_vecs, flags);
> +}
> +
>  /* Include architecture-dependent settings and functions */
>  
>  #include <asm/pci.h>
> -- 
> 2.25.0
> 

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v5 4/4] i2c: thunderx: Use pcim_alloc_irq_vectors() to allocate IRQ vectors
  2021-02-26 15:50 ` [PATCH v5 4/4] i2c: thunderx: " Dejin Zheng
@ 2021-02-26 19:19   ` Robert Richter
  0 siblings, 0 replies; 17+ messages in thread
From: Robert Richter @ 2021-02-26 19:19 UTC (permalink / raw)
  To: Dejin Zheng
  Cc: corbet, jarkko.nikula, andriy.shevchenko, mika.westerberg,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci, linux-kernel

On 26.02.21 23:50:56, Dejin Zheng wrote:
> The pcim_alloc_irq_vectors() function, an explicit device-managed version
> of pci_alloc_irq_vectors(). If pcim_enable_device() has been called
> before, then pci_alloc_irq_vectors() is actually a device-managed
> function. It is used here as a device-managed function, So replace it
> with pcim_alloc_irq_vectors().
> 
> Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>

Acked-by: Robert Richter <rric@kernel.org>

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

* Re: [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors()
  2021-02-26 15:50 [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors() Dejin Zheng
                   ` (3 preceding siblings ...)
  2021-02-26 15:50 ` [PATCH v5 4/4] i2c: thunderx: " Dejin Zheng
@ 2021-02-26 19:20 ` Robert Richter
  2021-02-28 11:17   ` Dejin Zheng
  2021-04-21 15:23 ` Andy Shevchenko
  5 siblings, 1 reply; 17+ messages in thread
From: Robert Richter @ 2021-02-26 19:20 UTC (permalink / raw)
  To: Dejin Zheng
  Cc: corbet, jarkko.nikula, andriy.shevchenko, mika.westerberg,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci, linux-kernel

On 26.02.21 23:50:52, Dejin Zheng wrote:
> Introduce pcim_alloc_irq_vectors(), a device-managed version of
> pci_alloc_irq_vectors(), In some i2c drivers, If pcim_enable_device()
> has been called before, then pci_alloc_irq_vectors() is actually a
> device-managed function. It is used as a device-managed function, So
> replace it with pcim_alloc_irq_vectors().

For the whole series:

Reviewed-by: Robert Richter <rric@kernel.org>

Thanks.

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

* Re: [PATCH v5 1/4] PCI: Introduce pcim_alloc_irq_vectors()
  2021-02-26 16:23   ` Andy Shevchenko
@ 2021-02-28 11:16     ` Dejin Zheng
  0 siblings, 0 replies; 17+ messages in thread
From: Dejin Zheng @ 2021-02-28 11:16 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: corbet, jarkko.nikula, mika.westerberg, rric, bhelgaas, wsa,
	linux-doc, linux-i2c, linux-pci, linux-kernel

On Fri, Feb 26, 2021 at 06:23:02PM +0200, Andy Shevchenko wrote:
> On Fri, Feb 26, 2021 at 11:50:53PM +0800, Dejin Zheng wrote:
> > Introduce pcim_alloc_irq_vectors(), a device-managed version of
> > pci_alloc_irq_vectors(). Introducing this function can simplify
> > the error handling path in many drivers.
> > 
> > And use pci_free_irq_vectors() to replace some code in pcim_release(),
> > they are equivalent, and no functional change. It is more explicit
> > that pcim_alloc_irq_vectors() is a device-managed function.
> 
> Thanks!
> 
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
Andy, Thanks!

> > Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
> > ---
> > v4 -> v5:
> > 	- Remove the check of enable device in pcim_alloc_irq_vectors()
> > 	  and make it as a static line function.
> > v3 -> v4:
> > 	- No change
> > v2 -> v3:
> > 	- Add some commit comments for replace some codes in
> > 	  pcim_release() by pci_free_irq_vectors().
> > v1 -> v2:
> > 	- Use pci_free_irq_vectors() to replace some code in
> > 	  pcim_release().
> > 	- Modify some commit messages.
> > 
> >  drivers/pci/pci.c   |  5 +----
> >  include/linux/pci.h | 24 ++++++++++++++++++++++++
> >  2 files changed, 25 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> > index 16a17215f633..fecfdc0add2f 100644
> > --- a/drivers/pci/pci.c
> > +++ b/drivers/pci/pci.c
> > @@ -1969,10 +1969,7 @@ static void pcim_release(struct device *gendev, void *res)
> >  	struct pci_devres *this = res;
> >  	int i;
> >  
> > -	if (dev->msi_enabled)
> > -		pci_disable_msi(dev);
> > -	if (dev->msix_enabled)
> > -		pci_disable_msix(dev);
> > +	pci_free_irq_vectors(dev);
> >  
> >  	for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
> >  		if (this->region_mask & (1 << i))
> > diff --git a/include/linux/pci.h b/include/linux/pci.h
> > index 86c799c97b77..5cafd7d65fd7 100644
> > --- a/include/linux/pci.h
> > +++ b/include/linux/pci.h
> > @@ -1818,6 +1818,30 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
> >  					      NULL);
> >  }
> >  
> > +/**
> > + * pcim_alloc_irq_vectors - a device-managed pci_alloc_irq_vectors()
> > + * @dev:		PCI device to operate on
> > + * @min_vecs:		minimum number of vectors required (must be >= 1)
> > + * @max_vecs:		maximum (desired) number of vectors
> > + * @flags:		flags or quirks for the allocation
> > + *
> > + * Return the number of vectors allocated, (which might be smaller than
> > + * @max_vecs) if successful, or a negative error code on error. If less
> > + * than @min_vecs interrupt vectors are available for @dev the function
> > + * will fail with -ENOSPC.
> > + *
> > + * It depends on calling pcim_enable_device() to make IRQ resources
> > + * manageable.
> > + */
> > +static inline int
> > +pcim_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
> > +			unsigned int max_vecs, unsigned int flags)
> > +{
> > +	if (!pci_is_managed(dev))
> > +		return -EINVAL;
> > +	return pci_alloc_irq_vectors(dev, min_vecs, max_vecs, flags);
> > +}
> > +
> >  /* Include architecture-dependent settings and functions */
> >  
> >  #include <asm/pci.h>
> > -- 
> > 2.25.0
> > 
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 

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

* Re: [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors()
  2021-02-26 19:20 ` [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors() Robert Richter
@ 2021-02-28 11:17   ` Dejin Zheng
  0 siblings, 0 replies; 17+ messages in thread
From: Dejin Zheng @ 2021-02-28 11:17 UTC (permalink / raw)
  To: Robert Richter
  Cc: corbet, jarkko.nikula, andriy.shevchenko, mika.westerberg,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci, linux-kernel

On Fri, Feb 26, 2021 at 08:20:55PM +0100, Robert Richter wrote:
> On 26.02.21 23:50:52, Dejin Zheng wrote:
> > Introduce pcim_alloc_irq_vectors(), a device-managed version of
> > pci_alloc_irq_vectors(), In some i2c drivers, If pcim_enable_device()
> > has been called before, then pci_alloc_irq_vectors() is actually a
> > device-managed function. It is used as a device-managed function, So
> > replace it with pcim_alloc_irq_vectors().
> 
> For the whole series:
> 
> Reviewed-by: Robert Richter <rric@kernel.org>
>
Robert, Thanks very much for your help!

> Thanks.

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

* Re: [PATCH v5 3/4] i2c: designware: Use pcim_alloc_irq_vectors() to allocate IRQ vectors
  2021-02-26 15:50 ` [PATCH v5 3/4] i2c: designware: Use pcim_alloc_irq_vectors() to allocate IRQ vectors Dejin Zheng
@ 2021-03-03  9:27   ` Jarkko Nikula
  0 siblings, 0 replies; 17+ messages in thread
From: Jarkko Nikula @ 2021-03-03  9:27 UTC (permalink / raw)
  To: Dejin Zheng, corbet, andriy.shevchenko, mika.westerberg, rric,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci
  Cc: linux-kernel

On 2/26/21 5:50 PM, Dejin Zheng wrote:
> The pcim_alloc_irq_vectors() function, an explicit device-managed version
> of pci_alloc_irq_vectors(). If pcim_enable_device() has been called
> before, then pci_alloc_irq_vectors() is actually a device-managed
> function. It is used here as a device-managed function, So replace it
> with pcim_alloc_irq_vectors(). At the same time, Remove the
> pci_free_irq_vectors() function to simplify the error handling path.
> the freeing resources will take automatically when device is gone.
> 
> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
> ---
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

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

* Re: [PATCH v5 1/4] PCI: Introduce pcim_alloc_irq_vectors()
  2021-02-26 15:50 ` [PATCH v5 1/4] PCI: " Dejin Zheng
  2021-02-26 16:23   ` Andy Shevchenko
@ 2021-03-23 22:47   ` Bjorn Helgaas
  2021-05-05 16:27     ` Dejin Zheng
  1 sibling, 1 reply; 17+ messages in thread
From: Bjorn Helgaas @ 2021-03-23 22:47 UTC (permalink / raw)
  To: Dejin Zheng
  Cc: corbet, jarkko.nikula, andriy.shevchenko, mika.westerberg, rric,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci, linux-kernel,
	Christoph Hellwig, Thomas Gleixner, Alexander Gordeev,
	Jonathan Derrick, Kurt Schwemmer, Logan Gunthorpe

[+cc Christoph, Thomas, Alexander, in case you're interested]
[+cc Jonathan, Kurt, Logan: vmd.c and switchtec.c use managed resources
and pci_alloc_irq_vectors()]

On Fri, Feb 26, 2021 at 11:50:53PM +0800, Dejin Zheng wrote:
> Introduce pcim_alloc_irq_vectors(), a device-managed version of
> pci_alloc_irq_vectors(). Introducing this function can simplify
> the error handling path in many drivers.
> 
> And use pci_free_irq_vectors() to replace some code in pcim_release(),
> they are equivalent, and no functional change. It is more explicit
> that pcim_alloc_irq_vectors() is a device-managed function.
> 
> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Let me know if you'd like me to take the series.

> ---
> v4 -> v5:
> 	- Remove the check of enable device in pcim_alloc_irq_vectors()
> 	  and make it as a static line function.
> v3 -> v4:
> 	- No change
> v2 -> v3:
> 	- Add some commit comments for replace some codes in
> 	  pcim_release() by pci_free_irq_vectors().
> v1 -> v2:
> 	- Use pci_free_irq_vectors() to replace some code in
> 	  pcim_release().
> 	- Modify some commit messages.
> 
>  drivers/pci/pci.c   |  5 +----
>  include/linux/pci.h | 24 ++++++++++++++++++++++++
>  2 files changed, 25 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 16a17215f633..fecfdc0add2f 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1969,10 +1969,7 @@ static void pcim_release(struct device *gendev, void *res)
>  	struct pci_devres *this = res;
>  	int i;
>  
> -	if (dev->msi_enabled)
> -		pci_disable_msi(dev);
> -	if (dev->msix_enabled)
> -		pci_disable_msix(dev);
> +	pci_free_irq_vectors(dev);
>  
>  	for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
>  		if (this->region_mask & (1 << i))
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 86c799c97b77..5cafd7d65fd7 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1818,6 +1818,30 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
>  					      NULL);
>  }
>  
> +/**
> + * pcim_alloc_irq_vectors - a device-managed pci_alloc_irq_vectors()
> + * @dev:		PCI device to operate on
> + * @min_vecs:		minimum number of vectors required (must be >= 1)
> + * @max_vecs:		maximum (desired) number of vectors
> + * @flags:		flags or quirks for the allocation
> + *
> + * Return the number of vectors allocated, (which might be smaller than
> + * @max_vecs) if successful, or a negative error code on error. If less
> + * than @min_vecs interrupt vectors are available for @dev the function
> + * will fail with -ENOSPC.
> + *
> + * It depends on calling pcim_enable_device() to make IRQ resources
> + * manageable.
> + */
> +static inline int
> +pcim_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
> +			unsigned int max_vecs, unsigned int flags)
> +{
> +	if (!pci_is_managed(dev))
> +		return -EINVAL;
> +	return pci_alloc_irq_vectors(dev, min_vecs, max_vecs, flags);
> +}
> +
>  /* Include architecture-dependent settings and functions */
>  
>  #include <asm/pci.h>
> -- 
> 2.25.0
> 

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

* Re: [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors()
  2021-02-26 15:50 [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors() Dejin Zheng
                   ` (4 preceding siblings ...)
  2021-02-26 19:20 ` [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors() Robert Richter
@ 2021-04-21 15:23 ` Andy Shevchenko
  5 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2021-04-21 15:23 UTC (permalink / raw)
  To: Dejin Zheng
  Cc: corbet, jarkko.nikula, mika.westerberg, rric, bhelgaas, wsa,
	linux-doc, linux-i2c, linux-pci, linux-kernel

On Fri, Feb 26, 2021 at 11:50:52PM +0800, Dejin Zheng wrote:
> Introduce pcim_alloc_irq_vectors(), a device-managed version of
> pci_alloc_irq_vectors(), In some i2c drivers, If pcim_enable_device()
> has been called before, then pci_alloc_irq_vectors() is actually a
> device-managed function. It is used as a device-managed function, So
> replace it with pcim_alloc_irq_vectors().

Bjorn, I don't see this anywhere, except mailing list. Neither your opinion.
What is the plan?

> Changelog
> ---------
> v4 -> v5:
> 	- Remove the check of enable device in pcim_alloc_irq_vectors()
> 	  and make it as a static line function.
> 	- Modify the subject name in patch 3 and patch 4.
> v3 -> v4:
> 	- add some commit comments for patch 3
> v2 -> v3:
> 	- Add some commit comments for replace some codes in
> 	  pcim_release() by pci_free_irq_vectors().
> 	- Simplify the error handling path in i2c designware
> 	  driver.
> v1 -> v2:
> 	- Use pci_free_irq_vectors() to replace some code in
> 	  pcim_release().
> 	- Modify some commit messages.
> 
> Dejin Zheng (4):
>   PCI: Introduce pcim_alloc_irq_vectors()
>   Documentation: devres: Add pcim_alloc_irq_vectors()
>   i2c: designware: Use pcim_alloc_irq_vectors() to allocate IRQ vectors
>   i2c: thunderx: Use pcim_alloc_irq_vectors() to allocate IRQ vectors
> 
>  .../driver-api/driver-model/devres.rst        |  1 +
>  drivers/i2c/busses/i2c-designware-pcidrv.c    | 15 ++++--------
>  drivers/i2c/busses/i2c-thunderx-pcidrv.c      |  2 +-
>  drivers/pci/pci.c                             |  5 +---
>  include/linux/pci.h                           | 24 +++++++++++++++++++
>  5 files changed, 31 insertions(+), 16 deletions(-)
> 
> -- 
> 2.25.0
> 

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v5 1/4] PCI: Introduce pcim_alloc_irq_vectors()
  2021-03-23 22:47   ` Bjorn Helgaas
@ 2021-05-05 16:27     ` Dejin Zheng
  2021-06-02  8:51       ` Andy Shevchenko
  0 siblings, 1 reply; 17+ messages in thread
From: Dejin Zheng @ 2021-05-05 16:27 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: corbet, jarkko.nikula, andriy.shevchenko, mika.westerberg, rric,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci, linux-kernel,
	Christoph Hellwig, Thomas Gleixner, Alexander Gordeev,
	Jonathan Derrick, Kurt Schwemmer, Logan Gunthorpe

On Tue, Mar 23, 2021 at 05:47:10PM -0500, Bjorn Helgaas wrote:
> [+cc Christoph, Thomas, Alexander, in case you're interested]
> [+cc Jonathan, Kurt, Logan: vmd.c and switchtec.c use managed resources
> and pci_alloc_irq_vectors()]
> 
> On Fri, Feb 26, 2021 at 11:50:53PM +0800, Dejin Zheng wrote:
> > Introduce pcim_alloc_irq_vectors(), a device-managed version of
> > pci_alloc_irq_vectors(). Introducing this function can simplify
> > the error handling path in many drivers.
> > 
> > And use pci_free_irq_vectors() to replace some code in pcim_release(),
> > they are equivalent, and no functional change. It is more explicit
> > that pcim_alloc_irq_vectors() is a device-managed function.
> > 
> > Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
> 
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> Let me know if you'd like me to take the series.
>
Hi Bjorn,

These patches are still invisible on the mainline, could you help me to
take it? Thanks very much!

BR,
Dejin

> > ---
> > v4 -> v5:
> > 	- Remove the check of enable device in pcim_alloc_irq_vectors()
> > 	  and make it as a static line function.
> > v3 -> v4:
> > 	- No change
> > v2 -> v3:
> > 	- Add some commit comments for replace some codes in
> > 	  pcim_release() by pci_free_irq_vectors().
> > v1 -> v2:
> > 	- Use pci_free_irq_vectors() to replace some code in
> > 	  pcim_release().
> > 	- Modify some commit messages.
> > 
> >  drivers/pci/pci.c   |  5 +----
> >  include/linux/pci.h | 24 ++++++++++++++++++++++++
> >  2 files changed, 25 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> > index 16a17215f633..fecfdc0add2f 100644
> > --- a/drivers/pci/pci.c
> > +++ b/drivers/pci/pci.c
> > @@ -1969,10 +1969,7 @@ static void pcim_release(struct device *gendev, void *res)
> >  	struct pci_devres *this = res;
> >  	int i;
> >  
> > -	if (dev->msi_enabled)
> > -		pci_disable_msi(dev);
> > -	if (dev->msix_enabled)
> > -		pci_disable_msix(dev);
> > +	pci_free_irq_vectors(dev);
> >  
> >  	for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
> >  		if (this->region_mask & (1 << i))
> > diff --git a/include/linux/pci.h b/include/linux/pci.h
> > index 86c799c97b77..5cafd7d65fd7 100644
> > --- a/include/linux/pci.h
> > +++ b/include/linux/pci.h
> > @@ -1818,6 +1818,30 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
> >  					      NULL);
> >  }
> >  
> > +/**
> > + * pcim_alloc_irq_vectors - a device-managed pci_alloc_irq_vectors()
> > + * @dev:		PCI device to operate on
> > + * @min_vecs:		minimum number of vectors required (must be >= 1)
> > + * @max_vecs:		maximum (desired) number of vectors
> > + * @flags:		flags or quirks for the allocation
> > + *
> > + * Return the number of vectors allocated, (which might be smaller than
> > + * @max_vecs) if successful, or a negative error code on error. If less
> > + * than @min_vecs interrupt vectors are available for @dev the function
> > + * will fail with -ENOSPC.
> > + *
> > + * It depends on calling pcim_enable_device() to make IRQ resources
> > + * manageable.
> > + */
> > +static inline int
> > +pcim_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
> > +			unsigned int max_vecs, unsigned int flags)
> > +{
> > +	if (!pci_is_managed(dev))
> > +		return -EINVAL;
> > +	return pci_alloc_irq_vectors(dev, min_vecs, max_vecs, flags);
> > +}
> > +
> >  /* Include architecture-dependent settings and functions */
> >  
> >  #include <asm/pci.h>
> > -- 
> > 2.25.0
> > 

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

* Re: [PATCH v5 1/4] PCI: Introduce pcim_alloc_irq_vectors()
  2021-05-05 16:27     ` Dejin Zheng
@ 2021-06-02  8:51       ` Andy Shevchenko
  2021-06-06  6:51         ` Dejin Zheng
  2021-06-07 16:15         ` Bjorn Helgaas
  0 siblings, 2 replies; 17+ messages in thread
From: Andy Shevchenko @ 2021-06-02  8:51 UTC (permalink / raw)
  To: Dejin Zheng
  Cc: Bjorn Helgaas, corbet, jarkko.nikula, mika.westerberg, rric,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci, linux-kernel,
	Christoph Hellwig, Thomas Gleixner, Alexander Gordeev,
	Jonathan Derrick, Kurt Schwemmer, Logan Gunthorpe

On Thu, May 06, 2021 at 12:27:16AM +0800, Dejin Zheng wrote:
> On Tue, Mar 23, 2021 at 05:47:10PM -0500, Bjorn Helgaas wrote:
> > [+cc Christoph, Thomas, Alexander, in case you're interested]
> > [+cc Jonathan, Kurt, Logan: vmd.c and switchtec.c use managed resources
> > and pci_alloc_irq_vectors()]

> > On Fri, Feb 26, 2021 at 11:50:53PM +0800, Dejin Zheng wrote:
> > > Introduce pcim_alloc_irq_vectors(), a device-managed version of
> > > pci_alloc_irq_vectors(). Introducing this function can simplify
> > > the error handling path in many drivers.
> > > 
> > > And use pci_free_irq_vectors() to replace some code in pcim_release(),
> > > they are equivalent, and no functional change. It is more explicit
> > > that pcim_alloc_irq_vectors() is a device-managed function.
> > > 
> > > Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
> > 
> > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> > 
> > Let me know if you'd like me to take the series.
> >
> Hi Bjorn,
> 
> These patches are still invisible on the mainline, could you help me to
> take it? Thanks very much!

I guess you have to rebase them on top of the latest rc (or PCI for-next) and
send with a cover letter.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v5 1/4] PCI: Introduce pcim_alloc_irq_vectors()
  2021-06-02  8:51       ` Andy Shevchenko
@ 2021-06-06  6:51         ` Dejin Zheng
  2021-06-07 16:15         ` Bjorn Helgaas
  1 sibling, 0 replies; 17+ messages in thread
From: Dejin Zheng @ 2021-06-06  6:51 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Bjorn Helgaas, corbet, jarkko.nikula, mika.westerberg, rric,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci, linux-kernel,
	Christoph Hellwig, Thomas Gleixner, Alexander Gordeev,
	Jonathan Derrick, Kurt Schwemmer, Logan Gunthorpe

On Wed, Jun 02, 2021 at 11:51:10AM +0300, Andy Shevchenko wrote:
> On Thu, May 06, 2021 at 12:27:16AM +0800, Dejin Zheng wrote:
> > On Tue, Mar 23, 2021 at 05:47:10PM -0500, Bjorn Helgaas wrote:
> > > [+cc Christoph, Thomas, Alexander, in case you're interested]
> > > [+cc Jonathan, Kurt, Logan: vmd.c and switchtec.c use managed resources
> > > and pci_alloc_irq_vectors()]
> 
> > > On Fri, Feb 26, 2021 at 11:50:53PM +0800, Dejin Zheng wrote:
> > > > Introduce pcim_alloc_irq_vectors(), a device-managed version of
> > > > pci_alloc_irq_vectors(). Introducing this function can simplify
> > > > the error handling path in many drivers.
> > > > 
> > > > And use pci_free_irq_vectors() to replace some code in pcim_release(),
> > > > they are equivalent, and no functional change. It is more explicit
> > > > that pcim_alloc_irq_vectors() is a device-managed function.
> > > > 
> > > > Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
> > > 
> > > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> > > 
> > > Let me know if you'd like me to take the series.
> > >
> > Hi Bjorn,
> > 
> > These patches are still invisible on the mainline, could you help me to
> > take it? Thanks very much!
> 
> I guess you have to rebase them on top of the latest rc (or PCI for-next) and
> send with a cover letter.
>
Andy, thanks for your reminder, I will do it.

> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 

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

* Re: [PATCH v5 1/4] PCI: Introduce pcim_alloc_irq_vectors()
  2021-06-02  8:51       ` Andy Shevchenko
  2021-06-06  6:51         ` Dejin Zheng
@ 2021-06-07 16:15         ` Bjorn Helgaas
  1 sibling, 0 replies; 17+ messages in thread
From: Bjorn Helgaas @ 2021-06-07 16:15 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Dejin Zheng, corbet, jarkko.nikula, mika.westerberg, rric,
	bhelgaas, wsa, linux-doc, linux-i2c, linux-pci, linux-kernel,
	Christoph Hellwig, Thomas Gleixner, Alexander Gordeev,
	Jonathan Derrick, Kurt Schwemmer, Logan Gunthorpe

On Wed, Jun 02, 2021 at 11:51:10AM +0300, Andy Shevchenko wrote:
> On Thu, May 06, 2021 at 12:27:16AM +0800, Dejin Zheng wrote:
> > On Tue, Mar 23, 2021 at 05:47:10PM -0500, Bjorn Helgaas wrote:
> > > [+cc Christoph, Thomas, Alexander, in case you're interested]
> > > [+cc Jonathan, Kurt, Logan: vmd.c and switchtec.c use managed resources
> > > and pci_alloc_irq_vectors()]
> 
> > > On Fri, Feb 26, 2021 at 11:50:53PM +0800, Dejin Zheng wrote:
> > > > Introduce pcim_alloc_irq_vectors(), a device-managed version of
> > > > pci_alloc_irq_vectors(). Introducing this function can simplify
> > > > the error handling path in many drivers.
> > > > 
> > > > And use pci_free_irq_vectors() to replace some code in pcim_release(),
> > > > they are equivalent, and no functional change. It is more explicit
> > > > that pcim_alloc_irq_vectors() is a device-managed function.
> > > > 
> > > > Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
> > > 
> > > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> > > 
> > > Let me know if you'd like me to take the series.
> > >
> > Hi Bjorn,
> > 
> > These patches are still invisible on the mainline, could you help me to
> > take it? Thanks very much!
> 
> I guess you have to rebase them on top of the latest rc (or PCI for-next) and
> send with a cover letter.

No need to rebase them.  The ideal is to base them on the "main" branch
from https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/
(currently v5.13-rc) because that's what I base topic branches on.
But I can deal with whatever your current base is.

Thanks for the reminder; I'll take a look at your v7 posting.

Bjorn

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

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

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 15:50 [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors() Dejin Zheng
2021-02-26 15:50 ` [PATCH v5 1/4] PCI: " Dejin Zheng
2021-02-26 16:23   ` Andy Shevchenko
2021-02-28 11:16     ` Dejin Zheng
2021-03-23 22:47   ` Bjorn Helgaas
2021-05-05 16:27     ` Dejin Zheng
2021-06-02  8:51       ` Andy Shevchenko
2021-06-06  6:51         ` Dejin Zheng
2021-06-07 16:15         ` Bjorn Helgaas
2021-02-26 15:50 ` [PATCH v5 2/4] Documentation: devres: Add pcim_alloc_irq_vectors() Dejin Zheng
2021-02-26 15:50 ` [PATCH v5 3/4] i2c: designware: Use pcim_alloc_irq_vectors() to allocate IRQ vectors Dejin Zheng
2021-03-03  9:27   ` Jarkko Nikula
2021-02-26 15:50 ` [PATCH v5 4/4] i2c: thunderx: " Dejin Zheng
2021-02-26 19:19   ` Robert Richter
2021-02-26 19:20 ` [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors() Robert Richter
2021-02-28 11:17   ` Dejin Zheng
2021-04-21 15:23 ` Andy Shevchenko

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