mailbox: mpfs: account for mbox offsets while sending
authorConor Dooley <conor.dooley@microchip.com>
Wed, 24 Aug 2022 07:08:12 +0000 (08:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:21 +0000 (12:35 +0200)
commitb8fcd9ab0f6596bc3c3b601ad859181cf84dbade
tree588657c964ba15e3c877b7922249af23eade52a9
parentba2264359525d5515399d30403f2534c34c8b37f
mailbox: mpfs: account for mbox offsets while sending

[ Upstream commit 0d1aadfe10ba17ebdeb96abb9638eb0f623f9b55 ]

The mailbox offset is not only used for receiving messages, but it is
also used by messages sent to the system controller by Linux that have a
payload, such as the "digital signature service". It is also overloaded
by certain other services (reprogramming of the FPGA fabric, see Link:)
to have a meaning other than the offset the system controller should
read from.
When the driver was written, no such services of the latter type were
in use & those of the former used an offset of zero so this has gone
un-noticed.

Link: https://www.microsemi.com/document-portal/doc_download/1245815-polarfire-fpga-and-polarfire-soc-fpga-system-services-user-guide
Fixes: 83d7b1560810 ("mbox: add polarfire soc system controller mailbox")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mailbox/mailbox-mpfs.c