common.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * System Control and Management Interface (SCMI) Message Protocol
  4. * driver common header file containing some definitions, structures
  5. * and function prototypes used in all the different SCMI protocols.
  6. *
  7. * Copyright (C) 2018-2024 ARM Ltd.
  8. */
  9. #ifndef _SCMI_COMMON_H
  10. #define _SCMI_COMMON_H
  11. #include <linux/bitfield.h>
  12. #include <linux/completion.h>
  13. #include <linux/device.h>
  14. #include <linux/errno.h>
  15. #include <linux/kernel.h>
  16. #include <linux/hashtable.h>
  17. #include <linux/list.h>
  18. #include <linux/module.h>
  19. #include <linux/refcount.h>
  20. #include <linux/scmi_protocol.h>
  21. #include <linux/spinlock.h>
  22. #include <linux/types.h>
  23. #include <linux/unaligned.h>
  24. #include "protocols.h"
  25. #include "notify.h"
  26. #define SCMI_MAX_CHANNELS 256
  27. #define SCMI_MAX_RESPONSE_TIMEOUT (2 * MSEC_PER_SEC)
  28. #define SCMI_SHMEM_MAX_PAYLOAD_SIZE 104
  29. enum scmi_error_codes {
  30. SCMI_SUCCESS = 0, /* Success */
  31. SCMI_ERR_SUPPORT = -1, /* Not supported */
  32. SCMI_ERR_PARAMS = -2, /* Invalid Parameters */
  33. SCMI_ERR_ACCESS = -3, /* Invalid access/permission denied */
  34. SCMI_ERR_ENTRY = -4, /* Not found */
  35. SCMI_ERR_RANGE = -5, /* Value out of range */
  36. SCMI_ERR_BUSY = -6, /* Device busy */
  37. SCMI_ERR_COMMS = -7, /* Communication Error */
  38. SCMI_ERR_GENERIC = -8, /* Generic Error */
  39. SCMI_ERR_HARDWARE = -9, /* Hardware Error */
  40. SCMI_ERR_PROTOCOL = -10,/* Protocol Error */
  41. };
  42. static const int scmi_linux_errmap[] = {
  43. /* better than switch case as long as return value is continuous */
  44. 0, /* SCMI_SUCCESS */
  45. -EOPNOTSUPP, /* SCMI_ERR_SUPPORT */
  46. -EINVAL, /* SCMI_ERR_PARAM */
  47. -EACCES, /* SCMI_ERR_ACCESS */
  48. -ENOENT, /* SCMI_ERR_ENTRY */
  49. -ERANGE, /* SCMI_ERR_RANGE */
  50. -EBUSY, /* SCMI_ERR_BUSY */
  51. -ECOMM, /* SCMI_ERR_COMMS */
  52. -EIO, /* SCMI_ERR_GENERIC */
  53. -EREMOTEIO, /* SCMI_ERR_HARDWARE */
  54. -EPROTO, /* SCMI_ERR_PROTOCOL */
  55. };
  56. static inline int scmi_to_linux_errno(int errno)
  57. {
  58. int err_idx = -errno;
  59. if (err_idx >= SCMI_SUCCESS && err_idx < ARRAY_SIZE(scmi_linux_errmap))
  60. return scmi_linux_errmap[err_idx];
  61. return -EIO;
  62. }
  63. #define MSG_ID_MASK GENMASK(7, 0)
  64. #define MSG_XTRACT_ID(hdr) FIELD_GET(MSG_ID_MASK, (hdr))
  65. #define MSG_TYPE_MASK GENMASK(9, 8)
  66. #define MSG_XTRACT_TYPE(hdr) FIELD_GET(MSG_TYPE_MASK, (hdr))
  67. #define MSG_TYPE_COMMAND 0
  68. #define MSG_TYPE_DELAYED_RESP 2
  69. #define MSG_TYPE_NOTIFICATION 3
  70. #define MSG_PROTOCOL_ID_MASK GENMASK(17, 10)
  71. #define MSG_XTRACT_PROT_ID(hdr) FIELD_GET(MSG_PROTOCOL_ID_MASK, (hdr))
  72. #define MSG_TOKEN_ID_MASK GENMASK(27, 18)
  73. #define MSG_XTRACT_TOKEN(hdr) FIELD_GET(MSG_TOKEN_ID_MASK, (hdr))
  74. #define MSG_TOKEN_MAX (MSG_XTRACT_TOKEN(MSG_TOKEN_ID_MASK) + 1)
  75. /*
  76. * Size of @pending_xfers hashtable included in @scmi_xfers_info; ideally, in
  77. * order to minimize space and collisions, this should equal max_msg, i.e. the
  78. * maximum number of in-flight messages on a specific platform, but such value
  79. * is only available at runtime while kernel hashtables are statically sized:
  80. * pick instead as a fixed static size the maximum number of entries that can
  81. * fit the whole table into one 4k page.
  82. */
  83. #define SCMI_PENDING_XFERS_HT_ORDER_SZ 9
  84. /**
  85. * pack_scmi_header() - packs and returns 32-bit header
  86. *
  87. * @hdr: pointer to header containing all the information on message id,
  88. * protocol id, sequence id and type.
  89. *
  90. * Return: 32-bit packed message header to be sent to the platform.
  91. */
  92. static inline u32 pack_scmi_header(struct scmi_msg_hdr *hdr)
  93. {
  94. return FIELD_PREP(MSG_ID_MASK, hdr->id) |
  95. FIELD_PREP(MSG_TYPE_MASK, hdr->type) |
  96. FIELD_PREP(MSG_TOKEN_ID_MASK, hdr->seq) |
  97. FIELD_PREP(MSG_PROTOCOL_ID_MASK, hdr->protocol_id);
  98. }
  99. /**
  100. * unpack_scmi_header() - unpacks and records message and protocol id
  101. *
  102. * @msg_hdr: 32-bit packed message header sent from the platform
  103. * @hdr: pointer to header to fetch message and protocol id.
  104. */
  105. static inline void unpack_scmi_header(u32 msg_hdr, struct scmi_msg_hdr *hdr)
  106. {
  107. hdr->id = MSG_XTRACT_ID(msg_hdr);
  108. hdr->protocol_id = MSG_XTRACT_PROT_ID(msg_hdr);
  109. hdr->type = MSG_XTRACT_TYPE(msg_hdr);
  110. }
  111. /*
  112. * An helper macro to lookup an xfer from the @pending_xfers hashtable
  113. * using the message sequence number token as a key.
  114. */
  115. #define XFER_FIND(__ht, __k) \
  116. ({ \
  117. typeof(__k) k_ = __k; \
  118. struct scmi_xfer *xfer_ = NULL; \
  119. \
  120. hash_for_each_possible((__ht), xfer_, node, k_) \
  121. if (xfer_->hdr.seq == k_) \
  122. break; \
  123. xfer_; \
  124. })
  125. struct scmi_revision_info *
  126. scmi_revision_area_get(const struct scmi_protocol_handle *ph);
  127. void scmi_setup_protocol_implemented(const struct scmi_protocol_handle *ph,
  128. u8 *prot_imp);
  129. extern const struct bus_type scmi_bus_type;
  130. #define SCMI_BUS_NOTIFY_DEVICE_REQUEST 0
  131. #define SCMI_BUS_NOTIFY_DEVICE_UNREQUEST 1
  132. extern struct blocking_notifier_head scmi_requested_devices_nh;
  133. struct scmi_device *scmi_device_create(struct device_node *np,
  134. struct device *parent, int protocol,
  135. const char *name);
  136. void scmi_device_destroy(struct device *parent, int protocol, const char *name);
  137. int scmi_protocol_acquire(const struct scmi_handle *handle, u8 protocol_id);
  138. void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id);
  139. /* SCMI Transport */
  140. /**
  141. * struct scmi_chan_info - Structure representing a SCMI channel information
  142. *
  143. * @id: An identifier for this channel: this matches the protocol number
  144. * used to initialize this channel
  145. * @dev: Reference to device in the SCMI hierarchy corresponding to this
  146. * channel
  147. * @is_p2a: A flag to identify a channel as P2A (RX)
  148. * @rx_timeout_ms: The configured RX timeout in milliseconds.
  149. * @max_msg_size: Maximum size of message payload.
  150. * @handle: Pointer to SCMI entity handle
  151. * @no_completion_irq: Flag to indicate that this channel has no completion
  152. * interrupt mechanism for synchronous commands.
  153. * This can be dynamically set by transports at run-time
  154. * inside their provided .chan_setup().
  155. * @transport_info: Transport layer related information
  156. */
  157. struct scmi_chan_info {
  158. int id;
  159. struct device *dev;
  160. bool is_p2a;
  161. unsigned int rx_timeout_ms;
  162. unsigned int max_msg_size;
  163. struct scmi_handle *handle;
  164. bool no_completion_irq;
  165. void *transport_info;
  166. };
  167. /**
  168. * struct scmi_transport_ops - Structure representing a SCMI transport ops
  169. *
  170. * @chan_available: Callback to check if channel is available or not
  171. * @chan_setup: Callback to allocate and setup a channel
  172. * @chan_free: Callback to free a channel
  173. * @get_max_msg: Optional callback to provide max_msg dynamically
  174. * Returns the maximum number of messages for the channel type
  175. * (tx or rx) that can be pending simultaneously in the system
  176. * @send_message: Callback to send a message
  177. * @mark_txdone: Callback to mark tx as done
  178. * @fetch_response: Callback to fetch response
  179. * @fetch_notification: Callback to fetch notification
  180. * @clear_channel: Callback to clear a channel
  181. * @poll_done: Callback to poll transfer status
  182. */
  183. struct scmi_transport_ops {
  184. bool (*chan_available)(struct device_node *of_node, int idx);
  185. int (*chan_setup)(struct scmi_chan_info *cinfo, struct device *dev,
  186. bool tx);
  187. int (*chan_free)(int id, void *p, void *data);
  188. unsigned int (*get_max_msg)(struct scmi_chan_info *base_cinfo);
  189. int (*send_message)(struct scmi_chan_info *cinfo,
  190. struct scmi_xfer *xfer);
  191. void (*mark_txdone)(struct scmi_chan_info *cinfo, int ret,
  192. struct scmi_xfer *xfer);
  193. void (*fetch_response)(struct scmi_chan_info *cinfo,
  194. struct scmi_xfer *xfer);
  195. void (*fetch_notification)(struct scmi_chan_info *cinfo,
  196. size_t max_len, struct scmi_xfer *xfer);
  197. void (*clear_channel)(struct scmi_chan_info *cinfo);
  198. bool (*poll_done)(struct scmi_chan_info *cinfo, struct scmi_xfer *xfer);
  199. };
  200. /**
  201. * struct scmi_desc - Description of SoC integration
  202. *
  203. * @ops: Pointer to the transport specific ops structure
  204. * @max_rx_timeout_ms: Timeout for communication with SoC (in Milliseconds)
  205. * @max_msg: Maximum number of messages for a channel type (tx or rx) that can
  206. * be pending simultaneously in the system. May be overridden by the
  207. * get_max_msg op.
  208. * @max_msg_size: Maximum size of data payload per message that can be handled.
  209. * @atomic_threshold: Optional system wide DT-configured threshold, expressed
  210. * in microseconds, for atomic operations.
  211. * Only SCMI synchronous commands reported by the platform
  212. * to have an execution latency lesser-equal to the threshold
  213. * should be considered for atomic mode operation: such
  214. * decision is finally left up to the SCMI drivers.
  215. * @force_polling: Flag to force this whole transport to use SCMI core polling
  216. * mechanism instead of completion interrupts even if available.
  217. * @sync_cmds_completed_on_ret: Flag to indicate that the transport assures
  218. * synchronous-command messages are atomically
  219. * completed on .send_message: no need to poll
  220. * actively waiting for a response.
  221. * Used by core internally only when polling is
  222. * selected as a waiting for reply method: i.e.
  223. * if a completion irq was found use that anyway.
  224. * @atomic_enabled: Flag to indicate that this transport, which is assured not
  225. * to sleep anywhere on the TX path, can be used in atomic mode
  226. * when requested.
  227. */
  228. struct scmi_desc {
  229. const struct scmi_transport_ops *ops;
  230. int max_rx_timeout_ms;
  231. int max_msg;
  232. int max_msg_size;
  233. unsigned int atomic_threshold;
  234. const bool force_polling;
  235. const bool sync_cmds_completed_on_ret;
  236. const bool atomic_enabled;
  237. };
  238. static inline bool is_polling_required(struct scmi_chan_info *cinfo,
  239. const struct scmi_desc *desc)
  240. {
  241. return cinfo->no_completion_irq || desc->force_polling;
  242. }
  243. static inline bool is_transport_polling_capable(const struct scmi_desc *desc)
  244. {
  245. return desc->ops->poll_done || desc->sync_cmds_completed_on_ret;
  246. }
  247. static inline bool is_polling_enabled(struct scmi_chan_info *cinfo,
  248. const struct scmi_desc *desc)
  249. {
  250. return is_polling_required(cinfo, desc) &&
  251. is_transport_polling_capable(desc);
  252. }
  253. void scmi_xfer_raw_put(const struct scmi_handle *handle,
  254. struct scmi_xfer *xfer);
  255. struct scmi_xfer *scmi_xfer_raw_get(const struct scmi_handle *handle);
  256. struct scmi_chan_info *
  257. scmi_xfer_raw_channel_get(const struct scmi_handle *handle, u8 protocol_id);
  258. int scmi_xfer_raw_inflight_register(const struct scmi_handle *handle,
  259. struct scmi_xfer *xfer);
  260. int scmi_xfer_raw_wait_for_message_response(struct scmi_chan_info *cinfo,
  261. struct scmi_xfer *xfer,
  262. unsigned int timeout_ms);
  263. enum debug_counters {
  264. SENT_OK,
  265. SENT_FAIL,
  266. SENT_FAIL_POLLING_UNSUPPORTED,
  267. SENT_FAIL_CHANNEL_NOT_FOUND,
  268. RESPONSE_OK,
  269. NOTIFICATION_OK,
  270. DELAYED_RESPONSE_OK,
  271. XFERS_RESPONSE_TIMEOUT,
  272. XFERS_RESPONSE_POLLED_TIMEOUT,
  273. RESPONSE_POLLED_OK,
  274. ERR_MSG_UNEXPECTED,
  275. ERR_MSG_INVALID,
  276. ERR_MSG_NOMEM,
  277. ERR_PROTOCOL,
  278. XFERS_INFLIGHT,
  279. SCMI_DEBUG_COUNTERS_LAST
  280. };
  281. /**
  282. * struct scmi_debug_info - Debug common info
  283. * @top_dentry: A reference to the top debugfs dentry
  284. * @name: Name of this SCMI instance
  285. * @type: Type of this SCMI instance
  286. * @is_atomic: Flag to state if the transport of this instance is atomic
  287. * @counters: An array of atomic_c's used for tracking statistics (if enabled)
  288. */
  289. struct scmi_debug_info {
  290. struct dentry *top_dentry;
  291. const char *name;
  292. const char *type;
  293. bool is_atomic;
  294. atomic_t counters[SCMI_DEBUG_COUNTERS_LAST];
  295. };
  296. static inline void scmi_inc_count(struct scmi_debug_info *dbg, int stat)
  297. {
  298. if (IS_ENABLED(CONFIG_ARM_SCMI_DEBUG_COUNTERS)) {
  299. if (dbg)
  300. atomic_inc(&dbg->counters[stat]);
  301. }
  302. }
  303. static inline void scmi_dec_count(struct scmi_debug_info *dbg, int stat)
  304. {
  305. if (IS_ENABLED(CONFIG_ARM_SCMI_DEBUG_COUNTERS)) {
  306. if (dbg)
  307. atomic_dec(&dbg->counters[stat]);
  308. }
  309. }
  310. enum scmi_bad_msg {
  311. MSG_UNEXPECTED = -1,
  312. MSG_INVALID = -2,
  313. MSG_UNKNOWN = -3,
  314. MSG_NOMEM = -4,
  315. MSG_MBOX_SPURIOUS = -5,
  316. };
  317. /* Used for compactness and signature validation of the function pointers being
  318. * passed.
  319. */
  320. typedef void (*shmem_copy_toio_t)(void __iomem *to, const void *from,
  321. size_t count);
  322. typedef void (*shmem_copy_fromio_t)(void *to, const void __iomem *from,
  323. size_t count);
  324. /**
  325. * struct scmi_shmem_io_ops - I/O operations to read from/write to
  326. * Shared Memory
  327. *
  328. * @toio: Copy data to the shared memory area
  329. * @fromio: Copy data from the shared memory area
  330. */
  331. struct scmi_shmem_io_ops {
  332. shmem_copy_fromio_t fromio;
  333. shmem_copy_toio_t toio;
  334. };
  335. /* shmem related declarations */
  336. struct scmi_shared_mem;
  337. /**
  338. * struct scmi_shared_mem_operations - Transport core operations for
  339. * Shared Memory
  340. *
  341. * @tx_prepare: Prepare the @xfer message for transmission on the chosen @shmem
  342. * @read_header: Read header of the message currently hold in @shmem
  343. * @fetch_response: Copy the message response from @shmem into @xfer
  344. * @fetch_notification: Copy the message notification from @shmem into @xfer
  345. * @clear_channel: Clear the @shmem channel busy flag
  346. * @poll_done: Check if poll has completed for @xfer on @shmem
  347. * @channel_free: Check if @shmem channel is marked as free
  348. * @channel_intr_enabled: Check is @shmem channel has requested a completion irq
  349. * @setup_iomap: Setup IO shared memory for channel @cinfo
  350. */
  351. struct scmi_shared_mem_operations {
  352. void (*tx_prepare)(struct scmi_shared_mem __iomem *shmem,
  353. struct scmi_xfer *xfer,
  354. struct scmi_chan_info *cinfo,
  355. shmem_copy_toio_t toio);
  356. u32 (*read_header)(struct scmi_shared_mem __iomem *shmem);
  357. void (*fetch_response)(struct scmi_shared_mem __iomem *shmem,
  358. struct scmi_xfer *xfer,
  359. shmem_copy_fromio_t fromio);
  360. void (*fetch_notification)(struct scmi_shared_mem __iomem *shmem,
  361. size_t max_len, struct scmi_xfer *xfer,
  362. shmem_copy_fromio_t fromio);
  363. void (*clear_channel)(struct scmi_shared_mem __iomem *shmem);
  364. bool (*poll_done)(struct scmi_shared_mem __iomem *shmem,
  365. struct scmi_xfer *xfer);
  366. bool (*channel_free)(struct scmi_shared_mem __iomem *shmem);
  367. bool (*channel_intr_enabled)(struct scmi_shared_mem __iomem *shmem);
  368. void __iomem *(*setup_iomap)(struct scmi_chan_info *cinfo,
  369. struct device *dev,
  370. bool tx, struct resource *res,
  371. struct scmi_shmem_io_ops **ops);
  372. };
  373. const struct scmi_shared_mem_operations *scmi_shared_mem_operations_get(void);
  374. /* declarations for message passing transports */
  375. struct scmi_msg_payld;
  376. /* Maximum overhead of message w.r.t. struct scmi_desc.max_msg_size */
  377. #define SCMI_MSG_MAX_PROT_OVERHEAD (2 * sizeof(__le32))
  378. /**
  379. * struct scmi_message_operations - Transport core operations for Message
  380. *
  381. * @response_size: Get calculated response size for @xfer
  382. * @command_size: Get calculated command size for @xfer
  383. * @tx_prepare: Prepare the @xfer message for transmission on the provided @msg
  384. * @read_header: Read header of the message currently hold in @msg
  385. * @fetch_response: Copy the message response from @msg into @xfer
  386. * @fetch_notification: Copy the message notification from @msg into @xfer
  387. */
  388. struct scmi_message_operations {
  389. size_t (*response_size)(struct scmi_xfer *xfer);
  390. size_t (*command_size)(struct scmi_xfer *xfer);
  391. void (*tx_prepare)(struct scmi_msg_payld *msg, struct scmi_xfer *xfer);
  392. u32 (*read_header)(struct scmi_msg_payld *msg);
  393. void (*fetch_response)(struct scmi_msg_payld *msg, size_t len,
  394. struct scmi_xfer *xfer);
  395. void (*fetch_notification)(struct scmi_msg_payld *msg, size_t len,
  396. size_t max_len, struct scmi_xfer *xfer);
  397. };
  398. const struct scmi_message_operations *scmi_message_operations_get(void);
  399. /**
  400. * struct scmi_transport_core_operations - Transpoert core operations
  401. *
  402. * @bad_message_trace: An helper to report a malformed/unexpected message
  403. * @rx_callback: Callback to report received messages
  404. * @shmem: Datagram operations for shared memory based transports
  405. * @msg: Datagram operations for message based transports
  406. */
  407. struct scmi_transport_core_operations {
  408. void (*bad_message_trace)(struct scmi_chan_info *cinfo,
  409. u32 msg_hdr, enum scmi_bad_msg err);
  410. void (*rx_callback)(struct scmi_chan_info *cinfo, u32 msg_hdr,
  411. void *priv);
  412. const struct scmi_shared_mem_operations *shmem;
  413. const struct scmi_message_operations *msg;
  414. };
  415. /**
  416. * struct scmi_transport - A structure representing a configured transport
  417. *
  418. * @supplier: Device representing the transport and acting as a supplier for
  419. * the core SCMI stack
  420. * @desc: Transport descriptor
  421. * @core_ops: A pointer to a pointer used by the core SCMI stack to make the
  422. * core transport operations accessible to the transports.
  423. */
  424. struct scmi_transport {
  425. struct device *supplier;
  426. struct scmi_desc desc;
  427. struct scmi_transport_core_operations **core_ops;
  428. };
  429. #define DEFINE_SCMI_TRANSPORT_DRIVER(__tag, __drv, __desc, __match, __core_ops)\
  430. static void __tag##_dev_free(void *data) \
  431. { \
  432. struct platform_device *spdev = data; \
  433. \
  434. platform_device_unregister(spdev); \
  435. } \
  436. \
  437. static int __tag##_probe(struct platform_device *pdev) \
  438. { \
  439. struct device *dev = &pdev->dev; \
  440. struct platform_device *spdev; \
  441. struct scmi_transport strans; \
  442. int ret; \
  443. \
  444. spdev = platform_device_alloc("arm-scmi", PLATFORM_DEVID_AUTO); \
  445. if (!spdev) \
  446. return -ENOMEM; \
  447. \
  448. device_set_of_node_from_dev(&spdev->dev, dev); \
  449. \
  450. strans.supplier = dev; \
  451. memcpy(&strans.desc, &(__desc), sizeof(strans.desc)); \
  452. strans.core_ops = &(__core_ops); \
  453. \
  454. ret = platform_device_add_data(spdev, &strans, sizeof(strans)); \
  455. if (ret) \
  456. goto err; \
  457. \
  458. spdev->dev.parent = dev; \
  459. ret = platform_device_add(spdev); \
  460. if (ret) \
  461. goto err; \
  462. \
  463. return devm_add_action_or_reset(dev, __tag##_dev_free, spdev); \
  464. \
  465. err: \
  466. platform_device_put(spdev); \
  467. return ret; \
  468. } \
  469. \
  470. static struct platform_driver __drv = { \
  471. .driver = { \
  472. .name = #__tag "_transport", \
  473. .of_match_table = __match, \
  474. }, \
  475. .probe = __tag##_probe, \
  476. }
  477. void scmi_notification_instance_data_set(const struct scmi_handle *handle,
  478. void *priv);
  479. void *scmi_notification_instance_data_get(const struct scmi_handle *handle);
  480. int scmi_inflight_count(const struct scmi_handle *handle);
  481. #endif /* _SCMI_COMMON_H */