All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, vkoul@kernel.org
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	bard.liao@intel.com,
	Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Subject: Re: [PATCH v2] soundwire: qcom: adjust autoenumeration timeout
Date: Mon, 9 May 2022 09:24:59 -0500	[thread overview]
Message-ID: <97cd6566-e686-e1f2-fe91-4b4ba9d95f12@linux.intel.com> (raw)
In-Reply-To: <fd355232-c5e3-ba1b-801d-526ee6f04946@linaro.org>


>>> You could say why do we need wait itself in the first place.
>>>
>>> The reason we need wait in first place is because, there is a danger of
>>> codec accessing registers even before enumeration is finished. Because
>>> most of the ASoC codec registration happens as part of codec/component
>>> driver probe function rather than status callback.
>>>
>>> I hope this answers your questions.
>>
>>
>> Humm, not really.
>>
>> First, you're using this TIMEOUT_MS value in 3 unrelated places, and
>> using 2 different struct completion, which means there are side effects
>> beyond autoenumeration.
> 
> 2 of these 3 are autoenum ones, one is in probe path and other in bus
> reset path during pm.
> 
> The final one is broadcast timeout, new timeout value should be okay for
> that too, given that we need 10ms timeout.

probably better to make things explicit with a different timeout value
for the broadcast case.

100ms for a broadcast is really eons, it's supposed to be immediate really.

>> And then I don't get what you do on a timeout. in the enumeration part,
> 
> We can't do much on the timeout.
> 
>> the timeout value is not checked for, so I guess enumeration proceeds
>> without the hardware being available? That seems to contradict the
>> assertion that you don't want to access registers before the hardware is
>> properly initialized.
> 
> Even if enumeration timeout, we will not access the registers because
> the ASoC codec is not registered yet from WCD938x component master.

What happens when the codec is registered then? the autoenumeration
still didn't complete, so what prevents the read/writes from failing then?

>> And then on broadcast you have this error handling:
>>
>>         ret = wait_for_completion_timeout(&swrm->broadcast,
>>                           msecs_to_jiffies(TIMEOUT_MS));
>>         if (!ret)
>>             ret = SDW_CMD_IGNORED;
>>         else
>>             ret = SDW_CMD_OK;
>>
>> Which is equally confusing since SDW_CMD_IGNORED is really an error, and
>> the bus layer does not really handle it well - not to mention that I
>> vaguely recall the qcom hardware having its own definition of IGNORED?
> QCom hardware alteast the version based on which this driver was written
> did not have any support to report errors type back on register
> read/writes.
> 
> In this case a broad cast read or write did not generate a complete
> interrupt its assumed that its ignored, as there is no way to say if its
> error or ignored.

ok, that should be fine.

The code in bus.c mostly ignores -ENODATA for the suspend cases. For the
bank switch, I forgot that we also ignore it, Bard added a patch in
2021. The only case where we abort a transfer is on a real error.




  reply	other threads:[~2022-05-09 14:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06  8:47 [PATCH v2] soundwire: qcom: adjust autoenumeration timeout Srinivas Kandagatla
2022-05-06  8:47 ` Srinivas Kandagatla
2022-05-06 14:13 ` Pierre-Louis Bossart
2022-05-07  6:52   ` Srinivas Kandagatla
2022-05-09 13:31     ` Pierre-Louis Bossart
2022-05-09 14:08       ` Srinivas Kandagatla
2022-05-09 14:24         ` Pierre-Louis Bossart [this message]
2022-05-09 14:32           ` Srinivas Kandagatla
2022-05-09 14:36             ` Pierre-Louis Bossart
2022-05-09 14:42               ` Srinivas Kandagatla
2022-05-09  6:33 ` Vinod Koul
2022-05-09  6:33   ` Vinod Koul

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=97cd6566-e686-e1f2-fe91-4b4ba9d95f12@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bard.liao@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_srivasam@quicinc.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=vkoul@kernel.org \
    /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.