Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srini@kernel.org>
To: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>,
	Vinod Koul <vkoul@kernel.org>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Srinivas Kandagatla <srini@kernel.org>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	Luca Weiss <luca.weiss@fairphone.com>,
	Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>,
	linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] soundwire: qcom: add SCP address paging support
Date: Mon, 6 Jul 2026 21:57:43 +0100	[thread overview]
Message-ID: <6b081039-595b-4e3e-bf4c-bf5f689c80a7@kernel.org> (raw)
In-Reply-To: <20260706192150.143921-1-jorijnvdgraaf@catcrafts.net>



On 7/6/26 8:21 PM, Jorijn van der Graaf wrote:
> The Qualcomm controller driver ignores the paging fields of struct
> sdw_msg. For a paged access (register address >= 0x8000 on a
> paging-capable peripheral, e.g. the SDCA control space at
> 0x40000000+) the core sets BIT(15) in the wire address and splits the
> upper bits into addr_page1/addr_page2, but since the controller never
> programmed the SCP_AddrPage registers the peripheral resolved every
> such command against their reset value: reads and writes were
> silently redirected to addr[14:0] in page 0.
> 
> Write the two SCP_AddrPage registers through the command FIFO before
> the transfer, as cadence_master.c (cdns_program_scp_addr) and
> amd_manager.c (amd_program_scp_addr) do. Like those controllers the
> pages are programmed on every paged message rather than cached per
> device; a cache can be a follow-up if the two extra FIFO commands
> ever matter.
> 
> No peripheral on a Qualcomm bus sets prop.paging_support in mainline
> today; the first user is the WCD9378 codec, whose driver is being
> upstreamed separately - its entire register map, the
> wcd937x-compatible analog core included, lives in the SDCA address
> space.
> 
> Verified on the Fairphone 6 (SM7635): WCD9378 SDCA registers read
> back their documented reset defaults and audio capture through the
> codec works end-to-end; without this change every paged access landed
> in page 0.
> 
> Assisted-by: Claude:claude-fable-5
> Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>
> ---
Thanks Jorjin for the patch, I have pretty much identical patch that I
was about to send.

LGTM,

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>

--srini
>  drivers/soundwire/qcom.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index 603f228f46b5..3562802f4204 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -975,6 +975,20 @@ static enum sdw_command_response qcom_swrm_xfer_msg(struct sdw_bus *bus,
>  	struct qcom_swrm_ctrl *ctrl = to_qcom_sdw(bus);
>  	int ret, i, len;
>  
> +	if (msg->page) {
> +		ret = qcom_swrm_cmd_fifo_wr_cmd(ctrl, msg->addr_page1,
> +						msg->dev_num,
> +						SDW_SCP_ADDRPAGE1);
> +		if (ret)
> +			return ret;
> +
> +		ret = qcom_swrm_cmd_fifo_wr_cmd(ctrl, msg->addr_page2,
> +						msg->dev_num,
> +						SDW_SCP_ADDRPAGE2);
> +		if (ret)
> +			return ret;
> +	}
> +
>  	if (msg->flags == SDW_MSG_FLAG_READ) {
>  		for (i = 0; i < msg->len;) {
>  			len = min(msg->len - i, QCOM_SWRM_MAX_RD_LEN);


      reply	other threads:[~2026-07-06 20:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 19:21 [PATCH] soundwire: qcom: add SCP address paging support Jorijn van der Graaf
2026-07-06 20:57 ` Srinivas Kandagatla [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=6b081039-595b-4e3e-bf4c-bf5f689c80a7@kernel.org \
    --to=srini@kernel.org \
    --cc=jorijnvdgraaf@catcrafts.net \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=luca.weiss@fairphone.com \
    --cc=mohammad.rafi.shaik@oss.qualcomm.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.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