Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: amd: acp: add DMIC capture switch
@ 2026-12-04 21:17 Bahadır Hamza Öztürk
  2026-12-04 21:39 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Bahadır Hamza Öztürk @ 2026-12-04 21:17 UTC (permalink / raw)
  To: broonie, lgirdwood, Vijendar.Mukunda
  Cc: venkataprasad.potturu, perex, tiwai, linux-sound,
	Bahadır Hamza Öztürk

On ACP platforms using the PDM microphone, e.g. Huawei MateBook
D15/D16/14 AMD with the acp3x-es83xx machine driver, the internal
digital microphone has no capture switch. User space can only mute it
in software, so the mic mute LED (platform::micmute from huawei-wmi)
cannot follow the mute state.

The ACP PDM block has no documented mute. Experiments on a MateBook D15
(BOM-WXX9, Renoir):
 - the gain field in ACP_WOV_MISC_CTRL[4:3] only attenuates (~19 dB)
 - clearing ACP_WOV_PDM_ENABLE stalls the DMA and the stream
 - ACP_WOV_MISC_CTRL bit 5 gates the PDM data input: no microphone data
   reaches memory and the stream keeps running, but the decimator then
   outputs a constant full-scale negative value instead of silence

Add a "DMIC Capture Switch" control. While it is off:
 - on Renoir, the PDM data input is gated with bit 5, also when the PDM
   settings are restored on resume, so microphone data never reaches
   the buffer, not even for mmap readers looking ahead of the hardware
   pointer
 - the whole capture buffer is cleared each time the hardware position
   is read, before user space is told about new data, which turns the
   gated constant (or, on other revisions, the live data) into silence
After unmuting, clearing goes on until at least 10 ms of new data has
been captured, so data captured while muted and the 1 ms full-scale
step the decimator produces when the gate opens are not delivered.
Clearing the whole buffer avoids tracking positions across wraparounds,
stream restarts and resume.

The control does not set SNDRV_CTL_ELEM_ACCESS_MIC_LED: on systems
where the PDM microphone is a second card next to HDA, an always
unmuted LED control would keep the mic mute LED off. Machines that
want the LED to follow the switch can attach it from UCM.

The mute state is kept in the platform data, which is valid from probe
on, rather than in the PCI drvdata, which is only set after the machine
driver may already have probed. The control is only added when the
component has the PDM DAI.

Tested on Huawei MateBook D15 (BOM-WXX9): with the switch off the
recording is digital silence, the stream keeps running, there is no
click on unmute, and with the LED attached from UCM it follows the
switch.

Signed-off-by: Bahadır Hamza Öztürk <bahadirhamza2@gmail.com>
---
Changes in v2:
- Fix issues found by the Sashiko AI review of v1:
  - Keep the mute state in the platform data. The PCI drvdata is not
    set yet when the component may probe, which could dereference NULL.
    Add the control only when the component has the PDM DAI.
  - Gate the PDM data input on Renoir (MISC_CTRL bit 5), so mmap
    readers looking ahead of the hardware pointer never see live data.
  - Clear the whole buffer instead of tracking positions. This removes
    the stale position after restart/resume, the full-buffer wraparound
    case, and data captured while muted being delivered after unmute.
    Keep clearing for 10 ms after unmute to drop the gate's 1 ms step.
  - Drop SNDRV_CTL_ELEM_ACCESS_MIC_LED, so other ACP systems (PDM card
    next to HDA) keep their current mic mute LED behaviour. The LED is
    attached from UCM for acp3x-es83xx instead.
- Read the mute state once per position read, so the gate and the
  buffer clearing always agree, and set the gate again when the PDM
  settings are restored on resume.
- AMD folks: bit 5 of ACP_WOV_MISC_CTRL is not documented in the
  driver. I only verified its effect on Renoir, so it is only used
  there. Is there a proper name or a better way to mute the PDM input?

v1: https://lore.kernel.org/linux-sound/20261204200115.10636-1-bahadirhamza2@gmail.com/

 sound/soc/amd/acp/acp-legacy-common.c |   2 +
 sound/soc/amd/acp/acp-pdm.c           |   1 +
 sound/soc/amd/acp/acp-platform.c      | 102 +++++++++++++++++++++++++-
 sound/soc/amd/acp/amd.h               |  30 ++++++++
 4 files changed, 134 insertions(+), 1 deletion(-)

diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c
index 9c0528a7d..a66d46574 100644
--- a/sound/soc/amd/acp/acp-legacy-common.c
+++ b/sound/soc/amd/acp/acp-legacy-common.c
@@ -178,6 +178,8 @@ static void set_acp_pdm_clk(struct snd_pcm_substream *substream,
 	pdm_ctrl = readl(chip->base + ACP_WOV_MISC_CTRL);
 	pdm_ctrl |= PDM_MISC_CTRL_MASK;
 	writel(pdm_ctrl, chip->base + ACP_WOV_MISC_CTRL);
+	/* The gate is lost over suspend, set it again before the stream resumes */
+	acp_dmic_update_gate(chip, READ_ONCE(chip->dmic_mute));
 	set_acp_pdm_ring_buffer(substream, dai);
 }
 
diff --git a/sound/soc/amd/acp/acp-pdm.c b/sound/soc/amd/acp/acp-pdm.c
index 1bfc34c2a..0daa935a5 100644
--- a/sound/soc/amd/acp/acp-pdm.c
+++ b/sound/soc/amd/acp/acp-pdm.c
@@ -40,6 +40,7 @@ static int acp_dmic_prepare(struct snd_pcm_substream *substream,
 	dmic_ctrl = readl(chip->base + ACP_WOV_MISC_CTRL);
 	dmic_ctrl |= PDM_MISC_CTRL_MASK;
 	writel(dmic_ctrl, chip->base + ACP_WOV_MISC_CTRL);
+	acp_dmic_update_gate(chip, READ_ONCE(chip->dmic_mute));
 
 	period_bytes = frames_to_bytes(substream->runtime,
 			substream->runtime->period_size);
diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c
index f2c885377..9deeb9d4d 100644
--- a/sound/soc/amd/acp/acp-platform.c
+++ b/sound/soc/amd/acp/acp-platform.c
@@ -272,6 +272,49 @@ static int acp_dma_hw_params(struct snd_soc_component *component,
 	return 0;
 }
 
+/*
+ * Mute for the PDM microphone. The ACP PDM block has no mute control.
+ * Where possible the PDM data input is gated, which keeps microphone data
+ * out of memory, but the decimator then outputs a constant full-scale
+ * value instead of silence. So while muted the whole capture buffer is
+ * also cleared whenever the hardware position is read, before user space
+ * is told about new data. After unmuting, clearing goes on until at least
+ * ACP_DMIC_SETTLE_MS of new data has been captured, which drops the
+ * full-scale step the decimator produces when the gate opens.
+ *
+ * The mute state lives in the platform data, which is valid from probe on.
+ */
+#define ACP_DMIC_SETTLE_MS	10
+
+static void acp_dmic_mute_update(struct acp_chip_info *pdata,
+				 struct snd_pcm_substream *substream,
+				 struct acp_stream *stream, u64 total,
+				 u32 buffersize)
+{
+	struct snd_pcm_runtime *runtime = substream->runtime;
+	bool mute = READ_ONCE(pdata->dmic_mute);
+	u32 settle;
+
+	acp_dmic_update_gate(pdata, mute);
+
+	if (mute) {
+		stream->dmic_clearing = true;
+		stream->dmic_open_pos = U64_MAX;
+	} else if (!stream->dmic_clearing) {
+		return;
+	} else if (stream->dmic_open_pos == U64_MAX) {
+		stream->dmic_open_pos = total;
+	} else {
+		settle = frames_to_bytes(runtime, runtime->rate / 1000 *
+					 ACP_DMIC_SETTLE_MS);
+		if (total < stream->dmic_open_pos ||
+		    total - stream->dmic_open_pos >= settle)
+			stream->dmic_clearing = false;
+	}
+
+	memset(runtime->dma_area, 0, buffersize);
+}
+
 static snd_pcm_uframes_t acp_dma_pointer(struct snd_soc_component *component,
 					 struct snd_pcm_substream *substream)
 {
@@ -279,7 +322,7 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_soc_component *component,
 	struct acp_chip_info *chip = dev_get_drvdata(dev->parent);
 	struct acp_stream *stream = substream->runtime->private_data;
 	u32 pos, buffersize;
-	u64 bytescount;
+	u64 bytescount, total;
 
 	buffersize = frames_to_bytes(substream->runtime,
 				     substream->runtime->buffer_size);
@@ -289,8 +332,14 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_soc_component *component,
 	if (bytescount > stream->bytescount)
 		bytescount -= stream->bytescount;
 
+	total = bytescount;
 	pos = do_div(bytescount, buffersize);
 
+	if (stream->dai_id == DMIC_INSTANCE &&
+	    substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+		acp_dmic_mute_update(dev_get_platdata(dev), substream, stream,
+				     total, buffersize);
+
 	return bytes_to_frames(substream->runtime, pos);
 }
 
@@ -320,8 +369,59 @@ static int acp_dma_close(struct snd_soc_component *component,
 	return 0;
 }
 
+static int acp_dmic_switch_get(struct snd_kcontrol *kcontrol,
+			       struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+	struct acp_chip_info *pdata = dev_get_platdata(component->dev);
+
+	ucontrol->value.integer.value[0] = !READ_ONCE(pdata->dmic_mute);
+	return 0;
+}
+
+static int acp_dmic_switch_put(struct snd_kcontrol *kcontrol,
+			       struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+	struct acp_chip_info *pdata = dev_get_platdata(component->dev);
+	bool mute = !ucontrol->value.integer.value[0];
+
+	if (mute == READ_ONCE(pdata->dmic_mute))
+		return 0;
+
+	/* Applied by the next prepare or position read */
+	WRITE_ONCE(pdata->dmic_mute, mute);
+	return 1;
+}
+
+static const struct snd_kcontrol_new acp_dmic_controls[] = {
+	{
+		.iface	= SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name	= "DMIC Capture Switch",
+		.info	= snd_ctl_boolean_mono_info,
+		.get	= acp_dmic_switch_get,
+		.put	= acp_dmic_switch_put,
+	},
+};
+
+static int acp_pcm_probe(struct snd_soc_component *component)
+{
+	struct snd_soc_dai *dai;
+
+	/* Only offer the switch when the PDM DAI is part of this component */
+	for_each_component_dais(component, dai) {
+		if (dai->driver->id == DMIC_INSTANCE)
+			return snd_soc_add_component_controls(component,
+							      acp_dmic_controls,
+							      ARRAY_SIZE(acp_dmic_controls));
+	}
+
+	return 0;
+}
+
 static const struct snd_soc_component_driver acp_pcm_component = {
 	.name			= DRV_NAME,
+	.probe			= acp_pcm_probe,
 	.open			= acp_dma_open,
 	.close			= acp_dma_close,
 	.hw_params		= acp_dma_hw_params,
diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h
index 73a028e67..e150706d0 100644
--- a/sound/soc/amd/acp/amd.h
+++ b/sound/soc/amd/acp/amd.h
@@ -131,6 +131,11 @@
 #define PDM_DEC_64              0x2
 #define PDM_CLK_FREQ_MASK       0x07
 #define PDM_MISC_CTRL_MASK      0x18
+/*
+ * Not documented: with this bit set the PDM data input is gated and the
+ * decimator outputs a constant value instead of microphone data.
+ */
+#define PDM_MISC_DATA_GATE      BIT(5)
 #define PDM_ENABLE              0x01
 #define PDM_DISABLE             0x00
 #define DMA_EN_MASK             0x02
@@ -170,6 +175,8 @@ struct acp_chip_info {
 	bool is_pdm_config;	/* flag set to true when PDM configuration is selected from BIOS */
 	bool is_i2s_config;	/* flag set to true when I2S configuration is selected from BIOS */
 	bool tdm_mode;
+	bool dmic_mute;		/* "DMIC Capture Switch" is off */
+	bool dmic_gated;	/* PDM_MISC_DATA_GATE was set by the driver */
 };
 
 struct acp_stream {
@@ -183,6 +190,8 @@ struct acp_stream {
 	u32 reg_offset;
 	u32 pte_offset;
 	u32 fifo_offset;
+	bool dmic_clearing;	/* DMIC buffer is being cleared */
+	u64 dmic_open_pos;	/* byte count when the gate was opened */
 };
 
 struct acp_resource {
@@ -362,4 +371,25 @@ static inline u64 acp_get_byte_count(struct acp_chip_info *chip, int dai_id, int
 POINTER_RETURN_BYTES:
 	return byte_count;
 }
+
+/*
+ * Gate the PDM data input while the DMIC is muted. Only done on Renoir,
+ * where the effect of the bit has been verified; the bit is only cleared
+ * again if the driver set it. The mute state is passed in, so a caller
+ * that also acts on it uses the same state as the gate.
+ */
+static inline void acp_dmic_update_gate(struct acp_chip_info *pdata, bool mute)
+{
+	u32 ctrl, val;
+
+	if (pdata->acp_rev != ACP_RN_PCI_ID || (!mute && !pdata->dmic_gated))
+		return;
+
+	ctrl = readl(pdata->base + ACP_WOV_MISC_CTRL);
+	val = mute ? ctrl | PDM_MISC_DATA_GATE : ctrl & ~PDM_MISC_DATA_GATE;
+	if (val != ctrl)
+		writel(val, pdata->base + ACP_WOV_MISC_CTRL);
+	pdata->dmic_gated = mute;
+}
+
 #endif
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] ASoC: amd: acp: add DMIC capture switch
  2026-12-04 21:17 [PATCH v2] ASoC: amd: acp: add DMIC capture switch Bahadır Hamza Öztürk
@ 2026-12-04 21:39 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-12-04 21:39 UTC (permalink / raw)
  To: Bahadır Hamza Öztürk; +Cc: linux-sound

Thank you for your contribution! Sashiko AI review found 6 potential
issues to consider:
- [Medium] ASoC: amd: acp: prepare and resume gate DMIC without arming
  dmic_clearing
- [Medium] ASoC: amd: acp: acp_dmic_dai_trigger() and switch put miss
  PDM gate sync
- [Medium] ASoC: amd: acp: full-buffer memset and MMIO read in
  acp_dma_pointer()
- [Medium] ASoC: amd: acp: undocumented ACP_WOV_MISC_CTRL bit 5 written
  on all Renoir
- [Medium] ASoC: amd: acp: DMIC mute bypassed via mmap and full-buffer
  memset in hardirq
- [Low] ASoC: amd: acp: acp_pcm_probe() exposes DMIC switch without PDM
  hardware
--

commit 861aa6259e9d977790367dd9467eb2b0278ea46e
Author: Bahadır Hamza Öztürk <bahadirhamza2@gmail.com>

ASoC: amd: acp: add DMIC capture switch

This commit adds a "DMIC Capture Switch" mixer control for the ACP PDM
microphone.  While muted, it gates the PDM data input via bit 5 of
ACP_WOV_MISC_CTRL on Renoir and zeroes the capture DMA buffer on each
pointer query, continuing for 10 ms after unmuting to drop the decimator
step.

[ ... ]

> diff --git a/sound/soc/amd/acp/acp-pdm.c b/sound/soc/amd/acp/acp-pdm.c
> index 1bfc34c2aa536..0daa935a5b057 100644
> --- a/sound/soc/amd/acp/acp-pdm.c
> +++ b/sound/soc/amd/acp/acp-pdm.c
> @@ -40,6 +40,7 @@ static int acp_dmic_prepare(struct snd_pcm_substream *substream,
>  	dmic_ctrl = readl(chip->base + ACP_WOV_MISC_CTRL);
>  	dmic_ctrl |= PDM_MISC_CTRL_MASK;
>  	writel(dmic_ctrl, chip->base + ACP_WOV_MISC_CTRL);
> +	acp_dmic_update_gate(chip, READ_ONCE(chip->dmic_mute));

[Severity: Medium]
Does acp_dmic_prepare() (and set_acp_pdm_clk() on resume) leave
stream->dmic_clearing and stream->dmic_open_pos out of sync with the gate?

A freshly opened stream starts with dmic_clearing = false.  If the stream is
prepared while muted and unmuted before the first acp_dma_pointer() call,
acp_dmic_mute_update() clears PDM_MISC_DATA_GATE and immediately returns at
"else if (!stream->dmic_clearing)" without zeroing runtime->dma_area or
waiting ACP_DMIC_SETTLE_MS.  That delivers up to a full period of gated
full-scale negative samples plus the decimator unmute step on Renoir (or
live muted audio on other revisions) as a loud pop.

Re-preparing an already-open stream after stop or suspend also carries over
stale dmic_clearing and dmic_open_pos values, which can cut the settle
period short or zero the start of an unmuted capture.  Initializing both
fields from the mute state in prepare and resume would keep them in sync.

> diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c
> index f2c8853775ad3..9deeb9d4d023d 100644
> --- a/sound/soc/amd/acp/acp-platform.c
> +++ b/sound/soc/amd/acp/acp-platform.c

[ ... ]

> +static void acp_dmic_mute_update(struct acp_chip_info *pdata,
> +				 struct snd_pcm_substream *substream,
> +				 struct acp_stream *stream, u64 total,
> +				 u32 buffersize)
> +{
> +	struct snd_pcm_runtime *runtime = substream->runtime;
> +	bool mute = READ_ONCE(pdata->dmic_mute);
> +	u32 settle;
> +
> +	acp_dmic_update_gate(pdata, mute);
> +
> +	if (mute) {
> +		stream->dmic_clearing = true;
> +		stream->dmic_open_pos = U64_MAX;
> +	} else if (!stream->dmic_clearing) {
> +		return;
> +	} else if (stream->dmic_open_pos == U64_MAX) {
> +		stream->dmic_open_pos = total;
> +	} else {
> +		settle = frames_to_bytes(runtime, runtime->rate / 1000 *
> +					 ACP_DMIC_SETTLE_MS);
> +		if (total < stream->dmic_open_pos ||
> +		    total - stream->dmic_open_pos >= settle)
> +			stream->dmic_clearing = false;
> +	}
> +
> +	memset(runtime->dma_area, 0, buffersize);
> +}

[Severity: Medium]
Is it safe to memset() the entire capture buffer on every acp_dma_pointer()
call?

acp_dma_pointer() runs in hardirq context from acp_irq_handler() while
holding chip->acp_lock and the PCM substream spinlock, and on every
userspace status/delay ioctl with interrupts disabled.  Zeroing up to 64 KiB
of coherent DMA memory on every call stalls sibling I2S streams and shared
IRQ handlers, skews the hardware-position timestamp taken right after
->pointer() in snd_pcm_update_hw_ptr0(), and overwrites already-captured
unread frames while userspace is reading them.

On Renoir, acp_dmic_update_gate() also does a redundant PCIe MMIO readl() on
every muted pointer call because it does not return early when
mute == pdata->dmic_gated.

[ ... ]

> +static int acp_dmic_switch_put(struct snd_kcontrol *kcontrol,
> +			       struct snd_ctl_elem_value *ucontrol)
> +{
> +	struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
> +	struct acp_chip_info *pdata = dev_get_platdata(component->dev);
> +	bool mute = !ucontrol->value.integer.value[0];
> +
> +	if (mute == READ_ONCE(pdata->dmic_mute))
> +		return 0;
> +
> +	/* Applied by the next prepare or position read */
> +	WRITE_ONCE(pdata->dmic_mute, mute);
> +	return 1;
> +}

[Severity: Medium]
Can live microphone audio reach runtime->dma_area on Renoir because the
hardware gate is deferred out of acp_dmic_switch_put() and not synced in
acp_dmic_dai_trigger()?

If the switch is muted after acp_dmic_prepare() or while the stream is
paused, acp_dmic_dai_trigger() enables PDM DMA without setting
PDM_MISC_DATA_GATE, so up to a full period of live audio is written to
memory before the first acp_dma_pointer() call.  The same window occurs
after muting an already running stream, and unmuting between prepare and
SNDRV_PCM_TRIGGER_START leaves the gate set for the first period.

[ ... ]

> +static int acp_pcm_probe(struct snd_soc_component *component)
> +{
> +	struct snd_soc_dai *dai;
> +
> +	/* Only offer the switch when the PDM DAI is part of this component */
> +	for_each_component_dais(component, dai) {
> +		if (dai->driver->id == DMIC_INSTANCE)
> +			return snd_soc_add_component_controls(component,
> +							      acp_dmic_controls,
> +							      ARRAY_SIZE(acp_dmic_controls));
> +	}
> +
> +	return 0;
> +}

[Severity: Low]
Will this expose a non-functional "DMIC Capture Switch" on I2S-only ACP
configurations?

All four ACP platform drivers (acp-renoir.c, acp-rembrandt.c, acp63.c,
acp70.c) unconditionally include an acp-pdm-dmic entry with DMIC_INSTANCE in
their static DAI arrays, so the loop always matches even when no PDM
microphone is present.  Checking pdata->is_pdm_dev && pdata->is_pdm_config
here, as create_acp_platform_devs() in acp-pci.c does, would restrict the
control to platforms with PDM hardware.

> diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h
> index 73a028e672462..e150706d00edd 100644
> --- a/sound/soc/amd/acp/amd.h
> +++ b/sound/soc/amd/acp/amd.h
> @@ -131,6 +131,11 @@
>  #define PDM_DEC_64              0x2
>  #define PDM_CLK_FREQ_MASK       0x07
>  #define PDM_MISC_CTRL_MASK      0x18
> +/*
> + * Not documented: with this bit set the PDM data input is gated and the
> + * decimator outputs a constant value instead of microphone data.
> + */
> +#define PDM_MISC_DATA_GATE      BIT(5)

[Severity: Medium]
Should an undocumented ACP_WOV_MISC_CTRL bit observed on a single laptop be
written across all ACP_RN_PCI_ID Renoir systems?

In 1-bit PDM, a constant all-zero bitstream decodes to full-scale negative
output, which is also consistent with a data-lane mux selecting an
unconnected lane or a clock/test mode rather than a dedicated mute gate.
Without hardware documentation confirming bit 5, setting it globally on
Renoir risks breaking PDM capture or failing to mute microphones wired to
other lanes on untested boards.

[ ... ]

> +static inline void acp_dmic_update_gate(struct acp_chip_info *pdata, bool mute)
> +{
> +	u32 ctrl, val;
> +
> +	if (pdata->acp_rev != ACP_RN_PCI_ID || (!mute && !pdata->dmic_gated))
> +		return;
> +
> +	ctrl = readl(pdata->base + ACP_WOV_MISC_CTRL);
> +	val = mute ? ctrl | PDM_MISC_DATA_GATE : ctrl & ~PDM_MISC_DATA_GATE;
> +	if (val != ctrl)
> +		writel(val, pdata->base + ACP_WOV_MISC_CTRL);
> +	pdata->dmic_gated = mute;
> +}

[Severity: Medium]
Does limiting hardware gating to ACP_RN_PCI_ID allow muted audio to leak
through mmap on Rembrandt, ACP63, and ACP70/71/72?

acp_pcm_probe() exposes "DMIC Capture Switch" on all those platforms, and
the ACP capture hardware advertises SNDRV_PCM_INFO_MMAP.  Because PDM DMA
continues writing live microphone samples into runtime->dma_area between
pointer queries while muted, an mmap client reading ahead of hw_ptr can
capture live audio while the switch and any UCM-linked mic mute LED report
muted; on Renoir, deferring the gate out of acp_dmic_switch_put() leaves the
same window until the next pointer read.

Relying on a full-buffer memset() in acp_dma_pointer() to clear the buffer
retroactively also adds hardirq spinlock latency in acp_irq_handler() under
chip->acp_lock and the PCM substream lock.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204211751.13825-1-bahadirhamza2@gmail.com?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-04 21:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 21:17 [PATCH v2] ASoC: amd: acp: add DMIC capture switch Bahadır Hamza Öztürk
2026-12-04 21:39 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox