diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0025-iommu-amd-Initialize-dma_ops-for-hotplug-and-sriov-d.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0025-iommu-amd-Initialize-dma_ops-for-hotplug-and-sriov-d.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0025-iommu-amd-Initialize-dma_ops-for-hotplug-and-sriov-d.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0025-iommu-amd-Initialize-dma_ops-for-hotplug-and-sriov-d.patch new file mode 100644 index 00000000..053d5e73 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0025-iommu-amd-Initialize-dma_ops-for-hotplug-and-sriov-d.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 60eec119060fbd35f569fd77fd448dbcd8d8f011 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joerg Roedel <joerg.roedel@amd.com> | ||
3 | Date: Thu, 21 Jun 2012 14:52:40 +0200 | ||
4 | Subject: [PATCH 025/109] iommu/amd: Initialize dma_ops for hotplug and sriov | ||
5 | devices | ||
6 | |||
7 | commit ac1534a55d1e87d59a21c09c570605933b551480 upstream. | ||
8 | |||
9 | When a device is added to the system at runtime the AMD | ||
10 | IOMMU driver initializes the necessary data structures to | ||
11 | handle translation for it. But it forgets to change the | ||
12 | per-device dma_ops to point to the AMD IOMMU driver. So | ||
13 | mapping actually never happens and all DMA accesses end in | ||
14 | an IO_PAGE_FAULT. Fix this. | ||
15 | |||
16 | Reported-by: Stefan Assmann <sassmann@redhat.com> | ||
17 | Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> | ||
18 | [bwh: Backported to 3.2: | ||
19 | - Adjust context | ||
20 | - Use global iommu_pass_through; there is no per-device pass_through] | ||
21 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
22 | --- | ||
23 | drivers/iommu/amd_iommu.c | 7 +++++++ | ||
24 | 1 files changed, 7 insertions(+), 0 deletions(-) | ||
25 | |||
26 | diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c | ||
27 | index f1d5408..a1b8caa 100644 | ||
28 | --- a/drivers/iommu/amd_iommu.c | ||
29 | +++ b/drivers/iommu/amd_iommu.c | ||
30 | @@ -59,6 +59,8 @@ static struct protection_domain *pt_domain; | ||
31 | |||
32 | static struct iommu_ops amd_iommu_ops; | ||
33 | |||
34 | +static struct dma_map_ops amd_iommu_dma_ops; | ||
35 | + | ||
36 | /* | ||
37 | * general struct to manage commands send to an IOMMU | ||
38 | */ | ||
39 | @@ -1878,6 +1880,11 @@ static int device_change_notifier(struct notifier_block *nb, | ||
40 | list_add_tail(&dma_domain->list, &iommu_pd_list); | ||
41 | spin_unlock_irqrestore(&iommu_pd_list_lock, flags); | ||
42 | |||
43 | + if (!iommu_pass_through) | ||
44 | + dev->archdata.dma_ops = &amd_iommu_dma_ops; | ||
45 | + else | ||
46 | + dev->archdata.dma_ops = &nommu_dma_ops; | ||
47 | + | ||
48 | break; | ||
49 | case BUS_NOTIFY_DEL_DEVICE: | ||
50 | |||
51 | -- | ||
52 | 1.7.7.6 | ||
53 | |||