All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: alsa-devel@alsa-project.org, broonie@kernel.org
Cc: Cezary Rojewski <cezary.rojewski@intel.com>,
	pierre-louis.bossart@linux.intel.com, tiwai@suse.com,
	hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com
Subject: [PATCH 05/16] ASoC: Intel: avs: Drop fifo_lock
Date: Thu,  1 Dec 2022 18:56:08 +0100	[thread overview]
Message-ID: <20221201175619.504758-6-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20221201175619.504758-1-cezary.rojewski@intel.com>

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(-)

diff --git a/sound/soc/intel/avs/apl.c b/sound/soc/intel/avs/apl.c
index 821d5a9ad25f..66672ffd95df 100644
--- a/sound/soc/intel/avs/apl.c
+++ b/sound/soc/intel/avs/apl.c
@@ -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);
 
diff --git a/sound/soc/intel/avs/avs.h b/sound/soc/intel/avs/avs.h
index 1c89af6240d2..957151ecf39a 100644
--- a/sound/soc/intel/avs/avs.h
+++ b/sound/soc/intel/avs/avs.h
@@ -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)
diff --git a/sound/soc/intel/avs/skl.c b/sound/soc/intel/avs/skl.c
index ff690e99d960..936cd44eb73e 100644
--- a/sound/soc/intel/avs/skl.c
+++ b/sound/soc/intel/avs/skl.c
@@ -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;
diff --git a/sound/soc/intel/avs/utils.c b/sound/soc/intel/avs/utils.c
index 13611dee9787..75ad434d7dfb 100644
--- a/sound/soc/intel/avs/utils.c
+++ b/sound/soc/intel/avs/utils.c
@@ -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;
 }
-- 
2.25.1


  parent reply	other threads:[~2022-12-01 17:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 17:56 [PATCH 00/16] ASoC: Intel: avs: Data probing and fw logging Cezary Rojewski
2022-12-01 17:56 ` [PATCH 01/16] ALSA: hda: Allow for compress stream to hdac_ext_stream assignment Cezary Rojewski
2022-12-02  8:51   ` Takashi Iwai
2022-12-01 17:56 ` [PATCH 02/16] ALSA: hda: Prepare for compress stream support Cezary Rojewski
2022-12-02  8:51   ` Takashi Iwai
2022-12-01 17:56 ` [PATCH 03/16] ALSA: hda: Interrupt servicing and BDL setup for compress streams Cezary Rojewski
2022-12-02  0:56   ` kernel test robot
2022-12-02  8:53   ` Takashi Iwai
2022-12-01 17:56 ` [PATCH 04/16] ASoC: Intel: avs: Introduce avs_log_buffer_status_locked() Cezary Rojewski
2022-12-01 17:56 ` Cezary Rojewski [this message]
2022-12-01 17:56 ` [PATCH 06/16] ASoC: Intel: avs: Introduce debug-context aware helpers Cezary Rojewski
2022-12-01 17:56 ` [PATCH 07/16] ASoC: Intel: avs: Make enable_logs() dependent on DEBUG_FS Cezary Rojewski
2022-12-01 17:56 ` [PATCH 08/16] ASoC: Intel: avs: Drop usage of debug members in non-debug code Cezary Rojewski
2022-12-01 17:56 ` [PATCH 09/16] ASoC: Intel: avs: Add data probing requests Cezary Rojewski
2022-12-01 17:56 ` [PATCH 10/16] ASoC: Intel: avs: Probe compress operations Cezary Rojewski
2022-12-01 17:56 ` [PATCH 11/16] ASoC: Intel: avs: Data probing soc-component Cezary Rojewski
2022-12-01 17:56 ` [PATCH 12/16] ASoC: Intel: avs: Add probe machine board Cezary Rojewski
2022-12-01 17:56 ` [PATCH 13/16] ASoC: Intel: avs: Probing and firmware tracing over debugfs Cezary Rojewski
2022-12-01 17:56 ` [PATCH 14/16] ASoC: Intel: avs: Gather remaining logs on strace_release() Cezary Rojewski
2022-12-01 17:56 ` [PATCH 15/16] ASoC: Intel: avs: Allow for dumping FW_REGS area Cezary Rojewski
2022-12-01 17:56 ` [PATCH 16/16] ASoC: Intel: avs: Allow for dumping debug window snapshot Cezary Rojewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221201175619.504758-6-cezary.rojewski@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.