From patchwork Fri Jul 12 02:53:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 11041341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2DC7913A4 for ; Fri, 12 Jul 2019 02:55:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EC8928BBA for ; Fri, 12 Jul 2019 02:55:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1341628BBC; Fri, 12 Jul 2019 02:55:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2B0C28BBA for ; Fri, 12 Jul 2019 02:55:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729316AbfGLCzG (ORCPT ); Thu, 11 Jul 2019 22:55:06 -0400 Received: from gate.crashing.org ([63.228.1.57]:54468 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729260AbfGLCzG (ORCPT ); Thu, 11 Jul 2019 22:55:06 -0400 Received: from ufdda393ec48b57.ant.amazon.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x6C2rnGk010240; Thu, 11 Jul 2019 21:54:15 -0500 From: Benjamin Herrenschmidt To: linux-usb@vger.kernel.org Cc: balbi@kernel.org, Joel Stanley , Alan Stern , Benjamin Herrenschmidt Subject: [PATCH v2 09/12] usb: gadget: composite: Clear "suspended" on reset/disconnect Date: Fri, 12 Jul 2019 12:53:45 +1000 Message-Id: <20190712025348.21019-10-benh@kernel.crashing.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190712025348.21019-1-benh@kernel.crashing.org> References: <20190712025348.21019-1-benh@kernel.crashing.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In some cases, one can get out of suspend with a reset or a disconnect followed by a reconnect. Previously we would leave a stale suspended flag set. Signed-off-by: Benjamin Herrenschmidt --- drivers/usb/gadget/composite.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index b8a15840b4ff..dfcabadeed01 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1976,6 +1976,7 @@ void composite_disconnect(struct usb_gadget *gadget) * disconnect callbacks? */ spin_lock_irqsave(&cdev->lock, flags); + cdev->suspended = 0; if (cdev->config) reset_config(cdev); if (cdev->driver->disconnect)