stderr is often highlighted with a different color.
This also makes the usual >/dev/null redirection possible.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
File offsets were critical in finding the serious begin_off bug fixed in
the same series. The information is already there so just show it.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes the adsp_mft_cse_entry Component added by
commit 8885b465df ("tools: sof-ri-info: move parsing adsp mft outside
cse mft").
`adsp_mft_cse_entry.entry_file_offset` did not account for the extended
manifest.
Also fix the large `reader.ext_mft_length + entry_offset`
copy/paste/diverge
That variable did not seem to be used anywhere yet but it's wrong value
was confusing and time-consuming when debugging.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Also convert 'differ' to all caps 'DIFFER' to highlight different files.
No other functional change.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The recommended programming sequence for HD-Audio DMA's is to clear the
GEN bit after the host has cleared the RUN bit. For host DMA, we can
replace the stop op with the stop_delayed op so that the GEN bit can be
cleared during host reset. For link DMA, add the stop_delayed op to
perform DMA stop during DAI_CONFIG IPC with hw_free if the two-step stop
flag is set for the DAI. For single-step op, there's no change in
sequence.
The two-step sequence for pause is similar to stop. The DMA will be
stopped with dma_stop_delayed when the DAI_CONFIG IPC with the
SOF_DAI_CONFIG_FLAGS_2_STEP_STOP_PAUSE flag after the host has cleard
the RUN bit.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a pointer to save the device-specific data for the client device that
requests the DMA channel in struct dma_chan_data.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Some DMA's like the HD-Audio DMA need to be stopped ater the pipeline
has been reset. So call dma_stop_delayed op in host reset so that the DMA
can be stopped during the PCM_FREE IPC when the host gets reset.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
If the two_step_stop flag is set for a DAI, DMA reset will be skipped
during DAI reset and it will be done when the DAI_CONFIG IPC is sent
during hw_free. Also, for the pause push case, the DAI_CONFIG IPC will
be sent with the flag SOF_DAI_CONFIG_FLAGS_2_STEP_STOP_PAUSE which
call dma_reset to stop the DMA.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a new optional op for DMA that can be used to stop the DMA after the
pipeline has been reset.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In preparation for adding a reset op that could be used in place of the
stop op for DAI's that support the two-step stop option.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a new field, delayed_dma_stop to struct dai_data that will be set by
the host when the DAI_CONFIG IPC is sent during hw_params.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Some DAI components, such as HDaudio, need to be stopped in two steps
a) stop the DAI component
b) stop the DAI DMA
This patch enables this two-step stop by expanding the DAI_CONFIG
IPC flags and split them into 2 parts.
The 4 LSB bits indicate when the DAI_CONFIG IPC is sent, ex: hw_params,
hw_free or pause. The 4 MSB bits are used as the quirk flags to be used
along with the command flags. The quirk flag called
SOF_DAI_CONFIG_FLAGS_2_STEP_STOP shall be set along with the HW_PARAMS
command flag, i.e. before the pipeline is started so that the stop/pause
trigger op in the FW can take the appropriate action to either
perform/skip the DMA stop. If set, the DMA stop will be executed when the
DAI_CONFIG IPC is sent during hw_free. In the case of pause, DMA pause
will be handled when the DAI_CONFIG IPC is sent with the PAUSE command
flag.
Along with this, modify the signature for the hda_ctrl_dai_widget_setup/
hda_ctrl_dai_widget_free() functions to take additional flags as an
argument and modify all users to pass the appropriate quirk flags. Only
the HDA DAI's need to pass the SOF_DAI_CONFIG_FLAGS_2_STEP_STOP quirk
flag during hw_params to indicate that it supports two-step stop and
pause.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Move the function dai_config_reset to the common DAI code so it can be
reused. Also, rename it to dai_dma_release as it does not really reset the
DAI config but rather releases the DMA channel.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Currently copier only supports setting sink format and
auttenuation in set_large_config ops, not in cmd ops.
We will add other features step by step.
Signed-off-by: Rander Wang <rander.wang@intel.com>
As per documentation in include/sof/lib/alloc.h, rmalloc from
MEM_ZONE_SYS will always succeed. In the unlikely case the alloc
fails, trigger a system panic in rmalloc().
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add caching to more heap zones. With addition of SYS, SYS_RUNTIME
and RUNTIME the mapping is now aligned with XTOS allocator.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
cpu_is_primary() can be easier to parse than !cpu_is_secondary(), make
the swap.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
With IPC3 it is an error to send a PCM_PARAMS IPC on an active
pipeline, but it is a valid use-case with IPC4, ignore such IPCs.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
test_keyword_get_threshold() can return errors, make sure to check
its return value before using it.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
IPCs from the host aren't very frequent during normal operation, and
having all their codes in firmware trace output is extremely useful
for debugging. Add a trace print for arriving IPCs.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
It is possible, that ipc_complete_cmd() is entered 3 times while
processing a single IPC message in multicore configurations: once by
the primary core, then by the IDC IPC processing context, and finally
by the pipeline thread, actually executing the IPC. To make sure that
the response is only sent once by the core, that actually processes
the IPC, we must not clear the .delayed_response flag on the primary
core in such cases, it should only be done by the IDC IPC context
before the pipeline task actually sends the response.
Fixes: 82857a78ba ("ipc: fix a IPC completion race")
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Buffer allocation has been changed to the runtime_shared
zone. Use cache ptr to do the invalidates/writebacks.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Make sure all pipeline_for_each_comp() return values are
consistently checked.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
atomic_read() returns values of type uint32_t, no need to cast to it
again.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
If the last task completes in a domain, don't re-enable it. It will
be re-enabled when a new task is submitted.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
If the last task in the timer domain is completed, the ll_scheduler
tries to unregister the task from the domain. The timer domain
driver currently tries to unregister the interruptin its
.domain_unregister handler, which then leads to a crash. Avoid
unregistering the handler from itself.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When recursing pipeline components, using pipeline_for_each_comp(),
each component's .comp_func() method is called. Those methods can
return 0 for success, a negative error code or PPL_STATUS_PATH_STOP
if recursing should stop. However, the latter code is ignored by
pipeline_for_each_comp(). Add a check for that code and terminate
recursion if detected.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
pipeline_for_each_comp() and buffer_set_params() can fail, make sure
to check their return values and propagate any errors.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
ipc_free is a function, we should avoid shadowing in the event we tried
to use the function here.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Can't return a negative error if we are returning an unsigned type.
C is great right? No reason to ever use something like rust...
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
We should always have a dev, and even if we didn't we would crash here
because we logged above in debug using dev and we are logging the
error itself using dev.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
cppcheck for some reason doesn't understand that j > 1 has nothing to do
with the indexing itself and this the check is pointless, so switch to
!= so it doesn't flag the issue anymore.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
if we shift 1 left 31 times we will overflow the signed bit. Assuming
the intent is correct lets make this unsigned so cppcheck won't
complain.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
cppcheck pointed out that either our nullpointer check was not needed or
that we are failing to do it before using the pointer. The check looks
valid so lets fix the lookup.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
This will be used to stop the trace DMA and free
its resources. This change is tagged for ABI 3.20.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add kconfig item CAVS_IMR_D3_PERSISTENT to denote if IMR restore feature
will be used on an Intel cAVS platform.
It will be disabled by default, please only enable it where IMR content
is persistent when DSP in D3, as enabling it means we don't need to
re-downloading firmware binary to DSP SRAM so fast D3->D0 transition
will be supported.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>