OSDN Git Service

mailbox: mpfs: read the system controller's status
authorConor Dooley <conor.dooley@microchip.com>
Wed, 23 Nov 2022 17:56:52 +0000 (17:56 +0000)
committerJassi Brar <jaswinder.singh@linaro.org>
Mon, 19 Dec 2022 02:40:30 +0000 (20:40 -0600)
commitab47d0bfdf88faac0eb02749e5bfaa306e004300
tree9aa423c19d5fe210a2302eb32ae2edacea857214
parent926d6214f66955f0c066175127cbcf2eaae5ad6b
mailbox: mpfs: read the system controller's status

Some services explicitly return an error code in their response, but
others rely on the system controller to set a status in its status
register. The meaning of the bits varies based on what service is
requested, so pass it back up to the driver that requested the service
in the first place. The field in the message struct already existed, but
was unused until now.

If the system controller is busy, in which case we should never actually
be in the interrupt handler, or if the service fails the mailbox itself
should not be read. Callers should check the status before operating on
the response.

There's an existing, but unused, #define for the mailbox mask - but it
was incorrect. It was doing a GENMASK_ULL(32, 16) which should've just
been a GENMASK(31, 16), so fix that up and start using it.

Fixes: 83d7b1560810 ("mbox: add polarfire soc system controller mailbox")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/mailbox-mpfs.c