Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2326199rwb; Wed, 5 Oct 2022 12:25:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7WLgvrV+denDeukUYufxgNWuLPzgm8T5Yg8UObniu6vD+A4ORhpD387IT8RSO0J+jRUXnn X-Received: by 2002:a17:90b:4a8a:b0:202:8eec:b87a with SMTP id lp10-20020a17090b4a8a00b002028eecb87amr6766373pjb.48.1664997956411; Wed, 05 Oct 2022 12:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664997956; cv=none; d=google.com; s=arc-20160816; b=nMiOGaYTNxfeZFp9sV5E+r0Hyw3kOcXhqQMo68nFO2rI3GHL1x83tdX/8mhl9LsCHd 5waTm4HSqzz7ZKeIzuOuXmUbuImcIkspvlV71IAiRByiQYRtUKb/V3EJJOGZM4ntq7gc AoO0b/IUdn2n0uSFQJ+0zUrEV7aD39I9SdGPL8ZJM3k2gN45WpE1nhKV05QXJkyRq7KS AGp2t1MkdnKVFu6JahkM25tbNHePxU7B9nOYcT0G7f9y7So349if9O9mszSIcIhIkmcT 5WD3IAeE08+HQMmz99kTs3TQpMSiv61Ivqx/ouqT8esth5qCjSI2lu5UP6FMCbhOqCcb PGuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=4u5zSFTTl6Tg6+Epgw/QLqRJlkHZ4tOE8mrGAtQf1eY=; b=rHR8WL/wgXowC+WcR7G6ajyPNRSiQOSHotoKghJs7K6g3GsNxKTiwqjkCddpCmOgtK H9N/yvkYLPbV9NH00U7XZs7h9HfTlw8DuzOOpHSeFING8Rh+loCxjxdbo+hNwK90SFK8 6zKBBwIQ3jNd6GFY3NRPkE+q92cQZWlsk0FmdJVHMJ4s9mq7N5yJhG7OT1fE4DVyW47H HB6NrduF1RAFn1drtseXKPC89DAl9GAgM+sF71Lpxhl1m4jvej+8wWDzfEzw8JraBQjx r/IpfLIBLpRKsaO5UGKkwQ6pRQaQnNOiNiqcg1Bl3BfdVYeB8fn49GeZb3SHwLAvo9Q3 CSJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cpGj3Cza; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nl8-20020a17090b384800b0020adba9ec02si3042048pjb.82.2022.10.05.12.25.42; Wed, 05 Oct 2022 12:25:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cpGj3Cza; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230357AbiJETOt (ORCPT + 99 others); Wed, 5 Oct 2022 15:14:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231447AbiJETOJ (ORCPT ); Wed, 5 Oct 2022 15:14:09 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 916732BE14; Wed, 5 Oct 2022 12:14:08 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id fb18so1087068qtb.12; Wed, 05 Oct 2022 12:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=4u5zSFTTl6Tg6+Epgw/QLqRJlkHZ4tOE8mrGAtQf1eY=; b=cpGj3Cza5JvNQBhL0EVzvVTrKhKEYvy+l7m+dr2otRPeMkyorX1Jw1ioNGiLPNu9/X CDEvhAKzat7UAEipq9oWyJLcPDP3cvn6FZHTaW2h7QYYCG0cyyfhkxBlkwvUfyjjcycf m/reUAf7f5gjK6286JekPFDFF2VLtFRgXh07EDHWBLmVnKyUXVb7nyTBLTH7L8o8ozW2 4BOIxk0OjQ58k1BiU2rZPDFhCb/tFbFwFXR3d3VQoAxF4UXvvZAPgZksVVHlAdNtNhcx xseDDRWeDg3kVqClxPVdh4t5kCR511BlLHyTWzzSwjhZGbpPeu/LCri2NzOG5/NpiafS Fujg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=4u5zSFTTl6Tg6+Epgw/QLqRJlkHZ4tOE8mrGAtQf1eY=; b=QiHGO8KaW73Ad8whProK/pYDXgR7VnLltSFWLfIJxczinrX1p+bAH3NCt8+o1DLXJG Dj835Qm1gMhlLM0N761U2ndrBW5LaqrCtZlk+JzhQjTq2taKqno+CRST3JLE9MbmtSWQ XlvpY1AlLBkJacC3FZlNoc5N6VMn3uC2pTjdz92s+dGhyMvvokO+BhQWpZt1VVZ9HrYs kVIyIUiT5v1sugjp6ug7qq/EnITHatGhJ8ev+RP2KMrYn9mUxvSzhMKuGISZXk+EKbki k8t5zpGw6IoDYa3O5i2y4U0dHmrmjTDIe7eVrP/LnOtw3Se7IRjyiE+TAMrnXF/VKfM+ weOA== X-Gm-Message-State: ACrzQf08O8Oo9LV/bUocj6XJCFmZd6MpD0irvpiFupOFTRbBC/4xW25W WSZKWzOyM6uFQiZOl7BDJnQ= X-Received: by 2002:ac8:5c4c:0:b0:35c:1373:5afc with SMTP id j12-20020ac85c4c000000b0035c13735afcmr873155qtj.86.1664997247536; Wed, 05 Oct 2022 12:14:07 -0700 (PDT) Received: from stbirv-lnx-2.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id l20-20020ac81494000000b0035d27b254f3sm14436500qtj.40.2022.10.05.12.14.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Oct 2022 12:14:07 -0700 (PDT) From: justinpopo6@gmail.com To: alcooperx@gmail.com, balbi@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: bcm-kernel-feedback-list@broadcom.com, justin.chen@broadcom.com, f.fainelli@gmail.com, Justin Chen Subject: [PATCH] usb: bdc: change state when port disconnected Date: Wed, 5 Oct 2022 12:13:55 -0700 Message-Id: <1664997235-18198-1-git-send-email-justinpopo6@gmail.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Justin Chen 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 --- drivers/usb/gadget/udc/bdc/bdc_udc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/udc/bdc/bdc_udc.c b/drivers/usb/gadget/udc/bdc/bdc_udc.c index 5ac0ef8..53ffaf4 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_udc.c +++ b/drivers/usb/gadget/udc/bdc/bdc_udc.c @@ -151,6 +151,7 @@ static void bdc_uspc_disconnected(struct bdc *bdc, bool reinit) bdc->delayed_status = false; bdc->reinit = reinit; bdc->test_mode = false; + usb_gadget_set_state(&bdc->gadget, USB_STATE_NOTATTACHED); } /* TNotify wkaeup timer */ -- 2.7.4