msm: kgsl: Add a flag to context struct for bad timestamp waits

If the userspace calls the waittimestamp ioctl with an invalid
timestamp for a context then set a flag indicating that the ioctl
was called with an invalid ts. If the flag is set then do not
print error message about this ioctl being called with an invalid
timestamp. This is required to prevent the kernel log from
spamming with error messages and causing a watchdog.

CRs-fixed: 374586

Change-Id: Iffa5c13d74ed90b78f88aba5c4c0e0f908eeaa19
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
This commit is contained in:
Rajeev Kulkarni
2012-12-14 14:47:55 -08:00
committed by Stephen Boyd
parent 64c28c80d2
commit d31dc032df
2 changed files with 29 additions and 7 deletions

View File

@@ -1440,6 +1440,11 @@ _adreno_recover_hang(struct kgsl_device *device,
} else {
adreno_context = context->devctxt;
adreno_context->flags |= CTXT_FLAGS_GPU_HANG;
/*
* set the invalid ts flag to 0 for this context since we have
* detected a hang for it
*/
context->wait_on_invalid_ts = false;
}
/* Extract valid contents from rb which can still be executed after
@@ -2306,14 +2311,24 @@ static int adreno_waittimestamp(struct kgsl_device *device,
*/
if (timestamp_cmp(timestamp, ts_issued) > 0) {
if (!(adreno_ctx->flags & CTXT_FLAGS_USER_GENERATED_TS)) {
KGSL_DRV_ERR(device,
if (context && !context->wait_on_invalid_ts) {
KGSL_DRV_ERR(device,
"Cannot wait for invalid ts <%d:0x%x>, "
"last issued ts <%d:0x%x>\n",
context_id, timestamp, context_id, ts_issued);
/*
* Prevent the above message from spamming the
* kernel logs and causing a watchdog
*/
context->wait_on_invalid_ts = true;
}
status = -EINVAL;
goto done;
} else
retry_ts_cmp = 1;
} else if (context && context->wait_on_invalid_ts) {
/* Once we wait for a valid ts reset the invalid wait flag */
context->wait_on_invalid_ts = false;
}
/*
@@ -2389,13 +2404,19 @@ static int adreno_waittimestamp(struct kgsl_device *device,
ts_issued =
adreno_dev->ringbuffer.timestamp[context_id];
if (timestamp_cmp(timestamp, ts_issued) > 0) {
KGSL_DRV_ERR(device,
"Cannot wait for user-generated ts <%d:0x%x>, "
"not submitted within server timeout period. "
"last issued ts <%d:0x%x>\n",
context_id, timestamp, context_id, ts_issued);
if (context && !context->wait_on_invalid_ts) {
KGSL_DRV_ERR(device,
"Cannot wait for user-generated ts <%d:0x%x>, "
"not submitted within server timeout period. "
"last issued ts <%d:0x%x>\n",
context_id, timestamp, context_id,
ts_issued);
context->wait_on_invalid_ts = true;
}
status = -EINVAL;
goto done;
} else if (context && context->wait_on_invalid_ts) {
context->wait_on_invalid_ts = false;
}
retry_ts_cmp = 0;
}

View File

@@ -240,7 +240,8 @@ struct kgsl_context {
* context was responsible for causing it
*/
unsigned int reset_status;
/* Flag indicating if we tried to wait for bad timestamp for this ctx */
bool wait_on_invalid_ts;
/*
* Timeline used to create fences that can be signaled when a
* sync_pt timestamp expires.