gpu: nvgpu: update device management framework to remove unusable engines

On certain platforms, not all copy engine instances are usable. The user
shouldn't submit any work to these engines. To enforce this, remove
these engines from active/host_engine list, this should ensure that these
engines do not get advertised to userspace. In order to accomplish this
introduce the following functions:
- nvgpu_engine_remove_one_dev: This function removes the specified device
  entry from following device lists: fifo->host_engines, fifo->active_engines,
  runlist->rl_dev_list, runlist->eng_bitmask.

Replace iteration over LCE device type entries using
nvgpu_device_for_each(g, dev, NVGPU_DEVTYPE_LCE), along with this introduce
macro nvgpu_device_for_each_safe.

Introduce gpu_dbg_ce flag for CE debugging.

Bug 3370462

Change-Id: I2e21f18363c6e53630d129da241c8fece106cd33
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2616711
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Antony Clince Alex
2021-10-26 10:09:20 +00:00
committed by mobile promotions
parent 79ee724b04
commit cce1d7ad84
7 changed files with 82 additions and 32 deletions

View File

@@ -410,4 +410,16 @@ u32 nvgpu_engine_mmu_fault_id_to_veid(struct gk20a *g, u32 mmu_fault_id,
*/
void nvgpu_engine_mmu_fault_id_to_eng_ve_pbdma_id(struct gk20a *g,
u32 mmu_fault_id, u32 *engine_id, u32 *veid, u32 *pbdma_id);
/**
* @brief Remove a device entry from engine list.
*
* @param g [in] The GPU driver struct.
* @param dev [in] A device.
*
* Remove the device entry \a dev from fifo->host_engines, fifo->active_engines.
* The device entry is retained in g->devs->devlist_heads list to ensure device
* reset.
*/
void nvgpu_engine_remove_one_dev(struct nvgpu_fifo *f,
const struct nvgpu_device *dev);
#endif /*NVGPU_ENGINE_H*/

View File

@@ -81,5 +81,6 @@ enum nvgpu_log_type {
#define gpu_dbg_mm BIT(41) /* Memory management debugging. */
#define gpu_dbg_hwpm BIT(42) /* GPU HWPM. */
#define gpu_dbg_verbose BIT(43) /* More verbose logs. */
#define gpu_dbg_ce BIT(44) /* Copy Engine debugging */
#endif