kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: media: ipu3: Replace depracated MSI API.
@ 2020-07-18 13:44 Suraj Upadhyay
  2020-07-20  2:17 ` Bingbu Cao
  2020-08-13 21:40 ` Sakari Ailus
  0 siblings, 2 replies; 3+ messages in thread
From: Suraj Upadhyay @ 2020-07-18 13:44 UTC (permalink / raw)
  To: sakari.ailus, bingbu.cao, tian.shu.qiu, mchehab, gregkh
  Cc: devel, kernel-janitors, linux-kernel, linux-media

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]

Replace depracated psi_enable_msi with pci_alloc_irq_vectors.
And as a result modify how the returned value is handled.

Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
---
 drivers/staging/media/ipu3/ipu3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c
index ee1bba6bdcac..54690e7442be 100644
--- a/drivers/staging/media/ipu3/ipu3.c
+++ b/drivers/staging/media/ipu3/ipu3.c
@@ -602,9 +602,9 @@ static irqreturn_t imgu_isr(int irq, void *imgu_ptr)
 static int imgu_pci_config_setup(struct pci_dev *dev)
 {
 	u16 pci_command;
-	int r = pci_enable_msi(dev);
+	int r = pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_MSI);
 
-	if (r) {
+	if (r < 0) {
 		dev_err(&dev->dev, "failed to enable MSI (%d)\n", r);
 		return r;
 	}
-- 
2.17.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] staging: media: ipu3: Replace depracated MSI API.
  2020-07-18 13:44 [PATCH] staging: media: ipu3: Replace depracated MSI API Suraj Upadhyay
@ 2020-07-20  2:17 ` Bingbu Cao
  2020-08-13 21:40 ` Sakari Ailus
  1 sibling, 0 replies; 3+ messages in thread
From: Bingbu Cao @ 2020-07-20  2:17 UTC (permalink / raw)
  To: Suraj Upadhyay, sakari.ailus, bingbu.cao, tian.shu.qiu, mchehab, gregkh
  Cc: devel, kernel-janitors, linux-kernel, linux-media

Upadhyay,

Thanks for your patch. Please correct the typo in message.

On 7/18/20 9:32 PM, Suraj Upadhyay wrote:
> Replace depracated psi_enable_msi with pci_alloc_irq_vectors.
> And as a result modify how the returned value is handled.
> 
> Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
> ---
>  drivers/staging/media/ipu3/ipu3.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c
> index ee1bba6bdcac..54690e7442be 100644
> --- a/drivers/staging/media/ipu3/ipu3.c
> +++ b/drivers/staging/media/ipu3/ipu3.c
> @@ -602,9 +602,9 @@ static irqreturn_t imgu_isr(int irq, void *imgu_ptr)
>  static int imgu_pci_config_setup(struct pci_dev *dev)
>  {
>  	u16 pci_command;
> -	int r = pci_enable_msi(dev);
> +	int r = pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_MSI);
>  
> -	if (r) {
> +	if (r < 0) {
>  		dev_err(&dev->dev, "failed to enable MSI (%d)\n", r);
>  		return r;
>  	}
> 

-- 
Best regards,
Bingbu Cao

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

* Re: [PATCH] staging: media: ipu3: Replace depracated MSI API.
  2020-07-18 13:44 [PATCH] staging: media: ipu3: Replace depracated MSI API Suraj Upadhyay
  2020-07-20  2:17 ` Bingbu Cao
@ 2020-08-13 21:40 ` Sakari Ailus
  1 sibling, 0 replies; 3+ messages in thread
From: Sakari Ailus @ 2020-08-13 21:40 UTC (permalink / raw)
  To: Suraj Upadhyay
  Cc: devel, gregkh, kernel-janitors, linux-kernel, bingbu.cao,
	mchehab, tian.shu.qiu, linux-media

Hi Suraj,

Thanks for the patch.

On Sat, Jul 18, 2020 at 07:02:38PM +0530, Suraj Upadhyay wrote:
> Replace depracated psi_enable_msi with pci_alloc_irq_vectors.
> And as a result modify how the returned value is handled.
> 
> Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
> ---
>  drivers/staging/media/ipu3/ipu3.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c
> index ee1bba6bdcac..54690e7442be 100644
> --- a/drivers/staging/media/ipu3/ipu3.c
> +++ b/drivers/staging/media/ipu3/ipu3.c
> @@ -602,9 +602,9 @@ static irqreturn_t imgu_isr(int irq, void *imgu_ptr)
>  static int imgu_pci_config_setup(struct pci_dev *dev)
>  {
>  	u16 pci_command;
> -	int r = pci_enable_msi(dev);
> +	int r = pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_MSI);
>  
> -	if (r) {
> +	if (r < 0) {
>  		dev_err(&dev->dev, "failed to enable MSI (%d)\n", r);
>  		return r;
>  	}

I believe fixing this requires also releasing it, i.e. a call to
pci_free_irq_vectors(). This seems to have been missing.

-- 
Kind regards,

Sakari Ailus

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

end of thread, other threads:[~2020-08-13 21:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-18 13:44 [PATCH] staging: media: ipu3: Replace depracated MSI API Suraj Upadhyay
2020-07-20  2:17 ` Bingbu Cao
2020-08-13 21:40 ` Sakari Ailus

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