All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	vkoul@kernel.org
Cc: yung-chuan.liao@linux.intel.com, sanyog.r.kale@intel.com,
	linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, quic_srivasam@quicinc.com
Subject: Re: [PATCH] soundwire: qcom: update status from device id 1
Date: Fri, 16 Sep 2022 10:12:12 +0100	[thread overview]
Message-ID: <bffab27c-6e25-5787-6958-648f9f2e2686@linaro.org> (raw)
In-Reply-To: <3962348a-33b4-5941-4a0b-cb447a513a41@linux.intel.com>



On 15/09/2022 14:10, Pierre-Louis Bossart wrote:
> 
> 
> On 9/15/22 14:42, Srinivas Kandagatla wrote:
>> By default autoenumeration is enabled on QCom SoundWire controller
>> which means the core should not be dealing with device 0 w.r.t enumeration.
>> Currently device 0 status is also shared with SoundWire core which confuses
>> the core sometimes and we endup adding 0:0:0:0 slave device.
> 
> The change looks fine, but the description of the issue is surprising.

Thanks Pierre,

> 
> Whether autoenumeration is enabled or not is irrelevant, by spec the
> device0 cannot be in ALERT status and throw in-band interrupts to the
> host with this mechanism.

This issue is more of around enumeration stage in specific during device 
status change interrupt from controller. Sharing the device 0 status 
with core makes it think that there is a device with 0:0:0:0 address and 
it tries to park device to group 13.


--srini

> 
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> ---
>>   drivers/soundwire/qcom.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
>> index e21a3306bf01..871e4d8b32c7 100644
>> --- a/drivers/soundwire/qcom.c
>> +++ b/drivers/soundwire/qcom.c
>> @@ -428,7 +428,7 @@ static int qcom_swrm_get_alert_slave_dev_num(struct qcom_swrm_ctrl *ctrl)
>>   
>>   	ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val);
>>   
>> -	for (dev_num = 0; dev_num <= SDW_MAX_DEVICES; dev_num++) {
>> +	for (dev_num = 1; dev_num <= SDW_MAX_DEVICES; dev_num++) {
>>   		status = (val >> (dev_num * SWRM_MCP_SLV_STATUS_SZ));
>>   
>>   		if ((status & SWRM_MCP_SLV_STATUS_MASK) == SDW_SLAVE_ALERT) {
>> @@ -448,7 +448,7 @@ static void qcom_swrm_get_device_status(struct qcom_swrm_ctrl *ctrl)
>>   	ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val);
>>   	ctrl->slave_status = val;
>>   
>> -	for (i = 0; i <= SDW_MAX_DEVICES; i++) {
>> +	for (i = 1; i <= SDW_MAX_DEVICES; i++) {
>>   		u32 s;
>>   
>>   		s = (val >> (i * 2));

WARNING: multiple messages have this Message-ID (diff)
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	vkoul@kernel.org
Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, sanyog.r.kale@intel.com,
	yung-chuan.liao@linux.intel.com, quic_srivasam@quicinc.com
Subject: Re: [PATCH] soundwire: qcom: update status from device id 1
Date: Fri, 16 Sep 2022 10:12:12 +0100	[thread overview]
Message-ID: <bffab27c-6e25-5787-6958-648f9f2e2686@linaro.org> (raw)
In-Reply-To: <3962348a-33b4-5941-4a0b-cb447a513a41@linux.intel.com>



On 15/09/2022 14:10, Pierre-Louis Bossart wrote:
> 
> 
> On 9/15/22 14:42, Srinivas Kandagatla wrote:
>> By default autoenumeration is enabled on QCom SoundWire controller
>> which means the core should not be dealing with device 0 w.r.t enumeration.
>> Currently device 0 status is also shared with SoundWire core which confuses
>> the core sometimes and we endup adding 0:0:0:0 slave device.
> 
> The change looks fine, but the description of the issue is surprising.

Thanks Pierre,

> 
> Whether autoenumeration is enabled or not is irrelevant, by spec the
> device0 cannot be in ALERT status and throw in-band interrupts to the
> host with this mechanism.

This issue is more of around enumeration stage in specific during device 
status change interrupt from controller. Sharing the device 0 status 
with core makes it think that there is a device with 0:0:0:0 address and 
it tries to park device to group 13.


--srini

> 
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> ---
>>   drivers/soundwire/qcom.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
>> index e21a3306bf01..871e4d8b32c7 100644
>> --- a/drivers/soundwire/qcom.c
>> +++ b/drivers/soundwire/qcom.c
>> @@ -428,7 +428,7 @@ static int qcom_swrm_get_alert_slave_dev_num(struct qcom_swrm_ctrl *ctrl)
>>   
>>   	ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val);
>>   
>> -	for (dev_num = 0; dev_num <= SDW_MAX_DEVICES; dev_num++) {
>> +	for (dev_num = 1; dev_num <= SDW_MAX_DEVICES; dev_num++) {
>>   		status = (val >> (dev_num * SWRM_MCP_SLV_STATUS_SZ));
>>   
>>   		if ((status & SWRM_MCP_SLV_STATUS_MASK) == SDW_SLAVE_ALERT) {
>> @@ -448,7 +448,7 @@ static void qcom_swrm_get_device_status(struct qcom_swrm_ctrl *ctrl)
>>   	ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val);
>>   	ctrl->slave_status = val;
>>   
>> -	for (i = 0; i <= SDW_MAX_DEVICES; i++) {
>> +	for (i = 1; i <= SDW_MAX_DEVICES; i++) {
>>   		u32 s;
>>   
>>   		s = (val >> (i * 2));

  reply	other threads:[~2022-09-16  9:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15 12:42 [PATCH] soundwire: qcom: update status from device id 1 Srinivas Kandagatla
2022-09-15 12:42 ` Srinivas Kandagatla
2022-09-15 13:10 ` Pierre-Louis Bossart
2022-09-15 13:10   ` Pierre-Louis Bossart
2022-09-16  9:12   ` Srinivas Kandagatla [this message]
2022-09-16  9:12     ` Srinivas Kandagatla
2022-09-16  9:39     ` Pierre-Louis Bossart
2022-09-16  9:49       ` Srinivas Kandagatla
2022-09-16 10:05         ` Pierre-Louis Bossart

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=bffab27c-6e25-5787-6958-648f9f2e2686@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=quic_srivasam@quicinc.com \
    --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 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.