From e8beb761bb5fbb2f3a062f5f643a09eae26f32bf Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 12 Feb 2024 15:20:30 +0000 Subject: [PATCH] nvdla: kmd: Return error on ICC failure Currently, the DLA driver does not return an error if the ICC write handle is not found and so it is possible that ICC failures will go undetected. By using dev_err_probe(), error messages are only printed if the error is not -EPROBE_DEFER. If an -EPROBE_DEFER error is returned from the ICC, then no error message is printed because probe is being deferred and we will try to probe the driver again later. This ensures that the DLA driver will wait for the ICC to be ready and if any other error occurs, then an error message will be displayed and the proper error code returned. Bug 4496044 Change-Id: I88632d7c6f7f1b83e0a69e4b132404a77fc090ec Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3084821 Reviewed-by: Johnny Liu Reviewed-by: Arvind M GVS: Gerrit_Virtual_Submit --- drivers/video/tegra/host/nvdla/nvdla.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/video/tegra/host/nvdla/nvdla.c b/drivers/video/tegra/host/nvdla/nvdla.c index 29a2ba42..711c42b4 100644 --- a/drivers/video/tegra/host/nvdla/nvdla.c +++ b/drivers/video/tegra/host/nvdla/nvdla.c @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2016-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. /* - * Copyright (c) 2016-2023, NVIDIA Corporation. All rights reserved. - * * NVDLA driver for T194/T23x */ @@ -1106,10 +1105,9 @@ static int nvdla_probe(struct platform_device *pdev) } nvdla_dev->icc_write = devm_of_icc_get(dev, "write"); - if (IS_ERR(nvdla_dev->icc_write)) { - dev_info(dev, "failed to get icc write handle\n"); - nvdla_dev->icc_write = NULL; - } + if (IS_ERR(nvdla_dev->icc_write)) + return dev_err_probe(&pdev->dev, PTR_ERR(nvdla_dev->icc_write), + "failed to get icc write handle\n"); nvdla_dev->dev = dev; nvdla_dev->pdev = pdev;