From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91C27633 for ; Wed, 2 Nov 2022 03:39:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B29FC433D6; Wed, 2 Nov 2022 03:39:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1667360344; bh=WU9ukT8HbcXcDJwuBLa+/Uz00o+if7Q/xKF4SC+Hc2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xl53MGEi6T2yTG6JkgxyAfDFtsTV5/lfHvjBorZ/+HeFZH1q7w5ScF+YCBKgeLQZa tWtNiUB5XI3wV1dXrgApUqNBdHIouhA5+EHpRtnZQpVUVtXwNSmYBI6zgdrNtaEyUT ws6jpy7lF7WlA20L7pYzCZQ0HfHyF044hlTxmByI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Justin Chen , Florian Fainelli , stable Subject: [PATCH 4.14 21/60] usb: bdc: change state when port disconnected Date: Wed, 2 Nov 2022 03:34:42 +0100 Message-Id: <20221102022051.774898869@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221102022051.081761052@linuxfoundation.org> References: <20221102022051.081761052@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Justin Chen commit fb8f60dd1b67520e0e0d7978ef17d015690acfc1 upstream. When port is connected and then disconnected, the state stays as configured. Which is incorrect as the port is no longer configured, but in a not attached state. Signed-off-by: Justin Chen Acked-by: Florian Fainelli Fixes: efed421a94e6 ("usb: gadget: Add UDC driver for Broadcom USB3.0 device controller IP BDC") Cc: stable Link: https://lore.kernel.org/r/1664997235-18198-1-git-send-email-justinpopo6@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/bdc/bdc_udc.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/gadget/udc/bdc/bdc_udc.c +++ b/drivers/usb/gadget/udc/bdc/bdc_udc.c @@ -156,6 +156,7 @@ static void bdc_uspc_disconnected(struct bdc->delayed_status = false; bdc->reinit = reinit; bdc->test_mode = false; + usb_gadget_set_state(&bdc->gadget, USB_STATE_NOTATTACHED); } /* TNotify wkaeup timer */