diff mbox series

[1/1,SRU,F/OEM-5.6/G] UBUNTU: SAUCE: PCI: vmd: Add AHCI to fast interrupt list

Message ID 20200908080334.1106239-2-vicamo.yang@canonical.com
State New
Headers show
Series UBUNTU: SAUCE: Fix disk probing under SATA controller behind VMD | expand

Commit Message

You-Sheng Yang Sept. 8, 2020, 8:03 a.m. UTC
From: Jon Derrick <jonathan.derrick@intel.com>

BugLink: https://bugs.launchpad.net/bugs/1894778

Some platforms have an AHCI controller behind VMD. These platforms are
working correctly except for a case when the AHCI MSI is programmed with
VMD IRQ vector 0 (0xfee00000). When programmed with any other interrupt
(0xfeeNN000), the MSI is routed correctly and is handled by VMD. Placing
the AHCI MSI(s) in the fast-interrupt allow list solves the issue.

This also requires that VMD allocate more than one MSI/X vector and
changes the minimum MSI/X vectors allocated to two.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
(cherry-picked from https://patchwork.kernel.org/patch/11758345/)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
---
 drivers/pci/controller/vmd.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Stefan Bader Sept. 17, 2020, 6:51 a.m. UTC | #1
On 08.09.20 10:03, You-Sheng Yang wrote:
> From: Jon Derrick <jonathan.derrick@intel.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1894778
> 
> Some platforms have an AHCI controller behind VMD. These platforms are
> working correctly except for a case when the AHCI MSI is programmed with
> VMD IRQ vector 0 (0xfee00000). When programmed with any other interrupt
> (0xfeeNN000), the MSI is routed correctly and is handled by VMD. Placing
> the AHCI MSI(s) in the fast-interrupt allow list solves the issue.
> 
> This also requires that VMD allocate more than one MSI/X vector and
> changes the minimum MSI/X vectors allocated to two.
> 
> Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
> (cherry-picked from https://patchwork.kernel.org/patch/11758345/)
> Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
> ---

This change to generic code still is not even on linux-next and there was no
feedback at all about plans for going upstream. Without that we risk having to
carry forward this change for eternity.

-Stefan

>  drivers/pci/controller/vmd.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
> index 41f4c1c825e6..7668988ed6b5 100644
> --- a/drivers/pci/controller/vmd.c
> +++ b/drivers/pci/controller/vmd.c
> @@ -199,15 +199,13 @@ static struct vmd_irq_list *vmd_next_irq(struct vmd_dev *vmd, struct msi_desc *d
>  	int i, best = 1;
>  	unsigned long flags;
>  
> -	if (vmd->msix_count == 1)
> -		return &vmd->irqs[0];
> -
>  	/*
> -	 * White list for fast-interrupt handlers. All others will share the
> +	 * Allow list for fast-interrupt handlers. All others will share the
>  	 * "slow" interrupt vector.
>  	 */
>  	switch (msi_desc_to_pci_dev(desc)->class) {
>  	case PCI_CLASS_STORAGE_EXPRESS:
> +	case PCI_CLASS_STORAGE_SATA_AHCI:
>  		break;
>  	default:
>  		return &vmd->irqs[0];
> @@ -778,7 +776,7 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  	if (vmd->msix_count < 0)
>  		return -ENODEV;
>  
> -	vmd->msix_count = pci_alloc_irq_vectors(dev, 1, vmd->msix_count,
> +	vmd->msix_count = pci_alloc_irq_vectors(dev, 2, vmd->msix_count,
>  					PCI_IRQ_MSIX);
>  	if (vmd->msix_count < 0)
>  		return vmd->msix_count;
>
diff mbox series

Patch

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 41f4c1c825e6..7668988ed6b5 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -199,15 +199,13 @@  static struct vmd_irq_list *vmd_next_irq(struct vmd_dev *vmd, struct msi_desc *d
 	int i, best = 1;
 	unsigned long flags;
 
-	if (vmd->msix_count == 1)
-		return &vmd->irqs[0];
-
 	/*
-	 * White list for fast-interrupt handlers. All others will share the
+	 * Allow list for fast-interrupt handlers. All others will share the
 	 * "slow" interrupt vector.
 	 */
 	switch (msi_desc_to_pci_dev(desc)->class) {
 	case PCI_CLASS_STORAGE_EXPRESS:
+	case PCI_CLASS_STORAGE_SATA_AHCI:
 		break;
 	default:
 		return &vmd->irqs[0];
@@ -778,7 +776,7 @@  static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	if (vmd->msix_count < 0)
 		return -ENODEV;
 
-	vmd->msix_count = pci_alloc_irq_vectors(dev, 1, vmd->msix_count,
+	vmd->msix_count = pci_alloc_irq_vectors(dev, 2, vmd->msix_count,
 					PCI_IRQ_MSIX);
 	if (vmd->msix_count < 0)
 		return vmd->msix_count;