From: Mark Brown <broonie@kernel.org>
To: Martin Sperl <kernel@martin.sperl.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: Sun, 12 May 2019 17:54:09 +0900 [thread overview]
Message-ID: <20190512085409.GM21483@sirena.org.uk> (raw)
In-Reply-To: <CB6BCD42-60F9-493A-B05B-FC27C125E982@martin.sperl.org>
[-- Attachment #1: Type: text/plain, Size: 2482 bytes --]
On Thu, May 09, 2019 at 09:47:08PM +0200, Martin Sperl wrote:
> 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...
I'd rather avoid having yet another interface for drivers to use, people
already get confused trying to choose between the ones we already have.
It'd have to be something where the existing drivers got actively
converted and the old interface retired rather than something that hangs
around.
> 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.
IIRC the mapping is deliberately done late in order to minimize the
amount of time we're consuming resources for the mapping, there were
some systems that had limited DMA channels. However I don't know how
big a concern that is in this day and age with even relatively old
systems. The idea of spi_async() having a separate path also makes me a
bit nervous as it's much less widely used so more likely to get broken
accidentially.
Otherwise pushing things out to the caller makes sense, it should have
no real impact in the majority of cases where the thread is just getting
used to idle the controller and the actual work is all happening in the
calling context anyway and if the pump is being used it means it's
spending more time actually pushing transfers out.
For the case where we do have the message pump going one thing it'd be
good to do is overlap more of the admin work around the messages with
other transfers - ideally we'd be able to kick off the next transfer
from within the completion of a DMA. I need to have a dig around and
figure out if I have any hardware that can actually support that, last
time I looked at this my main system needed to kick everything up to the
thread due to hardware requirements.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-05-12 17:05 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
2019-05-12 8:54 ` Mark Brown [this message]
2019-01-16 10:58 ` Jon Hunter
2019-01-22 9:36 ` Geert Uytterhoeven
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=20190512085409.GM21483@sirena.org.uk \
--to=broonie@kernel.org \
--cc=jonathanh@nvidia.com \
--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