linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: linux-pci@vger.kernel.org
Cc: agordeev@redhat.com, linux-kernel@vger.kernel.org
Subject: [PATCH 2/5] pci: switch msix_program_entries to use pci_msix_desc_addr
Date: Tue, 12 Jul 2016 18:20:15 +0900	[thread overview]
Message-ID: <1468315218-20490-3-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1468315218-20490-1-git-send-email-hch@lst.de>

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>
---
 drivers/pci/msi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 0d94fbf..a385f39 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -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++;
 	}
-- 
2.1.4

  parent reply	other threads:[~2016-07-12  9:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12  9:20 pci: automatic interrupt affinity for MSI/MSI-X capable devices V2 Christoph Hellwig
2016-07-12  9:20 ` [PATCH 1/5] pci: add a pci_msix_desc_addr helper Christoph Hellwig
2016-07-12 12:59   ` Alexander Gordeev
2016-07-12  9:20 ` Christoph Hellwig [this message]
2016-07-12 12:59   ` [PATCH 2/5] pci: switch msix_program_entries to use pci_msix_desc_addr Alexander Gordeev
2016-07-12  9:20 ` [PATCH 3/5] pci: make the entries argument to pci_enable_msix optional Christoph Hellwig
2016-07-12  9:20 ` [PATCH 4/5] pci: Provide sensible irq vector alloc/free routines Christoph Hellwig
2016-07-12 12:58   ` Alexander Gordeev
2016-07-12  9:20 ` [PATCH 5/5] pci: spread interrupt vectors in pci_alloc_irq_vectors Christoph Hellwig
2016-07-12 12:57   ` Alexander Gordeev
2016-07-21 21:06 ` pci: automatic interrupt affinity for MSI/MSI-X capable devices V2 Bjorn Helgaas
2016-07-21 21:10   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2016-07-10 11:57 pci: automatic interrupt affinity for MSI/MSI-X capable devices Christoph Hellwig
2016-07-10 11:57 ` [PATCH 2/5] pci: switch msix_program_entries to use pci_msix_desc_addr Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468315218-20490-3-git-send-email-hch@lst.de \
    --to=hch@lst.de \
    --cc=agordeev@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).