From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI fixes for 2.6.7
Date: Thu, 24 Jun 2004 14:46:08 -0700 [thread overview]
Message-ID: <10881135682230@kroah.com> (raw)
In-Reply-To: <10881135683559@kroah.com>
ChangeSet 1.1823.1.7, 2004/06/22 16:57:06-07:00, roland@topspin.com
[PATCH] PCI: Fix MSI-X setup
msix_capability_init() puts the offset of the MSI-X capability into
pos, then uses pos as a loop index to clear the MSI-X vector table,
and then tries to use pos as the offset again, which results in
writing the MSI-X enable bit off into space.
This patch fixes that by adding a new loop index variable and using
that to clear the vector table.
Signed-off-by: Roland Dreier <roland@tospin.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/pci/msi.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff -Nru a/drivers/pci/msi.c b/drivers/pci/msi.c
--- a/drivers/pci/msi.c 2004-06-24 13:50:17 -07:00
+++ b/drivers/pci/msi.c 2004-06-24 13:50:17 -07:00
@@ -569,7 +569,7 @@
struct msi_desc *entry;
struct msg_address address;
struct msg_data data;
- int vector = 0, pos, dev_msi_cap;
+ int vector = 0, pos, dev_msi_cap, i;
u32 phys_addr, table_offset;
u32 control;
u8 bir;
@@ -629,12 +629,12 @@
writel(address.hi_address, base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
writel(*(u32*)&data, base + PCI_MSIX_ENTRY_DATA_OFFSET);
/* Initialize all entries from 1 up to 0 */
- for (pos = 1; pos < dev_msi_cap; pos++) {
- writel(0, base + pos * PCI_MSIX_ENTRY_SIZE +
+ for (i = 1; i < dev_msi_cap; i++) {
+ writel(0, base + i * PCI_MSIX_ENTRY_SIZE +
PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
- writel(0, base + pos * PCI_MSIX_ENTRY_SIZE +
+ writel(0, base + i * PCI_MSIX_ENTRY_SIZE +
PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
- writel(0, base + pos * PCI_MSIX_ENTRY_SIZE +
+ writel(0, base + i * PCI_MSIX_ENTRY_SIZE +
PCI_MSIX_ENTRY_DATA_OFFSET);
}
attach_msi_entry(entry, vector);
next prev parent reply other threads:[~2004-06-24 22:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-24 21:30 [BK PATCH] PCI fixes for 2.6.7 Greg KH
2004-06-24 21:46 ` [PATCH] " Greg KH
2004-06-24 21:46 ` Greg KH
2004-06-24 21:46 ` Greg KH
2004-06-24 21:46 ` Greg KH
2004-06-24 21:46 ` Greg KH
2004-06-24 21:46 ` Greg KH
2004-06-24 21:46 ` Greg KH [this message]
2004-06-24 21:46 ` Greg KH
2004-06-24 21:46 ` Greg KH
2004-06-24 21:46 ` Greg KH
2004-06-24 21:46 ` Greg KH
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=10881135682230@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.