diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2019-07-12 18:08:38 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2019-07-12 18:08:38 -0400 |
commit | 916f12e494d7ff7c786144ac62807bd37755efb3 (patch) | |
tree | 282bd0333c7f704823075fe39e4f2cd20cb369f7 | |
parent | 6bfc0c07cdb775ff5648df4afbe3ac7ce1c766ab (diff) | |
parent | 181fa434d0514e40ebf6e9721f2b72700287b6e2 (diff) |
Merge branch 'remotes/lorenzo/pci/xilinx'
- Fix Xilinx NWL multi-MSI vector aliasing issue (Bharat Kumar Gogada)
* remotes/lorenzo/pci/xilinx:
PCI: xilinx-nwl: Fix Multi MSI data programming
-rw-r--r-- | drivers/pci/controller/pcie-xilinx-nwl.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/controller/pcie-xilinx-nwl.c index 3b031f00a94a..45c0f344ccd1 100644 --- a/drivers/pci/controller/pcie-xilinx-nwl.c +++ b/drivers/pci/controller/pcie-xilinx-nwl.c | |||
@@ -482,15 +482,13 @@ static int nwl_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, | |||
482 | int i; | 482 | int i; |
483 | 483 | ||
484 | mutex_lock(&msi->lock); | 484 | mutex_lock(&msi->lock); |
485 | bit = bitmap_find_next_zero_area(msi->bitmap, INT_PCI_MSI_NR, 0, | 485 | bit = bitmap_find_free_region(msi->bitmap, INT_PCI_MSI_NR, |
486 | nr_irqs, 0); | 486 | get_count_order(nr_irqs)); |
487 | if (bit >= INT_PCI_MSI_NR) { | 487 | if (bit < 0) { |
488 | mutex_unlock(&msi->lock); | 488 | mutex_unlock(&msi->lock); |
489 | return -ENOSPC; | 489 | return -ENOSPC; |
490 | } | 490 | } |
491 | 491 | ||
492 | bitmap_set(msi->bitmap, bit, nr_irqs); | ||
493 | |||
494 | for (i = 0; i < nr_irqs; i++) { | 492 | for (i = 0; i < nr_irqs; i++) { |
495 | irq_domain_set_info(domain, virq + i, bit + i, &nwl_irq_chip, | 493 | irq_domain_set_info(domain, virq + i, bit + i, &nwl_irq_chip, |
496 | domain->host_data, handle_simple_irq, | 494 | domain->host_data, handle_simple_irq, |
@@ -508,7 +506,8 @@ static void nwl_irq_domain_free(struct irq_domain *domain, unsigned int virq, | |||
508 | struct nwl_msi *msi = &pcie->msi; | 506 | struct nwl_msi *msi = &pcie->msi; |
509 | 507 | ||
510 | mutex_lock(&msi->lock); | 508 | mutex_lock(&msi->lock); |
511 | bitmap_clear(msi->bitmap, data->hwirq, nr_irqs); | 509 | bitmap_release_region(msi->bitmap, data->hwirq, |
510 | get_count_order(nr_irqs)); | ||
512 | mutex_unlock(&msi->lock); | 511 | mutex_unlock(&msi->lock); |
513 | } | 512 | } |
514 | 513 | ||