summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Liu <kaliu@codeaurora.org>2018-08-31 15:53:11 +0800
committerKai Liu <kaliu@codeaurora.org>2018-09-11 22:44:09 +0800
commit103fbe047a9dac8db3f8ea48a9ec17c2c27f2c10 (patch)
treeee16701d571791a63db74d8f0acd5cdfb746dab0
parent9c6c55b75a75bcc824cd7185f1e34852d3a0712b (diff)
qcacmn: claim host only when there are packets to send
Async task thread will claim sdio bus, this claim action will keep sdio clock on. During system suspend, after mmc controller suspended, wlan claim sdio, then it will cause mmc exit suspend as it found clock is on. Move this claim action before bus transaction to avoid rebundant claim. Change-Id: I3bab449d0a93c9107c455ee7dbcc6df99ca28636 CRs-Fixed: 2299526
-rw-r--r--hif/src/sdio/native_sdio/src/hif.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/hif/src/sdio/native_sdio/src/hif.c b/hif/src/sdio/native_sdio/src/hif.c
index cbe70d2b83b8..f0828d93428d 100644
--- a/hif/src/sdio/native_sdio/src/hif.c
+++ b/hif/src/sdio/native_sdio/src/hif.c
@@ -718,6 +718,7 @@ static int async_task(void *param)
struct hif_sdio_dev *device;
struct bus_request *request;
QDF_STATUS status;
+ bool claimed = false;
device = (struct hif_sdio_dev *) param;
set_current_state(TASK_INTERRUPTIBLE);
@@ -740,7 +741,6 @@ static int async_task(void *param)
* if possible, but holding the host blocks
* card interrupts
*/
- sdio_claim_host(device->func);
qdf_spin_lock_irqsave(&device->asynclock);
/* pull the request to work on */
while (device->asyncreq != NULL) {
@@ -754,6 +754,10 @@ static int async_task(void *param)
("%s: async_task processing req: 0x%lX\n",
__func__, (unsigned long)request));
+ if (!claimed) {
+ sdio_claim_host(device->func);
+ claimed = true;
+ }
if (request->scatter_req != NULL) {
A_ASSERT(device->scatter_enabled);
/* pass the request to scatter routine which
@@ -801,7 +805,10 @@ static int async_task(void *param)
qdf_spin_lock_irqsave(&device->asynclock);
}
qdf_spin_unlock_irqrestore(&device->asynclock);
- sdio_release_host(device->func);
+ if (claimed) {
+ sdio_release_host(device->func);
+ claimed = false;
+ }
}
complete_and_exit(&device->async_completion, 0);