From 4d2993762bd8738d55b57567656132259cb97c5b Mon Sep 17 00:00:00 2001 From: Cho KyongHo Date: Wed, 7 Feb 2018 01:26:32 +0900 Subject: [PATCH] android: ion-test: set correct dma configurations ion-test does not need swiotlb buffer because it temporarily creates writecombine mappings for test. Therefore it should have full dma mask. Moreover, without correct dma_ops, dma_buf_map_attachment() always fails. Let's configure dma_ops with arch_setup_dma_ops(). Change-Id: Iccdd0f7f593af42d7e708877723aae273bd4acf1 Signed-off-by: Cho KyongHo --- drivers/staging/android/ion/ion_test.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/ion/ion_test.c b/drivers/staging/android/ion/ion_test.c index b1b60ce90600..14201300dbd0 100644 --- a/drivers/staging/android/ion/ion_test.c +++ b/drivers/staging/android/ion/ion_test.c @@ -434,11 +434,23 @@ static struct platform_driver ion_test_platform_driver = { static int __init ion_test_init(void) { - ion_test_pdev = platform_device_register_simple("ion-test", - -1, NULL, 0); + struct platform_device_info pdevinfo = { + .parent = NULL, + .name = "ion-test", + .id = -1, + .res = NULL, + .num_res = 0, + .data = NULL, + .size_data = 0, + .dma_mask = DMA_BIT_MASK(36), + }; + + ion_test_pdev = platform_device_register_full(&pdevinfo); if (IS_ERR(ion_test_pdev)) return PTR_ERR(ion_test_pdev); + arch_setup_dma_ops(&ion_test_pdev->dev, 0, 0x100000000ULL, NULL, false); + return platform_driver_probe(&ion_test_platform_driver, ion_test_probe); } -- 2.20.1