Skip to content

Commit

Permalink
PCI: Switch msix_program_entries() to use pci_msix_desc_addr()
Browse files Browse the repository at this point in the history
Instead of relying on the msix_entry structure for the vector number, read
it from the msi_desc.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alexander Gordeev <agordeev@redhat.com>
  • Loading branch information
Christoph Hellwig authored and Bjorn Helgaas committed Jul 21, 2016
1 parent 5eb6d66 commit 12eb21d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,11 +713,9 @@ static void msix_program_entries(struct pci_dev *dev,
int i = 0;

for_each_pci_msi_entry(entry, dev) {
int offset = entries[i].entry * PCI_MSIX_ENTRY_SIZE +
PCI_MSIX_ENTRY_VECTOR_CTRL;

entries[i].vector = entry->irq;
entry->masked = readl(entry->mask_base + offset);
entry->masked = readl(pci_msix_desc_addr(entry) +
PCI_MSIX_ENTRY_VECTOR_CTRL);
msix_mask_irq(entry, 1);
i++;
}
Expand Down

0 comments on commit 12eb21d

Please sign in to comment.