Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527792pxf; Mon, 15 Mar 2021 11:33:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydtrgSO0BdDhsDzQF8UWNTXGdWmfqLaNw0OydBsWwjIuIOevdyNPeUG8hZZuKkSpRtoef3 X-Received: by 2002:a17:906:719b:: with SMTP id h27mr24842280ejk.123.1615833188379; Mon, 15 Mar 2021 11:33:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833188; cv=none; d=google.com; s=arc-20160816; b=torLa0Pybavxx6tpn0kQ9zLnOHQuUQmRIEtcczYEB1SyH3rhqiNrTMyEuKCwY64ZpY veUK//SqFYeVTT+GRu6H8SdJc9VmRJZHnB1Gfg8bXMRwxXf9f1TwzttrVysKk71ueV4n swau+/N5q0CCZG6FVE0I5vY+RF/gJL1uJBYFed8P0pohoVKGDLX2AEXShRq7B04AoVAu t/BDubdt49X+QFD2Ph2tvJsm8L7HPei1v004W+qgP8JQRQxPpca2On/LMwdAptWGDqbe wrhy4RTwbm4D3/7DzYq+OM0GzuJcDsHcEm3WHdhRf9fp8YGYQ8e4oK75Pu6AnZztNwkX ny9A== 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=DaGcmL61+xsMsjb4YXvH+nq/XSzG8c0N9b8bOwhg+r0=; b=uPusOB+Of9W6yH40Ui/Wr7JdT2/rMjfYk9uB/av7vT2owrN7f0nK0U8PV1ph39N1IN kau/7zhcyNNNqWUMglECgqlKp/MGu9AZaydjMXrT1CGdn/BwXtyGrYQiFU1dpqsX5aAq 1JugZ1QHBDzDpzXjGdSQ+Y3fTweKaohbh0PyV8/4PwAjSZinGEcmqVaa+w3kEMw0bWUP J2kc1v/o0letOCKZKab9LwzwvzgRJssdcbh7vG4CrZ5ofD5pPuR/OJ+dynrfLMem6wbe b5i+Dacw229F+sBiRsP0RbO52vZ/9wfSs1AtoGhJ+TiwK6VS4vOfT28xEnKTgD2jWFlt xa3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nAfxHc48; 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 m15si12456863edj.170.2021.03.15.11.32.45; Mon, 15 Mar 2021 11:33:08 -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=nAfxHc48; 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 S237846AbhCOOl0 (ORCPT + 99 others); Mon, 15 Mar 2021 10:41:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:48644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233538AbhCOOB6 (ORCPT ); Mon, 15 Mar 2021 10:01:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3F30964E4D; Mon, 15 Mar 2021 14:01:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816918; bh=18j29ErcnQ1AlvxdDfNzMhlNX3P38sse4hPA7HQqMC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nAfxHc48sOnAX065nV+/KCPSU5V2z+dH2eM0inP1P3v7I8m51e2upWwou67X2rX1n r2Yt7hhft3GB89/N4GQ6wzsF3j+0+kRpve4JolQ6p4Abzpwl9xbprjSMvZBBLNNSiQ 7D4eCIewvZvXrjVf6NpqSrD86gcP3TxtSQ1VQybE= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bjorn Andersson , Matthias Kaehlcke Subject: [PATCH 5.11 201/306] usb: dwc3: qcom: Honor wakeup enabled/disabled state Date: Mon, 15 Mar 2021 14:54:24 +0100 Message-Id: <20210315135514.428967658@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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: Greg Kroah-Hartman From: Matthias Kaehlcke commit 2664deb0930643149d61cddbb66ada527ae180bd upstream. The dwc3-qcom currently enables wakeup interrupts unconditionally when suspending, however this should not be done when wakeup is disabled (e.g. through the sysfs attribute power/wakeup). Only enable wakeup interrupts when device_may_wakeup() returns true. Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver") Reviewed-by: Bjorn Andersson Signed-off-by: Matthias Kaehlcke Cc: stable Link: https://lore.kernel.org/r/20210302103659.v2.1.I44954d9e1169f2cf5c44e6454d357c75ddfa99a2@changeid Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/dwc3-qcom.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -358,8 +358,10 @@ static int dwc3_qcom_suspend(struct dwc3 if (ret) dev_warn(qcom->dev, "failed to disable interconnect: %d\n", ret); + if (device_may_wakeup(qcom->dev)) + dwc3_qcom_enable_interrupts(qcom); + qcom->is_suspended = true; - dwc3_qcom_enable_interrupts(qcom); return 0; } @@ -372,7 +374,8 @@ static int dwc3_qcom_resume(struct dwc3_ if (!qcom->is_suspended) return 0; - dwc3_qcom_disable_interrupts(qcom); + if (device_may_wakeup(qcom->dev)) + dwc3_qcom_disable_interrupts(qcom); for (i = 0; i < qcom->num_clocks; i++) { ret = clk_prepare_enable(qcom->clks[i]);