Commit 1ef76128 authored by Justin Chen's avatar Justin Chen Committed by Todd Kjos
Browse files

BACKPORT: 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.

Bug: 374939101
Fixes: 5c8a47a5 ("firmware: arm_scmi: Make scmi core independent of the transport type")
Change-Id: I0ab132221c28d4594f0bbc161f431ceb49830824
Signed-off-by: default avatarJustin Chen <justin.chen@broadcom.com>
Message-Id: <20241014160717.1678953-1-justin.chen@broadcom.com>
Reviewed-by: default avatarCristian Marussi <cristian.marussi@arm.com>
Tested-by: default avatarCristian Marussi <cristian.marussi@arm.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit da1642bc)
Signed-off-by: default avatarDanesh Petigara <danesh.petigara@broadcom.com>
Signed-off-by: default avatarPierre Couillaud <pierre@broadcom.com>
(cherry picked from commit e02772c7)
parent 53a61c62
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment