@@ -65,13 +65,12 @@ static int apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg
buf = apl_log_payload_addr(addr);
if (layout.read_ptr > layout.write_ptr) {
- __kfifo_fromio_locked(&adev->dbg.trace_fifo, buf + layout.read_ptr,
- apl_log_payload_size(adev) - layout.read_ptr,
- &adev->dbg.fifo_lock);
+ __kfifo_fromio(&adev->dbg.trace_fifo, buf + layout.read_ptr,
+ apl_log_payload_size(adev) - layout.read_ptr);
layout.read_ptr = 0;
}
- __kfifo_fromio_locked(&adev->dbg.trace_fifo, buf + layout.read_ptr,
- layout.write_ptr - layout.read_ptr, &adev->dbg.fifo_lock);
+ __kfifo_fromio(&adev->dbg.trace_fifo, buf + layout.read_ptr,
+ layout.write_ptr - layout.read_ptr);
wake_up(&adev->dbg.trace_waitq);
@@ -95,7 +95,6 @@ struct avs_fw_entry {
struct avs_debug {
struct kfifo trace_fifo;
- spinlock_t fifo_lock; /* serialize I/O for trace_fifo */
spinlock_t trace_lock; /* serialize debug window I/O between each LOG_BUFFER_STATUS */
wait_queue_head_t trace_waitq;
u32 aging_timer_period;
@@ -331,8 +330,7 @@ void avs_unregister_all_boards(struct avs_dev *adev);
/* Firmware tracing helpers */
-unsigned int __kfifo_fromio_locked(struct kfifo *fifo, const void __iomem *src, unsigned int len,
- spinlock_t *lock);
+unsigned int __kfifo_fromio(struct kfifo *fifo, const void __iomem *src, unsigned int len);
#define avs_log_buffer_size(adev) \
((adev)->fw_cfg.trace_log_bytes / (adev)->hw_cfg.dsp_cores)
@@ -68,7 +68,7 @@ skl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
/* Address is guaranteed to exist in SRAM2. */
buf = avs_log_buffer_addr(adev, msg->log.core) + offset;
- __kfifo_fromio_locked(&adev->dbg.trace_fifo, buf, size, &adev->dbg.fifo_lock);
+ __kfifo_fromio(&adev->dbg.trace_fifo, buf, size);
wake_up(&adev->dbg.trace_waitq);
return 0;
@@ -301,14 +301,11 @@ void avs_release_firmwares(struct avs_dev *adev)
}
}
-unsigned int __kfifo_fromio_locked(struct kfifo *fifo, const void __iomem *src, unsigned int len,
- spinlock_t *lock)
+unsigned int __kfifo_fromio(struct kfifo *fifo, const void __iomem *src, unsigned int len)
{
struct __kfifo *__fifo = &fifo->kfifo;
- unsigned long flags;
unsigned int l, off;
- spin_lock_irqsave(lock, flags);
len = min(len, kfifo_avail(fifo));
off = __fifo->in & __fifo->mask;
l = min(len, kfifo_size(fifo) - off);
@@ -318,7 +315,6 @@ unsigned int __kfifo_fromio_locked(struct kfifo *fifo, const void __iomem *src,
/* Make sure data copied from SRAM is visible to all CPUs. */
smp_mb();
__fifo->in += len;
- spin_unlock_irqrestore(lock, flags);
return len;
}
Log gathering is already locked, thanks to ->trace_lock. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> --- sound/soc/intel/avs/apl.c | 9 ++++----- sound/soc/intel/avs/avs.h | 4 +--- sound/soc/intel/avs/skl.c | 2 +- sound/soc/intel/avs/utils.c | 6 +----- 4 files changed, 7 insertions(+), 14 deletions(-)