lkml.org 
[lkml]   [2009]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/8] PCI PCIe portdrv: Aviod using service devices with wrong interrupts
Date
On Sunday, January 4, 2009 2:49 pm Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rjw@sisk.pl>
>
> The PCI Express port driver should not attempt to register service
> devices that require the ability to generate interrupts if generating
> interrupts is not possible. Namely, if the port has no interrupt pin
> configured and we cannot set up MSI or MSI-X for it, there is no way
> it can generate interrupts and in such a case the port services that
> rely on interrupts (PME, PCIe HP, AER) should not be enabled for it.
>

> /* Root/Upstream/Downstream Port's Interrupt Mode */
> +#define PCIE_PORT_NO_IRQ (-1)
> #define PCIE_PORT_INTx_MODE 0
> #define PCIE_PORT_MSI_MODE 1
> #define PCIE_PORT_MSIX_MODE 2
> Index: linux-2.6/drivers/pci/pcie/portdrv_core.c
> ===================================================================
> --- linux-2.6.orig/drivers/pci/pcie/portdrv_core.c
> +++ linux-2.6/drivers/pci/pcie/portdrv_core.c
> @@ -41,13 +41,15 @@ static void release_pcie_device(struct d
> static int assign_interrupt_mode(struct pci_dev *dev, int *vectors, int
> mask) {
> int i, pos, nvec, status = -EINVAL;
> - int interrupt_mode = PCIE_PORT_INTx_MODE;
> + int interrupt_mode = PCIE_PORT_NO_IRQ;
>
> /* Set INTx as default */
> for (i = 0, nvec = 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++) {
> if (mask & (1 << i))
> nvec++;
> vectors[i] = dev->irq;
> + if (dev->pin)
> + interrupt_mode = PCIE_PORT_INTx_MODE;
> }


Looks like a good cleanup. I didn't audit all the places PCIE_PORT_* stuff
was used to see if != would be a problem though (probably isn't).

--
Jesse Barnes, Intel Open Source Technology Center


\
 
 \ /
  Last update: 2009-01-10 00:27    [W:0.208 / U:10.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site