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

Commit 0cf6e3ee 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_ipc: Re-initialize completion on every read/write"

parents 3f18bbc2 34faa9f1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2019, 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
@@ -265,6 +265,8 @@ static int ipc_write(struct platform_device *pdev, char *buf,
		return -EINVAL;
	}

	reinit_completion(&ipc_dev->write_done);

	if (usb_ep_queue(in, req, GFP_KERNEL)) {
		wait_event_interruptible(ipc_dev->state_wq, ipc_dev->online ||
				ipc_dev->current_state == IPC_DISCONNECTED);
@@ -332,6 +334,8 @@ static int ipc_read(struct platform_device *pdev, char *buf, unsigned int count)
		return -EINVAL;
	}

	reinit_completion(&ipc_dev->read_done);

	if (usb_ep_queue(out, req, GFP_KERNEL)) {
		wait_event_interruptible(ipc_dev->state_wq, ipc_dev->online ||
				ipc_dev->current_state == IPC_DISCONNECTED);