From: Patrick Jefferson <patrick.jefferson@hp.com>
To: gregkh@suse.de
Cc: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
Subject: [PATCH] PCI: fix MMIO addressing collisions
Date: Tue, 23 May 2006 12:28:10 +0000 [thread overview]
Message-ID: <4472FFDA.2040005@hp.com> (raw)
Hello,
Clearing PCI Command bits fixes machine halts observed during sizing
seqences using MMIO cycles. Clearing the bits is suggested by an
implementation note in the PCI spec.
Thanks,
Patrick
Signed-off-by: Patrick Jefferson <patrick.jefferson@hp.com>
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -147,7 +147,7 @@ static u32 pci_size(u32 base, u32 maxbas
static void pci_read_bases(struct pci_dev *dev, unsigned int howmany,
int rom)
{
unsigned int pos, reg, next;
- u32 l, sz;
+ u32 l, sz, cmd;
struct resource *res;
for(pos=0; pos<howmany; pos = next) {
@@ -155,10 +155,14 @@ static void pci_read_bases(struct pci_de
res = &dev->resource[pos];
res->name = pci_name(dev);
reg = PCI_BASE_ADDRESS_0 + (pos << 2);
+ /* disable Memory & I/O decoders before sizing a BAR */
+ pci_read_config_dword(dev, PCI_COMMAND, &cmd);
+ pci_write_config_dword(dev, PCI_COMMAND, cmd &
~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY));
pci_read_config_dword(dev, reg, &l);
pci_write_config_dword(dev, reg, ~0);
pci_read_config_dword(dev, reg, &sz);
pci_write_config_dword(dev, reg, l);
+ pci_write_config_dword(dev, PCI_COMMAND, cmd);
if (!sz || sz == 0xffffffff)
continue;
if (l == 0xffffffff)
next reply other threads:[~2006-05-23 17:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-23 12:28 Patrick Jefferson [this message]
2006-05-23 22:06 ` [PATCH] PCI: fix MMIO addressing collisions Ivan Kokshaysky
2006-05-23 22:47 ` Greg KH
2006-05-24 21:43 ` Patrick Jefferson
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=4472FFDA.2040005@hp.com \
--to=patrick.jefferson@hp.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
/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.