From 3f4b675e60148cb0cf98e034d0a4067a7b7a816e Mon Sep 17 00:00:00 2001 From: Amandeep Singh Date: Tue, 25 Jun 2019 12:04:34 +0530 Subject: msm: qcn: Update completion sequence during tx Update the completion variable sequence to avoid multiple complete call on a stale staack completion variable. Change-Id: I582777431918c359cd10e4e072f33589dc600e62 Signed-off-by: Amandeep Singh --- drivers/char/qti_sdio_client.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/char/qti_sdio_client.c b/drivers/char/qti_sdio_client.c index 9b13a2f91adb..4904c1be83d0 100644 --- a/drivers/char/qti_sdio_client.c +++ b/drivers/char/qti_sdio_client.c @@ -494,7 +494,7 @@ int qti_client_write(int id, char *buf, size_t count) unsigned int mdata = 0; unsigned int event = 0; struct qti_sdio_bridge *qsb = NULL; - struct completion tx_complete; + DECLARE_COMPLETION_ONSTACK(tx_complete); switch (id) { case QCN_SDIO_CLI_ID_TTY: @@ -575,7 +575,7 @@ int qti_client_write(int id, char *buf, size_t count) wait_event(qsb->wait_q, qsb->tx_ready); if (qsb->mode) { - init_completion(&tx_complete); + reinit_completion(&tx_complete); ret = sdio_al_queue_transfer_async(qsb->channel_handle, SDIO_AL_TX, buffer, padded_len, 0, @@ -586,6 +586,9 @@ int qti_client_write(int id, char *buf, size_t count) qsb->name, ret); return ret; } + + if (qsb->mode) + wait_for_completion(&tx_complete); } else { ret = sdio_al_queue_transfer(qsb->channel_handle, @@ -606,9 +609,6 @@ int qti_client_write(int id, char *buf, size_t count) count); } - if (qsb->mode) - wait_for_completion(&tx_complete); - return count; } EXPORT_SYMBOL(qti_client_write); -- cgit v1.2.3