mhi: core: make timesync register access strict
Ensure timesync register access is only attempted if both pm
states allow it to prevent unclocked access leading to NOC
errors when any of the pm states is a false-positive.
CRs-Fixed: 2465813
Change-Id: I46eb2179ce406bef833cbeb7f1728871b54c4eaf
Acked-by: Bhaumik Vasav Bhatt <bbhatt@qti.qualcomm.com>
Signed-off-by: Tony Truong <truong@codeaurora.org>
diff --git a/drivers/bus/mhi/core/mhi_pm.c b/drivers/bus/mhi/core/mhi_pm.c
index 7ebd6b2..517645b 100644
--- a/drivers/bus/mhi/core/mhi_pm.c
+++ b/drivers/bus/mhi/core/mhi_pm.c
@@ -145,7 +145,7 @@ enum MHI_PM_STATE __must_check mhi_tryset_pm_state(
MHI_VERB("Transition to pm state from:%s to:%s\n",
to_mhi_pm_state_str(cur_state), to_mhi_pm_state_str(state));
- if (MHI_REG_ACCESS_VALID(cur_state) || MHI_REG_ACCESS_VALID(state))
+ if (MHI_REG_ACCESS_VALID(cur_state) && MHI_REG_ACCESS_VALID(state))
mhi_timesync_log(mhi_cntrl);
mhi_cntrl->pm_state = state;