All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] megaraid_sas: enable intx only if msix request fails
@ 2017-03-02 10:54 Kashyap Desai
  2017-03-08 14:22 ` Kashyap Desai
  2017-03-08 15:09 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Kashyap Desai @ 2017-03-02 10:54 UTC (permalink / raw)
  To: linux-scsi; +Cc: martin.petersen, thenzl, jejb, hare, Kashyap Desai

Without this fix, driver will enable INTx Interrupt pin even
 though MSI-x vectors are enabled. See below lspci output. DisINTx is unset
 for MSIx setup.

lspci -s 85:00.0 -vvv |grep INT |grep Control
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-

After applying this fix, driver will enable INTx Interrupt pin only if Legacy interrupt method is required.
See below lspci output. DisINTx is unset for MSIx setup.
lspci -s 85:00.0 -vvv |grep INT |grep Control
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 7ac9a9e..82a8ec8 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -4990,6 +4990,7 @@ int megasas_set_crash_dump_params(struct megasas_instance *instance,
 	struct pci_dev *pdev;
 
 	pdev = instance->pdev;
+	pci_intx(pdev, 1);
 	instance->irq_context[0].instance = instance;
 	instance->irq_context[0].MSIxIndex = 0;
 	if (request_irq(pci_irq_vector(pdev, 0),
@@ -5277,10 +5278,6 @@ static int megasas_init_fw(struct megasas_instance *instance)
 			MPI2_REPLY_POST_HOST_INDEX_OFFSET);
 	}
 
-	i = pci_alloc_irq_vectors(instance->pdev, 1, 1, PCI_IRQ_LEGACY);
-	if (i < 0)
-		goto fail_setup_irqs;
-
 	dev_info(&instance->pdev->dev,
 		"firmware supports msix\t: (%d)", fw_msix_count);
 	dev_info(&instance->pdev->dev,
@@ -5494,7 +5491,6 @@ static int megasas_init_fw(struct megasas_instance *instance)
 	instance->instancet->disable_intr(instance);
 fail_init_adapter:
 	megasas_destroy_irqs(instance);
-fail_setup_irqs:
 	if (instance->msix_vectors)
 		pci_free_irq_vectors(instance->pdev);
 	instance->msix_vectors = 0;
-- 
1.8.3.1

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

* RE: [PATCH] megaraid_sas: enable intx only if msix request fails
  2017-03-02 10:54 [PATCH] megaraid_sas: enable intx only if msix request fails Kashyap Desai
@ 2017-03-08 14:22 ` Kashyap Desai
  2017-03-08 15:09 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Kashyap Desai @ 2017-03-08 14:22 UTC (permalink / raw)
  To: linux-scsi; +Cc: martin.petersen, thenzl, jejb, hare

Any feedback ? We have few more patches to be submitted, so looking for
review of this pending patch.

Thanks, Kashyap

