Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3520500pxf; Mon, 15 Mar 2021 11:23:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIo1KJQ6WC8VPpfplCNU68rIAvxbHEv8vwG6yWnvs8selv5DflbYlFo/X/g/5qAXZr6z60 X-Received: by 2002:aa7:d94c:: with SMTP id l12mr30430775eds.311.1615832583403; Mon, 15 Mar 2021 11:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832583; cv=none; d=google.com; s=arc-20160816; b=q5GeRiIz42FITM4V0BWVeOlEVF22/EQW1alDPfe8oYuzgSSGHIep3Kz7QVUiRLCUGz Yb6UXXZgsIanWplC8JEO+l8W8HEs7YXpLk9rnyW/Zef69gYEW1m6xfEGe6Y2DSUJrG/v ctpQ0d3TFqqOa2Fq9WucQLWE4bvx8gJr/lCyz3zHU4OQQTCN1oPWxQhBJHxnj3lbc1zg I2qlIYbaim8p57/BDBwHVuC9sJCM7EJaIOE2+dyNKKKkNcdf1/VSd8SB6gFJ8zOPUEOs 58n4V7+1w258L/lwhSxUcvpUipwlGMh1s/lnfDZSx5O4I7uyNx/hrVibuuchAD9ioiu1 u1rg== 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=qWV55I8xPKY6veZKMs1nSvr0RVs63A7yYPTXF+nROhs=; b=gNqdIUh4elYuf6CrU81GeBsU6Er0+0T3alS5XbSdMBvoDEK8XgxTE1dHx7SfSTTjuO mqmIaxXCe69ka7CkV3+g2QEANimvIA6X3guq/D9sSI5ZgNUe6PTs60bgrUk6yl1jIa9R RhVwE5sTQOcQhm34B/cM1WfvzLUrKGNE3jRzVmNFyI5X1HS3VdvX132bdOIxywLGkG7T Z5x6OZgKuAq+xkVMfMIvzn4Rtwou7kRR39MiLJ9Tll0N5427yvyZSh/RPeHcIaK54EtZ N7LM7IFH5n44f/KN3N06pLdo1iYPDA+OCHtHShFiUmlbvO7xw+RmD8esMeQeV2g7c2tQ imhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uB9XG7Xx; 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 a8si11890107ejt.44.2021.03.15.11.22.41; Mon, 15 Mar 2021 11:23:03 -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=uB9XG7Xx; 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 S237956AbhCOOW0 (ORCPT + 99 others); Mon, 15 Mar 2021 10:22:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:37582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232929AbhCOOAL (ORCPT ); Mon, 15 Mar 2021 10:00:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0A54864F6D; Mon, 15 Mar 2021 13:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816797; bh=08oL0oLXiYE0De0SgSdpidRFGQvV+jBUzg/iP7iGhW8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uB9XG7XxGSUxdmXukEhe+hbTrPj7+xxt/m30Vy0HHXNtODO2Hj1V1HbWxQ1aMn93p CYI6RyBUqgkCHyka4aCwExP2qC1CA7GTva46hpN8+b8/+4DoYkWwOrz7P8Vkb1VAWi MQ2pipesXP1bshRygi6XkEBmS84huoQBc2qyKPwM= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bjorn Andersson , Matthias Kaehlcke Subject: [PATCH 4.19 074/120] usb: dwc3: qcom: Honor wakeup enabled/disabled state Date: Mon, 15 Mar 2021 14:57:05 +0100 Message-Id: <20210315135722.401214691@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135720.002213995@linuxfoundation.org> References: <20210315135720.002213995@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 @@ -234,8 +234,10 @@ static int dwc3_qcom_suspend(struct dwc3 for (i = qcom->num_clocks - 1; i >= 0; i--) clk_disable_unprepare(qcom->clks[i]); + if (device_may_wakeup(qcom->dev)) + dwc3_qcom_enable_interrupts(qcom); + qcom->is_suspended = true; - dwc3_qcom_enable_interrupts(qcom); return 0; } @@ -248,7 +250,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]);