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

Commit 8448d472 authored by Jeff Hugo's avatar Jeff Hugo Committed by Matt Wagantall
Browse files

msm: rpm-smd: Handle multiple link up events



If multiple transports for an edge come up, rpm-smd can get multiple link
up events.  Rpm-smd will then attempt to incorrectly open the same channel
multiple times, which is expected to fail and could incorrectly trigger a
BUG_ON().

Fix rpm-smd to only open the channel when it gets the first link up event,
and ignore any additional link up events.

CRs-fixed: 763569
Change-Id: I1286a3fdb7d3d2f4dbfeaed3624e742ffcaf3a8c
Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
Signed-off-by: default avatarMurali Nalajala <mnalajal@codeaurora.org>
parent d32a782f
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -1597,22 +1597,26 @@ static void msm_rpm_glink_notifier_cb(struct glink_link_state_cb_info *cb_info,
					void *priv)
{
	struct glink_open_config *open_config;
	static bool first = true;

	if (!cb_info) {
		pr_err("Missing callback data\n");
		return;
	}

	switch (cb_info->link_state) {
	case GLINK_LINK_STATE_UP:
		if (first)
			first = false;
		else
			break;
		open_config = kzalloc(sizeof(*open_config), GFP_KERNEL);
		if (!open_config) {
			pr_err("Could not allocate memory\n");
		return;
			break;
		}

		glink_data->open_cfg = open_config;

	switch (cb_info->link_state) {
	case GLINK_LINK_STATE_UP:
		pr_debug("glink link state up cb receieved\n");
		INIT_WORK(&glink_data->work, msm_rpm_glink_open_work);