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

Commit f1e66129 authored by ChandanaKishori Chiluveru's avatar ChandanaKishori Chiluveru
Browse files

usb: gadget: Clear suspend flag on connect



Driver is setting is_suspended variable to true during suspend and
clearing on resume. When we disconnect the cable and reconnect once
on bootup, there is a suspend interrupt followed by disconnect. In
this case is_suspended variable gets set to TRUE not cleared on cable
connect and causing DUN call/MODEM Query failures.

This change is added to clear the suspended variable during connect.

Change-Id: Id345123a4184e4ffc47f205d5d765f7798db1452
Signed-off-by: default avatarChandanaKishori Chiluveru <cchilu@codeaurora.org>
parent a660e4d0
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/*
 * u_smd.c - utilities for USB gadget serial over smd
 *
 * Copyright (c) 2011, 2013-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011, 2013-2016, The Linux Foundation. All rights reserved.
 *
 * This code also borrows from drivers/usb/gadget/u_serial.c, which is
 * Copyright (C) 2000 - 2003 Al Borchers (alborchers@steinerpoint.com)
@@ -687,6 +687,7 @@ int gsmd_connect(struct gserial *gser, u8 portno)
	gser->notify_modem = gsmd_notify_modem;
	port->nbytes_tomodem = 0;
	port->nbytes_tolaptop = 0;
	port->is_suspended = false;
	spin_unlock_irqrestore(&port->port_lock, flags);

	ret = usb_ep_enable(gser->in);
@@ -734,6 +735,7 @@ void gsmd_disconnect(struct gserial *gser, u8 portno)

	spin_lock_irqsave(&port->port_lock, flags);
	port->port_usb = 0;
	port->is_suspended = false;
	spin_unlock_irqrestore(&port->port_lock, flags);

	/* disable endpoints, aborting down any active I/O */