Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
342688f9
Commit
342688f9
authored
Nov 03, 2009
by
Joerg Roedel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branches 'amd-iommu/fixes' and 'dma-debug/fixes' into iommu/fixes
parents
012abeea
ca020711
59a40e70
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
3 deletions
+30
-3
arch/x86/include/asm/amd_iommu.h
arch/x86/include/asm/amd_iommu.h
+1
-0
arch/x86/kernel/amd_iommu.c
arch/x86/kernel/amd_iommu.c
+2
-0
arch/x86/kernel/amd_iommu_init.c
arch/x86/kernel/amd_iommu_init.c
+23
-1
lib/dma-debug.c
lib/dma-debug.c
+4
-2
No files found.
arch/x86/include/asm/amd_iommu.h
View file @
342688f9
...
@@ -31,6 +31,7 @@ extern irqreturn_t amd_iommu_int_handler(int irq, void *data);
...
@@ -31,6 +31,7 @@ extern irqreturn_t amd_iommu_int_handler(int irq, void *data);
extern
void
amd_iommu_flush_all_domains
(
void
);
extern
void
amd_iommu_flush_all_domains
(
void
);
extern
void
amd_iommu_flush_all_devices
(
void
);
extern
void
amd_iommu_flush_all_devices
(
void
);
extern
void
amd_iommu_shutdown
(
void
);
extern
void
amd_iommu_shutdown
(
void
);
extern
void
amd_iommu_apply_erratum_63
(
u16
devid
);
#else
#else
static
inline
int
amd_iommu_init
(
void
)
{
return
-
ENODEV
;
}
static
inline
int
amd_iommu_init
(
void
)
{
return
-
ENODEV
;
}
static
inline
void
amd_iommu_detect
(
void
)
{
}
static
inline
void
amd_iommu_detect
(
void
)
{
}
...
...
arch/x86/kernel/amd_iommu.c
View file @
342688f9
...
@@ -1220,6 +1220,8 @@ static void __detach_device(struct protection_domain *domain, u16 devid)
...
@@ -1220,6 +1220,8 @@ static void __detach_device(struct protection_domain *domain, u16 devid)
amd_iommu_dev_table
[
devid
].
data
[
1
]
=
0
;
amd_iommu_dev_table
[
devid
].
data
[
1
]
=
0
;
amd_iommu_dev_table
[
devid
].
data
[
2
]
=
0
;
amd_iommu_dev_table
[
devid
].
data
[
2
]
=
0
;
amd_iommu_apply_erratum_63
(
devid
);
/* decrease reference counter */
/* decrease reference counter */
domain
->
dev_cnt
-=
1
;
domain
->
dev_cnt
-=
1
;
...
...
arch/x86/kernel/amd_iommu_init.c
View file @
342688f9
...
@@ -240,7 +240,7 @@ static void iommu_feature_enable(struct amd_iommu *iommu, u8 bit)
...
@@ -240,7 +240,7 @@ static void iommu_feature_enable(struct amd_iommu *iommu, u8 bit)
writel
(
ctrl
,
iommu
->
mmio_base
+
MMIO_CONTROL_OFFSET
);
writel
(
ctrl
,
iommu
->
mmio_base
+
MMIO_CONTROL_OFFSET
);
}
}
static
void
__init
iommu_feature_disable
(
struct
amd_iommu
*
iommu
,
u8
bit
)
static
void
iommu_feature_disable
(
struct
amd_iommu
*
iommu
,
u8
bit
)
{
{
u32
ctrl
;
u32
ctrl
;
...
@@ -519,6 +519,26 @@ static void set_dev_entry_bit(u16 devid, u8 bit)
...
@@ -519,6 +519,26 @@ static void set_dev_entry_bit(u16 devid, u8 bit)
amd_iommu_dev_table
[
devid
].
data
[
i
]
|=
(
1
<<
_bit
);
amd_iommu_dev_table
[
devid
].
data
[
i
]
|=
(
1
<<
_bit
);
}
}
static
int
get_dev_entry_bit
(
u16
devid
,
u8
bit
)
{
int
i
=
(
bit
>>
5
)
&
0x07
;
int
_bit
=
bit
&
0x1f
;
return
(
amd_iommu_dev_table
[
devid
].
data
[
i
]
&
(
1
<<
_bit
))
>>
_bit
;
}
void
amd_iommu_apply_erratum_63
(
u16
devid
)
{
int
sysmgt
;
sysmgt
=
get_dev_entry_bit
(
devid
,
DEV_ENTRY_SYSMGT1
)
|
(
get_dev_entry_bit
(
devid
,
DEV_ENTRY_SYSMGT2
)
<<
1
);
if
(
sysmgt
==
0x01
)
set_dev_entry_bit
(
devid
,
DEV_ENTRY_IW
);
}
/* Writes the specific IOMMU for a device into the rlookup table */
/* Writes the specific IOMMU for a device into the rlookup table */
static
void
__init
set_iommu_for_device
(
struct
amd_iommu
*
iommu
,
u16
devid
)
static
void
__init
set_iommu_for_device
(
struct
amd_iommu
*
iommu
,
u16
devid
)
{
{
...
@@ -547,6 +567,8 @@ static void __init set_dev_entry_from_acpi(struct amd_iommu *iommu,
...
@@ -547,6 +567,8 @@ static void __init set_dev_entry_from_acpi(struct amd_iommu *iommu,
if
(
flags
&
ACPI_DEVFLAG_LINT1
)
if
(
flags
&
ACPI_DEVFLAG_LINT1
)
set_dev_entry_bit
(
devid
,
DEV_ENTRY_LINT1_PASS
);
set_dev_entry_bit
(
devid
,
DEV_ENTRY_LINT1_PASS
);
amd_iommu_apply_erratum_63
(
devid
);
set_iommu_for_device
(
iommu
,
devid
);
set_iommu_for_device
(
iommu
,
devid
);
}
}
...
...
lib/dma-debug.c
View file @
342688f9
...
@@ -819,9 +819,11 @@ static void check_unmap(struct dma_debug_entry *ref)
...
@@ -819,9 +819,11 @@ static void check_unmap(struct dma_debug_entry *ref)
err_printk
(
ref
->
dev
,
entry
,
"DMA-API: device driver frees "
err_printk
(
ref
->
dev
,
entry
,
"DMA-API: device driver frees "
"DMA memory with different CPU address "
"DMA memory with different CPU address "
"[device address=0x%016llx] [size=%llu bytes] "
"[device address=0x%016llx] [size=%llu bytes] "
"[cpu alloc address=%p] [cpu free address=%p]"
,
"[cpu alloc address=0x%016llx] "
"[cpu free address=0x%016llx]"
,
ref
->
dev_addr
,
ref
->
size
,
ref
->
dev_addr
,
ref
->
size
,
(
void
*
)
entry
->
paddr
,
(
void
*
)
ref
->
paddr
);
(
unsigned
long
long
)
entry
->
paddr
,
(
unsigned
long
long
)
ref
->
paddr
);
}
}
if
(
ref
->
sg_call_ents
&&
ref
->
type
==
dma_debug_sg
&&
if
(
ref
->
sg_call_ents
&&
ref
->
type
==
dma_debug_sg
&&
...
...
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