fsi/fsi-master-gpio: Delay sampling of FSI data input
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 15 May 2018 13:05:58 +0000 (23:05 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 12 Jun 2018 04:04:59 +0000 (14:04 +1000)
commitf3ca4834ac335bbf693d424326e4c93523a0c245
tree87c2ddb063382784eb0425c2c404a51a36fe868c
parentb632642e4ce22f1fbf2094752e936565771b34f4
fsi/fsi-master-gpio: Delay sampling of FSI data input

Most SoC GPIO implementations, including the Aspeed one, have
synchronizers on the GPIO inputs. This means that the value
read from a GPIO is a couple of clocks old, from whatever clock
source feeds those synchronizers.

In practice, this means that in no-delay mode, we are using a
value that can potentially be a bit too old and too close to
the clock edge establishing the data on the other side of the link.

The voltage converters we use on some systems make this worse
and sensitive to things like voltage fluctuations etc... This is,
we believe, the cause of occasional CRC errors encountered during
heavy activity on the LPC bus.

This is fixed by introducing a dummy GPIO read before the actual
data read. It slows down SBEFIFO by about 15% (less than any delay
primitive) and the end result is so far solid.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>
Tested-by: Joel Stanley <joel@jms.id.au>
drivers/fsi/fsi-master-gpio.c