linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Mark Brown <broonie@kernel.org>, Martin Sperl <kernel@martin.sperl.org>
Cc: linux-tegra <linux-tegra@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	<linux-spi@vger.kernel.org>
Subject: Re: Regression: spi: core: avoid waking pump thread from spi_sync instead run teardown delayed
Date: Wed, 16 Jan 2019 11:01:37 +0000	[thread overview]
Message-ID: <b6d6585b-86ce-5eae-842e-83561beefa61@nvidia.com> (raw)
In-Reply-To: <20190115212539.GK5522@sirena.org.uk>


On 15/01/2019 21:25, Mark Brown wrote:
> On Tue, Jan 15, 2019 at 09:58:55PM +0100, Martin Sperl wrote:
> 
>> Maybe a bigger change to the reduce the complexity of
>> the state machine would solve that problem and also
>> reduce code complexity... 
> 
> Yeah, that's where I was getting to with that test patch I posted.
> 
>> I may find some time over the weekend if no solution
>> has been found until then.
> 
> Thanks for volunteering :)
> 
>> The way I would envision it it would have a “state”
>> as a level (0=shutdown, 1=hw enabled, 2=in pump, 
>> 3=in transfer, 4=in hw-mode,...) and a complete
>> to allow waking the shutdown thread (and by this
>> avoiding the busy wait loop we have now).
>> This would replace those idling, busy, and running flags.
> 
> That's a good idea, yes - a single enum much more reflects what we can
> actually do in terms of transitions.
> 
>> Drawback: it is invasive, but let us see what it
>> really looks like...
> 
> I think we need to either drop your change (which would be bad since it
> is a big performance improvement, I'd punted it for later when I did the
> original refactoring to push the work into the caller threads then never
> got around to it) or have a invasive changes to make the new situation
> clearer.  Right now things are just far too complex to reason about
> which isn't helping anyone.

What I am seeing on Tegra is that the SPI controller is no longer
runtime-pm suspended and so while this may improve performance, I think
that this change is going to have a negative impact on idle power.

I would be surprised if this problem is specific to Tegra because I
don't see how the controller's busy state can ever be cleared :-(

Cheers
Jon

-- 
nvpublic

  reply	other threads:[~2019-01-16 11:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14 15:35 Regression: spi: core: avoid waking pump thread from spi_sync instead run teardown delayed Jon Hunter
     [not found] ` <7C4A5EFC-8235-40C8-96E1-E6020529DF72@martin.sperl.org>
2019-01-15 14:26   ` Jon Hunter
2019-01-15 15:10     ` Mark Brown
2019-01-15 16:09       ` Jon Hunter
2019-01-15 19:27         ` Mark Brown
2019-01-15 17:39     ` kernel
2019-01-15 19:26       ` Mark Brown
2019-01-15 20:58         ` Martin Sperl
2019-01-15 21:25           ` Mark Brown
2019-01-16 11:01             ` Jon Hunter [this message]
2019-01-18 17:11             ` kernel
2019-01-18 19:12               ` Mark Brown
2019-01-20 11:24                 ` kernel
2019-01-23 17:56                   ` Mark Brown
2019-05-09 19:47                     ` Martin Sperl
2019-05-12  8:54                       ` Mark Brown
2019-01-16 10:58       ` Jon Hunter
2019-01-22  9:36 ` Geert Uytterhoeven
     [not found]   ` <CGME20190123082650eucas1p243ce21346a00e9b3e9eed2863cd3d280@eucas1p2.samsung.com>
2019-01-23  8:26     ` Marek Szyprowski

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=b6d6585b-86ce-5eae-842e-83561beefa61@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=kernel@martin.sperl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-tegra@vger.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 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).