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

Commit 06ef7b7b authored by Dan Bar-On's avatar Dan Bar-On Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: spss_utils: IAR fix CE after SSR - read cmacs from DDR on demand



After updating SPU images, if SSR occurred SPU would recalculate
the images cmacs and write them to DDR.
HLOS read those cmacs too early before SPU finished the calculation,
causing a CE.
The fix - when userspace asks for the calculated cmacs,
read them directly from DDR, instead of returning
cmacs that were already saved.

Change-Id: I0010a94eace107301652f20fbc62bbd66eda9ec3
Signed-off-by: default avatarDan Bar-On <dbaron@codeaurora.org>
parent 3918cbe1
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -270,6 +270,9 @@ static ssize_t pbl_cmac_show(struct device *dev,
		return -EINVAL;
	}

	/* first make sure the pbl cmac is updated */
	spss_get_pbl_and_apps_calc_cmac();

	ret = snprintf(buf, PAGE_SIZE, "0x%08x,0x%08x,0x%08x,0x%08x\n",
	    pbl_cmac_buf[0], pbl_cmac_buf[1], pbl_cmac_buf[2], pbl_cmac_buf[3]);

@@ -286,6 +289,9 @@ static ssize_t apps_cmac_show(struct device *dev,
		return -EINVAL;
	}

	/* first make sure the pbl cmac is updated */
	spss_get_pbl_and_apps_calc_cmac();

	memcpy(buf, calc_apps_cmac, sizeof(calc_apps_cmac));

	return sizeof(calc_apps_cmac);
@@ -430,7 +436,6 @@ static long spss_utils_ioctl(struct file *file,
		pr_debug("read pbl cmac from shared memory\n");
		spss_set_fw_cmac(cmac_buf, sizeof(cmac_buf));
		spss_set_saved_uefi_apps_cmac();
		spss_get_pbl_and_apps_calc_cmac();
		spss_get_saved_uefi_apps_cmac();
		break;

@@ -924,7 +929,6 @@ static int spss_utils_iar_callback(struct notifier_block *nb,
		break;
	case SUBSYS_AFTER_POWERUP:
		pr_debug("[SUBSYS_AFTER_POWERUP] event.\n");
		spss_get_pbl_and_apps_calc_cmac();
		break;
	case SUBSYS_BEFORE_AUTH_AND_RESET:
		pr_debug("[SUBSYS_BEFORE_AUTH_AND_RESET] event.\n");