mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
swiotlb: Add is_swiotlb_active() function
This function will be used from dma_direct code to determine the maximum segment size of a dma mapping. Cc: [email protected] Reviewed-by: Konrad Rzeszutek Wilk <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
This commit is contained in:
parent
abe420bfae
commit
492366f7b4
2 changed files with 15 additions and 0 deletions
|
|
@ -667,3 +667,12 @@ size_t swiotlb_max_mapping_size(struct device *dev)
|
|||
{
|
||||
return ((size_t)1 << IO_TLB_SHIFT) * IO_TLB_SEGSIZE;
|
||||
}
|
||||
|
||||
bool is_swiotlb_active(void)
|
||||
{
|
||||
/*
|
||||
* When SWIOTLB is initialized, even if io_tlb_start points to physical
|
||||
* address zero, io_tlb_end surely doesn't.
|
||||
*/
|
||||
return io_tlb_end != 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue