Linux Sound subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Srinivas Kandagatla" <srinivas.kandagatla@oss.qualcomm.com>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH 4/4] soundwire: qcom: program SSP period on multi-master primary
Date: Wed, 25 Nov 2026 10:55:40 +0000	[thread overview]
Message-ID: <sashiko-outbox-233175@kernel.org> (raw)
In-Reply-To: <20261125103825.936939-5-srinivas.kandagatla@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] soundwire: qcom: qcom_swrm_pre_bank_switch() writes
  SSP_PERIOD to peer
--

commit ea2417312b39017aa66bb591f5dc0c79d434de58
Author: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>

soundwire: qcom: program SSP period on multi-master primary

This commit programs SWRM_MCP_FRAME_CTRL_BANK_SSP_PERIOD_BMSK (and zeroes
SWRM_MCP_FRAME_CTRL_BANK_CLK_DIV_BMSK on bank switch) in
SWRM_MCP_FRAME_CTRL_BANK_ADDR on the multi-master primary controller at
initialization and before each bank switch.

> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index e0392f3cda34e..3476edd7c4236 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c

[ ... ]

> @@ -1005,10 +1011,16 @@ static int qcom_swrm_init(struct qcom_swrm_ctrl *ctrl)
>  	/* Clear Rows and Cols */
>  	val = FIELD_PREP(SWRM_MCP_FRAME_CTRL_BANK_ROW_CTRL_BMSK, ctrl->rows_index);
>  	val |= FIELD_PREP(SWRM_MCP_FRAME_CTRL_BANK_COL_CTRL_BMSK, ctrl->cols_index);
> +	if (ctrl->mm_role == QCOM_SWRM_MM_PRIMARY)
> +		val |= FIELD_PREP(SWRM_MCP_FRAME_CTRL_BANK_SSP_PERIOD_BMSK,
> +				  SWRM_SSP_PERIOD(ctrl->bus.params.row,
> +						  ctrl->bus.params.col));
>  
>  	reset_control_reset(ctrl->audio_cgcr);
>  
>  	ctrl->reg_write(ctrl, SWRM_MCP_FRAME_CTRL_BANK_ADDR(0), val);
> +	if (ctrl->mm_role == QCOM_SWRM_MM_PRIMARY)
> +		ctrl->reg_write(ctrl, SWRM_MCP_FRAME_CTRL_BANK_ADDR(1), val);
>  
>  	/* Enable Auto enumeration */
>  	ctrl->reg_write(ctrl, SWRM_ENUMERATOR_CFG_ADDR, 1);
> @@ -1191,6 +1203,14 @@ static int qcom_swrm_pre_bank_switch(struct sdw_bus *bus)
>  	if (ctrl->peer_ctrl)
>  		ctrl->peer_ctrl->reg_write(ctrl->peer_ctrl, reg, val);
>  
> +	if (ctrl->mm_role == QCOM_SWRM_MM_PRIMARY) {
> +		u32p_replace_bits(&val, 0,
> +				  SWRM_MCP_FRAME_CTRL_BANK_CLK_DIV_BMSK);
> +		u32p_replace_bits(&val,
> +				  SWRM_SSP_PERIOD(bus->params.row, bus->params.col),
> +				  SWRM_MCP_FRAME_CTRL_BANK_SSP_PERIOD_BMSK);
> +	}
> +
>  	return ctrl->reg_write(ctrl, reg, val);
>  }

[Severity: Medium]
Does qcom_swrm_pre_bank_switch() write the primary controller's
SWRM_MCP_FRAME_CTRL_BANK_SSP_PERIOD_BMSK value into ctrl->peer_ctrl?

qcom_swrm_pre_bank_switch() reads val from the primary controller ctrl,
where both banks already have SWRM_MCP_FRAME_CTRL_BANK_SSP_PERIOD_BMSK
populated from qcom_swrm_init(), updates only the row and column fields,
and writes that val directly to ctrl->peer_ctrl.  As a result, every bank
switch copies the primary's previous SSP_PERIOD (and any un-cleared
CLK_DIV bits) into the dependent controller's FRAME_CTRL_BANK register
instead of leaving SSP_PERIOD at 0 on the dependent.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125103825.936939-1-srinivas.kandagatla@oss.qualcomm.com?part=4

      reply	other threads:[~2026-11-25 10:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 10:38 [PATCH 0/4] soundwire: qcom: fixes and multi-master follow-ups Srinivas Kandagatla
2026-11-25 10:38 ` [PATCH 1/4] soundwire: qcom: always set master port_params.num Srinivas Kandagatla
2026-11-25 10:53   ` Marek Szyprowski
2026-11-25 10:38 ` [PATCH 2/4] soundwire: qcom: skip offset2 write when unset Srinivas Kandagatla
2026-11-25 11:01   ` sashiko-bot
2026-11-25 10:38 ` [PATCH 3/4] soundwire: qcom: fan out broadcasts on multi-master primary Srinivas Kandagatla
2026-11-25 10:38 ` [PATCH 4/4] soundwire: qcom: program SSP period " Srinivas Kandagatla
2026-11-25 10:55   ` sashiko-bot [this message]

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=sashiko-outbox-233175@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=srinivas.kandagatla@oss.qualcomm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox