linux/drivers/firmware/arm_scmi/transports
Justin Chen da1642bc97 firmware: arm_scmi: Queue in scmi layer for mailbox implementation
send_message() does not block in the MBOX implementation. This is
because the mailbox layer has its own queue. However, this confuses
the per xfer timeouts as they all start their timeout ticks in
parallel.

Consider a case where the xfer timeout is 30ms and a SCMI transaction
takes 25ms:

  | 0ms: Message #0 is queued in mailbox layer and sent out, then sits
  |      at scmi_wait_for_message_response() with a timeout of 30ms
  | 1ms: Message #1 is queued in mailbox layer but not sent out yet.
  |      Since send_message() doesn't block, it also sits at
  |      scmi_wait_for_message_response() with a timeout of 30ms
  |  ...
  | 25ms: Message #0 is completed, txdone is called and message #1 is sent
  | 31ms: Message #1 times out since the count started at 1ms. Even though
  |       it has only been inflight for 6ms.

Fixes: 5c8a47a5a9 ("firmware: arm_scmi: Make scmi core independent of the transport type")
Signed-off-by: Justin Chen <justin.chen@broadcom.com>
Message-Id: <20241014160717.1678953-1-justin.chen@broadcom.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-10-14 21:36:46 +01:00
..
Kconfig firmware: arm_scmi: Make VirtIO transport a standalone driver 2024-08-16 10:26:58 +01:00
mailbox.c firmware: arm_scmi: Queue in scmi layer for mailbox implementation 2024-10-14 21:36:46 +01:00
Makefile firmware: arm_scmi: Give SMC transport precedence over mailbox 2024-10-11 16:52:42 +01:00
optee.c firmware: arm_scmi: Remove const from transport descriptors 2024-08-18 20:22:16 +01:00
smc.c firmware: arm_scmi: Replace the use of of_node_put() to __free(device_node) 2024-08-28 17:16:25 +01:00
virtio.c firmware: arm_scmi: Remove const from transport descriptors 2024-08-18 20:22:16 +01:00