From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org,
Arjan van de Ven <arjan@linux.intel.com>, Andi Kleen <ak@suse.de>
Subject: [PATCH 4/4] MMCONFIG: Fix x86_64 ioremap base_address
Date: Wed, 10 Jan 2007 04:01:13 +0900 [thread overview]
Message-ID: <87slek3tza.fsf_-_@duaron.myhome.or.jp> (raw)
In-Reply-To: <87wt3w3u04.fsf_-_@duaron.myhome.or.jp> (OGAWA Hirofumi's message of "Wed\, 10 Jan 2007 04\:00\:43 +0900")
Current mmconfig has some problems of remapped range. The base
address always corresponds to bus number 0, but currently we are
assuming it corresponds to start bus number.
This patch fixes the above problems.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---
arch/x86_64/pci/mmconfig.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff -puN arch/x86_64/pci/mmconfig.c~pci-mmconfig-ioremap-range-fix-mm arch/x86_64/pci/mmconfig.c
--- linux-2.6/arch/x86_64/pci/mmconfig.c~pci-mmconfig-ioremap-range-fix-mm 2007-01-06 01:04:47.000000000 +0900
+++ linux-2.6-hirofumi/arch/x86_64/pci/mmconfig.c 2007-01-06 01:05:35.000000000 +0900
@@ -118,6 +118,20 @@ int __init pci_mmcfg_arch_reachable(unsi
return pci_dev_base(seg, bus, devfn) != NULL;
}
+static void __iomem * __init mcfg_ioremap(struct acpi_table_mcfg_config *cfg)
+{
+ void __iomem *addr;
+ u32 size;
+
+ size = (cfg->end_bus_number + 1) << 20;
+ addr = ioremap_nocache(cfg->base_address, size);
+ if (addr) {
+ printk(KERN_INFO "PCI: Using MMCONFIG at %x - %x\n",
+ cfg->base_address, cfg->base_address + size - 1);
+ }
+ return addr;
+}
+
int __init pci_mmcfg_arch_init(void)
{
int i;
@@ -128,19 +142,14 @@ int __init pci_mmcfg_arch_init(void)
}
for (i = 0; i < pci_mmcfg_config_num; ++i) {
- u32 size = (pci_mmcfg_config[0].end_bus_number - pci_mmcfg_config[0].start_bus_number + 1) << 20;
pci_mmcfg_virt[i].cfg = &pci_mmcfg_config[i];
- pci_mmcfg_virt[i].virt = ioremap_nocache(pci_mmcfg_config[i].base_address,
- size);
+ pci_mmcfg_virt[i].virt = mcfg_ioremap(&pci_mmcfg_config[i]);
if (!pci_mmcfg_virt[i].virt) {
printk(KERN_ERR "PCI: Cannot map mmconfig aperture for "
"segment %d\n",
pci_mmcfg_config[i].pci_segment_group_number);
return 0;
}
- printk(KERN_INFO "PCI: Using MMCONFIG at %x-%x\n",
- pci_mmcfg_config[i].base_address,
- pci_mmcfg_config[i].base_address + size - 1);
}
raw_pci_ops = &pci_mmcfg;
_
next prev parent reply other threads:[~2007-01-09 19:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-09 18:59 [PATCH 1/4] MMCONFIG: cleanup OGAWA Hirofumi
2007-01-09 19:00 ` [PATCH 2/4] MMCONFIG: Reject a broken MCFG tables on Asus etc OGAWA Hirofumi
2007-01-09 19:00 ` [PATCH 3/4] MMCONFIG: fix unreachable_devices() OGAWA Hirofumi
2007-01-09 19:01 ` OGAWA Hirofumi [this message]
2007-01-10 0:21 ` [PATCH 1/4] MMCONFIG: cleanup Andi Kleen
2007-01-10 0:41 ` OGAWA Hirofumi
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=87slek3tza.fsf_-_@duaron.myhome.or.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=arjan@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®