1. 05 8月, 2021 5 次提交
    • C
      firmware: arm_scmi: Make SCMI transports configurable · e8419c24
      Cristian Marussi 提交于
      Add configuration options to be able to select which SCMI transports have
      to be compiled into the SCMI stack.
      
      Mailbox and SMC are by default enabled if their related dependencies are
      satisfied.
      
      While doing that move all SCMI related config options in their own
      dedicated submenu.
      
      Link: https://lore.kernel.org/r/20210803131024.40280-9-cristian.marussi@arm.comSigned-off-by: NCristian Marussi <cristian.marussi@arm.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      e8419c24
    • C
      firmware: arm_scmi: Handle concurrent and out-of-order messages · ed7c04c1
      Cristian Marussi 提交于
      Even though in case of asynchronous commands an SCMI platform is
      constrained to emit the delayed response message only after the related
      message response has been sent, the configured underlying transport could
      still deliver such messages together or in inverted order, causing races
      due to the concurrent or out-of-order access to the underlying xfer.
      
      Introduce a mechanism to grant exclusive access to an xfer in order to
      properly serialize concurrent accesses to the same xfer originating from
      multiple correlated messages.
      
      Add additional state information to xfer descriptors so as to be able to
      identify out-of-order message deliveries and act accordingly:
      
       - when a delayed response is expected but delivered before the related
         response, the synchronous response is considered as successfully
         received and the delayed response processing is carried on as usual.
      
       - when/if the missing synchronous response is subsequently received, it
         is discarded as not congruent with the current state of the xfer, or
         simply, because the xfer has been already released and so, now, the
         monotonically increasing sequence number carried by the late response
         is stale.
      
      Link: https://lore.kernel.org/r/20210803131024.40280-6-cristian.marussi@arm.comSigned-off-by: NCristian Marussi <cristian.marussi@arm.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      ed7c04c1
    • C
      firmware: arm_scmi: Introduce monotonically increasing tokens · 9ca5a183
      Cristian Marussi 提交于
      Tokens are sequence numbers embedded in the each SCMI message header: they
      are used to correlate commands with responses (and delayed responses), but
      their usage and policy of selection is entirely up to the caller (usually
      the OSPM agent), while they are completely opaque to the callee (i.e. SCMI
      platform) which merely copies them back from the command into the response
      message header.
      This also means that the platform does not, can not and should not enforce
      any kind of policy on received messages depending on the contained sequence
      number: platform can perfectly handle concurrent requests carrying the same
      identifiying token if that should happen.
      
      Moreover the platform is not required to produce in-order responses to
      agent requests, the only constraint in these regards is that in case of
      an asynchronous message the delayed response must be sent after the
      immediate response for the synchronous part of the command transaction.
      
      Currenly the SCMI stack of the OSPM agent selects a token for the egressing
      commands picking the lowest possible number which is not already in use by
      an existing in-flight transaction, which means, in other words, that we
      immediately reuse any token after its transaction has completed or it has
      timed out: this policy indeed does simplify management and lookup of tokens
      and associated xfers.
      
      Under the above assumptions and constraints, since there is really no state
      shared between the agent and the platform to let the platform know when a
      token and its associated message has timed out, the current policy of early
      reuse of tokens can easily lead to the situation in which a spurious or
      late received response (or delayed_response), related to an old stale and
      timed out transaction, can be wrongly associated to a newer valid in-flight
      xfer that just happens to have reused the same token.
      
      This misbehaviour on such late/spurious responses is more easily exposed on
      those transports that naturally have an higher level of parallelism in
      processing multiple concurrent in-flight messages.
      
      This commit introduces a new policy of selection of tokens for the OSPM
      agent: each new command transfer now gets the next available, monotonically
      increasing token, until tokens are exhausted and the counter rolls over.
      
      Such new policy mitigates the above issues with late/spurious responses
      since the tokens are now reused as late as possible (when they roll back
      ideally) and so it is much easier to identify such late/spurious responses
      to stale timed out transactions: this also helps in simplifying the
      specific transports implementation since stale transport messages can be
      easily identified and discarded early on in the rx path without the need
      to cross check their actual state with the core transport layer.
      This mitigation is even more effective when, as is usually the case, the
      maximum number of pending messages is capped by the platform to a much
      lower number than the whole possible range of tokens values (2^10).
      
      This internal policy change in the core SCMI transport layer is fully
      transparent to the specific transports so it has not and should not have
      any impact on the transports implementation.
      
      Link: https://lore.kernel.org/r/20210803131024.40280-5-cristian.marussi@arm.comSigned-off-by: NCristian Marussi <cristian.marussi@arm.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      9ca5a183
    • C
      firmware: arm_scmi: Add optional transport_init/exit support · ceac257d
      Cristian Marussi 提交于
      Some SCMI transport could need to perform some transport specific setup
      before they can be used by the SCMI core transport layer: typically this
      early setup consists in registering with some other kernel subsystem.
      
      Add the optional capability for a transport to provide a couple of init
      and exit functions that are assured to be called early during the SCMI
      core initialization phase, well before the SCMI core probing step.
      
      [ Peter: Adapted RFC patch by Cristian for submission to upstream. ]
      
      Link: https://lore.kernel.org/r/20210803131024.40280-4-cristian.marussi@arm.comSigned-off-by: NPeter Hilber <peter.hilber@opensynergy.com>
      [ Cristian: Fixed scmi_transports_exit point of invocation ]
      Signed-off-by: NCristian Marussi <cristian.marussi@arm.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      ceac257d
    • C
      firmware: arm_scmi: Add support for type handling in common functions · 63b282f1
      Cristian Marussi 提交于
      Add SCMI type handling to pack/unpack_scmi_header common helper functions.
      Initialize hdr.type properly when initializing a command xfer.
      
      Link: https://lore.kernel.org/r/20210803131024.40280-2-cristian.marussi@arm.comSigned-off-by: NCristian Marussi <cristian.marussi@arm.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      63b282f1
  2. 02 6月, 2021 1 次提交
  3. 30 3月, 2021 6 次提交
  4. 29 3月, 2021 6 次提交
  5. 20 11月, 2020 1 次提交
  6. 13 10月, 2020 1 次提交
  7. 14 9月, 2020 2 次提交
  8. 07 9月, 2020 1 次提交
  9. 02 7月, 2020 1 次提交
  10. 21 4月, 2020 1 次提交
  11. 14 4月, 2020 2 次提交
  12. 10 2月, 2020 3 次提交
  13. 30 12月, 2019 1 次提交
    • L
      drivers: firmware: scmi: Extend SCMI transport layer by trace events · 729d3530
      Lukasz Luba 提交于
      The SCMI transport layer communicates via mailboxes and shared memory with
      firmware running on a microcontroller. It is platform specific how long it
      takes to pass a SCMI message. The most sensitive requests are coming from
      CPUFreq subsystem, which might be used by the scheduler.
      Thus, there is a need to measure these delays and capture anomalies.
      This change introduces trace events wrapped around transfer code.
      
      According to Jim's suggestion a unique transfer_id is to distinguish
      similar entries which might have the same message id, protocol id and
      sequence. This is a case then there are some timeouts in transfers.
      Suggested-by: NJim Quinlan <james.quinlan@broadcom.com>
      Signed-off-by: NLukasz Luba <lukasz.luba@arm.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      729d3530
  14. 12 8月, 2019 3 次提交
    • S
      firmware: arm_scmi: Use {get,put}_unaligned_le{32,64} accessors · aa90ac45
      Sudeep Holla 提交于
      Instead of type-casting the {tx,rx}.buf all over the place while
      accessing them to read/write __le{32,64} from/to the firmware, let's
      use the existing {get,put}_unaligned_le{32,64} accessors to hide all
      the type cast ugliness.
      Suggested-by: NPhilipp Zabel <p.zabel@pengutronix.de>
      Reviewed-by: NPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      aa90ac45
    • S
      firmware: arm_scmi: Add support for asynchronous commands and delayed response · 58ecdf03
      Sudeep Holla 提交于
      Messages that are sent to platform, also known as commands and can be:
      
      1. Synchronous commands that block the channel until the requested work
      has been completed. The platform responds to these commands over the
      same channel and hence can't be used to send another command until the
      previous command has completed.
      
      2. Asynchronous commands on the other hand, the platform schedules the
      requested work to complete later in time and returns almost immediately
      freeing the channel for new commands. The response indicates the success
      or failure in the ability to schedule the requested work. When the work
      has completed, the platform sends an additional delayed response message.
      
      Using the same transmit buffer used for sending the asynchronous command
      even for the delayed response corresponding to it simplifies handling of
      the delayed response. It's the caller of asynchronous command that is
      responsible for allocating the completion flag that scmi driver can
      complete to indicate the arrival of delayed response.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      58ecdf03
    • S
      firmware: arm_scmi: Use the term 'message' instead of 'command' · 5b65af8f
      Sudeep Holla 提交于
      In preparation to adding support for other two types of messages that
      SCMI specification mentions, let's replace the term 'command' with the
      correct term 'message'.
      
      As per the specification the messages are of 3 types:
      commands(synchronous or asynchronous), delayed responses and notifications.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      5b65af8f
  15. 20 6月, 2019 1 次提交
  16. 10 5月, 2018 4 次提交
  17. 01 3月, 2018 1 次提交
    • S
      firmware: arm_scmi: add initial support for performance protocol · a9e3fbfa
      Sudeep Holla 提交于
      The performance protocol is intended for the performance management of
      group(s) of device(s) that run in the same performance domain. It
      includes even the CPUs. A performance domain is defined by a set of
      devices that always have to run at the same performance level.
      For example, a set of CPUs that share a voltage domain, and have a
      common frequency control, is said to be in the same performance domain.
      
      The commands in this protocol provide functionality to describe the
      protocol version, describe various attribute flags, set and get the
      performance level of a domain. It also supports discovery of the list
      of performance levels supported by a performance domain, and the
      properties of each performance level.
      
      This patch adds basic support for the performance protocol.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      a9e3fbfa