diff mbox

use pci_alloc_irq_vectors issues

Message ID 20161017192858.GA25429@lst.de (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Christoph Hellwig Oct. 17, 2016, 7:28 p.m. UTC
Hi Emmanuel,

I think I have an idea now - we are accidentally hitting the per-port
MSI vector case because your SSD only has one AHCI "port".  Can you
try the below patch:

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Emmanuel Benisty Oct. 17, 2016, 8:51 p.m. UTC | #1
Hi Christoph,

On Mon, Oct 17, 2016 at 9:28 PM, Christoph Hellwig <hch@lst.de> wrote:
> I think I have an idea now - we are accidentally hitting the per-port
> MSI vector case because your SSD only has one AHCI "port".  Can you
> try the below patch:
>
> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index ba5f11c..3c2f92b 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -1413,6 +1413,7 @@ static int ahci_init_msi(struct pci_dev *pdev, unsigned int n_ports,
>         if (hpriv->flags & AHCI_HFLAG_NO_MSI)
>                 return -ENODEV;
>
> +       if (n_ports > 1) {
>         /*
>          * If number of MSIs is less than number of ports then Sharing Last
>          * Message mode could be enforced. In this case assume that advantage
> @@ -1434,6 +1435,7 @@ static int ahci_init_msi(struct pci_dev *pdev, unsigned int n_ports,
>                 printk(KERN_INFO "ahci: MRSM is on, fallback to single MSI\n");
>                 pci_free_irq_vectors(pdev);
>         }
> +       }
>
>         /*
>          * -ENOSPC indicated we don't have enough vectors.  Don't bother trying

This patch solved the issue, thanks a lot.

Cheers.
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig Oct. 17, 2016, 8:55 p.m. UTC | #2
On Mon, Oct 17, 2016 at 10:51:44PM +0200, Emmanuel Benisty wrote:
> This patch solved the issue, thanks a lot.

Thanks for testing!

I'll resend it to Tejun with proper indentation and a changelog
tomorrow.
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index ba5f11c..3c2f92b 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1413,6 +1413,7 @@  static int ahci_init_msi(struct pci_dev *pdev, unsigned int n_ports,
 	if (hpriv->flags & AHCI_HFLAG_NO_MSI)
 		return -ENODEV;
 
+	if (n_ports > 1) {
 	/*
 	 * If number of MSIs is less than number of ports then Sharing Last
 	 * Message mode could be enforced. In this case assume that advantage
@@ -1434,6 +1435,7 @@  static int ahci_init_msi(struct pci_dev *pdev, unsigned int n_ports,
 		printk(KERN_INFO "ahci: MRSM is on, fallback to single MSI\n");
 		pci_free_irq_vectors(pdev);
 	}
+	}
 
 	/*
 	 * -ENOSPC indicated we don't have enough vectors.  Don't bother trying