ASoC: Intel: avs: Make enable_logs() dependent on DEBUG_FS
Without debug filesystem present, this code is redundant. Operations: log_buffer_status and log_buffer_offset are left as is as EXCEPTION_CAUGHT and even unexpected LOG_BUFFER_STATUS notifications may occur without user ever touching debugfs. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221202152841.672536-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
9e3c15beb8
commit
b3eefa5d8d
@ -13,8 +13,9 @@
|
||||
#include "path.h"
|
||||
#include "topology.h"
|
||||
|
||||
static int apl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
|
||||
u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
|
||||
static int __maybe_unused
|
||||
apl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
|
||||
u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
|
||||
{
|
||||
struct apl_log_state_info *info;
|
||||
u32 size, num_cores = adev->hw_cfg.dsp_cores;
|
||||
@ -239,10 +240,10 @@ const struct avs_dsp_ops apl_dsp_ops = {
|
||||
.load_basefw = avs_hda_load_basefw,
|
||||
.load_lib = avs_hda_load_library,
|
||||
.transfer_mods = avs_hda_transfer_modules,
|
||||
.enable_logs = apl_enable_logs,
|
||||
.log_buffer_offset = skl_log_buffer_offset,
|
||||
.log_buffer_status = apl_log_buffer_status,
|
||||
.coredump = apl_coredump,
|
||||
.d0ix_toggle = apl_d0ix_toggle,
|
||||
.set_d0ix = apl_set_d0ix,
|
||||
AVS_SET_ENABLE_LOGS_OP(apl)
|
||||
};
|
||||
|
@ -376,10 +376,15 @@ struct apl_log_buffer_layout {
|
||||
(addr + sizeof(struct apl_log_buffer_layout))
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
#define AVS_SET_ENABLE_LOGS_OP(name) \
|
||||
.enable_logs = name##_enable_logs
|
||||
|
||||
bool avs_logging_fw(struct avs_dev *adev);
|
||||
void avs_dump_fw_log(struct avs_dev *adev, const void __iomem *src, unsigned int len);
|
||||
void avs_dump_fw_log_wakeup(struct avs_dev *adev, const void __iomem *src, unsigned int len);
|
||||
#else
|
||||
#define AVS_SET_ENABLE_LOGS_OP(name)
|
||||
|
||||
static inline bool avs_logging_fw(struct avs_dev *adev)
|
||||
{
|
||||
return false;
|
||||
|
@ -685,6 +685,24 @@ int avs_ipc_get_modules_info(struct avs_dev *adev, struct avs_mods_info **info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int avs_ipc_copier_set_sink_format(struct avs_dev *adev, u16 module_id,
|
||||
u8 instance_id, u32 sink_id,
|
||||
const struct avs_audio_format *src_fmt,
|
||||
const struct avs_audio_format *sink_fmt)
|
||||
{
|
||||
struct avs_copier_sink_format cpr_fmt;
|
||||
|
||||
cpr_fmt.sink_id = sink_id;
|
||||
/* Firmware expects driver to resend copier's input format. */
|
||||
cpr_fmt.src_fmt = *src_fmt;
|
||||
cpr_fmt.sink_fmt = *sink_fmt;
|
||||
|
||||
return avs_ipc_set_large_config(adev, module_id, instance_id,
|
||||
AVS_COPIER_SET_SINK_FORMAT,
|
||||
(u8 *)&cpr_fmt, sizeof(cpr_fmt));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
int avs_ipc_set_enable_logs(struct avs_dev *adev, u8 *log_info, size_t size)
|
||||
{
|
||||
return avs_ipc_set_large_config(adev, AVS_BASEFW_MOD_ID, AVS_BASEFW_INST_ID,
|
||||
@ -704,20 +722,4 @@ int avs_ipc_set_system_time(struct avs_dev *adev)
|
||||
return avs_ipc_set_large_config(adev, AVS_BASEFW_MOD_ID, AVS_BASEFW_INST_ID,
|
||||
AVS_BASEFW_SYSTEM_TIME, (u8 *)&sys_time, sizeof(sys_time));
|
||||
}
|
||||
|
||||
int avs_ipc_copier_set_sink_format(struct avs_dev *adev, u16 module_id,
|
||||
u8 instance_id, u32 sink_id,
|
||||
const struct avs_audio_format *src_fmt,
|
||||
const struct avs_audio_format *sink_fmt)
|
||||
{
|
||||
struct avs_copier_sink_format cpr_fmt;
|
||||
|
||||
cpr_fmt.sink_id = sink_id;
|
||||
/* Firmware expects driver to resend copier's input format. */
|
||||
cpr_fmt.src_fmt = *src_fmt;
|
||||
cpr_fmt.sink_fmt = *sink_fmt;
|
||||
|
||||
return avs_ipc_set_large_config(adev, module_id, instance_id,
|
||||
AVS_COPIER_SET_SINK_FORMAT,
|
||||
(u8 *)&cpr_fmt, sizeof(cpr_fmt));
|
||||
}
|
||||
#endif
|
||||
|
@ -12,8 +12,9 @@
|
||||
#include "avs.h"
|
||||
#include "messages.h"
|
||||
|
||||
static int skl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
|
||||
u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
|
||||
static int __maybe_unused
|
||||
skl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
|
||||
u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
|
||||
{
|
||||
struct skl_log_state_info *info;
|
||||
u32 size, num_cores = adev->hw_cfg.dsp_cores;
|
||||
@ -111,10 +112,10 @@ const struct avs_dsp_ops skl_dsp_ops = {
|
||||
.load_basefw = avs_cldma_load_basefw,
|
||||
.load_lib = avs_cldma_load_library,
|
||||
.transfer_mods = avs_cldma_transfer_modules,
|
||||
.enable_logs = skl_enable_logs,
|
||||
.log_buffer_offset = skl_log_buffer_offset,
|
||||
.log_buffer_status = skl_log_buffer_status,
|
||||
.coredump = skl_coredump,
|
||||
.d0ix_toggle = skl_d0ix_toggle,
|
||||
.set_d0ix = skl_set_d0ix,
|
||||
AVS_SET_ENABLE_LOGS_OP(skl)
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user