aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2014-03-09 19:29:55 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2014-03-24 10:08:04 -0400
commitecb509ec2bacfe341530e56abf6bf3f20548bcd6 (patch)
tree882f696230e65e0767c8265b96b8b741606a3a35 /drivers/iommu
parent5913c9bf0efecfa869375af8b4619529d3464038 (diff)
iommu/vt-d: Remove pdev from iommu_no_mapping()
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/intel-iommu.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 2333f36f4866..0f5e6c911e85 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2902,10 +2902,9 @@ static int iommu_dummy(struct device *dev)
2902 return dev->archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO; 2902 return dev->archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO;
2903} 2903}
2904 2904
2905/* Check if the pdev needs to go through non-identity map and unmap process.*/ 2905/* Check if the dev needs to go through non-identity map and unmap process.*/
2906static int iommu_no_mapping(struct device *dev) 2906static int iommu_no_mapping(struct device *dev)
2907{ 2907{
2908 struct pci_dev *pdev;
2909 int found; 2908 int found;
2910 2909
2911 if (unlikely(!dev_is_pci(dev))) 2910 if (unlikely(!dev_is_pci(dev)))
@@ -2917,10 +2916,9 @@ static int iommu_no_mapping(struct device *dev)
2917 if (!iommu_identity_mapping) 2916 if (!iommu_identity_mapping)
2918 return 0; 2917 return 0;
2919 2918
2920 pdev = to_pci_dev(dev);
2921 found = identity_mapping(dev); 2919 found = identity_mapping(dev);
2922 if (found) { 2920 if (found) {
2923 if (iommu_should_identity_map(&pdev->dev, 0)) 2921 if (iommu_should_identity_map(dev, 0))
2924 return 1; 2922 return 1;
2925 else { 2923 else {
2926 /* 2924 /*
@@ -2929,7 +2927,7 @@ static int iommu_no_mapping(struct device *dev)
2929 */ 2927 */
2930 domain_remove_one_dev_info(si_domain, dev); 2928 domain_remove_one_dev_info(si_domain, dev);
2931 printk(KERN_INFO "32bit %s uses non-identity mapping\n", 2929 printk(KERN_INFO "32bit %s uses non-identity mapping\n",
2932 pci_name(pdev)); 2930 dev_name(dev));
2933 return 0; 2931 return 0;
2934 } 2932 }
2935 } else { 2933 } else {
@@ -2937,7 +2935,7 @@ static int iommu_no_mapping(struct device *dev)
2937 * In case of a detached 64 bit DMA device from vm, the device 2935 * In case of a detached 64 bit DMA device from vm, the device
2938 * is put into si_domain for identity mapping. 2936 * is put into si_domain for identity mapping.
2939 */ 2937 */
2940 if (iommu_should_identity_map(&pdev->dev, 0)) { 2938 if (iommu_should_identity_map(dev, 0)) {
2941 int ret; 2939 int ret;
2942 ret = domain_add_dev_info(si_domain, dev, 2940 ret = domain_add_dev_info(si_domain, dev,
2943 hw_pass_through ? 2941 hw_pass_through ?
@@ -2945,7 +2943,7 @@ static int iommu_no_mapping(struct device *dev)
2945 CONTEXT_TT_MULTI_LEVEL); 2943 CONTEXT_TT_MULTI_LEVEL);
2946 if (!ret) { 2944 if (!ret) {
2947 printk(KERN_INFO "64bit %s uses identity mapping\n", 2945 printk(KERN_INFO "64bit %s uses identity mapping\n",
2948 pci_name(pdev)); 2946 dev_name(dev));
2949 return 1; 2947 return 1;
2950 } 2948 }
2951 } 2949 }