From: tip-bot for FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
fujita.tomonori@lab.ntt.co.jp, muli@il.ibm.com,
tglx@linutronix.de, mingo@elte.hu
Subject: [tip:core/iommu] x86: Calgary: Convert detect_calgary() to use iommu_init hook
Date: Tue, 10 Nov 2009 13:22:50 GMT [thread overview]
Message-ID: <tip-d7b9f7be216b04ff9d108f856bc03d96e7b3439c@git.kernel.org> (raw)
In-Reply-To: <1257849980-22640-3-git-send-email-fujita.tomonori@lab.ntt.co.jp>
Commit-ID: d7b9f7be216b04ff9d108f856bc03d96e7b3439c
Gitweb: http://git.kernel.org/tip/d7b9f7be216b04ff9d108f856bc03d96e7b3439c
Author: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
AuthorDate: Tue, 10 Nov 2009 19:46:13 +0900
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 10 Nov 2009 12:31:15 +0100
x86: Calgary: Convert detect_calgary() to use iommu_init hook
This changes detect_calgary() to set init_calgary() to
iommu_init hook if detect_calgary() finds the Calgary IOMMU.
We can kill the code to check if we found the IOMMU in
init_calgary() since detect_calgary() sets init_calgary() only
when it found the IOMMU.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: chrisw@sous-sol.org
Cc: dwmw2@infradead.org
Cc: joerg.roedel@amd.com
LKML-Reference: <1257849980-22640-3-git-send-email-fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/calgary.h | 2 --
arch/x86/kernel/pci-calgary_64.c | 11 +++++------
arch/x86/kernel/pci-dma.c | 2 --
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/arch/x86/include/asm/calgary.h b/arch/x86/include/asm/calgary.h
index b03bedb..0918654 100644
--- a/arch/x86/include/asm/calgary.h
+++ b/arch/x86/include/asm/calgary.h
@@ -62,10 +62,8 @@ struct cal_chipset_ops {
extern int use_calgary;
#ifdef CONFIG_CALGARY_IOMMU
-extern int calgary_iommu_init(void);
extern void detect_calgary(void);
#else
-static inline int calgary_iommu_init(void) { return 1; }
static inline void detect_calgary(void) { return; }
#endif
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index 971a3be..47bd419 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -46,6 +46,7 @@
#include <asm/dma.h>
#include <asm/rio.h>
#include <asm/bios_ebda.h>
+#include <asm/x86_init.h>
#ifdef CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT
int use_calgary __read_mostly = 1;
@@ -1344,6 +1345,8 @@ static void __init get_tce_space_from_tar(void)
return;
}
+int __init calgary_iommu_init(void);
+
void __init detect_calgary(void)
{
int bus;
@@ -1445,6 +1448,8 @@ void __init detect_calgary(void)
/* swiotlb for devices that aren't behind the Calgary. */
if (max_pfn > MAX_DMA32_PFN)
swiotlb = 1;
+
+ x86_init.iommu.iommu_init = calgary_iommu_init;
}
return;
@@ -1461,12 +1466,6 @@ int __init calgary_iommu_init(void)
{
int ret;
- if (no_iommu || (swiotlb && !calgary_detected))
- return -ENODEV;
-
- if (!calgary_detected)
- return -ENODEV;
-
/* ok, we're trying to use Calgary - let's roll */
printk(KERN_INFO "PCI-DMA: Using Calgary IOMMU\n");
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index a13478d..0224da8 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -294,8 +294,6 @@ static int __init pci_iommu_init(void)
x86_init.iommu.iommu_init();
- calgary_iommu_init();
-
intel_iommu_init();
amd_iommu_init();
next prev parent reply other threads:[~2009-11-10 13:23 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-10 10:46 [PATCH v2 0/9] x86: handle HW IOMMU initialization failure gracefully FUJITA Tomonori
2009-11-10 10:46 ` [PATCH -v2 1/9] add iommu_init to x86_init_ops FUJITA Tomonori
2009-11-10 13:22 ` [tip:core/iommu] x86: Add " tip-bot for FUJITA Tomonori
2009-11-10 13:42 ` [tip:core/iommu] x86: Add iommu_init to x86_init_ops, fix build tip-bot for Ingo Molnar
2009-11-10 10:46 ` [PATCH -v2 2/9] Calgary: convert detect_calgary to use iommu_init hook FUJITA Tomonori
2009-11-10 13:22 ` tip-bot for FUJITA Tomonori [this message]
2009-11-10 10:46 ` [PATCH -v2 3/9] GART: convert gart_iommu_hole_init " FUJITA Tomonori
2009-11-10 13:23 ` [tip:core/iommu] x86: GART: Convert gart_iommu_hole_init() " tip-bot for FUJITA Tomonori
2009-11-10 10:46 ` [PATCH -v2 4/9] amd_iommu: convert amd_iommu_detect " FUJITA Tomonori
2009-11-10 13:23 ` [tip:core/iommu] x86: amd_iommu: Convert amd_iommu_detect() " tip-bot for FUJITA Tomonori
2009-11-10 10:46 ` [PATCH -v2 5/9] intel-iommu: convert detect_intel_iommu " FUJITA Tomonori
2009-11-10 11:12 ` Ingo Molnar
2009-11-10 13:23 ` [tip:core/iommu] x86: intel-iommu: Convert " tip-bot for FUJITA Tomonori
2009-11-10 10:46 ` [PATCH -v2 6/9] bootmem: add free_bootmem_late FUJITA Tomonori
2009-11-10 12:00 ` Johannes Weiner
2009-11-14 12:50 ` FUJITA Tomonori
2009-11-10 13:23 ` [tip:core/iommu] bootmem: Add free_bootmem_late() tip-bot for FUJITA Tomonori
2009-11-11 23:56 ` [PATCH -v2 6/9] bootmem: add free_bootmem_late Andrew Morton
2009-11-12 7:47 ` Ingo Molnar
2009-11-10 10:46 ` [PATCH -v2 7/9] swiotlb: add swiotlb_free function FUJITA Tomonori
2009-11-10 11:27 ` Ingo Molnar
2009-11-10 13:24 ` [tip:core/iommu] swiotlb: Add swiotlb_free() function tip-bot for FUJITA Tomonori
2009-11-10 10:46 ` [PATCH -v2 8/9] swiotlb: export swiotlb_print_info FUJITA Tomonori
2009-11-10 13:24 ` [tip:core/iommu] swiotlb: Defer swiotlb init printing, export swiotlb_print_info() tip-bot for FUJITA Tomonori
2009-11-10 10:46 ` [PATCH -v2 9/9] x86: handle HW IOMMU initialization failure gracely FUJITA Tomonori
2009-11-10 11:27 ` Ingo Molnar
2009-11-10 13:24 ` [tip:core/iommu] x86: Handle HW IOMMU initialization failure gracefully tip-bot for FUJITA Tomonori
2009-11-22 4:24 ` [PATCH] x86: fix gart iommu using for amd 64 bit system Yinghai Lu
2009-11-22 5:19 ` [PATCH] x86: fix gart iommu using for amd 64 bit system -v2 Yinghai Lu
2009-11-24 8:46 ` [PATCH] x86: fix gart iommu using for amd 64 bit system FUJITA Tomonori
2009-11-24 9:19 ` Yinghai Lu
2009-11-24 9:35 ` FUJITA Tomonori
2009-11-24 9:48 ` Yinghai Lu
2009-11-24 10:31 ` FUJITA Tomonori
2009-11-24 10:42 ` Yinghai Lu
2009-11-24 13:50 ` FUJITA Tomonori
2009-11-24 15:26 ` Ingo Molnar
2009-11-24 18:28 ` Yinghai Lu
2009-11-24 23:57 ` FUJITA Tomonori
2009-11-25 7:25 ` Ingo Molnar
2009-11-25 7:56 ` FUJITA Tomonori
2009-11-24 18:48 ` Yinghai Lu
2009-11-24 23:48 ` FUJITA Tomonori
2009-11-10 11:19 ` [PATCH v2 0/9] x86: handle HW IOMMU initialization failure gracefully Ingo Molnar
2009-11-10 11:55 ` Ingo Molnar
2009-11-10 12:35 ` FUJITA Tomonori
2009-11-22 3:17 ` Yinghai Lu
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=tip-d7b9f7be216b04ff9d108f856bc03d96e7b3439c@git.kernel.org \
--to=fujita.tomonori@lab.ntt.co.jp \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=muli@il.ibm.com \
--cc=tglx@linutronix.de \
/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.