mailbox: mpfs: check the service status in .tx_done()
authorConor Dooley <conor.dooley@microchip.com>
Tue, 7 Mar 2023 20:22:54 +0000 (20:22 +0000)
committerConor Dooley <conor.dooley@microchip.com>
Mon, 3 Apr 2023 18:26:04 +0000 (19:26 +0100)
commit37e3430176ff333afb013314a6c949660d75cc92
tree76c8d3f054f475809304f7d1a0fca31df4a537f4
parentda82f95f7c0752f36cdb8ff99d543004e4e3acdf
mailbox: mpfs: check the service status in .tx_done()

Services are supposed to generate an interrupt once completed, whether
or not they have do so successfully. What appears to be a bug in the
system controller means that interrupts are only generated for
*successful* services.

Currently, the status of a service is only checked in the
mpfs_mbox_rx_data() once an interrupt is received. As it turns out, this
is not really helpful where the potentially buggy behaviour is present,
as we'll only see the status for successes where it is moot anyway.

Jassi suggested moving the check to the .tx_done() callback instead.
This makes sense, as the busy bit that tx_done() is polling will be
lowered on completion, regardless of whether the service passed or
failed.
That allows us to check the status bits for all services, whether they
generate an interrupt or not & pass something more informative than
-EBADMSG back to the drivers implementing individual services.

Suggested-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
Tested-by: Valentina Fernandez <valentina.fernandezalanis@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
drivers/mailbox/mailbox-mpfs.c