From: Jon Mason <jdmason@us.ibm.com>
To: ak@muc.de
Cc: mulix@mulix.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] x86-64: no_iommu removal in pci-gart.c
Date: Thu, 2 Feb 2006 18:15:29 -0600 [thread overview]
Message-ID: <20060203001529.GC32198@us.ibm.com> (raw)
In previous versions of pci-gart.c, no_iommu was used to determine if IOMMU was
disabled in the GART DMA mapping functions. This changed in 2.6.16 and now
gart_xxx() functions are only called if gart is enabled. Therefore, uses of
no_iommu in the GART code are no longer necessary and can be removed.
Also, it removes double deceleration of no_iommu and force_iommu in pci.h and
proto.h, by removing the deceleration in pci.h.
Lastly, end_pfn off by one error.
Tested (along with patch 1/2) on dual opteron with gart enabled, iommu=soft,
and iommu=off.
Thanks,
Jon
Signed-off-by: Jon Mason <jdmason@us.ibm.com>
diff -r e961b4a72270 arch/x86_64/kernel/aperture.c
--- a/arch/x86_64/kernel/aperture.c Thu Feb 2 21:28:35 2006
+++ b/arch/x86_64/kernel/aperture.c Thu Feb 2 15:34:24 2006
@@ -248,7 +248,7 @@
/* Got the aperture from the AGP bridge */
} else if (swiotlb && !valid_agp) {
/* Do nothing */
- } else if ((!no_iommu && end_pfn >= MAX_DMA32_PFN) ||
+ } else if ((!no_iommu && end_pfn > MAX_DMA32_PFN) ||
force_iommu ||
valid_agp ||
fallback_aper_force) {
diff -r e961b4a72270 arch/x86_64/kernel/pci-gart.c
--- a/arch/x86_64/kernel/pci-gart.c Thu Feb 2 21:28:35 2006
+++ b/arch/x86_64/kernel/pci-gart.c Thu Feb 2 15:34:24 2006
@@ -228,11 +228,6 @@
int mmu = high;
if (force_iommu)
mmu = 1;
- if (no_iommu) {
- if (high)
- panic("PCI-DMA: high address but no IOMMU.\n");
- mmu = 0;
- }
return mmu;
}
@@ -241,11 +236,6 @@
u64 mask = *dev->dma_mask;
int high = addr + size >= mask;
int mmu = high;
- if (no_iommu) {
- if (high)
- panic("PCI-DMA: high address but no IOMMU.\n");
- mmu = 0;
- }
return mmu;
}
@@ -631,17 +621,13 @@
(agp_copy_info(agp_bridge, &info) < 0);
#endif
- if (swiotlb) {
- no_iommu = 1;
+ if (swiotlb)
return -1;
- }
-
+
if (no_iommu ||
(!force_iommu && end_pfn <= MAX_DMA32_PFN) ||
!iommu_aperture ||
(no_agp && init_k8_gatt(&info) < 0)) {
- no_iommu = 1;
- no_iommu_init();
printk(KERN_INFO "PCI-DMA: Disabling IOMMU.\n");
if (end_pfn > MAX_DMA32_PFN) {
printk(KERN_ERR "WARNING more than 4GB of memory "
diff -r e961b4a72270 include/asm-x86_64/pci.h
--- a/include/asm-x86_64/pci.h Thu Feb 2 21:28:35 2006
+++ b/include/asm-x86_64/pci.h Thu Feb 2 15:34:24 2006
@@ -18,8 +18,6 @@
#define pcibios_assign_all_busses() 0
#endif
#define pcibios_scan_all_fns(a, b) 0
-
-extern int no_iommu, force_iommu;
extern unsigned long pci_mem_start;
#define PCIBIOS_MIN_IO 0x1000
reply other threads:[~2006-02-03 0:15 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=20060203001529.GC32198@us.ibm.com \
--to=jdmason@us.ibm.com \
--cc=ak@muc.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mulix@mulix.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.