Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1424857iob; Thu, 5 May 2022 00:27:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyr8YjtvPI9naI1gbLQpQVOM09tzVy/gESvMqeTBuUf0hmNNit0vkqTZvH0ZHBRoAQdmfVV X-Received: by 2002:a05:6a00:16c7:b0:4f7:e497:69b8 with SMTP id l7-20020a056a0016c700b004f7e49769b8mr24491804pfc.6.1651735628554; Thu, 05 May 2022 00:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651735628; cv=none; d=google.com; s=arc-20160816; b=pyLhp9clPED/lSms8GjkKuByrqgoOWM6sJs1vYwthH2QWoEiaosvGx4dSCTUfXlqId lmtafzCGB5EY46Jsox6MQr7KM9qjfPOx7coPMI2lZgDO9VH5j/wKlXjUhLc97rfCyDTI iCIsut1lP/UioOTqDNVg/mlHgT47umUQEOtM3kdyazkttqF61uGGIkdjH2uC2HJQBWHb XidEMmZobW/gYrpM3mzlBYjfcaD98ebV8/MVfdPdd+WLLWSrKbh4jaWVy50Iu6wd7JJE 7byx8vpxa+88Dg/3iYGFUZeB7Os5+7Z7wQhV0TMeB8BU9lMCHcby4WgW3r+VaqiexJ0p eCag== 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=jTjWK80rfdme32ZeD4mIFGzfmwD6vey4W92JIc5Gi0E=; b=EqcDAw/d3OAUwyd+vsbgFJtxznM5uSNqULhGnsxes+0TEJmtPHmeYoNIrLnzYLYLK4 agVS5ZkfpitpkREJgliwwDsDTeWIOP8sPdx1Q9kzdAVelQYQCeXmKPReNv1WUccqJA3V ZvONq85iIIKnVpKLYikuKGQP3NNSk0HstiwoXjFRewZB8Kea+ZdzHjh0zIxge9WZfYS8 NgtaO18nT+J9LM/l9YL/YEeiKb1hq464NwCHbaguIhGddhgG3Ncj8VLlkc3UWcyTUBIm QothdSj3MWCuXlU2Gs9GF/8/E0P9eMA3eNGj2oRS6xPGDzr3iRdjnXINJtfsEpSs6z4o 9LCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z543K7uB; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r8-20020a63d908000000b003c2828476a9si766788pgg.641.2022.05.05.00.26.54; Thu, 05 May 2022 00:27:08 -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=@linuxfoundation.org header.s=korg header.b=z543K7uB; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358091AbiEDRZc (ORCPT + 99 others); Wed, 4 May 2022 13:25:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354934AbiEDRDT (ORCPT ); Wed, 4 May 2022 13:03:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A6DE4D9E1; Wed, 4 May 2022 09:52:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1C3D0617DE; Wed, 4 May 2022 16:52:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68B6EC385A5; Wed, 4 May 2022 16:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683156; bh=Kcy6gpDq2hZTzRSVUre66DeO+UZylJ37PCmsU/ozR+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z543K7uBkUsAbiki18PNUUspyXmXpW3dJ5nXKKFImo6ARRYIw3kr9xZzEs2Hmxe07 X8dmBFYnC7g9EGqHTPpUrqtGK+EhTwyIjMxQbBTErON4tBgxVW5eT3JazLg1XbCNzN mNbORV7o18BCTEfqzv9Yv7L0qODuEp/lIas2stok= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vijayavardhan Vennapusa , Dan Vacura , stable Subject: [PATCH 5.15 021/177] usb: gadget: configfs: clear deactivation flag in configfs_composite_unbind() Date: Wed, 4 May 2022 18:43:34 +0200 Message-Id: <20220504153055.166161977@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153053.873100034@linuxfoundation.org> References: <20220504153053.873100034@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: Vijayavardhan Vennapusa commit bf95c4d4630c7a2c16e7b424fdea5177d9ce0864 upstream. If any function like UVC is deactivating gadget as part of composition switch which results in not calling pullup enablement, it is not getting enabled after switch to new composition due to this deactivation flag not cleared. This results in USB enumeration not happening after switch to new USB composition. Hence clear deactivation flag inside gadget structure in configfs_composite_unbind() before switch to new USB composition. Signed-off-by: Vijayavardhan Vennapusa Signed-off-by: Dan Vacura Cc: stable Link: https://lore.kernel.org/r/20220413211038.72797-1-w36195@motorola.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/configfs.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -1447,6 +1447,8 @@ static void configfs_composite_unbind(st usb_ep_autoconfig_reset(cdev->gadget); spin_lock_irqsave(&gi->spinlock, flags); cdev->gadget = NULL; + cdev->deactivations = 0; + gadget->deactivated = false; set_gadget_data(gadget, NULL); spin_unlock_irqrestore(&gi->spinlock, flags); }