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

Commit b1fe5d55 authored by Lokesh Batra's avatar Lokesh Batra
Browse files

msm: kgsl: Limit the frequency of logging on GPU pagefaults



Excissive logging due to several successive GPU pagefaults may
cause a watchdog bite. Hence, this change adds ratelimit to logging
on GPU pagefaults.

Change-Id: Idcdbe95d0f6715cddcc573847411a4a6fe134257
Signed-off-by: default avatarLokesh Batra <lbatra@codeaurora.org>
parent 331e7f8c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/qcom_iommu.h>
#endif
#include <linux/msm_kgsl.h>
#include <linux/ratelimit.h>
#include <soc/qcom/scm.h>
#include <soc/qcom/secure_buffer.h>
#include <stddef.h>
@@ -241,6 +242,10 @@ static int kgsl_iommu_fault_handler(struct iommu_domain *domain,
	struct kgsl_context *context;
	char *fault_type = "unknown";

	static DEFINE_RATELIMIT_STATE(_rs,
					DEFAULT_RATELIMIT_INTERVAL,
					DEFAULT_RATELIMIT_BURST);

	if (mmu == NULL || mmu->priv == NULL)
		return ret;

@@ -298,7 +303,7 @@ static int kgsl_iommu_fault_handler(struct iommu_domain *domain,
		&adreno_dev->ft_pf_policy))
		no_page_fault_log = kgsl_mmu_log_fault_addr(mmu, ptbase, addr);

	if (!no_page_fault_log) {
	if (!no_page_fault_log && __ratelimit(&_rs)) {
		KGSL_MEM_CRIT(ctx->kgsldev,
			"GPU PAGE FAULT: addr = %lX pid= %d\n", addr, ptname);
		KGSL_MEM_CRIT(ctx->kgsldev,