From 44587840e2bcba004f5672c899cf42e51c79375f Mon Sep 17 00:00:00 2001 From: Divya Date: Tue, 20 Sep 2022 12:47:32 +0000 Subject: [PATCH] gpu: nvgpu: Update the error code for tpc_pg_mask - nvpmodel service used to expect a return value of -ENODEV from the underlying tpc_pg_mask_store() when the golden image size was initialized. - With the current implementation, the return value is -EINVAL due to which write for new tpc_pg_mask was not successful. - Update the return value to -EBUSY for the case where golden image is already initialized. Bug 3765637 Change-Id: I5a1a38cce035ea245db5d72c9f5db210d3bb95f1 Signed-off-by: Divya Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2778855 (cherry picked from commit 1274f25dda3718d23aeb68374bb5431e50606c73) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2780005 Reviewed-by: svcacv Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Vijayakumar Subbu Reviewed-by: Yi-Wei Wang GVS: Gerrit_Virtual_Submit Tested-by: Yi-Wei Wang --- drivers/gpu/nvgpu/os/linux/sysfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/os/linux/sysfs.c b/drivers/gpu/nvgpu/os/linux/sysfs.c index 80fea2d63..585523048 100644 --- a/drivers/gpu/nvgpu/os/linux/sysfs.c +++ b/drivers/gpu/nvgpu/os/linux/sysfs.c @@ -1120,7 +1120,11 @@ static ssize_t tpc_pg_mask_store(struct device *dev, != 0) { nvgpu_err(g, "golden image size already initialized"); nvgpu_mutex_release(&g->static_pg_lock); - return -EINVAL; + /* + * as golden context is already created, + * return busy error code + */ + return -EBUSY; } if (platform->set_tpc_pg_mask != NULL) {