gpu: nvgpu: Check for ACK from PMU before timeout

At present in NVGPU for every get_status cmd we wait
for a response from PMU else timeout. In present code
we look for the ACK very early then after processing
the interrupts, this may result in timeout with valid
response from PMU. To avoid this timeout a check for
ACK is implemented before every timeout check.

NVBUG-200530426

Change-Id: I6f8df51ab73066953ef7c9c05c61aaf543e53b52
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2258899
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
rmylavarapu
2019-12-10 10:46:05 +05:30
committed by Alex Waterman
parent 29d4831780
commit ed33c465d5

View File

@@ -117,10 +117,6 @@ int nvgpu_pmu_wait_fw_ack_status(struct gk20a *g, struct nvgpu_pmu *pmu,
do {
nvgpu_rmb();
if (*(volatile u8 *)var == val) {
return 0;
}
if (nvgpu_can_busy(g) == 0) {
return 0;
}
@@ -131,6 +127,11 @@ int nvgpu_pmu_wait_fw_ack_status(struct gk20a *g, struct nvgpu_pmu *pmu,
nvgpu_usleep_range(delay, delay * 2U);
delay = min_t(u32, delay << 1, POLL_DELAY_MAX_US);
/* Confirm ACK from PMU before timeout check */
if (*(volatile u8 *)var == val) {
return 0;
}
} while (nvgpu_timeout_expired(&timeout) == 0);
return -ETIMEDOUT;