Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1ce922a authored by Deepak Kumar Singh's avatar Deepak Kumar Singh Committed by Sarannya S
Browse files

rpmsg: glink: do not break from interrupt handler



If receive callback fails, returning error can cause interrupt
handler to exit. if old interrupts have been missed glink may
not read new packets from rx fifo.

Print error message if callback fails but do not return any error
to interrupt handler so that it can continue reading pending data in
rx fifo even if old interrupts were missed and no new interrupt is
coming from remote host.

Change-Id: I1adec1e2ba7337008ecc2d71bf5f96c331a22695
Signed-off-by: default avatarDeepak Kumar Singh <deesin@codeaurora.org>
parent 8616e29d
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -39,6 +39,15 @@ do { \
			       ch->lcid, ch->rcid, __func__, ##__VA_ARGS__); \
} while (0)

#define CH_ERR(ch, x, ...)						     \
do {									     \
	if (ch->glink) {						     \
		ipc_log_string(ch->glink->ilc, "%s[%d:%d] %s: "x, ch->name,  \
			       ch->lcid, ch->rcid, __func__, ##__VA_ARGS__); \
		dev_err(ch->glink->dev, "[%s]: "x, __func__, ##__VA_ARGS__); \
	}								     \
} while (0)

#define GLINK_NAME_SIZE		32
#define GLINK_VERSION_1		1

@@ -1043,12 +1052,14 @@ static int qcom_glink_rx_data(struct qcom_glink *glink, size_t avail)
					intent->offset,
					channel->ept.priv,
					RPMSG_ADDR_ANY);
			if (ret < 0)
				CH_INFO(channel,
					"glink:callback error ret = %d\n", ret);

			if (ret < 0) {
				CH_ERR(channel,
					"callback error ret = %d\n", ret);
				ret = 0;
			}
		} else {
			CH_INFO(channel, "callback not present\n");
			dev_err(glink->dev, "glink:callback not present\n");
			CH_ERR(channel, "callback not present\n");
		}
		spin_unlock(&channel->recv_lock);

+3 −4
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ static int qcom_smd_qrtr_callback(struct rpmsg_device *rpdev,
	int rc;

	if (!qdev) {
		pr_err("%d:Not ready\n", __func__);
		pr_err("%s:Not ready\n", __func__);
		return -EAGAIN;
	}

@@ -65,7 +65,7 @@ static int qcom_smd_qrtr_probe(struct rpmsg_device *rpdev)
	u32 net_id;
	bool rt;
	int rc;
	pr_err("%d:Entered\n", __func__);
	pr_info("%s:Entered\n", __func__);

	qdev = devm_kzalloc(&rpdev->dev, sizeof(*qdev), GFP_KERNEL);
	if (!qdev)
@@ -87,8 +87,7 @@ static int qcom_smd_qrtr_probe(struct rpmsg_device *rpdev)

	dev_set_drvdata(&rpdev->dev, qdev);

	pr_err("%d:SMD QRTR driver probed\n", __func__);
	dev_dbg(&rpdev->dev, "SMD QRTR driver probed\n");
	pr_info("%s:SMD QRTR driver probed\n", __func__);

	return 0;
}