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

Commit 1d4ad14d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_gps: Fix no responses on suspend/resume"

parents 1f9d3eeb 25a6bb5d
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -351,6 +351,15 @@ static void gps_resume(struct usb_function *f)
		return;

	dev->is_suspended = false;

	/* Check if the previous session is closed as part of suspend
	 * and try to reconnect to open a new session.
	 */
	if (!atomic_read(&dev->ctrl_online)) {
		pr_debug("%s: ctrl disconnected, reconnect again\n", __func__);
		gport_ctrl_connect(dev);
	}

	spin_lock(&dev->lock);
	if (list_empty(&dev->cpkt_resp_q)) {
		spin_unlock(&dev->lock);
+10 −1
Original line number Diff line number Diff line
/* Copyright (c) 2017, Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018, Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -375,6 +375,15 @@ static void glink_notify_state(void *handle, const void *priv, unsigned event)
		if (gr && gr->disconnect)
			gr->disconnect(gr);
		glink_purge_tx_q(ch_info);
		/**
		 * If the channel is closed on the REMOTE side, the channel
		 * needs to be closed from the LOCAL as well so that the current
		 * context is cleared and the channel can be opened afresh.
		 */
		if (ch_info->handle) {
			pr_debug("%s queue disconnect work\n", __func__);
			queue_work(glink_ctrl_wq, &ch_info->disconnect_w);
		}
		break;
	default:
		pr_err("%s: invalid channel state notification\n", __func__);