Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1406665 > unrolled thread
| Started by | Baoquan He <bhe@redhat.com> |
|---|---|
| First post | 2016-05-25 08:30 +0200 |
| Last post | 2016-05-25 08:30 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[Patch v4 4/9] iommu/amd: add early_enable_iommu() helper function Baoquan He <bhe@redhat.com> - 2016-05-25 08:30 +0200
| From | Baoquan He <bhe@redhat.com> |
|---|---|
| Date | 2016-05-25 08:30 +0200 |
| Subject | [Patch v4 4/9] iommu/amd: add early_enable_iommu() helper function |
| Message-ID | <rCAul-619-7@gated-at.bofh.it> |
From: Baoquan HE <bhe@dhcp-129-10.nay.redhat.com>
This can make later kdump change easier.
Signed-off-by: Baoquan He <bhe@redhat.com>
---
drivers/iommu/amd_iommu_init.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 9e1dfcb..9c1aa54 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -1673,6 +1673,18 @@ static void iommu_apply_resume_quirks(struct amd_iommu *iommu)
iommu->stored_addr_lo | 1);
}
+static void early_enable_iommu(struct amd_iommu *iommu)
+{
+ iommu_disable(iommu);
+ iommu_init_flags(iommu);
+ iommu_set_device_table(iommu);
+ iommu_enable_command_buffer(iommu);
+ iommu_enable_event_buffer(iommu);
+ iommu_set_exclusion_range(iommu);
+ iommu_enable(iommu);
+ iommu_flush_all_caches(iommu);
+}
+
/*
* This function finally enables all IOMMUs found in the system after
* they have been initialized
@@ -1681,16 +1693,8 @@ static void early_enable_iommus(void)
{
struct amd_iommu *iommu;
- for_each_iommu(iommu) {
- iommu_disable(iommu);
- iommu_init_flags(iommu);
- iommu_set_device_table(iommu);
- iommu_enable_command_buffer(iommu);
- iommu_enable_event_buffer(iommu);
- iommu_set_exclusion_range(iommu);
- iommu_enable(iommu);
- iommu_flush_all_caches(iommu);
- }
+ for_each_iommu(iommu)
+ early_enable_iommu(iommu);
}
static void enable_iommus_v2(void)
--
2.5.5
Back to top | Article view | linux.kernel
csiph-web