[RFC/PATCH 4/16] Abstract MSI suspend

Eric W. Biederman ebiederm at xmission.com
Sun Jan 28 19:27:30 EST 2007


Michael Ellerman <michael at ellerman.id.au> writes:

> Currently pci_disable_device() disables MSI on a device by twiddling
> bits in config space via disable_msi_mode().
>
> On some platforms that may not be appropriate, so abstract the MSI
> suspend logic into pci_disable_device_msi().

>
> Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
> ---
>
>  drivers/pci/msi.c |   11 +++++++++++
>  drivers/pci/pci.c |    7 +------
>  drivers/pci/pci.h |    2 ++
>  3 files changed, 14 insertions(+), 6 deletions(-)
>
> Index: msi/drivers/pci/msi.c
> ===================================================================
> --- msi.orig/drivers/pci/msi.c
> +++ msi/drivers/pci/msi.c
> @@ -271,6 +271,17 @@ void disable_msi_mode(struct pci_dev *de
>  	pci_intx(dev, 1);  /* enable intx */
>  }
>  
> +void pci_disable_device_msi(struct pci_dev *dev)
> +{
> +	if (dev->msi_enabled)
> +		disable_msi_mode(dev, pci_find_capability(dev, PCI_CAP_ID_MSI),
> +			PCI_CAP_ID_MSI);
> +
> +	if (dev->msix_enabled)
> +		disable_msi_mode(dev, pci_find_capability(dev, PCI_CAP_ID_MSI),
> +			PCI_CAP_ID_MSIX);

Just a quick note. This is wrong.  It should be PCI_CAP_ID_MSIX.
The code that is being moved is buggy.  So the patch itself doesn't
make the situation any worse.

Eric



More information about the Linuxppc-dev mailing list