misc: fastrpc: patches for 7.4
Subsystems (2)
[email protected]
maintainercover misc: fastrpc: patches for 7.4
From: Srinivas Kandagatla <[email protected]>
Hi Greg,
Here are few fastrpc patches for 7.4, Could you please queue these for 7.4.
Patches include
- downgrade expected DSP info, reserved-memory and session messages to dev_dbg/ratelimited to reduce console noise
- switch to devm_of_reserved_mem_device_init() for proper release on device removal
Thanks,
Srini
Jianping Li (1):
misc: fastrpc: Reduce console noise from expected DSP info, reserved
memory and session messages
Mukesh Ojha (1):
misc: fastrpc: Use devm_of_reserved_mem_device_init()
drivers/misc/fastrpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.53.0
[email protected]
maintainerPATCH 1/2 misc: fastrpc: Reduce console noise from expected DSP info, reserved memory and session messages
From: Jianping Li <[email protected]>
On some platforms the DSP firmware does not support the fastrpc capability/attribute query. The DSP side returns an error (err: -1) while handling the request, so fastrpc_get_info_from_dsp() does not return DSP_UNSUPPORTED_API but a generic error, and the "else if (err)" branch in fastrpc_get_info_from_kernel() is taken.
cctx->valid_attributes is therefore never set and every open()/query re-prints the same "dsp information is incorrect" line. This is not tied to boot timing: it can be reproduced at any time by manually starting adsprpcd. On RC builds with metadata flashing enabled several clients come up and flood the console.
As this is an expected, platform-specific and non-fatal condition, downgrade the message to dev_dbg. Similarly, the absence of reserved DMA memory is a valid configuration and does not indicate an error, so downgrade that message to dev_dbg as well. Also rate-limit the "No session available" message with dev_err_ratelimited(): it reflects a genuine failure (open() returns -EBUSY) so it should still be visible, but must not flood dmesg when the session pool is exhausted.
No functional change intended.
--- drivers/misc/fastrpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/misc/fastrpc.c +3 -3
@@ -1783,7 +1783,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp) fl->sctx =fastrpc_session_alloc (fl);if (!fl->sctx) { -dev_err (&cctx->rpdev->dev,"No session available\n" ); +dev_err_ratelimited (&cctx->rpdev->dev,"No session available\n" );mutex_destroy (&fl->mutex);kfree (fl);fastrpc_channel_ctx_put (cctx);
@@ -1941,7 +1941,7 @@ static int fastrpc_get_info_from_kernel(struct fastrpc_ioctl_capability *cap,kfree (dsp_attributes);return -EOPNOTSUPP ; }else if (err) { -dev_err (&cctx->rpdev->dev,"Error: dsp information is incorrect err: %d\n" , err); +dev_dbg (&cctx->rpdev->dev,"Error: dsp information is incorrect err: %d\n" , err);kfree (dsp_attributes);return err; }
@@ -2563,7 +2563,7 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev) }if (of_reserved_mem_device_init_by_idx (rdev, rdev->of_node,0 )) -dev_info (rdev,"no reserved DMA memory for FASTRPC\n" ); +dev_dbg (rdev,"no reserved DMA memory for FASTRPC\n" ); vmcount =of_property_read_variable_u32_array (rdev->of_node,"qcom,vmids" , &vmids[0 ],0 ,FASTRPC_MAX_VMIDS );
Signature · 1 line
2.53.0
[email protected]
maintainerPATCH 2/2 misc: fastrpc: Use devm_of_reserved_mem_device_init()
In reply to [email protected]From: Mukesh Ojha <[email protected]>
Use the devres-managed devm_of_reserved_mem_device_init() to ensure the reserved memory region is released on device removal, fixing a missing of_reserved_mem_device_release() in fastrpc_rpmsg_remove().
--- drivers/misc/fastrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/fastrpc.c +1 -1
@@ -2562,7 +2562,7 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)return -EINVAL ; } -if (of_reserved_mem_device_init_by_idx (rdev, rdev->of_node,0 )) +if (devm_of_reserved_mem_device_init (rdev))dev_dbg (rdev,"no reserved DMA memory for FASTRPC\n" ); vmcount = of_property_read_variable_u32_array(rdev->of_node,
Signature · 1 line
2.53.0