msm: gsi: fix to client notify on poll mode

When processing an IEOB interrupt, do not process the pending
events in case the channel is in polling mode.

Change-Id: I9b9fbc71ae33fe1bfef837580f9f8e9aa875160d
CRs-Fixed: 1112064
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
This commit is contained in:
Skylar Chang 2017-01-16 10:29:49 -08:00 committed by Gerrit - the friendly Code Review server
parent 1f1d944084
commit 11f6178a51

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and
@ -362,8 +362,13 @@ static void gsi_process_chan(struct gsi_xfer_compl_evt *evt,
notify->chan_user_data = ch_ctx->props.chan_user_data; notify->chan_user_data = ch_ctx->props.chan_user_data;
notify->evt_id = evt->code; notify->evt_id = evt->code;
notify->bytes_xfered = evt->len; notify->bytes_xfered = evt->len;
if (callback) if (callback) {
if (atomic_read(&ch_ctx->poll_mode)) {
GSIERR("Calling client callback in polling mode\n");
WARN_ON(1);
}
ch_ctx->props.xfer_cb(notify); ch_ctx->props.xfer_cb(notify);
}
} }
static void gsi_process_evt_re(struct gsi_evt_ctx *ctx, static void gsi_process_evt_re(struct gsi_evt_ctx *ctx,
@ -459,12 +464,12 @@ check_again:
ctx->ring.rp = rp; ctx->ring.rp = rp;
while (ctx->ring.rp_local != rp) { while (ctx->ring.rp_local != rp) {
++cntr; ++cntr;
gsi_process_evt_re(ctx, &notify, true);
if (ctx->props.exclusive && if (ctx->props.exclusive &&
atomic_read(&ctx->chan->poll_mode)) { atomic_read(&ctx->chan->poll_mode)) {
cntr = 0; cntr = 0;
break; break;
} }
gsi_process_evt_re(ctx, &notify, true);
} }
gsi_ring_evt_doorbell(ctx); gsi_ring_evt_doorbell(ctx);
if (cntr != 0) if (cntr != 0)