]> git.baikalelectronics.ru Git - kernel.git/commit
omapdrm/dss/hdmi4_cec: fix interrupt handling
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 4 Dec 2017 13:32:46 +0000 (14:32 +0100)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 2 Jan 2018 12:20:10 +0000 (14:20 +0200)
commitecce30a7209591974b2db8a967b63240e6bff139
tree4c1d76e19d6d8ea2ca7667cd0c33305917c20f53
parent164edd34670021f52cc157814f576846d0bbc4a0
omapdrm/dss/hdmi4_cec: fix interrupt handling

The omap4 CEC hardware cannot tell a Nack from a Low Drive from an
Arbitration Lost error, so just report a Nack, which is almost
certainly the reason for the error anyway.

This also simplifies the implementation. The only three interrupts
that need to be enabled are:

Transmit Buffer Full/Empty Change event: triggered when the
transmit finished successfully and cleared the buffer.

Receiver FIFO Not Empty event: triggered when a message was received.

Frame Retransmit Count Exceeded event: triggered when a transmit
failed repeatedly, usually due to the message being Nacked. Other
reasons are possible (Low Drive, Arbitration Lost) but there is no
way to know. If this happens the TX buffer needs to be cleared
manually.

While testing various error conditions I noticed that the hardware
can receive messages up to 18 bytes in total, which exceeds the legal
maximum of 16. This could cause a buffer overflow, so we check for
this and constrain the size to 16 bytes.

The old incorrect interrupt handler could cause the CEC framework to
enter into a bad state because it mis-detected the "Start Bit Irregularity
event" as an ARB_LOST transmit error when it actually is a receive error
which should be ignored.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Henrik Austad <haustad@cisco.com>
Tested-by: Henrik Austad <haustad@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c