summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorAndrei Danaila <adanaila@codeaurora.org>2015-02-18 18:29:23 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:11:16 -0700
commit99ba40a4dce22b726f94c010262f7a1af93afe33 (patch)
tree5cf0e74d7a707738f482ec1a2fbb5b9460d8c418 /drivers/platform
parent30fc2b0436cbfb6994499d8944e0700174f8db86 (diff)
mhi: core: Assert on incorrect device events
Assert when an event is received for a channel which is empty. This is a fatal transport error. Change-Id: I0249f97480ebc3ca8d3e98c10e35a0eb040215a4 Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/msm/mhi/mhi.h3
-rw-r--r--drivers/platform/msm/mhi/mhi_main.c20
2 files changed, 5 insertions, 18 deletions
diff --git a/drivers/platform/msm/mhi/mhi.h b/drivers/platform/msm/mhi/mhi.h
index 907eb5413e55..eb719041324b 100644
--- a/drivers/platform/msm/mhi/mhi.h
+++ b/drivers/platform/msm/mhi/mhi.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
*
* 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
@@ -361,7 +361,6 @@ struct mhi_control_seg {
};
struct mhi_chan_counters {
- u32 empty_ring_removal;
u32 pkts_xferd;
u32 ev_processed;
};
diff --git a/drivers/platform/msm/mhi/mhi_main.c b/drivers/platform/msm/mhi/mhi_main.c
index f9459125e1ee..c6c30eaa292d 100644
--- a/drivers/platform/msm/mhi/mhi_main.c
+++ b/drivers/platform/msm/mhi/mhi_main.c
@@ -731,14 +731,8 @@ static enum MHI_STATUS parse_outbound(struct mhi_device_ctxt *mhi_dev_ctxt,
client_handle = mhi_dev_ctxt->client_handle_list[chan];
/* If ring is empty */
- if (mhi_dev_ctxt->mhi_local_chan_ctxt[chan].rp ==
- mhi_dev_ctxt->mhi_local_chan_ctxt[chan].wp) {
- mhi_dev_ctxt->mhi_chan_cntr[chan].empty_ring_removal++;
- mhi_wait_for_mdm(mhi_dev_ctxt);
- return mhi_send_cmd(mhi_dev_ctxt,
- MHI_COMMAND_RESET_CHAN,
- chan);
- }
+ MHI_ASSERT(!unlikely(mhi_dev_ctxt->mhi_local_chan_ctxt[chan].rp ==
+ mhi_dev_ctxt->mhi_local_chan_ctxt[chan].wp), "Empty Event Ring\n");
if (NULL != client_handle) {
result = &mhi_dev_ctxt->client_handle_list[chan]->result;
@@ -771,14 +765,8 @@ static enum MHI_STATUS parse_inbound(struct mhi_device_ctxt *mhi_dev_ctxt,
client_handle = mhi_dev_ctxt->client_handle_list[chan];
local_chan_ctxt = &mhi_dev_ctxt->mhi_local_chan_ctxt[chan];
- if (unlikely(mhi_dev_ctxt->mhi_local_chan_ctxt[chan].rp ==
- mhi_dev_ctxt->mhi_local_chan_ctxt[chan].wp)) {
- mhi_dev_ctxt->mhi_chan_cntr[chan].empty_ring_removal++;
- mhi_wait_for_mdm(mhi_dev_ctxt);
- return mhi_send_cmd(mhi_dev_ctxt,
- MHI_COMMAND_RESET_CHAN,
- chan);
- }
+ MHI_ASSERT(!unlikely(mhi_dev_ctxt->mhi_local_chan_ctxt[chan].rp ==
+ mhi_dev_ctxt->mhi_local_chan_ctxt[chan].wp), "Empty Event Ring\n");
if (NULL != mhi_dev_ctxt->client_handle_list[chan])
result = &mhi_dev_ctxt->client_handle_list[chan]->result;