Linux-Next discussions
 help / color / mirror / Atom feed
* linux-next: manual merge of the fastrpc tree with the char-misc.current tree
@ 2026-11-30 18:44 Mark Brown
  2026-11-30 22:47 ` Srinivas Kandagatla
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2026-11-30 18:44 UTC (permalink / raw)
  To: Srini Kandagatla
  Cc: Anandu Krishnan E, Arnd Bergmann, Greg KH, Greg Kroah-Hartman,
	Jianping Li, Linux Kernel Mailing List, Linux Next Mailing List,
	Srinivas Kandagatla, Vinayak Katoch

[-- Attachment #1: Type: text/plain, Size: 5200 bytes --]

Hi all,

Today's linux-next merge of the fastrpc tree got a conflict in:

  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;
  

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-30 22:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 18:44 linux-next: manual merge of the fastrpc tree with the char-misc.current tree Mark Brown
2026-11-30 22:47 ` Srinivas Kandagatla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox