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

Commit 7922b617 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

power: fg-memif: Wait before polling MEM_GNT first time



Currently, MEM_GNT bit is polled immediately after requesting
DMA. Some times it is not set while polling for the first time
adding a wait time of 10 ms every SRAM transaction. Hardware
takes 5 cycles (25 us) of 200 KHz clock to respond to the
request. Add a delay of 40 us before polling MEM_GNT first time
to improve the latency seen with SRAM transactions.

CRs-Fixed: 2151239
Change-Id: Ic26f1380194c20544ed9fc9ea0459afa29d98b09
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 6847aa66
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -777,6 +777,12 @@ static int fg_direct_mem_request(struct fg_chip *chip, bool request)
	if (!request)
		return 0;

	/*
	 * HW takes 5 cycles (200 KHz clock) to grant access after requesting
	 * for DMA. Wait for 40 us before polling for MEM_GNT first time.
	 */
	usleep_range(40, 41);

	while (i < MEM_GNT_RETRIES) {
		rc = fg_read(chip, MEM_IF_INT_RT_STS(chip), &val, 1);
		if (rc < 0) {