fsi/fsi-master-gpio: Implement CRC error recovery

The FSI protocol defines two modes of recovery from CRC errors,
this implements both:

 - If the device returns an ECRC (it detected a CRC error in the
   command), then we simply issue the command again.

 - If the master detects a CRC error in the response, we send
   an E_POLL command which requests a resend of the response
   without actually re-executing the command (which could otherwise
   have unwanted side effects such as dequeuing a FIFO twice).

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

Note: This was actually tested by removing some of my fixes, thus
causing us to hit occasional CRC errors during high LPC activity.
This commit is contained in:
Benjamin Herrenschmidt
2018-05-15 16:14:43 +10:00
parent 0e82e5c1fa
commit 4e56828a5d
2 changed files with 99 additions and 18 deletions

View File

@@ -64,6 +64,33 @@ TRACE_EVENT(fsi_master_gpio_break,
)
);
TRACE_EVENT(fsi_master_gpio_crc_cmd_error,
TP_PROTO(const struct fsi_master_gpio *master),
TP_ARGS(master),
TP_STRUCT__entry(
__field(int, master_idx)
),
TP_fast_assign(
__entry->master_idx = master->master.idx;
),
TP_printk("fsi-gpio%d ----CRC command retry---",
__entry->master_idx
)
);
TRACE_EVENT(fsi_master_gpio_crc_rsp_error,
TP_PROTO(const struct fsi_master_gpio *master),
TP_ARGS(master),
TP_STRUCT__entry(
__field(int, master_idx)
),
TP_fast_assign(
__entry->master_idx = master->master.idx;
),
TP_printk("fsi-gpio%d ----CRC response---",
__entry->master_idx
)
);
TRACE_EVENT(fsi_master_gpio_poll_response_busy,
TP_PROTO(const struct fsi_master_gpio *master, int busy),