Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
d4b709f4
Commit
d4b709f4
authored
Mar 09, 2014
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iommu/vt-d: Make get_valid_domain_for_dev() take struct device
Signed-off-by:
David Woodhouse
<
David.Woodhouse@intel.com
>
parent
3bdb2591
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
drivers/iommu/intel-iommu.c
drivers/iommu/intel-iommu.c
+12
-14
No files found.
drivers/iommu/intel-iommu.c
View file @
d4b709f4
...
@@ -2862,26 +2862,24 @@ static struct iova *intel_alloc_iova(struct device *dev,
...
@@ -2862,26 +2862,24 @@ static struct iova *intel_alloc_iova(struct device *dev,
return
iova
;
return
iova
;
}
}
static
struct
dmar_domain
*
__get_valid_domain_for_dev
(
struct
pci_dev
*
p
dev
)
static
struct
dmar_domain
*
__get_valid_domain_for_dev
(
struct
device
*
dev
)
{
{
struct
dmar_domain
*
domain
;
struct
dmar_domain
*
domain
;
int
ret
;
int
ret
;
domain
=
get_domain_for_dev
(
&
pdev
->
dev
,
DEFAULT_DOMAIN_ADDRESS_WIDTH
);
domain
=
get_domain_for_dev
(
dev
,
DEFAULT_DOMAIN_ADDRESS_WIDTH
);
if
(
!
domain
)
{
if
(
!
domain
)
{
printk
(
KERN_ERR
printk
(
KERN_ERR
"Allocating domain for %s failed"
,
"Allocating domain for %s failed"
,
pci_name
(
p
dev
));
dev_name
(
dev
));
return
NULL
;
return
NULL
;
}
}
/* make sure context mapping is ok */
/* make sure context mapping is ok */
if
(
unlikely
(
!
domain_context_mapped
(
&
pdev
->
dev
)))
{
if
(
unlikely
(
!
domain_context_mapped
(
dev
)))
{
ret
=
domain_context_mapping
(
domain
,
&
pdev
->
dev
,
ret
=
domain_context_mapping
(
domain
,
dev
,
CONTEXT_TT_MULTI_LEVEL
);
CONTEXT_TT_MULTI_LEVEL
);
if
(
ret
)
{
if
(
ret
)
{
printk
(
KERN_ERR
printk
(
KERN_ERR
"Domain context map for %s failed"
,
"Domain context map for %s failed"
,
dev_name
(
dev
));
pci_name
(
pdev
));
return
NULL
;
return
NULL
;
}
}
}
}
...
@@ -2889,12 +2887,12 @@ static struct dmar_domain *__get_valid_domain_for_dev(struct pci_dev *pdev)
...
@@ -2889,12 +2887,12 @@ static struct dmar_domain *__get_valid_domain_for_dev(struct pci_dev *pdev)
return
domain
;
return
domain
;
}
}
static
inline
struct
dmar_domain
*
get_valid_domain_for_dev
(
struct
pci_dev
*
dev
)
static
inline
struct
dmar_domain
*
get_valid_domain_for_dev
(
struct
device
*
dev
)
{
{
struct
device_domain_info
*
info
;
struct
device_domain_info
*
info
;
/* No lock here, assumes no domain exit in normal case */
/* No lock here, assumes no domain exit in normal case */
info
=
dev
->
dev
.
archdata
.
iommu
;
info
=
dev
->
archdata
.
iommu
;
if
(
likely
(
info
))
if
(
likely
(
info
))
return
info
->
domain
;
return
info
->
domain
;
...
@@ -2975,7 +2973,7 @@ static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
...
@@ -2975,7 +2973,7 @@ static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
if
(
iommu_no_mapping
(
hwdev
))
if
(
iommu_no_mapping
(
hwdev
))
return
paddr
;
return
paddr
;
domain
=
get_valid_domain_for_dev
(
p
dev
);
domain
=
get_valid_domain_for_dev
(
hw
dev
);
if
(
!
domain
)
if
(
!
domain
)
return
0
;
return
0
;
...
@@ -3280,7 +3278,7 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int ne
...
@@ -3280,7 +3278,7 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int ne
if
(
iommu_no_mapping
(
hwdev
))
if
(
iommu_no_mapping
(
hwdev
))
return
intel_nontranslate_map_sg
(
hwdev
,
sglist
,
nelems
,
dir
);
return
intel_nontranslate_map_sg
(
hwdev
,
sglist
,
nelems
,
dir
);
domain
=
get_valid_domain_for_dev
(
p
dev
);
domain
=
get_valid_domain_for_dev
(
hw
dev
);
if
(
!
domain
)
if
(
!
domain
)
return
0
;
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment