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

Commit aec44a24 authored by Arjun Singh's avatar Arjun Singh Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: bgcom: prevent BG status checking while SPI is busy



Stops any transaction which try to resume BG while SPI is held
by TZ.

Change-Id: I45c5d4dcc9ab094f63742d7ca3f82b12a2fdae4a
Signed-off-by: default avatarArjun Singh <arsingh@codeaurora.org>
Signed-off-by: default avatarRamesh Yadav Javadi <javadi@codeaurora.org>
parent 7bcb1bb4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -749,11 +749,18 @@ static int is_bg_resume(void *handle)
	uint8_t rx_buf[8] = {0};
	uint32_t cmnd_reg = 0;

	if (spi_state == BGCOM_SPI_BUSY) {
		printk_ratelimited("SPI is held by TZ\n");
		goto ret_err;
	}

	txn_len = 0x08;
	tx_buf[0] = 0x05;
	ret = bgcom_transfer(handle, tx_buf, rx_buf, txn_len);
	if (!ret)
		memcpy(&cmnd_reg, rx_buf+BG_SPI_READ_LEN, 0x04);

ret_err:
	return cmnd_reg & BIT(31);
}