diff --git a/drivers/gpu/nvgpu/common/pmu/ipc/pmu_cmd.c b/drivers/gpu/nvgpu/common/pmu/ipc/pmu_cmd.c index 9dcca8632..631be35c2 100644 --- a/drivers/gpu/nvgpu/common/pmu/ipc/pmu_cmd.c +++ b/drivers/gpu/nvgpu/common/pmu/ipc/pmu_cmd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-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"), @@ -723,8 +723,13 @@ int nvgpu_pmu_rpc_execute(struct nvgpu_pmu *pmu, struct nv_pmu_rpc_header *rpc, */ if (is_copy_back) { /* wait till RPC execute in PMU & ACK */ - pmu_wait_message_cond(pmu, nvgpu_get_poll_timeout(g), - &rpc_payload->complete, 1); + if (nvgpu_pmu_wait_fw_ack_status(g, pmu, + nvgpu_get_poll_timeout(g), + &rpc_payload->complete, 1U) != 0) { + nvgpu_err(g, "PMU wait timeout expired."); + status = -ETIMEDOUT; + goto cleanup; + } /* copy back data to caller */ nvgpu_memcpy((u8 *)rpc, (u8 *)rpc_buff, size_rpc); /* free allocated memory */ diff --git a/drivers/gpu/nvgpu/common/pmu/perf/change_seq.c b/drivers/gpu/nvgpu/common/pmu/perf/change_seq.c index f5b561bdb..a4fb2834d 100644 --- a/drivers/gpu/nvgpu/common/pmu/perf/change_seq.c +++ b/drivers/gpu/nvgpu/common/pmu/perf/change_seq.c @@ -332,9 +332,13 @@ int nvgpu_pmu_perf_changeseq_set_clks(struct gk20a *g, /* Wait for sync change to complete. */ if ((rpc.change.flags & CTRL_PERF_CHANGE_SEQ_CHANGE_ASYNC) == 0U) { - pmu_wait_message_cond(g->pmu, - nvgpu_get_poll_timeout(g), - &change_seq_pmu->change_state, 1U); + /* wait till RPC execute in PMU & ACK */ + if (nvgpu_pmu_wait_fw_ack_status(g, pmu, + nvgpu_get_poll_timeout(g), + &change_seq_pmu->change_state, 1U) != 0) { + nvgpu_err(g, "PMU wait timeout expired."); + status = -ETIMEDOUT; + } } change_seq_pmu->stop_time = nvgpu_current_time_us(); return status;