diff --git a/drivers/virt/gunyah/gunyah_qcom.c b/drivers/virt/gunyah/gunyah_qcom.c index ec62f1e23724..bfce5249d00a 100644 --- a/drivers/virt/gunyah/gunyah_qcom.c +++ b/drivers/virt/gunyah/gunyah_qcom.c @@ -13,7 +13,7 @@ #define QCOM_SCM_RM_MANAGED_VMID 0x3A #define QCOM_SCM_MAX_MANAGED_VMID 0x3F -static int qcom_scm_gh_rm_pre_mem_share(struct gh_rm *rm, struct gh_rm_mem_parcel *mem_parcel) +static int qcom_scm_gh_rm_pre_mem_share(void *rm, struct gh_rm_mem_parcel *mem_parcel) { struct qcom_scm_vmperm *new_perms; u64 src, src_cpy; @@ -72,7 +72,7 @@ static int qcom_scm_gh_rm_pre_mem_share(struct gh_rm *rm, struct gh_rm_mem_parce return ret; } -static int qcom_scm_gh_rm_post_mem_reclaim(struct gh_rm *rm, struct gh_rm_mem_parcel *mem_parcel) +static int qcom_scm_gh_rm_post_mem_reclaim(void *rm, struct gh_rm_mem_parcel *mem_parcel) { struct qcom_scm_vmperm new_perms; u64 src = 0, src_cpy; diff --git a/drivers/virt/gunyah/rsc_mgr.c b/drivers/virt/gunyah/rsc_mgr.c index 5571540311af..7183b7da223a 100644 --- a/drivers/virt/gunyah/rsc_mgr.c +++ b/drivers/virt/gunyah/rsc_mgr.c @@ -631,9 +631,10 @@ out: * Context: Process context. Will sleep waiting for reply. * Return: 0 on success. <0 if error. */ -int gh_rm_call(struct gh_rm *rm, u32 message_id, void *req_buf, size_t req_buf_size, +int gh_rm_call(void *_rm, u32 message_id, void *req_buf, size_t req_buf_size, void **resp_buf, size_t *resp_buf_size) { + struct gh_rm *rm = _rm; struct gh_rm_connection *connection; u32 seq_id; int ret; @@ -708,14 +709,18 @@ free: EXPORT_SYMBOL_GPL(gh_rm_call); -int gh_rm_notifier_register(struct gh_rm *rm, struct notifier_block *nb) +int gh_rm_notifier_register(void *_rm, struct notifier_block *nb) { + struct gh_rm *rm = _rm; + return blocking_notifier_chain_register(&rm->nh, nb); } EXPORT_SYMBOL_GPL(gh_rm_notifier_register); -int gh_rm_notifier_unregister(struct gh_rm *rm, struct notifier_block *nb) +int gh_rm_notifier_unregister(void *_rm, struct notifier_block *nb) { + struct gh_rm *rm = _rm; + return blocking_notifier_chain_unregister(&rm->nh, nb); } EXPORT_SYMBOL_GPL(gh_rm_notifier_unregister); diff --git a/drivers/virt/gunyah/rsc_mgr.h b/drivers/virt/gunyah/rsc_mgr.h index 1e0a1cc7e844..7dca3f0af3ae 100644 --- a/drivers/virt/gunyah/rsc_mgr.h +++ b/drivers/virt/gunyah/rsc_mgr.h @@ -10,7 +10,7 @@ #include struct gh_rm; -int gh_rm_call(struct gh_rm *rsc_mgr, u32 message_id, void *req_buf, size_t req_buf_size, +int gh_rm_call(void *rsc_mgr, u32 message_id, void *req_buf, size_t req_buf_size, void **resp_buf, size_t *resp_buf_size); int gh_rm_platform_pre_mem_share(struct gh_rm *rm, struct gh_rm_mem_parcel *mem_parcel); diff --git a/include/linux/gunyah_rsc_mgr.h b/include/linux/gunyah_rsc_mgr.h index f73371bd8f7c..f23e848794af 100644 --- a/include/linux/gunyah_rsc_mgr.h +++ b/include/linux/gunyah_rsc_mgr.h @@ -14,10 +14,10 @@ #define GH_MEM_HANDLE_INVAL U32_MAX struct gh_rm; -int gh_rm_call(struct gh_rm *rm, u32 message_id, void *req_buf, size_t req_buf_size, +int gh_rm_call(void *rm, u32 message_id, void *req_buf, size_t req_buf_size, void **resp_buf, size_t *resp_buf_size); -int gh_rm_notifier_register(struct gh_rm *rm, struct notifier_block *nb); -int gh_rm_notifier_unregister(struct gh_rm *rm, struct notifier_block *nb); +int gh_rm_notifier_register(void *rm, struct notifier_block *nb); +int gh_rm_notifier_unregister(void *rm, struct notifier_block *nb); struct device *gh_rm_get(struct gh_rm *rm); void gh_rm_put(struct gh_rm *rm); @@ -147,8 +147,8 @@ struct gh_resource *gh_rm_alloc_resource(struct gh_rm *rm, struct gh_rm_hyp_reso void gh_rm_free_resource(struct gh_resource *ghrsc); struct gh_rm_platform_ops { - int (*pre_mem_share)(struct gh_rm *rm, struct gh_rm_mem_parcel *mem_parcel); - int (*post_mem_reclaim)(struct gh_rm *rm, struct gh_rm_mem_parcel *mem_parcel); + int (*pre_mem_share)(void *rm, struct gh_rm_mem_parcel *mem_parcel); + int (*post_mem_reclaim)(void *rm, struct gh_rm_mem_parcel *mem_parcel); }; #if IS_ENABLED(CONFIG_GUNYAH_PLATFORM_HOOKS)