Subject: Re: [PATCH 1/2] powerpc: disable MSI using new interface if possible

From: Nishanth Aravamudan <[email-masked]>
Date: Thu, 3 Mar 2011 11:44:10 -0800

On 03.03.2011 [11:39:23 -0800], Nishanth Aravamudan wrote:
> On upcoming hardware, we have a PCI adapter with two functions, one of
> which uses MSI and the other uses MSI-X. This adapter, when MSI is
> disabled using the "old" firmware interface (RTAS_CHANGE_FN), still
> signals an MSI-X interrupt and triggers an EEH. We are working with the
> vendor to ensure that the hardware is not at fault, but if we use the
> "new" interface (RTAS_CHANGE_MSI_FN) to disable MSI, we also
> automatically disable MSI-X and the adapter does not appear to signal
> any stray MSI-X interrupt.
> 
> Signed-off-by: Nishanth Aravamudan <[email-masked]>
> Cc: Milton Miller <[email-masked]>
> Cc: Benjamin Herrenschmidt <[email-masked]>
> Cc: Paul Mackerras <[email-masked]>

Sorry, I fudged my git-send-email config, apologies that the Cc's above
weren't actually used in the original!

> ---
> 
> This is effectively a PCI quirk, but I'm not sure how to do a
> architecture-specific quirk (looking through the code now). If anyone
> has any pointers, I'd appreciate it!

If this would be preferred, I think I see now how it would be done and
can work on a different patch that only makes this change for this
device.

Thanks,
Nish

>  arch/powerpc/platforms/pseries/msi.c |   14 ++++++++++++--
>  1 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
> index 1164c34..9434576 100644
> --- a/arch/powerpc/platforms/pseries/msi.c
> +++ b/arch/powerpc/platforms/pseries/msi.c
> @@ -93,8 +93,18 @@ static void rtas_disable_msi(struct pci_dev *pdev)
>  	if (!pdn)
>  		return;
> 
> -	if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0) != 0)
> -		pr_debug("rtas_msi: Setting MSIs to 0 failed!\n");
> +	/*
> +	 * disabling MSI with the explicit interface also disables MSI-X
> +	 */
> +	if (rtas_change_msi(pdn, RTAS_CHANGE_MSI_FN, 0) != 0) {
> +		/* 
> +		 * may have failed due to lacking
> +		 * "ibm,change-msix-capable" property
> +		 */
> +		if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0) != 0) {
> +			pr_debug("rtas_msi: Setting MSIs to 0 failed!\n");
> +		}
> +	}
>  }
> 
>  static int rtas_query_irq_number(struct pci_dn *pdn, int offset)
> -- 
> 1.7.1
> 
> _______________________________________________
> Linuxppc-dev mailing list
> [email-masked]
> https://lists.ozlabs.org/listinfo/linuxppc-dev

-- 
Nishanth Aravamudan <[email-masked]>
IBM Linux Technology Center