summaryrefslogtreecommitdiffstats
path: root/arch/s390/pci/pci_msi.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2013-06-25 16:36:29 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-08-22 12:20:03 +0200
commit5d0d8f43535bc4e19406ecf158340ccc4027a477 (patch)
tree14dedb7e575f97715f51e3c50c3044c804ff0409 /arch/s390/pci/pci_msi.c
parent9389339f28c2f0a32ad5043a1fe05444a7f3e677 (diff)
downloadop-kernel-dev-5d0d8f43535bc4e19406ecf158340ccc4027a477.zip
op-kernel-dev-5d0d8f43535bc4e19406ecf158340ccc4027a477.tar.gz
s390/pci: use adapter interrupt vector helpers
Make use of the adapter interrupt helpers in the PCI code. This is the first step to convert the MSI interrupt code to PCI domains. The patch removes the limitation of 64 adapter interrupts per PCI function. Reviewed-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/pci/pci_msi.c')
-rw-r--r--arch/s390/pci/pci_msi.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/arch/s390/pci/pci_msi.c b/arch/s390/pci/pci_msi.c
index b097aed..d4b480a 100644
--- a/arch/s390/pci/pci_msi.c
+++ b/arch/s390/pci/pci_msi.c
@@ -62,19 +62,15 @@ int zpci_msi_set_mask_bits(struct msi_desc *msi, u32 mask, u32 flag)
}
int zpci_setup_msi_irq(struct zpci_dev *zdev, struct msi_desc *msi,
- unsigned int nr, int offset)
+ unsigned int nr, int offset)
{
struct msi_map *map;
struct msi_msg msg;
int rc;
- map = kmalloc(sizeof(*map), GFP_KERNEL);
- if (map == NULL)
- return -ENOMEM;
-
+ map = zdev->msi_map + (nr & ZPCI_MSI_VEC_MASK);
map->irq = nr;
map->msi = msi;
- zdev->msi_map[nr & ZPCI_MSI_MASK] = map;
INIT_HLIST_NODE(&map->msi_chain);
pr_debug("%s hashing irq: %u to bucket nr: %llu\n",
@@ -86,8 +82,6 @@ int zpci_setup_msi_irq(struct zpci_dev *zdev, struct msi_desc *msi,
if (rc) {
spin_unlock(&msi_map_lock);
hlist_del_rcu(&map->msi_chain);
- kfree(map);
- zdev->msi_map[nr & ZPCI_MSI_MASK] = NULL;
return rc;
}
spin_unlock(&msi_map_lock);
@@ -101,20 +95,18 @@ int zpci_setup_msi_irq(struct zpci_dev *zdev, struct msi_desc *msi,
void zpci_teardown_msi_irq(struct zpci_dev *zdev, struct msi_desc *msi)
{
- int irq = msi->irq & ZPCI_MSI_MASK;
+ int nr = msi->irq & ZPCI_MSI_VEC_MASK;
struct msi_map *map;
+ zpci_msi_set_mask_bits(msi, 1, 1);
msi->msg.address_lo = 0;
msi->msg.address_hi = 0;
msi->msg.data = 0;
msi->irq = 0;
- zpci_msi_set_mask_bits(msi, 1, 1);
spin_lock(&msi_map_lock);
- map = zdev->msi_map[irq];
+ map = zdev->msi_map + nr;
hlist_del_rcu(&map->msi_chain);
- kfree(map);
- zdev->msi_map[irq] = NULL;
spin_unlock(&msi_map_lock);
}
OpenPOWER on IntegriCloud