Skip to content

Commit c5f37c2

Browse files
committed
cleanup: remove stale async fastrpc code (#218)
Removed async-related fastrpc code. It is stable code that is no longer used or maintained. Signed-off-by: Jianping Li <[email protected]>
1 parent bd8980c commit c5f37c2

File tree

11 files changed

+12
-935
lines changed

11 files changed

+12
-935
lines changed

inc/AEEStdErr.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,6 @@
289289

290290
#define AEE_DEFAULT_PROCESS (AEE_EOFFSET + 0x180) ///< Default process in Guest OS is not present
291291
#define AEE_ENULLCONTEXT (AEE_EOFFSET + 0x181) ///< User NULL context vote
292-
#define AEE_EINVALIDJOB (AEE_EOFFSET + 0x182) ///< AsyncRPC Invalid job
293-
#define AEE_EBUSY (AEE_EOFFSET + 0x183) ///< AsyncRPC Pending job
294292

295293
/** @defgroup heaperror Heap error codes
296294
* @{

inc/Makefile.am

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ noinst_HEADERS = \
3636
dspqueue_shared.h \
3737
dspsignal.h \
3838
fastrpc_apps_user.h \
39-
fastrpc_async.h \
4039
fastrpc_cap.h \
4140
fastrpc_common.h \
4241
fastrpc_config.h \

inc/fastrpc_async.h

Lines changed: 0 additions & 73 deletions
This file was deleted.

inc/fastrpc_internal.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
* Update these values for any additions to
4444
* the corresponding enums.
4545
**/
46-
/* Max value of fastrpc_async_notify_type, used to validate the user input */
47-
#define FASTRPC_ASYNC_TYPE_MAX FASTRPC_ASYNC_POLL + 1
4846

4947
/* Max value of remote_dsp_attributes, used to validate the attribute ID*/
5048
#define FASTRPC_MAX_DSP_ATTRIBUTES MCID_MULTICAST + 1
@@ -190,7 +188,6 @@ enum fastrpc_control_type {
190188
FASTRPC_CONTROL_WAKELOCK = 4,
191189
FASTRPC_CONTROL_PM = 5,
192190
FASTRPC_CONTROL_RPC_POLL = 7,
193-
FASTRPC_CONTROL_ASYNC_WAKE = 8,
194191
FASTRPC_CONTROL_NOTIF_WAKE = 9,
195192
};
196193

@@ -319,8 +316,6 @@ struct handle_list {
319316
uint64_t jobid;
320317
/* Capability flag to check if mapping DMA handle through reverse RPC is supported */
321318
int dma_handle_reverse_rpc_map_capability;
322-
/* Mutex to synchronize ASync init and deinit */
323-
pthread_mutex_t async_init_deinit_mut;
324319
uint32_t pd_initmem_size; /** Initial memory allocated for remote userPD */
325320
uint32_t refs; // Number of multi-domain handles + contexts on session
326321
bool is_session_reserved; /** Set if session is reserved or used */
@@ -377,11 +372,6 @@ int check_rpc_error(int err);
377372
**/
378373
void fastrpc_qos_activity(int domain);
379374

380-
/**
381-
* @brief Make IOCTL call to exit async thread
382-
*/
383-
int fastrpc_exit_async_thread(int domain);
384-
385375
/**
386376
* @brief Make IOCTL call to exit notif thread
387377
*/
@@ -509,8 +499,7 @@ int fastrpc_update_module_list(uint32_t req, int domain, remote_handle64 handle,
509499
* @brief functions to wrap ioctl syscalls for downstream and upstream kernel
510500
**/
511501
int ioctl_init(int dev, uint32_t flags, int attr, unsigned char* shell, int shelllen, int shellfd, char* initmem, int initmemlen, int initmemfd, int tessiglen);
512-
int ioctl_invoke(int dev, int req, remote_handle handle, uint32_t sc, void* pra, int* fds, unsigned int* attrs, void *job, unsigned int* crc, uint64_t* perf_kernel, uint64_t* perf_dsp);
513-
int ioctl_invoke2_response(int dev, fastrpc_async_jobid *jobid, remote_handle *handle, uint32_t *sc, int* result, uint64_t *perf_kernel, uint64_t *perf_dsp);
502+
int ioctl_invoke(int dev, int req, remote_handle handle, uint32_t sc, void* pra, int* fds, unsigned int* attrs, unsigned int* crc, uint64_t* perf_kernel, uint64_t* perf_dsp);
514503
int ioctl_invoke2_notif(int dev, int *domain, int *session, int *status);
515504
int ioctl_mmap(int dev, int req, uint32_t flags, int attr, int fd, int offset, size_t len, uintptr_t vaddrin, uint64_t* vaddr_out);
516505
int ioctl_munmap(int dev, int req, int attr, void* buf, int fd, int len, uint64_t vaddr);
@@ -546,7 +535,6 @@ int ioctl_mdctx_manage(int dev, int req, void *user_ctx,
546535
unsigned int *domain_ids, unsigned int num_domain_ids, uint64_t *ctx);
547536

548537
const char* get_secure_domain_name(int domain_id);
549-
int is_async_fastrpc_supported(void);
550538

551539
#include "fastrpc_ioctl.h"
552540

inc/remote.h

Lines changed: 0 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -190,40 +190,6 @@ typedef union {
190190
remote_dma_handle dma; /** 32-bit remote dma handle */
191191
} remote_arg;
192192

193-
/** 64-bit Remote Arg structure for RPC calls */
194-
typedef union {
195-
remote_buf64 buf; /** 64-bit remote buffer */
196-
remote_handle h; /** non-domains remote handle */
197-
remote_handle64 h64; /** multi-domains remote handle */
198-
remote_dma_handle64 dma; /** 64-bit remote dma handle */
199-
} remote_arg64;
200-
201-
/** Async response type */
202-
enum fastrpc_async_notify_type {
203-
FASTRPC_ASYNC_NO_SYNC, /** No notification required */
204-
FASTRPC_ASYNC_CALLBACK, /** Callback notification using fastrpc_async_callback */
205-
FASTRPC_ASYNC_POLL, /** User will poll for the notification */
206-
/** Update FASTRPC_ASYNC_TYPE_MAX when adding new value to this enum */
207-
};
208-
209-
/** Job id of Async job queued to DSP */
210-
typedef uint64_t fastrpc_async_jobid;
211-
212-
/** Async call back response type, input structure */
213-
typedef struct fastrpc_async_callback {
214-
/** Callback function for async notification */
215-
void (*fn)(fastrpc_async_jobid jobid, void* context, int result);
216-
/** Current context to identify the callback */
217-
void *context;
218-
}fastrpc_async_callback_t;
219-
220-
/** Async descriptor to submit async job */
221-
typedef struct fastrpc_async_descriptor {
222-
enum fastrpc_async_notify_type type; /** Async response type */
223-
fastrpc_async_jobid jobid; /** Job id of Async job queued to DSP */
224-
fastrpc_async_callback_t cb; /** Async call back response type */
225-
}fastrpc_async_descriptor_t;
226-
227193

228194
/**
229195
* Flags used in struct remote_rpc_control_latency
@@ -307,7 +273,6 @@ enum remote_dsp_attributes {
307273
ARCH_VER, /** Hexagon processor architecture version */
308274
HMX_SUPPORT_DEPTH, /** HMX Support Depth */
309275
HMX_SUPPORT_SPATIAL, /** HMX Support Spatial */
310-
ASYNC_FASTRPC_SUPPORT, /** Async FastRPC Support */
311276
STATUS_NOTIFICATION_SUPPORT , /** DSP User PD status notification Support */
312277
MCID_MULTICAST, /** Multicast widget programming */
313278
/** Update FASTRPC_MAX_DSP_ATTRIBUTES when adding new value to this enum */
@@ -362,7 +327,6 @@ enum handle_control_req_id {
362327
DSPRPC_KALLOC_SUPPORT, /** Request ID to check kalloc support by kernel */
363328
DSPRPC_PM, /** Request ID to awake PM */
364329
DSPRPC_RPC_POLL, /** Request ID to update polling mode in kernel */
365-
DSPRPC_ASYNC_WAKE, /** Request ID to exit async thread */
366330
DSPRPC_NOTIF_WAKE, /** Request ID to exit notif thread */
367331
DSPRPC_REMOTE_PROCESS_KILL, /** Request ID to kill remote process */
368332
DSPRPC_SET_MODE, /** Request ID to set mode */
@@ -931,101 +895,6 @@ __QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE(remote_handle64_control)(__
931895
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE(remote_session_control)(__QAIC_IN uint32_t req, __QAIC_IN_LEN(datalen) void *data, __QAIC_IN uint32_t datalen) __QAIC_REMOTE_ATTRIBUTE;
932896

933897

934-
/**
935-
* Invokes a remote handle asynchronously
936-
*
937-
* This function allows asynchronous invocation of remote methods, providing non-blocking
938-
* execution and callback mechanisms.
939-
*
940-
* @param h [in] Remote handle obtained from remote_handle_open()
941-
*
942-
* @param desc [in] Async descriptor containing:
943-
* - type: Type of async job (FASTRPC_ASYNC_NO_SYNC, FASTRPC_ASYNC_CALLBACK)
944-
* - context: User context passed to callback
945-
* - cb: Callback function and arguments (for FASTRPC_ASYNC_CALLBACK type)
946-
* See fastrpc_async_descriptor_t for details
947-
*
948-
* @param dwScalars [in] Method invocation parameters encoded as scalar value:
949-
* - Number of input/output buffers
950-
* - Number of input/output handles
951-
* Use REMOTE_SCALARS_* macros to decode
952-
*
953-
* @param pra [in] Array of remote_arg structures containing:
954-
* 1. Input buffers
955-
* 2. Output buffers
956-
* 3. Input handles
957-
* 4. Output handles
958-
* Output buffers must be allocated via rpcmem_alloc() or
959-
* registered as ION buffers using register_buf()
960-
*
961-
* @return 0 on success, otherwise error code:
962-
* - AEE_EBADPARM: Invalid parameters
963-
* - AEE_EUNSUPPORTED: Async operations not supported
964-
* - AEE_ENOSUCH: Invalid handle
965-
* - Other error codes from FastRPC framework
966-
*
967-
* @note The async job status can be queried using fastrpc_async_get_status()
968-
* @note Resources must be released using fastrpc_release_async_job() after completion
969-
*/
970-
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE(remote_handle_invoke_async)(__QAIC_IN remote_handle h, __QAIC_IN fastrpc_async_descriptor_t *desc, __QAIC_IN uint32_t dwScalars, __QAIC_IN remote_arg *pra) __QAIC_REMOTE_ATTRIBUTE;
971-
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE(remote_handle64_invoke_async)(__QAIC_IN remote_handle64 h, __QAIC_IN fastrpc_async_descriptor_t *desc, __QAIC_IN uint32_t dwScalars, __QAIC_IN remote_arg *pra) __QAIC_REMOTE_ATTRIBUTE;
972-
973-
974-
/**
975-
* Gets the status and result of an asynchronous FastRPC job
976-
*
977-
* This function allows checking the completion status of an asynchronous FastRPC job
978-
* and retrieving its result. It can be configured to wait for job completion with
979-
* different timeout behaviors.
980-
*
981-
* @param jobid [in] Job ID returned by remote_handle_invoke_async() when submitting
982-
* the asynchronous job
983-
*
984-
* @param timeout_us [in] Timeout value in microseconds:
985-
* - 0: Returns immediately with current status/result
986-
* - Positive value: Waits up to specified microseconds for completion
987-
* - Negative value: Waits indefinitely until job completes
988-
*
989-
* @param result [out] Pointer to store the job result:
990-
* - 0 if job completed successfully
991-
* - Error code if job failed
992-
* Only valid when function returns 0 (job completed)
993-
*
994-
* @return 0 on success (job completed), otherwise error code:
995-
* - AEE_EBUSY: Job is still pending and not completed within timeout
996-
* - AEE_EBADPARM: Invalid job ID provided
997-
* - AEE_EFAILED: Internal FastRPC framework error
998-
*
999-
* @note After job completion, resources must be released using fastrpc_release_async_job()
1000-
* @note This function is thread-safe and can be called concurrently from multiple threads
1001-
*/
1002-
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE(fastrpc_async_get_status)(__QAIC_IN fastrpc_async_jobid jobid,__QAIC_IN int timeout_us,__QAIC_OUT int *result);
1003-
1004-
1005-
/**
1006-
* Releases resources associated with an asynchronous FastRPC job
1007-
*
1008-
* This function must be called after an asynchronous job completes to free associated
1009-
* resources and cleanup internal state. It should only be called after receiving job
1010-
* completion status either through:
1011-
* - Callback notification (for FASTRPC_ASYNC_CALLBACK jobs)
1012-
* - Polling via fastrpc_async_get_status() (for FASTRPC_ASYNC_POLL jobs)
1013-
*
1014-
* @param jobid [in] Job ID returned by remote_handle_invoke_async() when submitting
1015-
* the asynchronous job
1016-
*
1017-
* @return 0 on success, otherwise error code:
1018-
* - AEE_EBUSY: Job is still pending and has not completed yet
1019-
* - AEE_EBADPARM: Invalid job ID provided
1020-
* - AEE_EFAILED: Internal FastRPC framework error
1021-
*
1022-
* @note This function is thread-safe and can be called concurrently from multiple threads
1023-
* @note Calling this function before job completion will return AEE_EBUSY
1024-
* @note Resources must be released exactly once per async job to avoid memory leaks
1025-
*/
1026-
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE(fastrpc_release_async_job)(__QAIC_IN fastrpc_async_jobid jobid);
1027-
1028-
1029898
/**
1030899
* DEPRECATED: Use fastrpc_mmap() instead.
1031900
*

src/Makefile.am

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LIBDSPRPC_SOURCES = \
77
fastrpc_perf.c \
88
fastrpc_pm.c \
99
fastrpc_config.c \
10-
fastrpc_async.c \
1110
fastrpc_mem.c \
1211
fastrpc_notif.c \
1312
fastrpc_latency.c \

0 commit comments

Comments
 (0)