Linux SPI subsystem development
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Tim Harvey <tharvey@gateworks.com>
Cc: "Marc Kleine-Budde" <mkl@pengutronix.de>,
	"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: Thu, 21 May 2020 22:08:53 +0100	[thread overview]
Message-ID: <20200521210853.GK4770@sirena.org.uk> (raw)
In-Reply-To: <CAJ+vNU06DHVS25OQR1Kqyzy2ZxLVq-HdwenGv-jN5Rb3r8F86Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

On Thu, May 21, 2020 at 01:19:16PM -0700, Tim Harvey wrote:

> Should I be submitting this patch with logic that only does
> half-duplex if the spi controller doesn't support it (if
> (spi->controller->flags & SPI_CONTROLLER_HALF_DUPLEX)) or is it
> acceptable to simply make the driver half-duplex like this for all
> cases?

It seems likely that making the transfers explicitly half duplex will
perform better, especially for PIO controllers since there's less FIFO
stuffing to do but also just generally on longer messages.  You will
get some overhead setting up two transfers on write then read messages
which might offset that but my best guess would be that it'll be
negligable on most controllers.  It's also just a more accurate
representation of what the transfers are actually doing which seems
nicer.

If there *is* a performance win for doing full duplex messages on some
controllers we should probably look at optimizing this in the SPI core
since it'll affect a wide range of hardware and we already have some
code for forcing full duplex anyway.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-05-21 21:08 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 [this message]
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
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=20200521210853.GK4770@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