slim_msm: Gracefully handle QMI timeout failures
QMI timeout can happen if other processor doesn't respond within the time expected by slimbus driver on apps. It has been noticed that QMI call to power-on slimbus rarely takes more than 500msec. Timeout is increased to allow that possibility. Additionally, QMI channel is drained out of left-over messages and runtime-PM state check is modified to allow graceful handling of timeout if at all any timeout still happens. Change-Id: I392a4fa761735135a261fb543815823cee5eba41 Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
This commit is contained in:
parent
37808f8ece
commit
ed2fedf0a5
3 changed files with 9 additions and 6 deletions
|
@ -395,7 +395,7 @@ static int ngd_xfer_msg(struct slim_controller *ctrl, struct slim_msg_txn *txn)
|
||||||
* It also makes HW status cosistent with what SW has it here
|
* It also makes HW status cosistent with what SW has it here
|
||||||
*/
|
*/
|
||||||
if ((pm_runtime_enabled(dev->dev) && ret < 0) ||
|
if ((pm_runtime_enabled(dev->dev) && ret < 0) ||
|
||||||
dev->state == MSM_CTRL_DOWN) {
|
dev->state >= MSM_CTRL_ASLEEP) {
|
||||||
SLIM_ERR(dev, "slim ctrl vote failed ret:%d, state:%d",
|
SLIM_ERR(dev, "slim ctrl vote failed ret:%d, state:%d",
|
||||||
ret, dev->state);
|
ret, dev->state);
|
||||||
pm_runtime_set_suspended(dev->dev);
|
pm_runtime_set_suspended(dev->dev);
|
||||||
|
@ -716,7 +716,7 @@ static int ngd_bulk_wr(struct slim_controller *ctrl, u8 la, u8 mt, u8 mc,
|
||||||
mutex_lock(&dev->tx_lock);
|
mutex_lock(&dev->tx_lock);
|
||||||
|
|
||||||
if ((pm_runtime_enabled(dev->dev) && ret < 0) ||
|
if ((pm_runtime_enabled(dev->dev) && ret < 0) ||
|
||||||
dev->state == MSM_CTRL_DOWN) {
|
dev->state >= MSM_CTRL_ASLEEP) {
|
||||||
SLIM_WARN(dev, "vote failed/SSR in-progress ret:%d, state:%d",
|
SLIM_WARN(dev, "vote failed/SSR in-progress ret:%d, state:%d",
|
||||||
ret, dev->state);
|
ret, dev->state);
|
||||||
pm_runtime_set_suspended(dev->dev);
|
pm_runtime_set_suspended(dev->dev);
|
||||||
|
|
|
@ -1404,9 +1404,12 @@ static void msm_slim_qmi_recv_msg(struct kthread_work *work)
|
||||||
struct msm_slim_qmi *qmi =
|
struct msm_slim_qmi *qmi =
|
||||||
container_of(work, struct msm_slim_qmi, kwork);
|
container_of(work, struct msm_slim_qmi, kwork);
|
||||||
|
|
||||||
rc = qmi_recv_msg(qmi->handle);
|
/* Drain all packets received */
|
||||||
if (rc < 0)
|
do {
|
||||||
pr_err("%s: Error receiving QMI message\n", __func__);
|
rc = qmi_recv_msg(qmi->handle);
|
||||||
|
} while (rc == 0);
|
||||||
|
if (rc != -ENOMSG)
|
||||||
|
pr_err("%s: Error receiving QMI message:%d\n", __func__, rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void msm_slim_qmi_notify(struct qmi_handle *handle,
|
static void msm_slim_qmi_notify(struct qmi_handle *handle,
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
#define SLIMBUS_QMI_INS_ID 0
|
#define SLIMBUS_QMI_INS_ID 0
|
||||||
|
|
||||||
/* QMI response timeout of 500ms */
|
/* QMI response timeout of 500ms */
|
||||||
#define SLIM_QMI_RESP_TOUT 500
|
#define SLIM_QMI_RESP_TOUT 1000
|
||||||
|
|
||||||
#define PGD_THIS_EE(r, v) ((v) ? PGD_THIS_EE_V2(r) : PGD_THIS_EE_V1(r))
|
#define PGD_THIS_EE(r, v) ((v) ? PGD_THIS_EE_V2(r) : PGD_THIS_EE_V1(r))
|
||||||
#define PGD_PORT(r, p, v) ((v) ? PGD_PORT_V2(r, p) : PGD_PORT_V1(r, p))
|
#define PGD_PORT(r, p, v) ((v) ? PGD_PORT_V2(r, p) : PGD_PORT_V1(r, p))
|
||||||
|
|
Loading…
Add table
Reference in a new issue