Loading drivers/bus/mhi/core/mhi_main.c +15 −3 Original line number Diff line number Diff line Loading @@ -1285,20 +1285,32 @@ irqreturn_t mhi_intvec_threaded_handlr(int irq_number, void *dev) struct mhi_controller *mhi_cntrl = dev; enum mhi_dev_state state = MHI_STATE_MAX; enum MHI_PM_STATE pm_state = 0; enum mhi_ee ee; MHI_VERB("Enter\n"); write_lock_irq(&mhi_cntrl->pm_lock); if (MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) if (MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) { state = mhi_get_mhi_state(mhi_cntrl); ee = mhi_get_exec_env(mhi_cntrl); } if (state == MHI_STATE_SYS_ERR) { MHI_ERR("MHI system error detected\n"); pm_state = mhi_tryset_pm_state(mhi_cntrl, MHI_PM_SYS_ERR_DETECT); } write_unlock_irq(&mhi_cntrl->pm_lock); if (pm_state == MHI_PM_SYS_ERR_DETECT) if (pm_state == MHI_PM_SYS_ERR_DETECT) { wake_up_all(&mhi_cntrl->state_event); /* for fatal errors, we let controller decide next step */ if (MHI_IN_PBL(ee)) mhi_cntrl->status_cb(mhi_cntrl, mhi_cntrl->priv_data, MHI_CB_FATAL_ERROR); else schedule_work(&mhi_cntrl->syserr_worker); } MHI_VERB("Exit\n"); Loading drivers/bus/mhi/core/mhi_pm.c +5 −0 Original line number Diff line number Diff line Loading @@ -507,6 +507,11 @@ static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl, TO_MHI_STATE_STR(mhi_cntrl->dev_state), to_mhi_pm_state_str(transition_state)); /* We must notify MHI control driver so it can clean up first */ if (transition_state == MHI_PM_SYS_ERR_PROCESS) mhi_cntrl->status_cb(mhi_cntrl, mhi_cntrl->priv_data, MHI_CB_SYS_ERROR); mutex_lock(&mhi_cntrl->pm_mutex); write_lock_irq(&mhi_cntrl->pm_lock); prev_state = mhi_cntrl->pm_state; Loading drivers/platform/msm/ipa/ipa_v3/ipa_mhi_proxy.c +1 −2 Original line number Diff line number Diff line Loading @@ -882,8 +882,7 @@ static void imp_mhi_status_cb(struct mhi_device *mhi_dev, enum MHI_CB mhi_cb) } break; case MHI_CB_EE_RDDM: case MHI_CB_PENDING_DATA: default: IMP_ERR("unexpected event %d\n", mhi_cb); break; } Loading include/linux/mhi.h +4 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ struct mhi_buf_info; * @MHI_CB_LPM_ENTER: MHI host entered low power mode * @MHI_CB_LPM_EXIT: MHI host about to exit low power mode * @MHI_CB_EE_RDDM: MHI device entered RDDM execution enviornment * @MHI_CB_SYS_ERROR: MHI device enter error state (may recover) * @MHI_CB_FATAL_ERROR: MHI device entered fatal error */ enum MHI_CB { MHI_CB_IDLE, Loading @@ -35,6 +37,8 @@ enum MHI_CB { MHI_CB_LPM_ENTER, MHI_CB_LPM_EXIT, MHI_CB_EE_RDDM, MHI_CB_SYS_ERROR, MHI_CB_FATAL_ERROR, }; /** Loading Loading
drivers/bus/mhi/core/mhi_main.c +15 −3 Original line number Diff line number Diff line Loading @@ -1285,20 +1285,32 @@ irqreturn_t mhi_intvec_threaded_handlr(int irq_number, void *dev) struct mhi_controller *mhi_cntrl = dev; enum mhi_dev_state state = MHI_STATE_MAX; enum MHI_PM_STATE pm_state = 0; enum mhi_ee ee; MHI_VERB("Enter\n"); write_lock_irq(&mhi_cntrl->pm_lock); if (MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) if (MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) { state = mhi_get_mhi_state(mhi_cntrl); ee = mhi_get_exec_env(mhi_cntrl); } if (state == MHI_STATE_SYS_ERR) { MHI_ERR("MHI system error detected\n"); pm_state = mhi_tryset_pm_state(mhi_cntrl, MHI_PM_SYS_ERR_DETECT); } write_unlock_irq(&mhi_cntrl->pm_lock); if (pm_state == MHI_PM_SYS_ERR_DETECT) if (pm_state == MHI_PM_SYS_ERR_DETECT) { wake_up_all(&mhi_cntrl->state_event); /* for fatal errors, we let controller decide next step */ if (MHI_IN_PBL(ee)) mhi_cntrl->status_cb(mhi_cntrl, mhi_cntrl->priv_data, MHI_CB_FATAL_ERROR); else schedule_work(&mhi_cntrl->syserr_worker); } MHI_VERB("Exit\n"); Loading
drivers/bus/mhi/core/mhi_pm.c +5 −0 Original line number Diff line number Diff line Loading @@ -507,6 +507,11 @@ static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl, TO_MHI_STATE_STR(mhi_cntrl->dev_state), to_mhi_pm_state_str(transition_state)); /* We must notify MHI control driver so it can clean up first */ if (transition_state == MHI_PM_SYS_ERR_PROCESS) mhi_cntrl->status_cb(mhi_cntrl, mhi_cntrl->priv_data, MHI_CB_SYS_ERROR); mutex_lock(&mhi_cntrl->pm_mutex); write_lock_irq(&mhi_cntrl->pm_lock); prev_state = mhi_cntrl->pm_state; Loading
drivers/platform/msm/ipa/ipa_v3/ipa_mhi_proxy.c +1 −2 Original line number Diff line number Diff line Loading @@ -882,8 +882,7 @@ static void imp_mhi_status_cb(struct mhi_device *mhi_dev, enum MHI_CB mhi_cb) } break; case MHI_CB_EE_RDDM: case MHI_CB_PENDING_DATA: default: IMP_ERR("unexpected event %d\n", mhi_cb); break; } Loading
include/linux/mhi.h +4 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ struct mhi_buf_info; * @MHI_CB_LPM_ENTER: MHI host entered low power mode * @MHI_CB_LPM_EXIT: MHI host about to exit low power mode * @MHI_CB_EE_RDDM: MHI device entered RDDM execution enviornment * @MHI_CB_SYS_ERROR: MHI device enter error state (may recover) * @MHI_CB_FATAL_ERROR: MHI device entered fatal error */ enum MHI_CB { MHI_CB_IDLE, Loading @@ -35,6 +37,8 @@ enum MHI_CB { MHI_CB_LPM_ENTER, MHI_CB_LPM_EXIT, MHI_CB_EE_RDDM, MHI_CB_SYS_ERROR, MHI_CB_FATAL_ERROR, }; /** Loading