mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
mhi: cntrl: qcom: disable boot logger after forced suspend
Prioritize handling of forced suspend/resume cycle at mission mode entry and disable boot logger channel after the cycle has completed to avoid race conditions. Change-Id: Iddc3d560fa687399434cc8ad51c08509ddfadf70 Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
This commit is contained in:
parent
96cd181257
commit
cf2a299dea
3 changed files with 22 additions and 11 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.*/
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.*/
|
||||
|
||||
#include <asm/dma-iommu.h>
|
||||
#include <linux/async.h>
|
||||
|
|
@ -310,7 +310,6 @@ static void mhi_boot_monitor(void *data, async_cookie_t cookie)
|
|||
struct mhi_controller *mhi_cntrl = data;
|
||||
struct mhi_dev *mhi_dev = mhi_controller_get_devdata(mhi_cntrl);
|
||||
struct arch_info *arch_info = mhi_dev->arch_info;
|
||||
struct mhi_device *boot_dev;
|
||||
/* 15 sec timeout for booting device */
|
||||
const u32 timeout = msecs_to_jiffies(15000);
|
||||
|
||||
|
|
@ -323,15 +322,10 @@ static void mhi_boot_monitor(void *data, async_cookie_t cookie)
|
|||
ipc_log_string(arch_info->boot_ipc_log, HLOG "Device current ee = %s\n",
|
||||
TO_MHI_EXEC_STR(mhi_cntrl->ee));
|
||||
|
||||
/* if we successfully booted to amss disable boot log channel */
|
||||
if (mhi_cntrl->ee == MHI_EE_AMSS) {
|
||||
boot_dev = arch_info->boot_dev;
|
||||
if (boot_dev)
|
||||
mhi_unprepare_from_transfer(boot_dev);
|
||||
|
||||
/* if we successfully booted to amss, enable runtime pm */
|
||||
if (mhi_cntrl->ee == MHI_EE_AMSS)
|
||||
if (!mhi_dev->drv_supported || arch_info->drv_connected)
|
||||
pm_runtime_allow(&mhi_dev->pci_dev->dev);
|
||||
}
|
||||
}
|
||||
|
||||
int mhi_arch_power_up(struct mhi_controller *mhi_cntrl)
|
||||
|
|
@ -346,6 +340,17 @@ int mhi_arch_power_up(struct mhi_controller *mhi_cntrl)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void mhi_arch_mission_mode_enter(struct mhi_controller *mhi_cntrl)
|
||||
{
|
||||
struct mhi_dev *mhi_dev = mhi_controller_get_devdata(mhi_cntrl);
|
||||
struct arch_info *arch_info = mhi_dev->arch_info;
|
||||
struct mhi_device *boot_dev = arch_info->boot_dev;
|
||||
|
||||
/* disable boot logger channel */
|
||||
if (boot_dev)
|
||||
mhi_unprepare_from_transfer(boot_dev);
|
||||
}
|
||||
|
||||
static int mhi_arch_pcie_scale_bw(struct mhi_controller *mhi_cntrl,
|
||||
struct pci_dev *pci_dev,
|
||||
struct mhi_link_info *link_info)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.*/
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.*/
|
||||
|
||||
#include <asm/arch_timer.h>
|
||||
#include <linux/debugfs.h>
|
||||
|
|
@ -636,6 +636,7 @@ static void mhi_status_cb(struct mhi_controller *mhi_cntrl,
|
|||
if (!ret)
|
||||
mhi_runtime_resume(dev);
|
||||
pm_runtime_put(dev);
|
||||
mhi_arch_mission_mode_enter(mhi_cntrl);
|
||||
break;
|
||||
default:
|
||||
MHI_ERR("Unhandled cb:0x%x\n", reason);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.*/
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.*/
|
||||
|
||||
#ifndef _MHI_QCOM_
|
||||
#define _MHI_QCOM_
|
||||
|
|
@ -68,6 +68,7 @@ int mhi_pci_probe(struct pci_dev *pci_dev,
|
|||
|
||||
#ifdef CONFIG_ARCH_QCOM
|
||||
|
||||
void mhi_arch_mission_mode_enter(struct mhi_controller *mhi_cntrl);
|
||||
int mhi_arch_power_up(struct mhi_controller *mhi_cntrl);
|
||||
int mhi_arch_pcie_init(struct mhi_controller *mhi_cntrl);
|
||||
void mhi_arch_pcie_deinit(struct mhi_controller *mhi_cntrl);
|
||||
|
|
@ -100,6 +101,10 @@ static inline int mhi_arch_power_up(struct mhi_controller *mhi_cntrl)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline void mhi_arch_mission_mode_enter(struct mhi_controller *mhi_cntrl)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _MHI_QCOM_ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue