Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp910279pxj; Thu, 27 May 2021 14:45:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwodJ8z0qa0Nu55JZ731tlgPWy+Gi4ZQdAXeANFFrDK4rJUJ4ZCycrBYdCqaz61ZjiRP/NV X-Received: by 2002:a05:6602:2013:: with SMTP id y19mr4498328iod.71.1622151959190; Thu, 27 May 2021 14:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622151959; cv=none; d=google.com; s=arc-20160816; b=PIpoJnyUXTaUmOY7kYS/EWRmz9jCcmXszk9YSsCiCvX/lhzzD9vhsHMTPlWqa0Sv69 H/89Bf+yhZCs+ww58Rd7DOlS0qAg5SQE0L/2AaoC0maDWugtwjkpNsnTqmNagF8I6LUR M1lFgHNBv9BpWpmKuYMWv3Tx/riPOIfXJsl9uZL7UzY+ITDYKghSdsus8k3kXJiORYU1 09caPn28TYQ0brSWjOBlx265zVugOVYwSw/j504GiVPGN6Zi9fdNWAjsUWtOz2uLThD1 Pn4qwjHzYcXaR3disbZRw27ptCXkry/shL6IZ2KqxweAbcGYuQBwOoXg5aqSDe79c7qj beHw== 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=qkDlkcG8kE7Oby1VetcPUTMSgA6WffZhl4VXtps+2X4=; b=Xahum89h/uHX6wiQrDUnmUNAXmjJGbfhYeMHxaCdL7BoitA8Ip6IWYuIIsKc+fpqFJ JaHDChFrI+qHA79Xs4S1gxxQr/kbXcsIaonFXwxVM/yZrkPeGo0r8eWP0oU84J0WvREK KFD8yPiJkZmLIo3r62AEJtNr/nvtU1598X5lfO2vH7FMM27tMVrnDTiK7bOw0MpuN8l/ YWmaQT/QccVk3toeWUSbizqxipVkSDf9kZd4ZzH+FJgYy/15wRz6yctGSTNfNjJZBtaJ Jji9sZ2w/GhHgX4GL0j7+ignsirRK3g/ic0r8t/mj9CM+qCd7KT72Plfa+qO5llo/763 a1hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NTnJUVGD; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 13si4315804ilx.46.2021.05.27.14.45.45; Thu, 27 May 2021 14:45:59 -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=@linuxfoundation.org header.s=korg header.b=NTnJUVGD; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236960AbhE0POu (ORCPT + 99 others); Thu, 27 May 2021 11:14:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:43170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236899AbhE0POk (ORCPT ); Thu, 27 May 2021 11:14:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D1EAE61358; Thu, 27 May 2021 15:13:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622128385; bh=PGSDWSy5zTruX9mD8xCw9OZ6XVWP6IV6zXvmckvGE9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NTnJUVGDcj3JOesxhRlt2vrNmgnvZBjIcj9DVjnQMRFkdYoTrURHqE0Q+wV+z+sr7 jT6KkslFTdEZx5h7FCKmy0aGfc8p+8vDJ300Wm8U0Sp/zejRoyIiGoqbDYWUTlHuYI DqrQcJDxA3oTRKfnloZd7nG3wwZ7ZBZ7L6+c5/kk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felipe Balbi , Jack Pham Subject: [PATCH 5.4 4/7] usb: dwc3: gadget: Enable suspend events Date: Thu, 27 May 2021 17:12:46 +0200 Message-Id: <20210527151139.361919991@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210527151139.224619013@linuxfoundation.org> References: <20210527151139.224619013@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jack Pham commit d1d90dd27254c44d087ad3f8b5b3e4fff0571f45 upstream. commit 72704f876f50 ("dwc3: gadget: Implement the suspend entry event handler") introduced (nearly 5 years ago!) an interrupt handler for U3/L1-L2 suspend events. The problem is that these events aren't currently enabled in the DEVTEN register so the handler is never even invoked. Fix this simply by enabling the corresponding bit in dwc3_gadget_enable_irq() using the same revision check as found in the handler. Fixes: 72704f876f50 ("dwc3: gadget: Implement the suspend entry event handler") Acked-by: Felipe Balbi Signed-off-by: Jack Pham Cc: stable Link: https://lore.kernel.org/r/20210428090111.3370-1-jackp@codeaurora.org [jackp@codeaurora.org: backport to pre-5.7 by replacing DWC3_IS_VER_PRIOR check with direct comparison of dwc->revision] Signed-off-by: Jack Pham Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/gadget.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2022,6 +2022,10 @@ static void dwc3_gadget_enable_irq(struc if (dwc->revision < DWC3_REVISION_250A) reg |= DWC3_DEVTEN_ULSTCNGEN; + /* On 2.30a and above this bit enables U3/L2-L1 Suspend Events */ + if (dwc->revision >= DWC3_REVISION_230A) + reg |= DWC3_DEVTEN_EOPFEN; + dwc3_writel(dwc->regs, DWC3_DEVTEN, reg); }