Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp498040pxb; Wed, 14 Apr 2021 22:40:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGbjEKFmt/DM9BFKy4RcbsfOGzOTjRUqY9Zqrx1UI18L1e2dBxUGov0uVLuQJ199K6g6Dp X-Received: by 2002:a62:bd03:0:b029:21d:b680:db15 with SMTP id a3-20020a62bd030000b029021db680db15mr1497281pff.25.1618465236628; Wed, 14 Apr 2021 22:40:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618465236; cv=none; d=google.com; s=arc-20160816; b=Y/qA61Mwymd3Ka0cDz2uYAFb9BlZBjexFtZ9HJvCFjDQGB4wdXoF+CBQdRJq/JISlx faKyFEyNh4FwPg9VkRmKVAUMFjv2bHv64K9G2n5M71A8LOMLeHKPh4tTqKaTeyreIujf l4wUSp090BcfuIKfbZZdkkjd4q8ZHdmFil11IECwe23dxCebHU03303jkNIf78X67AL8 dN6bvyzHlNMGQvsEL2eRwk+095pAFY/J9rkdZVdHYByytUz9tkileUQo8xHG8jy20oCE hPqYuNU3754w+dnDQ1yz70PP6djddOPJ4D1QCQ+/WpHJqVwmSUIDsbfPjrDQRHtl/tR9 PITg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:from:references:in-reply-to :message-id:date:dkim-signature; bh=2VuMZVaM9DemAw3Kyslu+rlVJWqPMhZ8kXA08tuyw7M=; b=E7JX6MYgtEG3HuRCCBaqlDz5miKaVrg/CbtnTo3xCmeaCpLBgjtzsDPwVsV8A6jzil ItwqXOOqkmxXTNaFYplXVayQnWnDF4FlmnaAreOII1gofSIsaTblcTecXbyRdD+qhnuW IYMSfkOFTUhnBiQ9/YrxrVhG8TTVczoUyw1Z0ZlBiIXwmrYnPv/rxlOXzv0p5h5782F7 NRPrSGSNanAPIIcbyQwaJW24cfcvUkg0h/o4sAwmAtbYWYNX5rAcZ18f6dMTxA0LIOCg MlpyryPnyUNSkR2E5bjgxjR32BvBXaCwI3zcNtlGWVr1PM6g/S4b4S2I/xOclpRw+unQ 4IIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=D28ijBM+; 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 x10si1986794pfi.182.2021.04.14.22.40.24; Wed, 14 Apr 2021 22:40:36 -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=D28ijBM+; 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 S230195AbhDOFkD (ORCPT + 99 others); Thu, 15 Apr 2021 01:40:03 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.73.133]:56436 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230159AbhDOFkC (ORCPT ); Thu, 15 Apr 2021 01:40:02 -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 3B076400CB; Thu, 15 Apr 2021 05:39:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1618465179; bh=EB3d1O8ZkzAhpUgq8QJFbFXUneDMHT1L8PBMvL6acPw=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=D28ijBM+9zkLyup6OeGK2f9lmOi+EhilzKWW9yut2d+7kr2L3Fj3FDzi2MA6bwshT aLZ74Vs3t+GmsXIESg5ZVx6JghQ9cevd6WgMGUuSF1B9qlr82csRfYHxtD95Jz4GH2 fPdaR5rLGICfDKB1Kjuly+XAtisZJHln+w3/LZtsJr3g0Giw/jFs5xxPCAanDjJiR+ jS4IvHXvAhOmvGvPnNH91vZcWeiPC1TmhtXiEtOctQvzIEIUBLftB8SkG8+af0aWC6 LbxvGhz8oLBcnTAPyaC4fvcPiGBZDa2cJnC+WN7L45pzgq3aAke5dU7REK6+PuHk/H T1xfmkBGpMhlA== 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 4D7D9A005C; Thu, 15 Apr 2021 05:39:36 +0000 (UTC) Received: by razpc-HP (sSMTP sendmail emulation); Thu, 15 Apr 2021 09:39:35 +0400 Date: Thu, 15 Apr 2021 09:39:35 +0400 Message-Id: In-Reply-To: References: X-SNPS-Relay: synopsys.com From: Artur Petrosyan Subject: [PATCH 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 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