From: Russell King <rmk@flint.arm.linux.org.uk>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] PCI updates - handle resource flags correctly
Date: Tue, 18 Dec 2001 23:50:31 +0000 [thread overview]
Message-ID: <20011218235031.O13126@flint.arm.linux.org.uk> (raw)
The following patch fixes a problem noticed on ARM while the generic PCI
code allocates bus addresses.
The region flags ended up containing some of the low-order bits of the IO
address that was read initially. This carries over some of the old PCI
address bits after the PCI resource allocator has reassigned them.
Obviously not good. The following patch correctly masks the resource flags
depending on the resource type.
This patch is being sent for only review at this time, but is ultimately
targeted at both the 2.4 and 2.5 kernel series.
diff -ur orig/drivers/pci/pci.c linux/drivers/pci/pci.c
--- orig/drivers/pci/pci.c Fri Nov 23 10:12:15 2001
+++ linux/drivers/pci/pci.c Tue Dec 18 19:31:15 2001
@@ -914,13 +914,15 @@
l = 0;
if ((l & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_MEMORY) {
res->start = l & PCI_BASE_ADDRESS_MEM_MASK;
+ res->flags |= l & ~PCI_BASE_ADDRESS_MEM_MASK;
sz = pci_size(sz, PCI_BASE_ADDRESS_MEM_MASK);
} else {
res->start = l & PCI_BASE_ADDRESS_IO_MASK;
+ res->flags |= l & ~PCI_BASE_ADDRESS_IO_MASK;
sz = pci_size(sz, PCI_BASE_ADDRESS_IO_MASK & 0xffff);
}
res->end = res->start + (unsigned long) sz;
- res->flags |= (l & 0xf) | pci_calc_resource_flags(l);
+ res->flags |= pci_calc_resource_flags(l);
if ((l & (PCI_BASE_ADDRESS_SPACE | PCI_BASE_ADDRESS_MEM_TYPE_MASK))
== (PCI_BASE_ADDRESS_SPACE_MEMORY | PCI_BASE_ADDRESS_MEM_TYPE_64)) {
pci_read_config_dword(dev, reg+4, &l);
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
reply other threads:[~2001-12-19 11:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20011218235031.O13126@flint.arm.linux.org.uk \
--to=rmk@flint.arm.linux.org.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome