Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1741066
| From | Brian Norris <briannorris@chromium.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mfd: cros ec: spi: Fix "in progress" error signaling |
| Date | 2017-09-28 00:20 +0200 |
| Message-ID | <uusQp-sS-5@gated-at.bofh.it> (permalink) |
| References | <uusdI-8rg-31@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Sep 27, 2017 at 02:35:27PM -0700, Shawn Nematbakhsh wrote: > For host commands that take a long time to process, cros ec can return > early by signaling a EC_RES_IN_PROGRESS result. The host must then poll > status with EC_CMD_GET_COMMS_STATUS until completion of the command. > > None of the above applies when data link errors are encountered. When > errors such as EC_SPI_PAST_END are encountered during command > transmission, it usually means the command was not received by the EC. > Treating such errors as if they were 'EC_RES_IN_PROGRESS' results is > almost always the wrong decision, and can result in host commands > silently being lost. > > Reported-and-tested-by: Jon Hunter <jonathanh@nvidia.com> > Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> > --- > drivers/mfd/cros_ec_spi.c | 52 ++++++++++++++++++++++------------------------- > 1 file changed, 24 insertions(+), 28 deletions(-) I'm still not sure I understand the full extent of the originally-reported error (it's still likely a SPI transport issue?), but I believe this patch is good anyway: Reviewed-by: Brian Norris <briannorris@chromium.org> I wonder if we should tone down the BUG_ON()'s in drivers/mfd/cros_ec* and drivers/platform/chrome/* too. That's basically a no-no these days, as all of these type of things should be able to gracefully propagate errors, no matter how "unlikely" it should be to see a crazy protocol version number or a bad message length.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] mfd: cros ec: spi: Fix "in progress" error signaling Shawn Nematbakhsh <shawnn@chromium.org> - 2017-09-27 23:40 +0200 Re: [PATCH] mfd: cros ec: spi: Fix "in progress" error signaling Brian Norris <briannorris@chromium.org> - 2017-09-28 00:20 +0200
csiph-web