synx_api.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef __SYNX_API_H__
  7. #define __SYNX_API_H__
  8. #include <linux/list.h>
  9. #include <synx_header.h>
  10. #include "synx_err.h"
  11. #define SYNX_NO_TIMEOUT ((u64)-1)
  12. /**
  13. * SYNX_INVALID_HANDLE : client can assign the synx handle variable with this value
  14. * when it doesn't hold a valid synx handle
  15. */
  16. #define SYNX_INVALID_HANDLE 0
  17. /* synx object states */
  18. #define SYNX_STATE_INVALID 0 // Invalid synx object
  19. #define SYNX_STATE_ACTIVE 1 // Synx object has not been signaled
  20. #define SYNX_STATE_SIGNALED_ERROR 3 // Synx object signaled with error
  21. #define SYNX_STATE_SIGNALED_EXTERNAL 5 // Synx object was signaled by external dma client.
  22. #define SYNX_STATE_SIGNALED_SSR 6 // Synx object signaled with SSR
  23. #define SYNX_STATE_TIMEOUT 7 // Callback status for synx object in case of timeout
  24. /**
  25. * enum synx_create_flags - Flags passed during synx_create call.
  26. *
  27. * SYNX_CREATE_LOCAL_FENCE : Instructs the framework to create local synx object,
  28. * for local synchronization i.e. within same core.
  29. * SYNX_CREATE_GLOBAL_FENCE : Instructs the framework to create global synx object
  30. * for global synchronization i.e. across supported core.
  31. * SYNX_CREATE_DMA_FENCE : Create a synx object by wrapping the provided dma fence.
  32. * Need to pass the dma_fence ptr through fence variable
  33. * if this flag is set. (NOT SUPPORTED)
  34. * SYNX_CREATE_CSL_FENCE : Create a synx object with provided csl fence.
  35. * Establishes interop with the csl fence through
  36. * bind operations. (NOT SUPPORTED)
  37. */
  38. enum synx_create_flags {
  39. SYNX_CREATE_LOCAL_FENCE = 0x01,
  40. SYNX_CREATE_GLOBAL_FENCE = 0x02,
  41. SYNX_CREATE_DMA_FENCE = 0x04,
  42. SYNX_CREATE_CSL_FENCE = 0x08,
  43. SYNX_CREATE_MAX_FLAGS = 0x10,
  44. };
  45. /**
  46. * enum synx_init_flags - Session initialization flag
  47. * SYNX_INIT_DEFAULT : Initialization flag to be passed
  48. * when initializing session
  49. * SYNX_INIT_MAX : Used for internal checks
  50. */
  51. enum synx_init_flags {
  52. SYNX_INIT_DEFAULT = 0x00,
  53. SYNX_INIT_MAX = 0x01,
  54. };
  55. /**
  56. * enum synx_import_flags - Import flags
  57. *
  58. * SYNX_IMPORT_LOCAL_FENCE : Instructs the framework to create local synx object,
  59. * for local synchronization i.e. within same core.
  60. * SYNX_IMPORT_GLOBAL_FENCE : Instructs the framework to create global synx object,
  61. * for global synchronization i.e. across supported core.
  62. * SYNX_IMPORT_SYNX_FENCE : Import native Synx handle for synchronization.
  63. * Need to pass the Synx handle ptr through fence variable
  64. * if this flag is set. Client must pass:
  65. * a. SYNX_IMPORT_SYNX_FENCE|SYNX_IMPORT_LOCAL_FENCE
  66. * to import a synx handle as local synx handle.
  67. * b. SYNX_IMPORT_SYNX_FENCE|SYNX_IMPORT_GLOBAL_FENCE
  68. * to import a synx handle as global synx handle.
  69. * SYNX_IMPORT_DMA_FENCE : Import dma fence and create Synx handle for interop.
  70. * Need to pass the dma_fence ptr through fence variable
  71. * if this flag is set. Client must pass:
  72. * a. SYNX_IMPORT_DMA_FENCE|SYNX_IMPORT_LOCAL_FENCE
  73. * to import a dma fence and create local synx handle
  74. * for interop.
  75. * b. SYNX_IMPORT_DMA_FENCE|SYNX_IMPORT_GLOBAL_FENCE
  76. * to import a dma fence and create global synx handle
  77. * for interop.
  78. * SYNX_IMPORT_EX_RELEASE : Flag to inform relaxed invocation where release call
  79. * need not be called by client on this handle after import.
  80. * (NOT SUPPORTED)
  81. */
  82. enum synx_import_flags {
  83. SYNX_IMPORT_LOCAL_FENCE = 0x01,
  84. SYNX_IMPORT_GLOBAL_FENCE = 0x02,
  85. SYNX_IMPORT_SYNX_FENCE = 0x04,
  86. SYNX_IMPORT_DMA_FENCE = 0x08,
  87. SYNX_IMPORT_EX_RELEASE = 0x10,
  88. };
  89. /**
  90. * enum synx_signal_status - Signal status
  91. *
  92. * SYNX_STATE_SIGNALED_SUCCESS : Signal success
  93. * SYNX_STATE_SIGNALED_CANCEL : Signal cancellation
  94. * SYNX_STATE_SIGNALED_MAX : Clients can send custom notification
  95. * beyond the max value (only positive)
  96. */
  97. enum synx_signal_status {
  98. SYNX_STATE_SIGNALED_SUCCESS = 2,
  99. SYNX_STATE_SIGNALED_CANCEL = 4,
  100. SYNX_STATE_SIGNALED_MAX = 64,
  101. };
  102. /**
  103. * synx_callback - Callback invoked by external fence
  104. *
  105. * External fence dispatch the registered callback to notify
  106. * signal to synx framework.
  107. */
  108. typedef void (*synx_callback)(s32 sync_obj, int status, void *data);
  109. /**
  110. * synx_user_callback - Callback function registered by clients
  111. *
  112. * User callback registered for non-blocking wait. Dispatched when
  113. * synx object is signaled or timed-out with status of synx object.
  114. */
  115. typedef void (*synx_user_callback_t)(u32 h_synx, int status, void *data);
  116. /**
  117. * struct bind_operations - Function pointers that need to be defined
  118. * to achieve bind functionality for external fence with synx obj
  119. *
  120. * @register_callback : Function to register with external sync object
  121. * @deregister_callback : Function to deregister with external sync object
  122. * @enable_signaling : Function to enable the signaling on the external
  123. * sync object (optional)
  124. * @signal : Function to signal the external sync object
  125. */
  126. struct bind_operations {
  127. int (*register_callback)(synx_callback cb_func,
  128. void *userdata, s32 sync_obj);
  129. int (*deregister_callback)(synx_callback cb_func,
  130. void *userdata, s32 sync_obj);
  131. int (*enable_signaling)(s32 sync_obj);
  132. int (*signal)(s32 sync_obj, u32 status);
  133. };
  134. /**
  135. * synx_bind_client_type : External fence supported for bind (NOT SUPPORTED)
  136. *
  137. * SYNX_TYPE_CSL : Camera CSL fence
  138. * SYNX_MAX_BIND_TYPES : Used for internal checks
  139. */
  140. enum synx_bind_client_type {
  141. SYNX_TYPE_CSL = 0,
  142. SYNX_MAX_BIND_TYPES,
  143. };
  144. /**
  145. * struct synx_register_params - External registration parameters (NOT SUPPORTED)
  146. *
  147. * @ops : Bind operations struct
  148. * @name : External client name
  149. * Only first 64 bytes are accepted, rest will be ignored
  150. * @type : Synx bind client type
  151. */
  152. struct synx_register_params {
  153. struct bind_operations ops;
  154. char *name;
  155. enum synx_bind_client_type type;
  156. };
  157. /**
  158. * struct synx_queue_desc - Memory descriptor of the queue allocated by
  159. * the fence driver for each client during
  160. * register. (Clients need not pass any pointer
  161. * in synx_initialize_params. It is for future
  162. * use).
  163. *
  164. * @vaddr : CPU virtual address of the queue.
  165. * @dev_addr : Physical address of the memory object.
  166. * @size : Size of the memory.
  167. * @mem_data : Internal pointer with the attributes of the allocation.
  168. */
  169. struct synx_queue_desc {
  170. void *vaddr;
  171. u64 dev_addr;
  172. u64 size;
  173. void *mem_data;
  174. };
  175. /**
  176. * enum synx_client_id : Unique identifier of the supported clients
  177. *
  178. * @SYNX_CLIENT_NATIVE : Native Client
  179. * @SYNX_CLIENT_GFX_CTX0 : GFX Client 0
  180. * @SYNX_CLIENT_DPU_CTL0 : DPU Client 0
  181. * @SYNX_CLIENT_DPU_CTL1 : DPU Client 1
  182. * @SYNX_CLIENT_DPU_CTL2 : DPU Client 2
  183. * @SYNX_CLIENT_DPU_CTL3 : DPU Client 3
  184. * @SYNX_CLIENT_DPU_CTL4 : DPU Client 4
  185. * @SYNX_CLIENT_DPU_CTL5 : DPU Client 5
  186. * @SYNX_CLIENT_EVA_CTX0 : EVA Client 0
  187. * @SYNX_CLIENT_VID_CTX0 : Video Client 0
  188. * @SYNX_CLIENT_NSP_CTX0 : NSP Client 0
  189. * @SYNX_CLIENT_IFE_CTX0 : IFE Client 0
  190. * @SYNX_CLIENT_ICP_CTX0 : ICP Client 0
  191. */
  192. enum synx_client_id {
  193. SYNX_CLIENT_NATIVE = 0,
  194. SYNX_CLIENT_GFX_CTX0,
  195. SYNX_CLIENT_DPU_CTL0,
  196. SYNX_CLIENT_DPU_CTL1,
  197. SYNX_CLIENT_DPU_CTL2,
  198. SYNX_CLIENT_DPU_CTL3,
  199. SYNX_CLIENT_DPU_CTL4,
  200. SYNX_CLIENT_DPU_CTL5,
  201. SYNX_CLIENT_EVA_CTX0,
  202. SYNX_CLIENT_VID_CTX0,
  203. SYNX_CLIENT_NSP_CTX0,
  204. SYNX_CLIENT_IFE_CTX0,
  205. SYNX_CLIENT_ICP_CTX0,
  206. SYNX_CLIENT_MAX,
  207. };
  208. /**
  209. * struct synx_session - Client session identifier
  210. *
  211. * @type : Session type.
  212. * Internal Member. (Do not access/modify)
  213. * @client : Pointer to client session
  214. * Internal Member. (Do not access/modify)
  215. */
  216. struct synx_session {
  217. u32 type;
  218. void *client;
  219. };
  220. /**
  221. * struct synx_initialization_params - Session params
  222. *
  223. * @name : Client session name
  224. * Only first 64 bytes are accepted, rest will be ignored
  225. * @ptr : Memory descriptor of queue allocated by fence during
  226. * device register. (filled by function)
  227. * @id : Client identifier
  228. * @flags : Synx initialization flags
  229. */
  230. struct synx_initialization_params {
  231. const char *name;
  232. struct synx_queue_desc *ptr;
  233. enum synx_client_id id;
  234. enum synx_init_flags flags;
  235. };
  236. /**
  237. * struct synx_create_params - Synx creation parameters
  238. *
  239. * @name : Optional parameter associating a name with the synx
  240. * object for debug purposes
  241. * Only first 64 bytes are accepted,
  242. * rest will be ignored
  243. * @h_synx : Pointer to synx object handle (filled by function)
  244. * @fence : Pointer to external dma fence or csl fence. (NOT SUPPORTED)
  245. * @flags : Synx flags for customization
  246. */
  247. struct synx_create_params {
  248. const char *name;
  249. u32 *h_synx;
  250. void *fence;
  251. enum synx_create_flags flags;
  252. };
  253. /**
  254. * enum synx_merge_flags - Handle merge flags
  255. *
  256. * SYNX_MERGE_LOCAL_FENCE : Create local composite synx object. To be passed along
  257. * with SYNX_MERGE_NOTIFY_ON_ALL.
  258. * SYNX_MERGE_GLOBAL_FENCE : Create global composite synx object. To be passed along
  259. * with SYNX_MERGE_NOTIFY_ON_ALL.
  260. * SYNX_MERGE_NOTIFY_ON_ALL : Notify on signaling of ALL objects.
  261. * Clients must pass:
  262. * a. SYNX_MERGE_LOCAL_FENCE|SYNX_MERGE_NOTIFY_ON_ALL
  263. * to create local composite synx object and notify
  264. * it when all child synx objects are signaled.
  265. * b. SYNX_MERGE_GLOBAL_FENCE|SYNX_MERGE_NOTIFY_ON_ALL
  266. * to create global composite synx object and notify
  267. * it when all child synx objects are signaled.
  268. * SYNX_MERGE_NOTIFY_ON_ANY : Notify on signaling of ANY object. (NOT SUPPORTED)
  269. */
  270. enum synx_merge_flags {
  271. SYNX_MERGE_LOCAL_FENCE = 0x01,
  272. SYNX_MERGE_GLOBAL_FENCE = 0x02,
  273. SYNX_MERGE_NOTIFY_ON_ALL = 0x04,
  274. SYNX_MERGE_NOTIFY_ON_ANY = 0x08,
  275. };
  276. /*
  277. * struct synx_merge_params - Synx merge parameters
  278. *
  279. * @h_synxs : Pointer to a array of synx handles to be merged
  280. * @flags : Merge flags
  281. * @num_objs : Number of synx handles to be merged (in array h_synxs).
  282. * @h_merged_obj : Merged synx handle (filled by function)
  283. */
  284. struct synx_merge_params {
  285. u32 *h_synxs;
  286. enum synx_merge_flags flags;
  287. u32 num_objs;
  288. u32 *h_merged_obj;
  289. };
  290. /**
  291. * enum synx_import_type - Import type
  292. *
  293. * SYNX_IMPORT_INDV_PARAMS : Import filled with synx_import_indv_params struct
  294. * SYNX_IMPORT_ARR_PARAMS : Import filled with synx_import_arr_params struct
  295. */
  296. enum synx_import_type {
  297. SYNX_IMPORT_INDV_PARAMS = 0x01,
  298. SYNX_IMPORT_ARR_PARAMS = 0x02,
  299. };
  300. /**
  301. * struct synx_import_indv_params - Synx import indv parameters
  302. *
  303. * @new_h_synxs : Pointer to new synx object
  304. * (filled by the function)
  305. * The new handle/s should be used by importing
  306. * process for all synx api operations and
  307. * for sharing with FW cores.
  308. * @flags : Synx import flags
  309. * @fence : Pointer to DMA fence fd or synx handle.
  310. */
  311. struct synx_import_indv_params {
  312. u32 *new_h_synx;
  313. enum synx_import_flags flags;
  314. void *fence;
  315. };
  316. /**
  317. * struct synx_import_arr_params - Synx import arr parameters
  318. *
  319. * @list : List of synx_import_indv_params
  320. * @num_fences : Number of fences or synx handles to be imported
  321. */
  322. struct synx_import_arr_params {
  323. struct synx_import_indv_params *list;
  324. u32 num_fences;
  325. };
  326. /**
  327. * struct synx_import_params - Synx import parameters
  328. *
  329. * @type : Import params type filled by client
  330. * @indv : Params to import an individual handle or fence
  331. * @arr : Params to import an array of handles or fences
  332. */
  333. struct synx_import_params {
  334. enum synx_import_type type;
  335. union {
  336. struct synx_import_indv_params indv;
  337. struct synx_import_arr_params arr;
  338. };
  339. };
  340. /**
  341. * struct synx_callback_params - Synx callback parameters
  342. *
  343. * @h_synx : Synx object handle
  344. * @cb_func : Pointer to callback func to be invoked.
  345. * @userdata : Opaque pointer passed back with callback as data
  346. * @cancel_cb_func : Pointer to callback to ack cancellation
  347. * @timeout_ms : Timeout in ms. SYNX_NO_TIMEOUT if no timeout.
  348. */
  349. struct synx_callback_params {
  350. u32 h_synx;
  351. synx_user_callback_t cb_func;
  352. void *userdata;
  353. synx_user_callback_t cancel_cb_func;
  354. u64 timeout_ms;
  355. };
  356. /* Kernel APIs */
  357. /* synx_register_ops - Register operations for external synchronization (NOT SUPPORTED)
  358. *
  359. * Register with synx for enabling external synchronization through bind
  360. *
  361. * @param params : Pointer to register params
  362. *
  363. * @return Status of operation. SYNX_SUCCESS in case of success.
  364. * -SYNX_INVALID will be returned if params are invalid.
  365. * -SYNX_NOMEM will be returned if bind ops cannot be registered due to
  366. * insufficient memory.
  367. * -SYNX_ALREADY will be returned if type already in use.
  368. */
  369. int synx_register_ops(const struct synx_register_params *params);
  370. /**
  371. * synx_deregister_ops - De-register external synchronization operations (NOT SUPPORTED)
  372. *
  373. * @param params : Pointer to register params
  374. *
  375. * @return Status of operation. SYNX_SUCCESS in case of success.
  376. * -SYNX_INVALID will be returned if record not found.
  377. */
  378. int synx_deregister_ops(const struct synx_register_params *params);
  379. /**
  380. * synx_initialize - Initializes a new client session
  381. *
  382. * @param params : Pointer to session init params
  383. *
  384. * @return Client session pointer on success. NULL or error in case of failure.
  385. */
  386. struct synx_session *synx_initialize(struct synx_initialization_params *params);
  387. /**
  388. * synx_uninitialize - Destroys the client session
  389. *
  390. * @param session : Session ptr (returned from synx_initialize)
  391. *
  392. * @return Status of operation. Negative in case of error, SYNX_SUCCESS otherwise.
  393. */
  394. int synx_uninitialize(struct synx_session *session);
  395. /**
  396. * synx_create - Creates a synx object
  397. *
  398. * Creates a new synx obj and returns the handle to client. There can be
  399. * maximum of 4095 global synx handles or local synx handles across
  400. * sessions.
  401. *
  402. * @param session : Session ptr (returned from synx_initialize)
  403. * @param params : Pointer to create params
  404. *
  405. * @return Status of operation. Negative in case of error, SYNX_SUCCESS otherwise.
  406. */
  407. int synx_create(struct synx_session *session, struct synx_create_params *params);
  408. /**
  409. * synx_async_wait - Registers a callback with a synx object
  410. *
  411. * Clients can register maximum of 64 callbacks functions per
  412. * synx session. Clients should register callback functions with minimal computation.
  413. *
  414. * @param session : Session ptr (returned from synx_initialize)
  415. * @param params : Callback params.
  416. * cancel_cb_func in callback params is optional with this API.
  417. *
  418. * @return Status of operation. Negative in case of error, SYNX_SUCCESS otherwise.
  419. */
  420. int synx_async_wait(struct synx_session *session, struct synx_callback_params *params);
  421. /**
  422. * synx_cancel_async_wait - De-registers a callback with a synx object
  423. *
  424. * This API will cancel one instance of callback function (mapped
  425. * with userdata and h_synx) provided in cb_func of callback params.
  426. *
  427. * @param session : Session ptr (returned from synx_initialize)
  428. * @param params : Callback params
  429. *
  430. * @return Status of operation.Negative in case of error, SYNX_SUCCESS otherwise.
  431. */
  432. int synx_cancel_async_wait(struct synx_session *session,
  433. struct synx_callback_params *params);
  434. /**
  435. * synx_signal - Signals a synx object with the status argument.
  436. *
  437. * This function will signal the synx object referenced by h_synx
  438. * and invoke any external binding synx objs.
  439. * The status parameter will indicate whether the entity
  440. * performing the signaling wants to convey an error case or a success case.
  441. *
  442. * @param session : Session ptr (returned from synx_initialize)
  443. * @param h_synx : Synx object handle
  444. * @param status : Status of signaling.
  445. * Clients can send custom signaling status
  446. * beyond SYNX_STATE_SIGNALED_MAX.
  447. *
  448. * @return Status of operation. Negative in case of error. SYNX_SUCCESS otherwise.
  449. */
  450. int synx_signal(struct synx_session *session, u32 h_synx,
  451. enum synx_signal_status status);
  452. /**
  453. * synx_merge - Merges multiple synx objects
  454. *
  455. * This function will merge multiple synx objects into a synx group.
  456. *
  457. * @param session : Session ptr (returned from synx_initialize)
  458. * @param params : Merge params
  459. *
  460. * @return Status of operation. Negative in case of error. SYNX_SUCCESS otherwise.
  461. */
  462. int synx_merge(struct synx_session *session, struct synx_merge_params *params);
  463. /**
  464. * synx_wait - Waits for a synx object synchronously
  465. *
  466. * Does a wait on the synx object identified by h_synx for a maximum
  467. * of timeout_ms milliseconds. Must not be called from interrupt context as
  468. * this API can sleep.
  469. *
  470. * @param session : Session ptr (returned from synx_initialize)
  471. * @param h_synx : Synx object handle to be waited upon
  472. * @param timeout_ms : Timeout in ms
  473. *
  474. * @return Status of synx object if handle is signaled. -SYNX_INVAL if synx object
  475. * is in bad state or arguments are invalid, -SYNX_TIMEOUT if wait times out.
  476. */
  477. int synx_wait(struct synx_session *session, u32 h_synx, u64 timeout_ms);
  478. /**
  479. * synx_get_status - Returns the status of the synx object.
  480. *
  481. * This API should not be used in polling mode to know if the handle
  482. * is signaled or not.
  483. * Clients need to explicitly wait using synx_wait() or synx_async_wait()
  484. *
  485. * @param session : Session ptr (returned from synx_initialize)
  486. * @param h_synx : Synx object handle
  487. *
  488. * @return Status of the synx object
  489. */
  490. int synx_get_status(struct synx_session *session, u32 h_synx);
  491. /**
  492. * synx_import - Imports (looks up) synx object from given handle or fence
  493. * *
  494. * @param session : Session ptr (returned from synx_initialize)
  495. * @param params : Pointer to import params
  496. *
  497. * @return Status of operation. Negative in case of failure, SYNX_SUCCESS otherwise.
  498. */
  499. int synx_import(struct synx_session *session, struct synx_import_params *params);
  500. /**
  501. * synx_get_fence - Get the native fence backing the synx object
  502. *
  503. * Synx framework will take additional reference on dma fence and returns the native
  504. * fence. Clients need to release additional reference explicitly by calling kref_put.
  505. *
  506. * @param session : Session ptr (returned from synx_initialize)
  507. * @param h_synx : Synx object handle
  508. *
  509. * @return Fence pointer in case of success and NULL in case of failure.
  510. */
  511. void *synx_get_fence(struct synx_session *session, u32 h_synx);
  512. /**
  513. * synx_release - Release the synx object.
  514. *
  515. * Every created, imported or merged synx object should be released.
  516. *
  517. * @param session : Session ptr (returned from synx_initialize)
  518. * @param h_synx : Synx object handle to be destroyed
  519. *
  520. * @return Status of operation. Negative in case of error. SYNX_SUCCESS otherwise.
  521. */
  522. int synx_release(struct synx_session *session, u32 h_synx);
  523. /**
  524. * synx_recover - Recover any possible handle leaks
  525. *
  526. * Function should be called on HW hang/reset to
  527. * recover the Synx handles shared. This cleans up
  528. * synx handles owned by subsystem under hang/reset, and avoids
  529. * potential resource leaks.
  530. *
  531. * Function does not destroy the session, but only
  532. * recover synx handles belonging to the session.
  533. * Synx session would still be active and clients
  534. * need to destroy the session explicitly through
  535. * synx_uninitialize API.
  536. *
  537. * All the unsignaled handles owned/imported by the core at the time of reset
  538. * will be signaled by synx framework on behalf of hung core with SYNX_STATE_SIGNALED_SSR.
  539. *
  540. * @param id : Client ID of core to recover
  541. *
  542. * @return Status of operation. Negative in case of error. SYNX_SUCCESS otherwise.
  543. */
  544. int synx_recover(enum synx_client_id id);
  545. #endif /* __SYNX_API_H__ */