From 9a618aaef378921d2e664067568f279c23ee7636 Mon Sep 17 00:00:00 2001 From: Prateek sethi Date: Mon, 7 Dec 2020 10:14:41 +0530 Subject: [PATCH] nvgpu: update details of return types Patch updates the doxygen for APIs nvgpu_enable_irqs and nvgpu_init_soc_vars and adds describe the error codes which can be returned by these APIs. Jira NVGPU-6258 Change-Id: I002d25865eec6e3fa52250fd25880bf259358f1d Signed-off-by: Prateek sethi Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2455856 (cherry picked from commit 01c7f3398622047bdf3d46024c1b51223461cba7) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2460377 GVS: Gerrit_Virtual_Submit Reviewed-by: Rajesh Devaraj Reviewed-by: Vaibhav Kachore Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h | 15 +++++++++++++-- drivers/gpu/nvgpu/include/nvgpu/soc.h | 5 ++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h index a8d3d3a12..ef48c2a32 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -176,7 +176,18 @@ void nvgpu_start_gpu_idle(struct gk20a *g); * - set r->irq_requested to true once all the irqs are enabled successfully. * - In case of failure start cleanup in the reverse order of init. * - * @return 0 in case of success or error code for the respective failure. + * @return 0 in case of success, <0 in case of failure. + * @retval ENOMEM is returned if (1) Insufficient memory to initialize the + * condition variable attribute object attr, (2) All kernel synchronization + * objects are in use, or there wasn't enough memory to initialize the condvar. + * @retval EBUSY is returned if the cond argument pointer to a previously + * initialized condition variable that hasn't been destroyed. + * @retval EINVAL is returned if invalid value attr passed. + * @retval EFAULT is returned if (1) A fault occurred when the kernel tried to + * access cond or attr, (2) An error occurred trying to access the buffers or + * the start_routine provided. + * @retval EAGAIN is returned if insufficient system resources to create thread. + * @retval Other error codes if pthread_attr_destroy() fails. */ int nvgpu_enable_irqs(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/include/nvgpu/soc.h b/drivers/gpu/nvgpu/include/nvgpu/soc.h index 6b920b46b..7f1980b26 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/soc.h +++ b/drivers/gpu/nvgpu/include/nvgpu/soc.h @@ -111,7 +111,10 @@ bool nvgpu_is_soc_t194_a01(struct gk20a *g); * - Check if nvgpu_is_hypervisor_mode is enabled if yes then * - If module is not virtual then set nvgpu_hv_ipa_pa to desc->phys_addr. * - * @return Returns 0 on success or in case of failure, a suitable error code. + * @return 0 in case of success, <0 in case of call to NvHvGetOsVmId() gets fail. + * @retval ENODEV Get VM id fails to open device node. + * @retval EINVAL Invalid argument + * @retval EFAULT devctl call to nvhv device node returned failure */ int nvgpu_init_soc_vars(struct gk20a *g);