mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: do not abort probe if secure page alloc fails
Do not abort GPU probe if secure page alloc fails. We can just note that this allocation failed (using bool secure_alloc_ready) and prevent further secure memory allocation if this flag is not set. Bug 1525465 Change-Id: Ie4eb6393951690174013d2de3db507876d7b657f Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/427730 GVS: Gerrit_Virtual_Submit Reviewed-by: Shridhar Rasal <srasal@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
committed by
Dan Willemsen
parent
2680d6be57
commit
7ed71374e9
@@ -1351,6 +1351,9 @@ int gk20a_secure_page_alloc(struct platform_device *pdev)
|
||||
tegra_periph_reset_deassert(platform->clk[0]);
|
||||
}
|
||||
|
||||
if (!err)
|
||||
platform->secure_alloc_ready = true;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -1453,10 +1456,9 @@ static int gk20a_probe(struct platform_device *dev)
|
||||
}
|
||||
|
||||
err = gk20a_secure_page_alloc(dev);
|
||||
if (err) {
|
||||
dev_err(&dev->dev, "failed to allocate secure buffer\n");
|
||||
return err;
|
||||
}
|
||||
if (err)
|
||||
dev_err(&dev->dev,
|
||||
"failed to allocate secure buffer %d\n", err);
|
||||
|
||||
gk20a_debug_init(dev);
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@ struct gk20a_platform {
|
||||
*/
|
||||
int (*secure_page_alloc)(struct platform_device *dev);
|
||||
struct secure_page_buffer secure_buffer;
|
||||
bool secure_alloc_ready;
|
||||
|
||||
/* Device is going to be suspended */
|
||||
int (*suspend)(struct device *);
|
||||
|
||||
@@ -135,6 +135,7 @@ static int gk20a_tegra_secure_alloc(struct platform_device *pdev,
|
||||
struct gr_ctx_buffer_desc *desc,
|
||||
size_t size)
|
||||
{
|
||||
struct gk20a_platform *platform = platform_get_drvdata(pdev);
|
||||
struct device *dev = &pdev->dev;
|
||||
DEFINE_DMA_ATTRS(attrs);
|
||||
dma_addr_t iova;
|
||||
@@ -142,6 +143,9 @@ static int gk20a_tegra_secure_alloc(struct platform_device *pdev,
|
||||
struct page *page;
|
||||
int err = 0;
|
||||
|
||||
if (!platform->secure_alloc_ready)
|
||||
return -EINVAL;
|
||||
|
||||
(void)dma_alloc_attrs(&tegra_vpr_dev, size, &iova,
|
||||
DMA_MEMORY_NOMAP, &attrs);
|
||||
if (dma_mapping_error(&tegra_vpr_dev, iova))
|
||||
|
||||
Reference in New Issue
Block a user