devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	robh+dt@kernel.org, vkoul@kernel.org,
	yung-chuan.liao@linux.intel.com
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, quic_srivasam@quicinc.com
Subject: Re: [PATCH v3 3/3] soundwire: qcom: add in-band wake up interrupt support
Date: Tue, 1 Mar 2022 11:13:30 +0000	[thread overview]
Message-ID: <c6b0506a-24ed-d4fd-c74e-d95c6dca6fe6@linaro.org> (raw)
In-Reply-To: <28a7aa9b-8322-54df-1cfa-275805e2b044@linux.intel.com>



On 28/02/2022 18:01, Pierre-Louis Bossart wrote:
> 
>> @@ -1424,6 +1464,11 @@ static int swrm_runtime_resume(struct device *dev)
>>   	struct qcom_swrm_ctrl *ctrl = dev_get_drvdata(dev);
>>   	int ret;
>>   
>> +	if (ctrl->wake_irq > 0) {
>> +		if (!irqd_irq_disabled(irq_get_irq_data(ctrl->wake_irq)))
>> +			disable_irq_nosync(ctrl->wake_irq);
>> +	}
>> +
>>   	clk_prepare_enable(ctrl->hclk);
> 
> This one is quite interesting. If you disable the IRQ mechanism but
> haven't yet resumed the clock, that leaves a time window where the
> peripheral could attempt to drive the line high. what happens in that case?


We did call pm_runtime_get_sync() from Wake IRQ handler, which means 
that resume should be finished as part of Wake IRQ handler. Any new 
Interrupt conditions/status generated by slave in the meantime will be 
cleared while handling SLAVE PEND interrupt.

> 
>>   
>>   	if (ctrl->clock_stop_not_supported) {
>> @@ -1491,6 +1536,11 @@ static int __maybe_unused swrm_runtime_suspend(struct device *dev)
>>   
>>   	usleep_range(300, 305);
>>   
>> +	if (ctrl->wake_irq > 0) {
>> +		if (irqd_irq_disabled(irq_get_irq_data(ctrl->wake_irq)))
>> +			enable_irq(ctrl->wake_irq);
>> +	}
>> +
> 
> and this one is similar, you could have a case where the peripheral
> signals a wake immediately after the ClockStopNow frame, but you may not
> yet have enabled the wake detection interrupt.
> 
> Would that imply that the wake is missed?
Its Possible it might be missed at that instance, however as the Slave 
interrupt source condition/status (Ex: button Press) is still not 
cleared it should generate a Wake interrupt as soon as its enabled.

--srini
> 
> 
> 
>>   	return 0;
>>   }
>>   

  reply	other threads:[~2022-03-01 11:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 17:25 [PATCH v3 0/3] soundwire: qcom: add pm runtime support Srinivas Kandagatla
2022-02-28 17:25 ` [PATCH v3 1/3] soundwire: qcom: add runtime pm support Srinivas Kandagatla
2022-03-01 13:52   ` Pierre-Louis Bossart
2022-03-03 10:52   ` Geert Uytterhoeven
2022-04-20 17:39   ` Pierre-Louis Bossart
2022-04-20 17:46     ` Srinivas Kandagatla
2022-04-20 17:53       ` Pierre-Louis Bossart
2022-02-28 17:25 ` [PATCH v3 2/3] dt-bindings: soundwire: qcom: document optional wake irq Srinivas Kandagatla
2022-02-28 17:25 ` [PATCH v3 3/3] soundwire: qcom: add in-band wake up interrupt support Srinivas Kandagatla
2022-02-28 18:01   ` Pierre-Louis Bossart
2022-03-01 11:13     ` Srinivas Kandagatla [this message]
2022-03-01 13:51       ` Pierre-Louis Bossart
2022-03-01 13:52   ` Pierre-Louis Bossart
2022-04-20 17:40     ` Pierre-Louis Bossart
2022-03-02 15:42 ` [PATCH v3 0/3] soundwire: qcom: add pm runtime support Vinod Koul
2022-04-04 21:42   ` Amit Pundir

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=c6b0506a-24ed-d4fd-c74e-d95c6dca6fe6@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=quic_srivasam@quicinc.com \
    --cc=robh+dt@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).