[Sound-open-firmware] [PATCH v2] Use atomic API without spin lock for trace_error().
From: Yan Wang yan.wang@linux.intel.com
When trace_error() is used to save error information into trace buffer, the firmware may not in normal state and some spin lock be still locked. So it may cause dead lock if trace_error() still uses non-atomic API with spin lock.
Signed-off-by: Yan Wang yan.wang@linux.intel.com --- src/include/reef/trace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/reef/trace.h b/src/include/reef/trace.h index ef82d75..9497f98 100644 --- a/src/include/reef/trace.h +++ b/src/include/reef/trace.h @@ -128,7 +128,7 @@ void trace_init(struct reef * reef); /* error tracing */ #if TRACEE #define trace_error(__c, __e) \ - _trace_error(__c | (__e[0] << 16) | (__e[1] <<8) | __e[2]) + _trace_error_atomic(__c | (__e[0] << 16) | (__e[1] <<8) | __e[2]) #define trace_error_atomic(__c, __e) \ _trace_error_atomic(__c | (__e[0] << 16) | (__e[1] <<8) | __e[2]) #else
On Wed, 2017-12-06 at 15:05 +0800, yan.wang@linux.intel.com wrote:
From: Yan Wang yan.wang@linux.intel.com
When trace_error() is used to save error information into trace buffer, the firmware may not in normal state and some spin lock be still locked. So it may cause dead lock if trace_error() still uses non-atomic API with spin lock.
Signed-off-by: Yan Wang yan.wang@linux.intel.com
Applied. --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
participants (2)
-
Liam Girdwood
-
yan.wang@linux.intel.com