swiotlb: Convert swiotlb_force from int to enum
Convert the flag swiotlb_force from an int to an enum, to prepare for the advent of more possible values. Suggested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:

committed by
Konrad Rzeszutek Wilk

parent
6c206e4d99
commit
ae7871be18
@@ -524,7 +524,8 @@ EXPORT_SYMBOL(dummy_dma_ops);
|
||||
|
||||
static int __init arm64_dma_init(void)
|
||||
{
|
||||
if (swiotlb_force || max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT))
|
||||
if (swiotlb_force == SWIOTLB_FORCE ||
|
||||
max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT))
|
||||
swiotlb = 1;
|
||||
|
||||
return atomic_pool_init();
|
||||
|
@@ -401,7 +401,8 @@ static void __init free_unused_memmap(void)
|
||||
*/
|
||||
void __init mem_init(void)
|
||||
{
|
||||
if (swiotlb_force || max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT))
|
||||
if (swiotlb_force == SWIOTLB_FORCE ||
|
||||
max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT))
|
||||
swiotlb_init(1);
|
||||
|
||||
set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
|
||||
|
@@ -68,7 +68,7 @@ static struct dma_map_ops swiotlb_dma_ops = {
|
||||
*/
|
||||
int __init pci_swiotlb_detect_override(void)
|
||||
{
|
||||
if (swiotlb_force)
|
||||
if (swiotlb_force == SWIOTLB_FORCE)
|
||||
swiotlb = 1;
|
||||
|
||||
return swiotlb;
|
||||
|
@@ -48,7 +48,7 @@ int __init pci_xen_swiotlb_detect(void)
|
||||
* activate this IOMMU. If running as PV privileged, activate it
|
||||
* irregardless.
|
||||
*/
|
||||
if ((xen_initial_domain() || swiotlb || swiotlb_force))
|
||||
if (xen_initial_domain() || swiotlb || swiotlb_force == SWIOTLB_FORCE)
|
||||
xen_swiotlb = 1;
|
||||
|
||||
/* If we are running under Xen, we MUST disable the native SWIOTLB.
|
||||
|
Reference in New Issue
Block a user