Skip to content

Commit

Permalink
rpmsg: glink: use only lower 16-bits of param2 for CMD_OPEN name length
Browse files Browse the repository at this point in the history
The name len field of the CMD_OPEN packet is only 16-bits and the upper
16-bits of "param2" are a different "prio" field, which can be nonzero in
certain situations, and CMD_OPEN packets can be unexpectedly dropped
because of this.

Fix this by masking out the upper 16 bits of param2.

Fixes: b4f8e52 ("rpmsg: Introduce Qualcomm RPM glink driver")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20241007235935.6216-1-jonathan@marek.ca
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
  • Loading branch information
Jonathan Marek authored and Bjorn Andersson committed Nov 16, 2024
1 parent 9852d85 commit 06c59d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/rpmsg/qcom_glink_native.c
Original file line number Diff line number Diff line change
@@ -1204,7 +1204,8 @@ void qcom_glink_native_rx(struct qcom_glink *glink)
ret = qcom_glink_rx_open_ack(glink, param1);
break;
case GLINK_CMD_OPEN:
ret = qcom_glink_rx_defer(glink, param2);
/* upper 16 bits of param2 are the "prio" field */
ret = qcom_glink_rx_defer(glink, param2 & 0xffff);
break;
case GLINK_CMD_TX_DATA:
case GLINK_CMD_TX_DATA_CONT:

0 comments on commit 06c59d9

Please sign in to comment.