From: Mark Brown <broonie@kernel.org>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: "Tim Harvey" <tharvey@gateworks.com>,
"open list" <linux-kernel@vger.kernel.org>,
linux-can@vger.kernel.org,
"Wolfgang Grandegger" <wg@grandegger.com>,
"Timo Schlüßler" <schluessler@krause.de>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
linux-spi@vger.kernel.org, "Jan Glauber" <jglauber@marvell.com>,
"Robert Richter" <rrichter@marvell.com>
Subject: Re: [PATCH] can: mcp251x: convert to half-duplex SPI
Date: Mon, 25 May 2020 13:57:43 +0100 [thread overview]
Message-ID: <20200525125743.GF4544@sirena.org.uk> (raw)
In-Reply-To: <a337c8ea-66e2-13c2-f625-fbe93e367d44@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]
On Mon, May 25, 2020 at 02:41:31PM +0200, Marc Kleine-Budde wrote:
> On 5/25/20 1:31 PM, Mark Brown wrote:
> > This isn't something that every individual driver should be doing, such
> > rewriting should happen in the core so that everything sees the benefit.
> The core could merge several half duplex transfers (until there's as cs_change)
> into a single full duplex transfer.
Yes, that is what I am suggesting.
> I think it's not easy to detect and reliable to split a full duplex transfer
> into half duplex ones. How can you tell, if the controller is supposed to tx 0x0
> or actually receive.
I don't understand how that could possibly work or why it would make
sense?
> I think spi_write_then_read() can be extended to generate one full duplex
> transfer instead on two half duplex ones it does a memcpy() anyways.
This has the same problem as doing it in any other driver code - it
causes a needless incompatibility with three wire and single duplex
devices.
> To get a feeling for the use cases, this is what I do in the regmap read
> function of a (not yet mainlined) CAN SPI driver.
Like I say it's probably better if code like this gets pushed into the
SPI core where we've got more information about what the controller can
do and there's more win from doing the tuning since more devices and
systems can take advantage of it.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-05-25 12:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1582655734-20890-1-git-send-email-tharvey@gateworks.com>
[not found] ` <0ac77abd-0df5-e437-ea46-f6c77f59b81c@pengutronix.de>
[not found] ` <CAJ+vNU3vk92_1UnrYH72QgD3-q9Oy9As=jCiup42jzx_2LG9FA@mail.gmail.com>
[not found] ` <0b351fe3-8fe9-572f-fd85-e2aed22873e3@pengutronix.de>
[not found] ` <7b85e098-b9a9-dd14-203f-100cdf2e703e@pengutronix.de>
2020-05-21 20:19 ` [PATCH] can: mcp251x: convert to half-duplex SPI Tim Harvey
2020-05-21 21:08 ` Mark Brown
2020-05-25 11:17 ` Marc Kleine-Budde
2020-05-25 11:31 ` Mark Brown
2020-05-25 12:41 ` Marc Kleine-Budde
2020-05-25 12:57 ` Mark Brown [this message]
2020-05-25 13:12 ` Marc Kleine-Budde
2020-05-25 13:27 ` Mark Brown
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=20200525125743.GF4544@sirena.org.uk \
--to=broonie@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jglauber@marvell.com \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=rrichter@marvell.com \
--cc=schluessler@krause.de \
--cc=tharvey@gateworks.com \
--cc=wg@grandegger.com \
/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