2020-07-02 00:46:19

by Doug Anderson

[permalink] [raw]
Subject: [PATCH 2/3] spi: spi-geni-qcom: Set an autosuspend delay of 250 ms

In commit 0e3b8a81f5df ("spi: spi-geni-qcom: Add interconnect
support") the spi_geni_runtime_suspend() and spi_geni_runtime_resume()
became a bit slower. Measuring on my hardware I see numbers in the
hundreds of microseconds now.

Let's use autosuspend to help avoid some of the overhead. Now if
we're doing a bunch of transfers we won't need to be constantly
chruning.

The number 250 ms for the autosuspend delay was picked a bit
arbitrarily, so if someone has measurements showing a better value we
could easily change this.

Fixes: 0e3b8a81f5df ("spi: spi-geni-qcom: Add interconnect support")
Signed-off-by: Douglas Anderson <[email protected]>
---

drivers/spi/spi-geni-qcom.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index bb4cdda2dec8..f51279608fc7 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -595,6 +595,8 @@ static int spi_geni_probe(struct platform_device *pdev)

init_completion(&mas->xfer_done);
spin_lock_init(&mas->lock);
+ pm_runtime_use_autosuspend(&pdev->dev);
+ pm_runtime_set_autosuspend_delay(&pdev->dev, 250);
pm_runtime_enable(dev);

ret = geni_icc_get(&mas->se, NULL);
--
2.27.0.383.g050319c2ae-goog


2020-07-07 10:22:17

by Akash Asthana

[permalink] [raw]
Subject: Re: [PATCH 2/3] spi: spi-geni-qcom: Set an autosuspend delay of 250 ms


On 7/2/2020 6:15 AM, Douglas Anderson wrote:
> In commit 0e3b8a81f5df ("spi: spi-geni-qcom: Add interconnect
> support") the spi_geni_runtime_suspend() and spi_geni_runtime_resume()
> became a bit slower. Measuring on my hardware I see numbers in the
> hundreds of microseconds now.
>
> Let's use autosuspend to help avoid some of the overhead. Now if
> we're doing a bunch of transfers we won't need to be constantly
> chruning.
>
> The number 250 ms for the autosuspend delay was picked a bit
> arbitrarily, so if someone has measurements showing a better value we
> could easily change this.

Reviewed-by: Akash Asthana<[email protected]>

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project