linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Sperl <kernel@martin.sperl.org>
To: Mark Brown <broonie@kernel.org>
Cc: Jon Hunter <jonathanh@nvidia.com>,
	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: Thu, 9 May 2019 21:47:08 +0200	[thread overview]
Message-ID: <CB6BCD42-60F9-493A-B05B-FC27C125E982@martin.sperl.org> (raw)
In-Reply-To: <20190123175609.GG7503@sirena.org.uk>

Hi Mark!

> On 23.01.2019, at 18:56, Mark Brown <broonie@kernel.org> wrote:
> 
>> On Sun, Jan 20, 2019 at 12:24:23PM +0100, kernel@martin.sperl.org wrote:
>> 
>> These kind of changes it requires are consuming a bit more time than
>> I was hoping for.
> 
> Thanks for trying.
> 
>> So maybe at this very moment the best is reverting the patch.
> 
> Yes, I'm just going to do that for now.
> 
>> As for the root cause of the regression: my guess is that spi-mem is
>> just not triggering a shutdown any more because of how message_pump works.
> 
> I'm fairly sure that's what's going on but not been able to get my head
> around things enough to figure out what's going wrong yet.

While thinking about this again maybe an idea:
What about implement a second spi_transfer_one implementation (together
with a message pump implementation) that would handle things correctly.

Any driver then can select the old (default) or new implementation and thus
would allow the optimizations to take place only for verified working drivers...

At least this way we would not be blocked because no hw exposing this
Behavior is available to us - at the cost of extra code to get maintained.

What I would then also like to do for the new implementation is modify the
API a bit - ideally I would like to:
* Make spi_sync the primary interface which the message pump is also 
  using directly
* move all the prepare stuff early into spi-sync, so that for example the
  Preparing (including dma mapping) would get done in the calling thread
  And only the prepared message would get submitted to the queue
  - special processing would be needed for the spi-async case.

This should optimize the computations out of the central loop faster.

Adding spi-nand support could get added later by someone who has
access to a device making use of this.

If that sounds as somewhat acceptable then I will try get something
Implemented.

Any other ideas where we could improve as well?

Martin




  reply	other threads:[~2019-05-09 19:47 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
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 [this message]
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=CB6BCD42-60F9-493A-B05B-FC27C125E982@martin.sperl.org \
    --to=kernel@martin.sperl.org \
    --cc=broonie@kernel.org \
    --cc=jonathanh@nvidia.com \
    --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).