mirror of https://gitee.com/openkylin/linux.git
slimbus: ngd: set correct device for pm
For some reason we ended up using wrong device in some places for pm_runtime calls.
Fix this so that NGG driver can do runtime pm correctly.
Fixes: 917809e228
("slimbus: ngd: Add qcom SLIMBus NGD driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210809082428.11236-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a263c1ff6a
commit
c0e38eaa8d
|
@ -618,7 +618,7 @@ static void qcom_slim_ngd_rx(struct qcom_slim_ngd_ctrl *ctrl, u8 *buf)
|
||||||
(mc == SLIM_USR_MC_GENERIC_ACK &&
|
(mc == SLIM_USR_MC_GENERIC_ACK &&
|
||||||
mt == SLIM_MSG_MT_SRC_REFERRED_USER)) {
|
mt == SLIM_MSG_MT_SRC_REFERRED_USER)) {
|
||||||
slim_msg_response(&ctrl->ctrl, &buf[4], buf[3], len - 4);
|
slim_msg_response(&ctrl->ctrl, &buf[4], buf[3], len - 4);
|
||||||
pm_runtime_mark_last_busy(ctrl->dev);
|
pm_runtime_mark_last_busy(ctrl->ctrl.dev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1257,13 +1257,14 @@ static int qcom_slim_ngd_enable(struct qcom_slim_ngd_ctrl *ctrl, bool enable)
|
||||||
}
|
}
|
||||||
/* controller state should be in sync with framework state */
|
/* controller state should be in sync with framework state */
|
||||||
complete(&ctrl->qmi.qmi_comp);
|
complete(&ctrl->qmi.qmi_comp);
|
||||||
if (!pm_runtime_enabled(ctrl->dev) ||
|
if (!pm_runtime_enabled(ctrl->ctrl.dev) ||
|
||||||
!pm_runtime_suspended(ctrl->dev))
|
!pm_runtime_suspended(ctrl->ctrl.dev))
|
||||||
qcom_slim_ngd_runtime_resume(ctrl->dev);
|
qcom_slim_ngd_runtime_resume(ctrl->ctrl.dev);
|
||||||
else
|
else
|
||||||
pm_runtime_resume(ctrl->dev);
|
pm_runtime_resume(ctrl->ctrl.dev);
|
||||||
pm_runtime_mark_last_busy(ctrl->dev);
|
|
||||||
pm_runtime_put(ctrl->dev);
|
pm_runtime_mark_last_busy(ctrl->ctrl.dev);
|
||||||
|
pm_runtime_put(ctrl->ctrl.dev);
|
||||||
|
|
||||||
ret = slim_register_controller(&ctrl->ctrl);
|
ret = slim_register_controller(&ctrl->ctrl);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
@ -1389,7 +1390,7 @@ static int qcom_slim_ngd_ssr_pdr_notify(struct qcom_slim_ngd_ctrl *ctrl,
|
||||||
/* Make sure the last dma xfer is finished */
|
/* Make sure the last dma xfer is finished */
|
||||||
mutex_lock(&ctrl->tx_lock);
|
mutex_lock(&ctrl->tx_lock);
|
||||||
if (ctrl->state != QCOM_SLIM_NGD_CTRL_DOWN) {
|
if (ctrl->state != QCOM_SLIM_NGD_CTRL_DOWN) {
|
||||||
pm_runtime_get_noresume(ctrl->dev);
|
pm_runtime_get_noresume(ctrl->ctrl.dev);
|
||||||
ctrl->state = QCOM_SLIM_NGD_CTRL_DOWN;
|
ctrl->state = QCOM_SLIM_NGD_CTRL_DOWN;
|
||||||
qcom_slim_ngd_down(ctrl);
|
qcom_slim_ngd_down(ctrl);
|
||||||
qcom_slim_ngd_exit_dma(ctrl);
|
qcom_slim_ngd_exit_dma(ctrl);
|
||||||
|
|
Loading…
Reference in New Issue