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

Commit f4d6cb97 authored by Shrenuj Bansal's avatar Shrenuj Bansal
Browse files

msm: kgsl: Dont crash the device if the zap shader is not found



If there are problems loading the zap shader or if the zap ucode
is not found in the build system, do not crash the device.
Instead, just propagate the error up the stack.

Change-Id: I2f9d821dbe3dbfb8708cb41e630876cce7571696
Signed-off-by: default avatarShrenuj Bansal <shrenujb@codeaurora.org>
parent 583980be
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2074,7 +2074,7 @@ static int a5xx_microcode_load(struct adreno_device *adreno_dev,
		ret = scm_call2(SCM_SIP_FNID(SCM_SVC_BOOT, 0xA), &desc);
		if (ret) {
			pr_err("SCM resume call failed with error %d\n", ret);
			BUG();
			return ret;
		}

	}
@@ -2083,8 +2083,9 @@ static int a5xx_microcode_load(struct adreno_device *adreno_dev,
	if (adreno_dev->gpucore->zap_name && !zap_ucode_loaded) {
		ptr = subsystem_get(adreno_dev->gpucore->zap_name);

		/* Crash the device if the zap shader cannot be loaded */
		BUG_ON(IS_ERR_OR_NULL(ptr));
		/* Return error if the zap shader cannot be loaded */
		if (IS_ERR_OR_NULL(ptr))
			return (ptr == NULL) ? -ENODEV : PTR_ERR(ptr);

		zap_ucode_loaded = 1;
	}