Add a simple trace method to output lock users and detect any sleeping
during atomic context. The intention is to provide simple trace data
that can be used to pinpoint any deadlocks or attempts to sleep whilst
atomic.
Future: The trace output in that patch can be improved to provide easier
lookup for lock users rather than line numbers.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Execution should never return from do_task(). Dump stack in the panic
if we do return here.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add support for DMA trace to run in atomic and IRQ contexts. Currently
DMA trace would sleep between DMA copies and enter atomic state when
inserting new tarce data into the trace buffer.
This patch adds new DMA _nowait() APIs that dont sleep and _atomic() APIs
for trace logging that can be safely called in atomic context.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Fix locking in DMA trace. Also run the DMA trace as delayed work so
we dont block callers. Refactor API so that DMAC and channel are
pre-allocated.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
DMA trace must be run from a work context and not from any atomic
context as it waits on DMA completion IRQs.
Check the host and local buffers for wrap.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1. Ignore DMA trace event when forwarding for avoiding dead lock
because DMA tracing uses DMA API to copy trace event.
2. Add _trace_error() API to send error event by mail box at the same
time too when copying error event by DMA.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
1. Change trace data coping API for current trace event data including
64-bit timestamp.
2. Remove trace event of DMA tracing for avoiding dead lock.
3. If DMA tracing is ready, send event data when the data size is
half full or the DMA tracing buffer arrive at the end. Otherwise,
overwrite the data directly.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
Block on DMA completion for stop/pause to serialise IPC with host.
i.e. new host IPC is queued until DMA completes.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The reload handling code has 3 outcomes that are better represented in
a switch statement. Remove unreachable if statement too.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Make sure we check all component state transitions and report any errors
to trace by calling comp_set_state().
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
comp fixup
SSP can either be in paused or prepared state during stream pause
depending on the state of the other SSP data direction. Make sure this
is taken into account.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This patch decouples the first and second stage in two phase conversion
that is used for out/in rate fractions with high numerator or denominator
value. For e.g. 44.1 -> 48 kHz 160/147 fraction the 1st 8/7 stage and
2nd 20/21 stage are executed number of times close to period length in
time used for the scheduling rate. The number of consumed and produced
samples per copy() is no more constant. The latency of 44.1 kHz is
decreased about 2 ms and processing load is less variable.
This patch removes mute feature due to non-compatibility with variable
length data processing. It can be introduced later if needed as different
implementation.
The polyphase filter is also optimized slightly. More optimizations will
follow.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Current timer has been upgraded to 64-bit but work queue utility
still uses 32-bit.
So timer->hitime can't be added rightly because the 64-bit time
is truncated by work queue utility.
"rmbox" will still receive 32-bit timestamp value only and can't
be upgraded to 64-bit timestamp.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
Before the 1st rollover, timer->hitimeout = 0, it will cause
platform_timer_64_handler() set timeout = 1.
So the time irq is forced to be fired at the beginning of rollover.
And the timeout of platform_timer_set() will be invalid and work
queue cannot be fired.
Just set the new hitimeout to timer->hitimeout.
timer->hitime will be added in the next rollover.
It is unnecessary to check timer->hitimout > 0.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
This patch fixes the warning messages shown with gcc option -Wextra. The
source and sink buffer pointers advance is moved from filter function to
higher level copy function as update consume/produce parameter.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Make remaining region translation APIs static inline to avoid
unused function errors.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
gcc -Wall is not enough, add -Wmissing-prototypes to align with
kernel warnings.
Add relevant includes and move functions without prototype as static
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Last test would always evaluate as true, refactor to fold equal and
less than case as one
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
MISRA-C:2012, 15.4 - There should be no more than one break or goto
statement used to terminate any iteration statement
reshuffle the code to use a single break
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
MISRA C:2012, 16.5: Every switch statement shall have at least two
switch-clauses
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
MISRA C:2012, 16.5: Every switch statement shall have at least two
switch-clauses
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
MISRA C:2012, 16.5: Every switch statement shall have at least two
switch-clauses
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
MISRA C:2012, 16.5: Every switch statement shall have at least two
switch-clauses
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
MISRA-C:2012, 15.4 - There should be no more than one break or goto
statement used to terminate any iteration statement
reshuffle the code to use a single break with no additional tests.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Make static analysis warnings go away and comply with MISRA rules:
the final clause of a switch statement shall be the default case
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
MISRA C++:2008, 8.0.1 and CERT-DCL52-J require that one variable per
declaration.
Change tree-wide, keeping variables in the initial order (except
when it was obviously better to change).
No functional change. The Tensilica HAL remains as is as it should
be modified separately
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The IIR equalizer configure and control is updated to use the new
component ABI. In addition there are checks added to protect IIR
equalizer from invalid setup.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The FIR equalizer configure and control is updated to use the new
component ABI. Checks are added to protect equalizer from invalid
setup. Also an unused parameter is removed from fir_init_delay()
function.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds the code to check the generic ABI header fields and reject
data with invalid header. The individual components those use ABI need
to check the component specific fields in addition.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds to component volume S24_4LE to S24_4LE processing. The
macro from audio/format.h is used to compute shifts needed for product.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>