> -----Original Message-----
> From: Kashyap Desai [mailto:kashyap.desai@broadcom.com]
> Sent: Thursday, March 02, 2017 4:24 PM
> To: linux-scsi@vger.kernel.org
> Cc: martin.petersen@oracle.com; thenzl@redhat.com;
> jejb@linux.vnet.ibm.com; hare@suse.de; Kashyap Desai
> Subject: [PATCH] megaraid_sas: enable intx only if msix request fails
>
> Without this fix, driver will enable INTx Interrupt pin even  though
MSI-x
> vectors are enabled. See below lspci output. DisINTx is unset  for MSIx
setup.
>
> lspci -s 85:00.0 -vvv |grep INT |grep Control
> 	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR+ FastB2B- DisINTx-
>
> After applying this fix, driver will enable INTx Interrupt pin only if
Legacy
> interrupt method is required.
> See below lspci output. DisINTx is unset for MSIx setup.
> lspci -s 85:00.0 -vvv |grep INT |grep Control
> 	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR+ FastB2B- DisINTx+
>
> Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
> ---
>  drivers/scsi/megaraid/megaraid_sas_base.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
> b/drivers/scsi/megaraid/megaraid_sas_base.c
> index 7ac9a9e..82a8ec8 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -4990,6 +4990,7 @@ int megasas_set_crash_dump_params(struct
> megasas_instance *instance,
>  	struct pci_dev *pdev;
>
>  	pdev = instance->pdev;
> +	pci_intx(pdev, 1);
>  	instance->irq_context[0].instance = instance;
>  	instance->irq_context[0].MSIxIndex = 0;
>  	if (request_irq(pci_irq_vector(pdev, 0), @@ -5277,10 +5278,6 @@
> static int megasas_init_fw(struct megasas_instance *instance)
>  			MPI2_REPLY_POST_HOST_INDEX_OFFSET);
>  	}
>
> -	i = pci_alloc_irq_vectors(instance->pdev, 1, 1, PCI_IRQ_LEGACY);
> -	if (i < 0)
> -		goto fail_setup_irqs;
> -
>  	dev_info(&instance->pdev->dev,
>  		"firmware supports msix\t: (%d)", fw_msix_count);
>  	dev_info(&instance->pdev->dev,
> @@ -5494,7 +5491,6 @@ static int megasas_init_fw(struct
> megasas_instance *instance)
>  	instance->instancet->disable_intr(instance);
>  fail_init_adapter:
>  	megasas_destroy_irqs(instance);
> -fail_setup_irqs:
>  	if (instance->msix_vectors)
>  		pci_free_irq_vectors(instance->pdev);
>  	instance->msix_vectors = 0;
> --
> 1.8.3.1

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

* Re: [PATCH] megaraid_sas: enable intx only if msix request fails
  2017-03-02 10:54 [PATCH] megaraid_sas: enable intx only if msix request fails Kashyap Desai
  2017-03-08 14:22 ` Kashyap Desai
@ 2017-03-08 15:09 ` Christoph Hellwig
  2017-03-08 15:43   ` Kashyap Desai
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2017-03-08 15:09 UTC (permalink / raw)
  To: Kashyap Desai; +Cc: linux-scsi, martin.petersen, thenzl, jejb, hare

On Thu, Mar 02, 2017 at 02:54:16AM -0800, Kashyap Desai wrote:
> Without this fix, driver will enable INTx Interrupt pin even
>  though MSI-x vectors are enabled. See below lspci output. DisINTx is unset
>  for MSIx setup.
> 
> lspci -s 85:00.0 -vvv |grep INT |grep Control
> 	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
> 
> After applying this fix, driver will enable INTx Interrupt pin only if Legacy interrupt method is required.
> See below lspci output. DisINTx is unset for MSIx setup.
> lspci -s 85:00.0 -vvv |grep INT |grep Control
> 	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
> 
> Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
> ---
>  drivers/scsi/megaraid/megaraid_sas_base.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
> index 7ac9a9e..82a8ec8 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -4990,6 +4990,7 @@ int megasas_set_crash_dump_params(struct megasas_instance *instance,
>  	struct pci_dev *pdev;
>  
>  	pdev = instance->pdev;
> +	pci_intx(pdev, 1);

Please use pci_alloc_irq_vectors with the PCI_IRQ_LEGACY flag here,
I'd like to phase out the pci_intx API.

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

* RE: [PATCH] megaraid_sas: enable intx only if msix request fails
  2017-03-08 15:09 ` Christoph Hellwig
@ 2017-03-08 15:43   ` Kashyap Desai
  0 siblings, 0 replies; 4+ messages in thread
From: Kashyap Desai @ 2017-03-08 15:43 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-scsi, martin.petersen, thenzl, jejb, hare

> > ---
> >  drivers/scsi/megaraid/megaraid_sas_base.c | 6 +-----
> >  1 file changed, 1 insertion(+), 5 deletions(-)
> >
> > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
> > b/drivers/scsi/megaraid/megaraid_sas_base.c
> > index 7ac9a9e..82a8ec8 100644
> > --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> > @@ -4990,6 +4990,7 @@ int megasas_set_crash_dump_params(struct
> megasas_instance *instance,
> >  	struct pci_dev *pdev;
> >
> >  	pdev = instance->pdev;
> > +	pci_intx(pdev, 1);
>
> Please use pci_alloc_irq_vectors with the PCI_IRQ_LEGACY flag here, I'd
like to
> phase out the pci_intx API.

I will resubmit v2 patch using pci_alloc_irq_vectors.

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

end of thread, other threads:[~2017-03-08 15:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-02 10:54 [PATCH] megaraid_sas: enable intx only if msix request fails Kashyap Desai
2017-03-08 14:22 ` Kashyap Desai
2017-03-08 15:09 ` Christoph Hellwig
2017-03-08 15:43   ` Kashyap Desai

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.