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 3F3C2633 for ; Wed, 2 Nov 2022 03:44:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33C08C433C1; Wed, 2 Nov 2022 03:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1667360647; bh=WU9ukT8HbcXcDJwuBLa+/Uz00o+if7Q/xKF4SC+Hc2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DuOfPWIEBKeqEatge2KIufpxDxae8/CmG7mFfjb9P69H9EyLk4yMBnLrMuw6vSsBV JrxqpeIBl8jhNEhpVrbkNEr0m8IEuPGtJc08gv0nQB9xX0BFyW3njN2yJUZJ83YmIJ gk5uif2du9Qlewm/7SQ/gHM5Mq+SABeKzBHTUArk= 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.9 13/44] usb: bdc: change state when port disconnected Date: Wed, 2 Nov 2022 03:34:59 +0100 Message-Id: <20221102022049.510555383@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221102022049.017479464@linuxfoundation.org> References: <20221102022049.017479464@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 */