msm: kgsl: Debugfs knob to configure wait timeout of adreno device

There are times when the adreno device is heavily loaded. Here, a
predetermined wait timeout value will not be useful. The configurability
introduced with this change will help in understanding the behaviour and
to tune the value. Will also be helpful in quickly identifying problems
that arise when the irqs don't fire.

Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
diff --git a/drivers/gpu/msm/z180.c b/drivers/gpu/msm/z180.c
index 37ba621..a81eeaa 100644
--- a/drivers/gpu/msm/z180.c
+++ b/drivers/gpu/msm/z180.c
@@ -806,6 +806,11 @@
 				unsigned int msecs)
 {
 	int status = -EINVAL;
+
+	/* Don't wait forever, set a max (10 sec) value for now */
+	if (msecs == -1)
+		msecs = 10 * MSEC_PER_SEC;
+
 	mutex_unlock(&device->mutex);
 	status = z180_wait(device, timestamp, msecs);
 	mutex_lock(&device->mutex);