public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Vinod Koul <vkoul@kernel.org>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Sanyog Kale <sanyog.r.kale@intel.com>,
	linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH] soundwire: qcom: allow multi-link on newer devices
Date: Wed, 29 Nov 2023 11:07:20 -0600	[thread overview]
Message-ID: <3d36d707-86f7-44fe-a613-64e264bb53cd@linux.intel.com> (raw)
In-Reply-To: <ab0fc6e0-a358-42e7-92e5-77ceea53a546@linaro.org>



On 11/29/23 10:43, Krzysztof Kozlowski wrote:
> On 28/11/2023 16:35, Pierre-Louis Bossart wrote:
>>>  static enum sdw_command_response qcom_swrm_xfer_msg(struct sdw_bus *bus,
>>>  						    struct sdw_msg *msg)
>>>  {
>>> @@ -1078,6 +1090,7 @@ static const struct sdw_master_port_ops qcom_swrm_port_ops = {
>>>  };
>>>  
>>>  static const struct sdw_master_ops qcom_swrm_ops = {
>>> +	.read_prop = qcom_swrm_read_prop,
>>
>> nit-pick: read_prop() literally means "read platform properties".
>>
>> The functionality implemented in this callback looks more like an
>> initialization done in a probe, no?
> 
> Yes, but multi_link is being set by sdw_bus_master_add() just before
> calling read_prop(). It looks a bit odd, because "bus" comes from the
> caller and is probably zero-ed already. Therefore I assumed the code did
> it on purpose - ignored multi_link set before sdw_bus_master_add(),

On the Intel side, there's a bit of luck here.

The caller intel_link_probe() does not set the multi-link property, but
it's set in intel_link_startup() *AFTER* reading the properties - but we
don't have any properties related to multi-link, only the ability to
discard specific links.

>>>  	.xfer_msg = qcom_swrm_xfer_msg,
>>>  	.pre_bank_switch = qcom_swrm_pre_bank_switch,
>>>  	.post_bank_switch = qcom_swrm_post_bank_switch,
>>> @@ -1196,6 +1209,15 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl,
>>>  
>>>  	mutex_lock(&ctrl->port_lock);
>>>  	list_for_each_entry(m_rt, &stream->master_list, stream_node) {
>>
>> just realizing this now, are you sure the 'port_lock' is the proper
>> means to protecting the stream->master_list? I don't see this used
>> anywhere else in stream.c. I think you need to use bus_lock.
> 
> This is from ctrl, internal driver structure:
> 
> struct qcom_swrm_ctrl *ctrl

My point what that all other instances where list_for_each_entry() is
used on stream->master list rely on the bus_lock.

You may be fine in this specific case with a QCOM-specific lock, not
sure if there's any risk. At any rate that is not introduced by this
patch, so for now

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

      reply	other threads:[~2023-11-29 18:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28 15:00 [PATCH] soundwire: qcom: allow multi-link on newer devices Krzysztof Kozlowski
2023-11-28 15:35 ` Pierre-Louis Bossart
2023-11-29 16:43   ` Krzysztof Kozlowski
2023-11-29 17:07     ` Pierre-Louis Bossart [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=3d36d707-86f7-44fe-a613-64e264bb53cd@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=agross@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=andersson@kernel.org \
    --cc=broonie@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sanyog.r.kale@intel.com \
    --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