Skip to content

Commit

Permalink
Merge branch 'pci/msi'
Browse files Browse the repository at this point in the history
  - Remove unused pci_irq_get_node() Greg Kroah-Hartman)

  - Move power state check out of pci_msi_supported() (Bjorn Helgaas)

  - Fix incorrect MSI-X masking on resume and revert related nvme quirk for
    Kingston NVME SSD running FW E8FK11.T (Jian-Hong Pan)

  - Make asm/msi.h mandatory and simplify PCI_MSI_IRQ_DOMAIN Kconfig
    (Palmer Dabbelt, Michal Simek)

* pci/msi:
  PCI: Remove PCI_MSI_IRQ_DOMAIN architecture whitelist
  asm-generic: Make msi.h a mandatory include/asm header
  Revert "nvme: Add quirk for Kingston NVME SSD running FW E8FK11.T"
  PCI/MSI: Fix incorrect MSI-X masking on resume
  PCI/MSI: Move power state check out of pci_msi_supported()
  PCI/MSI: Remove unused pci_irq_get_node()
  • Loading branch information
bjorn-helgaas committed Nov 28, 2019
2 parents e87eb58 + 191d6f9 commit c59f0da
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 44 deletions.
1 change: 0 additions & 1 deletion arch/arc/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ generic-y += local64.h
generic-y += mcs_spinlock.h
generic-y += mm-arch-hooks.h
generic-y += mmiowb.h
generic-y += msi.h
generic-y += parport.h
generic-y += percpu.h
generic-y += preempt.h
Expand Down
1 change: 0 additions & 1 deletion arch/arm/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ generic-y += local.h
generic-y += local64.h
generic-y += mm-arch-hooks.h
generic-y += mmiowb.h
generic-y += msi.h
generic-y += parport.h
generic-y += preempt.h
generic-y += seccomp.h
Expand Down
1 change: 0 additions & 1 deletion arch/arm64/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ generic-y += local64.h
generic-y += mcs_spinlock.h
generic-y += mm-arch-hooks.h
generic-y += mmiowb.h
generic-y += msi.h
generic-y += qrwlock.h
generic-y += qspinlock.h
generic-y += serial.h
Expand Down
1 change: 0 additions & 1 deletion arch/mips/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ generic-y += irq_work.h
generic-y += local64.h
generic-y += mcs_spinlock.h
generic-y += mm-arch-hooks.h
generic-y += msi.h
generic-y += parport.h
generic-y += percpu.h
generic-y += preempt.h
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ generic-y += local64.h
generic-y += mcs_spinlock.h
generic-y += preempt.h
generic-y += vtime.h
generic-y += msi.h
1 change: 0 additions & 1 deletion arch/riscv/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ generic-y += kvm_para.h
generic-y += local.h
generic-y += local64.h
generic-y += mm-arch-hooks.h
generic-y += msi.h
generic-y += percpu.h
generic-y += preempt.h
generic-y += sections.h
Expand Down
1 change: 0 additions & 1 deletion arch/sparc/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ generic-y += mcs_spinlock.h
generic-y += mm-arch-hooks.h
generic-y += mmiowb.h
generic-y += module.h
generic-y += msi.h
generic-y += preempt.h
generic-y += serial.h
generic-y += trace_clock.h
Expand Down
10 changes: 0 additions & 10 deletions drivers/nvme/host/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2404,16 +2404,6 @@ static const struct nvme_core_quirk_entry core_quirks[] = {
.vid = 0x14a4,
.fr = "22301111",
.quirks = NVME_QUIRK_SIMPLE_SUSPEND,
},
{
/*
* This Kingston E8FK11.T firmware version has no interrupt
* after resume with actions related to suspend to idle
* https://bugzilla.kernel.org/show_bug.cgi?id=204887
*/
.vid = 0x2646,
.fr = "E8FK11.T",
.quirks = NVME_QUIRK_SIMPLE_SUSPEND,
}
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/pci/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ config PCI_MSI
If you don't know what to do here, say Y.

config PCI_MSI_IRQ_DOMAIN
def_bool ARC || ARM || ARM64 || X86 || RISCV
def_bool y
depends on PCI_MSI
select GENERIC_MSI_IRQ_DOMAIN

Expand Down
25 changes: 5 additions & 20 deletions drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,13 @@ u32 __pci_msix_desc_mask_irq(struct msi_desc *desc, u32 flag)

if (pci_msi_ignore_mask)
return 0;

desc_addr = pci_msix_desc_addr(desc);
if (!desc_addr)
return 0;

mask_bits &= ~PCI_MSIX_ENTRY_CTRL_MASKBIT;
if (flag)
if (flag & PCI_MSIX_ENTRY_CTRL_MASKBIT)
mask_bits |= PCI_MSIX_ENTRY_CTRL_MASKBIT;

writel(mask_bits, desc_addr + PCI_MSIX_ENTRY_VECTOR_CTRL);
Expand Down Expand Up @@ -861,7 +862,7 @@ static int pci_msi_supported(struct pci_dev *dev, int nvec)
if (!pci_msi_enable)
return 0;

if (!dev || dev->no_msi || dev->current_state != PCI_D0)
if (!dev || dev->no_msi)
return 0;

/*
Expand Down Expand Up @@ -972,7 +973,7 @@ static int __pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries,
int nr_entries;
int i, j;

if (!pci_msi_supported(dev, nvec))
if (!pci_msi_supported(dev, nvec) || dev->current_state != PCI_D0)
return -EINVAL;

nr_entries = pci_msix_vec_count(dev);
Expand Down Expand Up @@ -1058,7 +1059,7 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,
int nvec;
int rc;

if (!pci_msi_supported(dev, minvec))
if (!pci_msi_supported(dev, minvec) || dev->current_state != PCI_D0)
return -EINVAL;

/* Check whether driver already requested MSI-X IRQs */
Expand Down Expand Up @@ -1315,22 +1316,6 @@ const struct cpumask *pci_irq_get_affinity(struct pci_dev *dev, int nr)
}
EXPORT_SYMBOL(pci_irq_get_affinity);

/**
* pci_irq_get_node - return the NUMA node of a particular MSI vector
* @pdev: PCI device to operate on
* @vec: device-relative interrupt vector index (0-based).
*/
int pci_irq_get_node(struct pci_dev *pdev, int vec)
{
const struct cpumask *mask;

mask = pci_irq_get_affinity(pdev, vec);
if (mask)
return local_memory_node(cpu_to_node(cpumask_first(mask)));
return dev_to_node(&pdev->dev);
}
EXPORT_SYMBOL(pci_irq_get_node);

struct pci_dev *msi_desc_to_pci_dev(struct msi_desc *desc)
{
return to_pci_dev(desc->dev);
Expand Down
1 change: 1 addition & 0 deletions include/asm-generic/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
# (This file is not included when SRCARCH=um since UML borrows several
# asm headers from the host architecutre.)

mandatory-y += msi.h
mandatory-y += simd.h
6 changes: 0 additions & 6 deletions include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,6 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
void pci_free_irq_vectors(struct pci_dev *dev);
int pci_irq_vector(struct pci_dev *dev, unsigned int nr);
const struct cpumask *pci_irq_get_affinity(struct pci_dev *pdev, int vec);
int pci_irq_get_node(struct pci_dev *pdev, int vec);

#else
static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; }
Expand Down Expand Up @@ -1497,11 +1496,6 @@ static inline const struct cpumask *pci_irq_get_affinity(struct pci_dev *pdev,
{
return cpu_possible_mask;
}

static inline int pci_irq_get_node(struct pci_dev *pdev, int vec)
{
return first_online_node;
}
#endif

/**
Expand Down

0 comments on commit c59f0da

Please sign in to comment.