mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
Merge "mhi: cntrl: qcom: remove boot monitor thread to use status cb"
This commit is contained in:
commit
9bc4396584
3 changed files with 7 additions and 52 deletions
|
|
@ -28,7 +28,6 @@ struct arch_info {
|
|||
u32 icc_peak_bw_len;
|
||||
struct msm_pcie_register_event pcie_reg_event;
|
||||
struct pci_saved_state *pcie_state;
|
||||
async_cookie_t cookie;
|
||||
void *boot_ipc_log;
|
||||
void *tsync_ipc_log;
|
||||
struct mhi_device *boot_dev;
|
||||
|
|
@ -172,7 +171,7 @@ static int mhi_arch_esoc_ops_power_on(void *priv, unsigned int flags)
|
|||
return 0;
|
||||
}
|
||||
|
||||
MHI_LOG("Enter\n");
|
||||
MHI_LOG("Enter: mdm_crashed:%d\n", flags & ESOC_HOOK_MDM_CRASH);
|
||||
|
||||
/* reset rpm state */
|
||||
pm_runtime_set_active(&pci_dev->dev);
|
||||
|
|
@ -193,7 +192,6 @@ static int mhi_arch_esoc_ops_power_on(void *priv, unsigned int flags)
|
|||
return ret;
|
||||
}
|
||||
|
||||
mhi_dev->mdm_state = (flags & ESOC_HOOK_MDM_CRASH);
|
||||
return mhi_pci_probe(pci_dev, NULL);
|
||||
}
|
||||
|
||||
|
|
@ -254,9 +252,6 @@ static void mhi_arch_esoc_ops_power_off(void *priv, unsigned int flags)
|
|||
mhi_deinit_pci_dev(mhi_cntrl);
|
||||
mhi_arch_link_off(mhi_cntrl);
|
||||
|
||||
/* wait for boot monitor to exit */
|
||||
async_synchronize_cookie(arch_info->cookie + 1);
|
||||
|
||||
mhi_arch_pcie_deinit(mhi_cntrl);
|
||||
mhi_cntrl->dev = NULL;
|
||||
|
||||
|
|
@ -315,50 +310,21 @@ static void mhi_bl_remove(struct mhi_device *mhi_device)
|
|||
HLOG "Received Remove notif.\n");
|
||||
}
|
||||
|
||||
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;
|
||||
/* 15 sec timeout for booting device */
|
||||
const u32 timeout = msecs_to_jiffies(15000);
|
||||
|
||||
/* wait for device to enter boot stage */
|
||||
wait_event_timeout(mhi_cntrl->state_event, mhi_cntrl->ee == MHI_EE_AMSS
|
||||
|| mhi_cntrl->ee == MHI_EE_DISABLE_TRANSITION
|
||||
|| mhi_cntrl->power_down,
|
||||
timeout);
|
||||
|
||||
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, 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)
|
||||
{
|
||||
struct mhi_dev *mhi_dev = mhi_controller_get_devdata(mhi_cntrl);
|
||||
struct arch_info *arch_info = mhi_dev->arch_info;
|
||||
|
||||
/* start a boot monitor if not in crashed state */
|
||||
if (!mhi_dev->mdm_state)
|
||||
arch_info->cookie = async_schedule(mhi_boot_monitor, 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;
|
||||
|
||||
ipc_log_string(arch_info->boot_ipc_log,
|
||||
HLOG "Device entered mission mode\n");
|
||||
|
||||
/* disable boot logger channel */
|
||||
if (boot_dev)
|
||||
mhi_unprepare_from_transfer(boot_dev);
|
||||
|
||||
if (!mhi_dev->drv_supported || arch_info->drv_connected)
|
||||
pm_runtime_allow(&mhi_dev->pci_dev->dev);
|
||||
}
|
||||
|
||||
static int mhi_arch_pcie_scale_bw(struct mhi_controller *mhi_cntrl,
|
||||
|
|
|
|||
|
|
@ -496,10 +496,6 @@ static int mhi_qcom_power_up(struct mhi_controller *mhi_cntrl)
|
|||
mhi_cntrl->ee = 0;
|
||||
mhi_cntrl->power_down = false;
|
||||
|
||||
ret = mhi_arch_power_up(mhi_cntrl);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = mhi_async_power_up(mhi_cntrl);
|
||||
|
||||
/* Update modem serial Info */
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ struct mhi_dev {
|
|||
int resn;
|
||||
void *arch_info;
|
||||
bool powered_on;
|
||||
bool mdm_state;
|
||||
dma_addr_t iova_start;
|
||||
dma_addr_t iova_stop;
|
||||
enum mhi_suspend_mode suspend_mode;
|
||||
|
|
@ -67,7 +66,6 @@ int mhi_pci_probe(struct pci_dev *pci_dev,
|
|||
int mhi_arch_link_lpm_disable(struct mhi_controller *mhi_cntrl);
|
||||
int mhi_arch_link_lpm_enable(struct mhi_controller *mhi_cntrl);
|
||||
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);
|
||||
int mhi_arch_link_suspend(struct mhi_controller *mhi_cntrl);
|
||||
|
|
@ -94,11 +92,6 @@ static inline int mhi_arch_link_resume(struct mhi_controller *mhi_cntrl)
|
|||
return 0;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue