Commit 2a45e9b2 authored by Justin Chen's avatar Justin Chen Committed by Will Deacon
Browse files

UPSTREAM: 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: 5c8a47a5 ("firmware: arm_scmi: Make scmi core independent of the transport type")
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>
Bug: 374258793
Bug: 376162237
(cherry picked from commit da1642bc)
Signed-off-by: default avatarMukesh Ojha <quic_mojha@quicinc.com>
Signed-off-by: default avatarCarlos Llamas <cmllamas@google.com>
Change-Id: I422dc998f14666b68f38e0440495b7e728a4a6c6
Signed-off-by: default avatarzhangxiaowei <zhangxiaowei4@oppo.com>
parent 2122c133
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment