diff options
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 0cc29026..fd7fdee1 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -1275,8 +1275,6 @@ static int gk20a_pm_init(struct platform_device *dev) | |||
1275 | 1275 | ||
1276 | gk20a_dbg_fn(""); | 1276 | gk20a_dbg_fn(""); |
1277 | 1277 | ||
1278 | mutex_init(&platform->railgate_lock); | ||
1279 | |||
1280 | /* Initialise pm runtime */ | 1278 | /* Initialise pm runtime */ |
1281 | if (platform->clockgate_delay) { | 1279 | if (platform->clockgate_delay) { |
1282 | pm_runtime_set_autosuspend_delay(&dev->dev, | 1280 | pm_runtime_set_autosuspend_delay(&dev->dev, |
@@ -1299,10 +1297,6 @@ static int gk20a_pm_init(struct platform_device *dev) | |||
1299 | if (IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS)) | 1297 | if (IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS)) |
1300 | err = gk20a_pm_initialise_domain(dev); | 1298 | err = gk20a_pm_initialise_domain(dev); |
1301 | 1299 | ||
1302 | platform->reset_control = devm_reset_control_get(&dev->dev, NULL); | ||
1303 | if (IS_ERR(platform->reset_control)) | ||
1304 | platform->reset_control = NULL; | ||
1305 | |||
1306 | return err; | 1300 | return err; |
1307 | } | 1301 | } |
1308 | 1302 | ||
@@ -1312,17 +1306,11 @@ static int gk20a_secure_page_alloc(struct platform_device *pdev) | |||
1312 | int err = 0; | 1306 | int err = 0; |
1313 | 1307 | ||
1314 | if (platform->secure_page_alloc) { | 1308 | if (platform->secure_page_alloc) { |
1315 | if (platform->num_clks > 0) | ||
1316 | tegra_periph_reset_assert(platform->clk[0]); | ||
1317 | udelay(10); | ||
1318 | err = platform->secure_page_alloc(pdev); | 1309 | err = platform->secure_page_alloc(pdev); |
1319 | if (platform->num_clks > 0) | 1310 | if (!err) |
1320 | tegra_periph_reset_deassert(platform->clk[0]); | 1311 | platform->secure_alloc_ready = true; |
1321 | } | 1312 | } |
1322 | 1313 | ||
1323 | if (!err) | ||
1324 | platform->secure_alloc_ready = true; | ||
1325 | |||
1326 | return err; | 1314 | return err; |
1327 | } | 1315 | } |
1328 | 1316 | ||
@@ -1413,9 +1401,14 @@ static int gk20a_probe(struct platform_device *dev) | |||
1413 | gk20a_init_support(dev); | 1401 | gk20a_init_support(dev); |
1414 | 1402 | ||
1415 | init_rwsem(&gk20a->busy_lock); | 1403 | init_rwsem(&gk20a->busy_lock); |
1404 | mutex_init(&platform->railgate_lock); | ||
1416 | 1405 | ||
1417 | spin_lock_init(&gk20a->mc_enable_lock); | 1406 | spin_lock_init(&gk20a->mc_enable_lock); |
1418 | 1407 | ||
1408 | platform->reset_control = devm_reset_control_get(&dev->dev, NULL); | ||
1409 | if (IS_ERR(platform->reset_control)) | ||
1410 | platform->reset_control = NULL; | ||
1411 | |||
1419 | gk20a_debug_init(dev); | 1412 | gk20a_debug_init(dev); |
1420 | 1413 | ||
1421 | /* Initialize the platform interface. */ | 1414 | /* Initialize the platform interface. */ |
@@ -1425,6 +1418,11 @@ static int gk20a_probe(struct platform_device *dev) | |||
1425 | return err; | 1418 | return err; |
1426 | } | 1419 | } |
1427 | 1420 | ||
1421 | err = gk20a_secure_page_alloc(dev); | ||
1422 | if (err) | ||
1423 | dev_err(&dev->dev, | ||
1424 | "failed to allocate secure buffer %d\n", err); | ||
1425 | |||
1428 | err = gk20a_pm_init(dev); | 1426 | err = gk20a_pm_init(dev); |
1429 | if (err) { | 1427 | if (err) { |
1430 | dev_err(&dev->dev, "pm init failed"); | 1428 | dev_err(&dev->dev, "pm init failed"); |
@@ -1445,11 +1443,6 @@ static int gk20a_probe(struct platform_device *dev) | |||
1445 | } | 1443 | } |
1446 | } | 1444 | } |
1447 | 1445 | ||
1448 | err = gk20a_secure_page_alloc(dev); | ||
1449 | if (err) | ||
1450 | dev_err(&dev->dev, | ||
1451 | "failed to allocate secure buffer %d\n", err); | ||
1452 | |||
1453 | /* Set DMA parameters to allow larger sgt lists */ | 1446 | /* Set DMA parameters to allow larger sgt lists */ |
1454 | dev->dev.dma_parms = &gk20a->dma_parms; | 1447 | dev->dev.dma_parms = &gk20a->dma_parms; |
1455 | dma_set_max_seg_size(&dev->dev, UINT_MAX); | 1448 | dma_set_max_seg_size(&dev->dev, UINT_MAX); |