Re: linux-next: manual merge of the fastrpc tree with the char-misc.current tree

From: Srinivas Kandagatla

Date: Mon Nov 30 2026 - 17:48:03 EST




On 11/30/26 6:44 PM, Mark Brown wrote:
> Hi all,
>
> Today's linux-next merge of the fastrpc tree got a conflict in:

Thanks Mark,

I will drop the patches from my tree now that these ended up in Greg's Tree.

--srini
>
> drivers/misc/fastrpc.c
>
> between commits:
>
> 85f055e32e9fd ("misc: fastrpc: fix NULL rpdev dereference when session alloc fails")
> 3679721130657 ("misc: fastrpc: fix init ordering race in rpmsg probe")
> e8ac43ce9e5e4 ("misc: fastrpc: remove dead context drain in fastrpc_user_free()")
> 5cb8f2410bee3 ("misc: fastrpc: drop the DSP-response reference on channel removal")
> 28b1f55cba430 ("misc: fastrpc: fix context leak and hang on signal-interrupted invoke")
> f116b7202308e ("misc: fastrpc: avoid duplicate DMA mappings in fastrpc_create_maps()")
>
> from the char-misc.current tree and commits:
>
> 2b22e32663861 ("misc: fastrpc: fix NULL rpdev dereference when session alloc fails")
> 1bf78aac760fd ("misc: fastrpc: fix init ordering race in rpmsg probe")
> 78455fa9f0227 ("misc: fastrpc: remove dead context drain in fastrpc_user_free()")
> c9c16d1d15038 ("misc: fastrpc: drop the DSP-response reference on channel removal")
> 3f645f6884b5c ("misc: fastrpc: fix context leak and hang on signal-interrupted invoke")
> 81b3908cf7b9b ("misc: fastrpc: iterate CB nodes manually instead of of_platform_populate")
> 112dc91edd51e ("misc: fastrpc: move ADSP duplicate session creation to the driver")
> f914df45c3228 ("misc: fastrpc: map ADSP remote heap into remoteproc IOMMU domain")
>
> from the fastrpc tree (it's all the cherry picking).
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> diff --cc drivers/misc/fastrpc.c
> index 7e33b9467b1ba,a2cf6df2651ca..0000000000000
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@@ -2761,37 -2893,52 +2919,52 @@@ static int fastrpc_rpmsg_probe(struct r
> data->rpdev = rpdev;
> dev_set_drvdata(&rpdev->dev, data);
>
> - err = of_platform_populate(rdev->of_node, NULL, NULL, rdev);
> - switch (domain_id) {
> - case ADSP_DOMAIN_ID:
> - case MDSP_DOMAIN_ID:
> - case SDSP_DOMAIN_ID:
> - /* Unsigned PD offloading is only supported on CDSP and GDSP */
> - data->unsigned_support = false;
> - err = fastrpc_device_register(rdev, data, secure_dsp, domain);
> - if (err)
> - goto err_notify;
> - break;
> - case CDSP_DOMAIN_ID:
> - case GDSP_DOMAIN_ID:
> - data->unsigned_support = true;
> - /* Create both device nodes so that we can allow both Signed and Unsigned PD */
> - err = fastrpc_device_register(rdev, data, true, domain);
> - if (err)
> - goto err_notify;
> -
> - err = fastrpc_device_register(rdev, data, false, domain);
> - if (err)
> - goto err_deregister_fdev;
> - break;
> - default:
> - err = -EINVAL;
> - goto err_notify;
> - }
> -
> + err = fastrpc_cb_devices_create(rpdev);
> if (err)
> - goto err_free_data;
> - goto err_deregister_fdev;
> ++ goto err_release_heap;
> +
> + if (data->domain_id == ADSP_DOMAIN_ID && data->sesscount > 0) {
> + struct fastrpc_session_ctx *last_sess;
> + struct fastrpc_session_ctx *dup_sess;
> +
> + spin_lock_irqsave(&data->lock, flags);
> + last_sess = &data->session[data->sesscount - 1];
> + for (i = 0; i < FASTRPC_DUP_SESSIONS; i++) {
> + if (data->sesscount >= FASTRPC_MAX_SESSIONS)
> + break;
> + dup_sess = &data->session[data->sesscount++];
> + memcpy(dup_sess, last_sess, sizeof(*dup_sess));
> + }
> + spin_unlock_irqrestore(&data->lock, flags);
> + }
>
> + switch (domain_id) {
> + case ADSP_DOMAIN_ID:
> + case MDSP_DOMAIN_ID:
> + case SDSP_DOMAIN_ID:
> + /* Unsigned PD offloading is only supported on CDSP and GDSP */
> + data->unsigned_support = false;
> + err = fastrpc_device_register(rdev, data, secure_dsp, domain);
> + if (err)
> - goto err_depopulate;
> ++ goto err_destroy_cbs;
> + break;
> + case CDSP_DOMAIN_ID:
> + case GDSP_DOMAIN_ID:
> + data->unsigned_support = true;
> + /* Create both device nodes so that we can allow both Signed and Unsigned PD */
> + err = fastrpc_device_register(rdev, data, true, domain);
> + if (err)
> - goto err_depopulate;
> ++ goto err_destroy_cbs;
> +
> + err = fastrpc_device_register(rdev, data, false, domain);
> + if (err)
> + goto err_deregister_fdev;
> + break;
> + default:
> + err = -EINVAL;
> - goto err_depopulate;
> ++ goto err_destroy_cbs;
> + }
> +
> return 0;
>
> err_deregister_fdev:
> @@@ -2800,7 -2947,7 +2973,7 @@@
> if (data->secure_fdevice)
> misc_deregister(&data->secure_fdevice->miscdev);
>
> - err_depopulate:
> -err_notify:
> ++err_destroy_cbs:
> /*
> * A registered device node may already have been opened, so a user
> * can hold a cctx reference. Drop only our reference instead of
> @@@ -2812,7 -2959,7 +2985,9 @@@
> fastrpc_notify_users(user);
> spin_unlock_irqrestore(&data->lock, flags);
>
> - of_platform_depopulate(rdev);
> ++ fastrpc_cb_devices_destroy(rpdev);
> ++err_release_heap:
> + fastrpc_remote_heap_release(data, rpdev);
> fastrpc_channel_ctx_put(data);
> return err;
>