Re: [PATCH] spi: spi-geni-qcom: Set the clock properly at runtime resume

From: Doug Anderson
Date: Thu Jul 09 2020 - 10:50:11 EST


Hi,

On Thu, Jul 9, 2020 at 1:55 AM Rajendra Nayak <rnayak@xxxxxxxxxxxxxx> wrote:
>
>
> On 7/9/2020 5:09 AM, Douglas Anderson wrote:
> > In the patch ("spi: spi-geni-qcom: Avoid clock setting if not needed")
> > we avoid a whole pile of clock code. As part of that, we should have
> > restored the clock at runtime resume. Do that.
> >
> > It turns out that, at least with today's configurations, this doesn't
> > actually matter. That's because none of the current device trees have
> > an OPP table for geni SPI yet. That makes dev_pm_opp_set_rate(dev, 0)
> > a no-op. This is why it wasn't noticed in the testing of the original
> > patch. It's still a good idea to fix, though.
>
> good catch, without this (and with OPP tables added) we would end up removing
> the performance vote on suspend and never put it back unless the rate changes.
> Perhaps a similar change would be needed for spi-qcom-qspi too?

The quad spi already patch had this fix and it actually mattered
there. That's what made me go look back and realize that I needed the
fix in the geni SPI. See:

https://lore.kernel.org/r/20200707131607.1.Ia7cb4f41ce93d37d0a764b47c8a453ce9e9c70ef@changeid

I'll send a v2 of that with Akash's suggestion of checking the return
value, though.

-Doug