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

Commit 4493222e authored by Hemant Kumar's avatar Hemant Kumar
Browse files

mhi: controller: Enable L1 when mhi is not active



offload worker checks if mhi is active before doing the reg
write. If mhi is not active it returns without enabling L1.
This causes prevent_l1 counter to go out of sync. Fix this
by enabling L1 before returning from offload worker function.

Change-Id: I8a356acca3d8b8a7b4ff4d95e7378a056a2b06cf
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 91aa9b06
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -76,12 +76,15 @@ void mhi_reg_write_work(struct work_struct *w)
	if (!info->valid)
		return;

	if (mhi_is_active(mhi_cntrl->mhi_dev) && msm_pcie_prevent_l1(pci_dev))
	if (!mhi_is_active(mhi_cntrl->mhi_dev))
		return;

	if (msm_pcie_prevent_l1(pci_dev))
		return;

	while (info->valid) {
		if (!mhi_is_active(mhi_cntrl->mhi_dev))
			return;
			break;

		writel_relaxed(info->val, info->reg_addr);
		info->valid = false;