Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47297943 authored by Prabhat Awasthi's avatar Prabhat Awasthi
Browse files

msm: kgsl: Add ratelimit check to limit excessive kernel logging



In a3xx_err_callback(), ratelimit check is needed to limit error interrupt
reporting messages. This will prevent kernel logs causing watchdog timeout.

Change-Id: Id01f232fa5dd6b54e1ca9af8d6b7f37f34ed85b8
Signed-off-by: default avatarPrabhat Awasthi <pawasthi@codeaurora.org>
parent d81481d4
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -796,6 +796,8 @@ static void a3xx_err_callback(struct adreno_device *adreno_dev, int bit)
{
	struct kgsl_device *device = &adreno_dev->dev;
	const char *err = "";
	/* Limit to 10 messages every 5 seconds */
	static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 10);

	switch (bit) {
	case A3XX_INT_RBBM_ATB_BUS_OVERFLOW:
@@ -813,6 +815,12 @@ static void a3xx_err_callback(struct adreno_device *adreno_dev, int bit)
	default:
		return;
	}

	/*
	* Limit error interrupt reporting to prevent
	* kernel logs causing watchdog timeout
	*/
	if (__ratelimit(&ratelimit_state))
		KGSL_DRV_CRIT(device, "%s\n", err);
}