From: Douglas Anderson <dianders@chromium.org>
To: Mark Brown <broonie@kernel.org>,
Benson Leung <bleung@chromium.org>,
Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: linux-rockchip@lists.infradead.org, drinkcat@chromium.org,
Guenter Roeck <groeck@chromium.org>,
briannorris@chromium.org, mka@chromium.org,
Douglas Anderson <dianders@chromium.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/3] platform/chrome: cros_ec_spi: Force transfers to realtime priority
Date: Mon, 13 May 2019 13:18:24 -0700 [thread overview]
Message-ID: <20190513201825.166969-3-dianders@chromium.org> (raw)
In-Reply-To: <20190513201825.166969-1-dianders@chromium.org>
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
finishes.
Let's use the new feature introduced in the patch ("spi: Allow SPI
devices to force transfers on a realtime thread") to specify this and
increase the success rate of our transfers.
NOTE: 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.
With this change we can revert the commit 37a186225a0c
("platform/chrome: cros_ec_spi: Transfer messages at high priority").
...and, in fact, transfers are _even more_ reliable than they were
with that commit since the SPI framework will use a higher priority
(realtime) and we no longer lose our priority when we get shunted over
to the message pumping thread (because we now always get shunted and
the thread is high priority).
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
---
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 8e9451720e73..a2959365a870 100644
--- a/drivers/platform/chrome/cros_ec_spi.c
+++ b/drivers/platform/chrome/cros_ec_spi.c
@@ -703,6 +703,7 @@ static int cros_ec_spi_probe(struct spi_device *spi)
spi->bits_per_word = 8;
spi->mode = SPI_MODE_0;
+ spi->force_rt_transfers = true;
err = spi_setup(spi);
if (err < 0)
return err;
--
2.21.0.1020.gf2820cf01a-goog
next prev parent reply other threads:[~2019-05-13 20:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-13 20:18 [PATCH v2 0/3] spi: A better solution for cros_ec_spi reliability Douglas Anderson
2019-05-13 20:18 ` [PATCH v2 1/3] spi: Allow SPI devices to force transfers on a realtime thread Douglas Anderson
2019-05-13 20:18 ` Douglas Anderson [this message]
2019-05-13 20:18 ` [PATCH v2 3/3] Revert "platform/chrome: cros_ec_spi: Transfer messages at high priority" Douglas Anderson
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=20190513201825.166969-3-dianders@chromium.org \
--to=dianders@chromium.org \
--cc=bleung@chromium.org \
--cc=briannorris@chromium.org \
--cc=broonie@kernel.org \
--cc=drinkcat@chromium.org \
--cc=enric.balletbo@collabora.com \
--cc=groeck@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mka@chromium.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
all inboxes | Powered by JetHome®