LKML Archive on
help / color / mirror / Atom feed
From: Douglas Anderson <>
To: Mark Brown <>,
	Benson Leung <>,
	Enric Balletbo i Serra <>
	Guenter Roeck <>,,,
	Douglas Anderson <>,
Subject: [PATCH v4 3/3] platform/chrome: cros_ec_spi: Request the SPI thread be realtime
Date: Wed, 15 May 2019 09:48:13 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

All currently known ECs in the wild are very sensitive to timing.
Specifically the ECs are known to drop a transfer if more than 8 ms
passes from the assertion of the chip select until the transfer

Let's use the new feature introduced in the patch (spi: Allow SPI
devices to request the pumping thread be realtime") to request the SPI
pumping thread be realtime.  This means that if we get shunted off to
the SPI thread for whatever reason we won't get downgraded to low

- We still need to keep ourselves as high priority since the SPI core
  doesn't guarantee that all transfers end up on the pumping thread
  (in fact, it tries pretty hard to do them in the calling context).
- If future Chrome OS ECs ever fix themselves to be less sensitive
  then we could consider adding a property (or compatible string) to
  not set this property.  For now we need it across the board.

Signed-off-by: Douglas Anderson <>
Reviewed-by: Guenter Roeck <>

Changes in v4: None
Changes in v3:
- Updated description and variable name since we no longer force.

Changes in v2:
- Renamed variable to "force_rt_transfers".

 drivers/platform/chrome/cros_ec_spi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c
index 1e38a885c539..daf3119191c8 100644
--- a/drivers/platform/chrome/cros_ec_spi.c
+++ b/drivers/platform/chrome/cros_ec_spi.c
@@ -740,6 +740,7 @@ static int cros_ec_spi_probe(struct spi_device *spi)
 	spi->bits_per_word = 8;
 	spi->mode = SPI_MODE_0;
+	spi->rt = true;
 	err = spi_setup(spi);
 	if (err < 0)
 		return err;

  parent reply	other threads:[~2019-05-15 16:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-15 16:48 [PATCH v4 0/3] spi: A better solution for cros_ec_spi reliability Douglas Anderson
2019-05-15 16:48 ` [PATCH v4 1/3] platform/chrome: cros_ec_spi: Move to real time priority for transfers Douglas Anderson
2019-05-15 17:02   ` Guenter Roeck
2019-05-21  7:52     ` Enric Balletbo i Serra
2019-05-15 16:48 ` [PATCH v4 2/3] spi: Allow SPI devices to request the pumping thread be realtime Douglas Anderson
2019-05-21  7:49   ` Enric Balletbo i Serra
2019-05-23 13:46   ` Mark Brown
2019-05-23 13:49   ` Applied "spi: Allow SPI devices to request the pumping thread be realtime" to the spi tree Mark Brown
2019-05-15 16:48 ` Douglas Anderson [this message]
2019-05-21  7:50   ` [PATCH v4 3/3] platform/chrome: cros_ec_spi: Request the SPI thread be realtime Enric Balletbo i Serra
2019-05-24 10:26   ` Enric Balletbo i Serra

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH v4 3/3] platform/chrome: cros_ec_spi: Request the SPI thread be realtime' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).