On Fri, May 14, 2021 at 05:15:48PM +0200, Marc Kleine-Budde wrote: > On 14.05.2021 15:51:01, Torin Cooper-Bennun wrote: > > I agree we should shut down the interface - I've previously endured > > serious debugging pain due to SPI errors going unrecognised and > > causing havoc. > > You can eventually do the same, return negative error value from the > tcan4x5x handler and the main IRQ handler will shut down the chip. A > return value >= 0 would be the IRQ_*. > > Some background information: > > You have to keep in mind, the regmap_() functions might fail due to a > non permanent problem, e.g. resource shortage (out-of-memory, etc...). I > decided it's too complicated to properly recover from those, especially > if the driver touches some FIFO pointer. > > The mcp251xfd chip offers CRC check summing during read. If the driver > detect a CRC read error (that stays even after some retries), I let the > regmap_read() function to return an error that is then passed down the > call stack. And then chip will be shut down. Cool, I'll keep this in mind. Obviously tcan4550 has no such SPI checking, but it does have ECC memory at least. Unrecoverable ECC errors are reported in the device interrupts, so that's a good example of something I'd want to respond to with a shutdown! -- Regards, Torin Cooper-Bennun Software Engineer | maxiluxsystems.com
Attachment:
signature.asc
Description: PGP signature