Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp263383pxx; Wed, 28 Oct 2020 04:26:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYhWRPqUZuugrsLyIUU7Nhe8jEQUQt3ZC7OOm550fAiS8EX3Aj/JmvvEtcMfh0djCx85HT X-Received: by 2002:a17:906:8157:: with SMTP id z23mr6730895ejw.274.1603884419610; Wed, 28 Oct 2020 04:26:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603884419; cv=none; d=google.com; s=arc-20160816; b=l/4NeyHRIlK5ZqYmlfxD4cP56P0eCc/MGBynpq3A//MPpEzmnahLPLzTvebTwxvreW qUnsrdISTJzuToBmPpMrNr4zEgvX6Dsg2SvZ5VXGqO89ptbqKG/ERWkDqSSSSIJPTwIf OQ0rJmAboie89tHEAyHb6M11mfjUMlTUEribqoDdv6dbb7q7WAgKbKaWmjm3g7o9RV1n e+SEZUcV/jHsWn7vI1iKzvQlWpH4T8F0j3Kr9V95yI6C1ETQdA3SMJNXfUZjxAXnKUqM 2KqQevE1Z/Oy98jMK3/wvJH8blT3xp3Pn0ZeHcekP6Zd14VXmxgBcTaEBi7QHhsE9yNB /uFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O+zX3tIWx/EIn7WetYNKt1T63UIB3CKN1k4E3uT12Ls=; b=i6LWHinJy04hzgbL0Qmsx/t4uph8OIJ4i3MCZQS1yq5Uh2Xj1LjHHbufU+biyp1zDh +5v/yn6FbprquwHirJuHs/GDpEFsx8aXvQPuqXfBVEi13WA0q8Oc0z4PXxDmD6f3TR3m JrkaKl+tiYjhNhphMoVD1BGed2AFC+DtMiSFz5IbglU8sLMP85NaNPDRq+c9MkUIFCTJ EYlCOTT7nFDDAAxpMH/yBLQ5031dM9nwJKq7vdvxrYTWxNbEwtIpW39RrqU4dBR7eGJD TaT0B5CD5bjNf3XFOEXgklpKcZAi+eOJBDy3/FprE/NweYqouNRklINjoY3QbzHr/xAs QrAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FxEnebD3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s16si2897729edy.300.2020.10.28.04.26.38; Wed, 28 Oct 2020 04:26:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FxEnebD3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1790287AbgJ0PET (ORCPT + 99 others); Tue, 27 Oct 2020 11:04:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:35352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1788970AbgJ0PB3 (ORCPT ); Tue, 27 Oct 2020 11:01:29 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 01AFB22264; Tue, 27 Oct 2020 15:01:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810888; bh=4pUed4VROy9nOj/9XsiIeRnGe9h+xTjtWlpgp4aG6bY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FxEnebD3R4oHPpiwHBdpkbDu1eOtRYrddHsbwSVxk1FZddTuOSQmN1iEy3NHmoqXt GvmMa/ZBqHXK5XN8dxsc/Qza0JGXYP8rjxtDKIvdBVOe/4bM/xyWRT4wmLBlxUXyVT LUKwtTLWrOCADQql/eQg6Nx86HzpyrH5LXF632vs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yoshihiro Shimoda , Linh Phung , Tam Nguyen , Felipe Balbi , Sasha Levin Subject: [PATCH 5.8 298/633] usb: gadget: u_serial: clear suspended flag when disconnecting Date: Tue, 27 Oct 2020 14:50:41 +0100 Message-Id: <20201027135536.650544510@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yoshihiro Shimoda [ Upstream commit d98ef43bfb65b5201e1afe36aaf8c4f9d71b4307 ] The commit aba3a8d01d62 ("usb: gadget: u_serial: add suspend resume callbacks") set/cleared the suspended flag in USB bus suspend/resume only. But, when a USB cable is disconnected in the suspend, since some controllers will not detect USB bus resume, the suspended flag is not cleared. After that, user cannot send any data. To fix the issue, clears the suspended flag in the gserial_disconnect(). Fixes: aba3a8d01d62 ("usb: gadget: u_serial: add suspend resume callbacks") Signed-off-by: Yoshihiro Shimoda Tested-by: Linh Phung Tested-by: Tam Nguyen Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/gadget/function/u_serial.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index 3cfc6e2eba71a..e0e3cb2f6f3bc 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -1391,6 +1391,7 @@ void gserial_disconnect(struct gserial *gser) if (port->port.tty) tty_hangup(port->port.tty); } + port->suspended = false; spin_unlock_irqrestore(&port->port_lock, flags); /* disable endpoints, aborting down any active I/O */ -- 2.25.1