diff options
| author | Sujeev Dias <sdias@codeaurora.org> | 2016-03-24 13:54:37 -0700 |
|---|---|---|
| committer | Sujeev Dias <sdias@codeaurora.org> | 2017-02-21 16:23:58 -0800 |
| commit | ac489269bb2aa1daaaa59b58f2133a2ea096397f (patch) | |
| tree | 9e553529c416b8cb5f0c0da8ec0c8e3b6c7a8a5a | |
| parent | 667012017d56d7edea10d33b68d95f7f5876e788 (diff) | |
mhi: core: add memory barrier after ring operations
There are instances when MHI channel context read
pointer can be accessed simultaneously by different
CPU cores. To make sure read pointer updates visible
to all cores, add a memory barrier after completion
of MHI ring operation.
CRs-Fixed: 966338
Change-Id: Ifc8c4cd7595fed9049009c42420a665fb170079f
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
| -rw-r--r-- | drivers/platform/msm/mhi/mhi_ring_ops.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/platform/msm/mhi/mhi_ring_ops.c b/drivers/platform/msm/mhi/mhi_ring_ops.c index e5a6dd51f51a..7063053ca841 100644 --- a/drivers/platform/msm/mhi/mhi_ring_ops.c +++ b/drivers/platform/msm/mhi/mhi_ring_ops.c @@ -48,6 +48,9 @@ static int add_element(struct mhi_ring *ring, void **rp, *assigned_addr = (char *)ring->wp; *wp = (void *)(((d_wp + 1) % ring_size) * ring->el_size + (uintptr_t)ring->base); + + /* force update visible to other cores */ + smp_wmb(); return 0; } @@ -101,6 +104,9 @@ int delete_element(struct mhi_ring *ring, void **rp, *rp = (void *)(((d_rp + 1) % ring_size) * ring->el_size + (uintptr_t)ring->base); + + /* force update visible to other cores */ + smp_wmb(); return 0; } |
