diff mbox

ahci: use pci_alloc_irq_vectors

Message ID 20161022141123.GA25500@lst.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christoph Hellwig Oct. 22, 2016, 2:11 p.m. UTC
Hi Robert,

is this a controller that's using MSI-X?

If so can you try the patch below?

Comments

David Daney Oct. 24, 2016, 6:57 p.m. UTC | #1
Hi Christoph,

I can answer these...

On 10/22/2016 07:11 AM, Christoph Hellwig wrote:
> Hi Robert,
>
> is this a controller that's using MSI-X?

Yes.  This is a ThunderX SoC with on-chip AHCI that use MSI-X

>
> If so can you try the patch below?

I applied it to v4.9-rc1 (really commit 
6f33d6458e35d6ba53c2635ee4b8a3177cbd912d), and this didn't seem to make 
it work.



>
> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index ba5f11c..5fe852d 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -1617,7 +1617,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>   		/* legacy intx interrupts */
>   		pci_intx(pdev, 1);
>   	}
> -	hpriv->irq = pdev->irq;
> +	hpriv->irq = pci_irq_vector(pdev, 0);
>
>   	if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss)
>   		host->flags |= ATA_HOST_PARALLEL_SCAN;
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
Christoph Hellwig Oct. 24, 2016, 7:21 p.m. UTC | #2
Hi David,

On Mon, Oct 24, 2016 at 11:57:46AM -0700, David Daney wrote:
>> If so can you try the patch below?
>
> I applied it to v4.9-rc1 (really commit 
> 6f33d6458e35d6ba53c2635ee4b8a3177cbd912d), and this didn't seem to make it 
> work.

Please try on top of the libata for-4.9-fixes branch:

https://git.kernel.org/cgit/linux/kernel/git/tj/libata.git/log/?h=for-4.9-fixes
David Daney Oct. 24, 2016, 8:29 p.m. UTC | #3
On 10/22/2016 07:11 AM, Christoph Hellwig wrote:
> Hi Robert,
>
> is this a controller that's using MSI-X?
>
> If so can you try the patch below?
>

After better understanding your request, I applied this against:

http://git.kernel.org/cgit/linux/kernel/git/tj/libata.git/log/?h=for-4.9-fixes 
(commit a478b097474cd9f2268ab1beaca74ff09e652b9b)

This is now working on my ThunderX CRB-2S system.

You can add:

Tested-by: David Daney <david.daney@cavium.com>


Thanks for taking the time to work through this.



> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index ba5f11c..5fe852d 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -1617,7 +1617,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>   		/* legacy intx interrupts */
>   		pci_intx(pdev, 1);
>   	}
> -	hpriv->irq = pdev->irq;
> +	hpriv->irq = pci_irq_vector(pdev, 0);
>
>   	if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss)
>   		host->flags |= ATA_HOST_PARALLEL_SCAN;
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
Richter, Robert Oct. 25, 2016, 9:25 a.m. UTC | #4
On 22.10.16 16:11:23, Christoph Hellwig wrote:
> Hi Robert,
> 
> is this a controller that's using MSI-X?
> 
> If so can you try the patch below?

Great, that fixes the issue. Thanks.

Tested-by: Robert Richter <rrichter@cavium.com>

> 
> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index ba5f11c..5fe852d 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -1617,7 +1617,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  		/* legacy intx interrupts */
>  		pci_intx(pdev, 1);
>  	}
> -	hpriv->irq = pdev->irq;
> +	hpriv->irq = pci_irq_vector(pdev, 0);
>  
>  	if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss)
>  		host->flags |= ATA_HOST_PARALLEL_SCAN;
diff mbox

Patch

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index ba5f11c..5fe852d 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1617,7 +1617,7 @@  static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		/* legacy intx interrupts */
 		pci_intx(pdev, 1);
 	}
-	hpriv->irq = pdev->irq;
+	hpriv->irq = pci_irq_vector(pdev, 0);
 
 	if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss)
 		host->flags |= ATA_HOST_PARALLEL_SCAN;