diff options
author | Carter Cooper <ccooper@codeaurora.org> | 2015-10-28 13:33:10 -0600 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:17:19 -0700 |
commit | 30e849fa8babb67b9afa00c60705f5d20ad9dd30 (patch) | |
tree | 05cecd75271f9904b0e604c00ed42f2778e6078a /drivers/gpu/msm/adreno_ringbuffer.c | |
parent | e45a913e1efb67b93fcca2d9b852affb779df06c (diff) |
msm: kgsl: Avoid an interrupt storm from the GPU
CP_CACHE_FLUSH interrupts can storm on very rare occasions.
Check for this interrupt storm and do nothing when it occurs
rather than thrashing the CPU which can occasionally bring the
system down.
Change-Id: I0528ad4fec43abfaeeba1499d0b0e51e14b09f0d
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Diffstat (limited to 'drivers/gpu/msm/adreno_ringbuffer.c')
-rw-r--r-- | drivers/gpu/msm/adreno_ringbuffer.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/gpu/msm/adreno_ringbuffer.c b/drivers/gpu/msm/adreno_ringbuffer.c index 6d577e4045cf..a6fab3e29f55 100644 --- a/drivers/gpu/msm/adreno_ringbuffer.c +++ b/drivers/gpu/msm/adreno_ringbuffer.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2002,2007-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2002,2007-2016, 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 @@ -515,6 +515,7 @@ adreno_ringbuffer_addcmds(struct adreno_ringbuffer *rb, struct kgsl_context *context = NULL; bool secured_ctxt = false; uint64_t cond_addr; + static unsigned int _seq_cnt; if (drawctxt != NULL && kgsl_context_detached(&drawctxt->base) && !(flags & KGSL_CMD_FLAGS_INTERNAL_ISSUE)) @@ -565,6 +566,9 @@ adreno_ringbuffer_addcmds(struct adreno_ringbuffer *rb, total_sizedwords += (secured_ctxt) ? 26 : 0; + /* _seq mem write for each submission */ + total_sizedwords += 4; + /* context rollover */ if (adreno_is_a3xx(adreno_dev)) total_sizedwords += 3; @@ -714,6 +718,17 @@ adreno_ringbuffer_addcmds(struct adreno_ringbuffer *rb, *ringcmds++ = cp_packet(adreno_dev, CP_WAIT_MEM_WRITES, 0); /* + * Do a unique memory write from the GPU. This can be used in + * early detection of timestamp interrupt storms to stave + * off system collapse. + */ + *ringcmds++ = cp_mem_packet(adreno_dev, CP_MEM_WRITE, 2, 1); + ringcmds += cp_gpuaddr(adreno_dev, ringcmds, gpuaddr + + KGSL_MEMSTORE_OFFSET(KGSL_MEMSTORE_GLOBAL, + ref_wait_ts)); + *ringcmds++ = ++_seq_cnt; + + /* * end-of-pipeline timestamp. If per context timestamps is not * enabled, then drawctxt will be NULL or internal command flag will be * set and hence the rb timestamp will be used in else statement below. |