Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp344185pxb; Fri, 16 Apr 2021 07:08:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQYpTKK/HjEX46FaaP6XC9lWHVhgcFmxqjzk7LR0zsoVfbRr6Z2HQrtF+Rsiis+hXkxRCO X-Received: by 2002:a17:906:6d41:: with SMTP id a1mr1172137ejt.482.1618582092508; Fri, 16 Apr 2021 07:08:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618582092; cv=none; d=google.com; s=arc-20160816; b=ijPUrj9bf2NDGjCuZM3vRqnrVPXiOuMcNraPuOZ/nUpvjA4LQNGqdyRCEm61zqiF6g WeBmJdqqLTNWEejgpM9V9I0iGDVwvr4r3m+gO19T9S3WXnND/DLUF9bcmZFg3efi0TA1 VEoPCDvpPBemTE0iEUHtuzfeB+corvOuTRpor7QnRhWH8BCEctq5nJaf4Ixp1fbSM8VD kCZ1lW6LwsRD/P8/YHSJqs1wdtjMlx4DrM7UB4gYFFBc9ADC+Ng+yvFsKMmogNVu+i2n crPPXx78hYEEILLdpvz+nd/Qvb4+gEH5tPlF87APQqjouw6gNgHen1DRA+TbJNRiXW+J LAHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:cc:to:subject:from:references :in-reply-to:date:dkim-signature; bh=2VuMZVaM9DemAw3Kyslu+rlVJWqPMhZ8kXA08tuyw7M=; b=JWtyuh4+pH3YJjJdJItS6zXWYt0gkDnoSTDODCVL/AIno6mOFCjCxrb2xo7fVsJPNp YkNRMyJPOcSbO4iyJj+gpfWTvTUkzrzKoOoi1K4oLft2VE0aQfanCcv1aVohF4HpLSxP PGSLl8RcRVT4VwNyQX81oqZboxclBBMZSH8rBzXnCqVIaktpAuD+kM+3g+d8IIi4faco TmxvIKY1IzQMU5zFttk8LjpC7q7bXCYhBfv+LoT44wJhrTa0pb7dSFHtP8/9tqqqUExJ w6ZsVDIqiNn9rsoCIPkx48Jpjj0lGBe5nmhUObaWifCkKmCr//8d3Dwxh5oUYa5xds2t sj0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=BTKwQJ01; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q20si4894522edw.269.2021.04.16.07.07.49; Fri, 16 Apr 2021 07:08:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=BTKwQJ01; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243596AbhDPMr2 (ORCPT + 99 others); Fri, 16 Apr 2021 08:47:28 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:42226 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243069AbhDPMr1 (ORCPT ); Fri, 16 Apr 2021 08:47:27 -0400 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 85CD0C06B9; Fri, 16 Apr 2021 12:47:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1618577222; bh=EB3d1O8ZkzAhpUgq8QJFbFXUneDMHT1L8PBMvL6acPw=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=BTKwQJ01811YGPnYL7QPJGuoLneHbq2jCfFXUl3pnyiWR6+Ik+VmFApXc6gLOzkxG vPmXlDcnue2xUUsPOIQqPVZSh8BZo3rrrXhHJ1BGAUxvjINi8uDch5ReOXWP8HPgpx IXW60CsAOHFoN7J0CykiS7pl1Yeybyzf44bUov/AkJzBRILoBK4oZ2IsJEmutGFCeK WWAWmiMHiOi1EZc56R+UEA5tIYgDQhPAThLV8EpPjwCJNsuHiq+J7HZOEH5p3FPqfL vitCp6G1q5vsW6rGPdHFApiy0HAfUp1LXeZgXf4YKdU5+CZgLM4lRONwsKOu5A5Xwk zHDV2bCML4keA== Received: from razpc-HP (razpc-hp.internal.synopsys.com [10.116.126.207]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPSA id 652CFA005C; Fri, 16 Apr 2021 12:46:59 +0000 (UTC) Received: by razpc-HP (sSMTP sendmail emulation); Fri, 16 Apr 2021 16:46:58 +0400 Date: Fri, 16 Apr 2021 16:46:58 +0400 In-Reply-To: References: X-SNPS-Relay: synopsys.com From: Artur Petrosyan Subject: [PATCH v2 02/15] usb: dwc2: Reset DEVADDR after exiting gadget hibernation. To: Felipe Balbi , Greg Kroah-Hartman , Minas Harutyunyan , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: John Youn , Artur Petrosyan , Minas Harutyunyan Message-Id: <20210416124659.652CFA005C@mailhost.synopsys.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Initially resetting device address was done in dwc2_hsotg_irq() interrupt handler. However, when core is hibernated USB RESET is not handled in dwc2_hsotg_irq() handler, instead USB RESET interrupt is handled in dwc2_handle_gpwrdn_intr() handler. - Added reset device address to zero when core exits from gadget hibernation. Signed-off-by: Artur Petrosyan Signed-off-by: Minas Harutyunyan Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/gadget.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 2f50f3e62caa..e6bb1bdb2760 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -5305,6 +5305,10 @@ int dwc2_gadget_exit_hibernation(struct dwc2_hsotg *hsotg, dwc2_writel(hsotg, dr->dcfg, DCFG); dwc2_writel(hsotg, dr->dctl, DCTL); + /* On USB Reset, reset device address to zero */ + if (reset) + dwc2_clear_bit(hsotg, DCFG, DCFG_DEVADDR_MASK); + /* De-assert Wakeup Logic */ gpwrdn = dwc2_readl(hsotg, GPWRDN); gpwrdn &= ~GPWRDN_PMUACTV; -- 2.25.1