Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2849401iob; Fri, 6 May 2022 11:42:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQHuR+6NKCC0mMhl3l2Exn3UJJAkX3KGo5nOC5JGzwVyp6egfYyDp2YLprlr6Nyzf3jkht X-Received: by 2002:a17:902:8ecc:b0:15e:f63f:233f with SMTP id x12-20020a1709028ecc00b0015ef63f233fmr1150570plo.86.1651862548690; Fri, 06 May 2022 11:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651862548; cv=none; d=google.com; s=arc-20160816; b=lj9A90M5XnSTvFBfniQ5WKOTnM4NJ9nJ7ircn/ratBHO2M1mJkv2AEBX6A7cClP5XS x6ohxyd+EoF3EkIZcoRX3LYTZeZKDBHEV37U1Kat1uC0vLwEvt/o24a0e4KfNSng/P81 wGh1mVNEVq+obml00eolOEIFqCCduzTXrjL4qnhZe9Ad+Te3BJaBIVlPxS+rBiz84guw Pf8O7bIGqpVla+uZ9NXGCqvcowZhLPRH/gipVcCWMk0khd6/J4wIkJTem91N+ADaEX4d 1oXW8gPfHgV/W9iUWwYPSxpbRg3qb3DB5w2bF0GRkidHGw6VXSjePM1h4kfYICgW8KE4 2hFA== 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=K0PhiYk7JT1/tspCiukACxbxHP9+aD/qhCcdzsUyEQA=; b=D0Dq6PKPPFrCUbgUJ+o5Ci/CTuCwd5U7P2INF+YiEnlnnmMGmTH14yA9xbSXVxwR6o ldZ+aMH8weNBuIwenllKXfjOfAA3IcK7GimbRA2uJmmY4b+0k0d/zQnqq5Flpmo6WIT4 UlCPx5t4AsXpHakUIi3hCO8GPKbHLTTwq+W/D9iWxc3rn7NMGFmYQtj2YMzL/5BRGDdN PMbKE+FPsp+rODu6sbArDxCfI+4vMw6wjc0W2O8wnpvFVCqf9MJgLoqbemJozmFGExlD loLEPz7Io1ik0fRabWsQh1DEGVS3sukT5JzhXvKHbTwGRv7ZcaQrzsNQ77Zq8afNRbwF iZhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=USPsLbye; 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 v31-20020a63465f000000b0039d94389fe6si5558604pgk.599.2022.05.06.11.42.11; Fri, 06 May 2022 11:42:28 -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=USPsLbye; 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 S1353973AbiEDQxi (ORCPT + 99 others); Wed, 4 May 2022 12:53:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353751AbiEDQwN (ORCPT ); Wed, 4 May 2022 12:52:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 997384738C; Wed, 4 May 2022 09:48:35 -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 CACCD61771; Wed, 4 May 2022 16:48:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 225B1C385A4; Wed, 4 May 2022 16:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651682914; bh=eFPjMgElhDEszECLNXLR9KghKw55KcyONnperHZm5LM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=USPsLbyeRBhiPBNX7SRzSFnr3aKX1ygyenALc8f0VmL88hHuUTNqNPXrFx1Qh1jSr Tzpz7CuHIlKr1LnhWkrydbiYIwW5k97tHg/Tt4DouA7GmHWIkS/jbl6E+xpVe8ij5U 6IACsJ0b5W0zLgsLZQIGZY5zoQO0mmMZe0KB1yZ8= 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.4 20/84] usb: gadget: configfs: clear deactivation flag in configfs_composite_unbind() Date: Wed, 4 May 2022 18:44:01 +0200 Message-Id: <20220504152929.188480953@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504152927.744120418@linuxfoundation.org> References: <20220504152927.744120418@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 @@ -1412,6 +1412,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); }