Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3520972pxf; Mon, 15 Mar 2021 11:23:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx48ecM1ktO2QTrRKFfBGSizicCY0Kn5ybA7BJz2DHM6ZOZ4BmK9V3HrKhAGCDjMgvzvXs1 X-Received: by 2002:a17:906:c005:: with SMTP id e5mr25260734ejz.270.1615832625838; Mon, 15 Mar 2021 11:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832625; cv=none; d=google.com; s=arc-20160816; b=spXzsa97vEr9VhHGa0DWmGIG9t/8BCQegP9FPAwR1dJpv/SQWptukPrd2eoHNgSVuU sp9rHl84uUR02KHFz1wkdm+e5u2yvLI+xvYmn/f8AzSI+F5qONcn83i9ltqOy15Ib80s Fe0QZimBMkIwO8s00h6MxlvBHDH1exZ/k5nLg+NzUNITpfJesYLzjYUXUb+DD9sa6pRt a/dVww0bOpmqm8s9/jZfSpAEJOOsEPGTkhDAD2hodJ0TDaLhr/HCXZ7RCk4Z/BvaeFX2 JmnWrGs++PG0WdzpSvep/1R7UtOkuKnhGIC5PIltMgmzwM5n9c151QZ41HPmSbcnETcE IHBg== 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=CtGX/7hwxqfc9xN3nCd6Ly7QD29lvcHT+fl4V6CaWpA=; b=VgraVAQoW5+WdkTzl8eKff8Oc4wmPL8teoFO136NHjsyw/JrLYM/s//cTWzRHMkmlx E0PGKpVsTXmDEwjQ51pKOeGXyeb5bFuMwSfcyj4C1m/qUHF/AhN4JTgG86maBojCILQd 2DRQfTRvTIko1PzI0sc/WALJkzl7JECNnhFpgSXyUxSpoETcWvEK246P+Ox/me7mb8rX QQN8jQkCU/2LwbURyY1paUARUXbTuC5Unko8t2HBRd3e05XQuzONF0sbJ6TJBQ/ugRPC YN6FqgLPmIsJ5cLvrP76Lq9wycOiehEPK1/wnR7ffgOVa/MjwQGHnHsHQsYwkLandVmF 63eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ix3OM/YT"; 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 m9si11745174ejj.339.2021.03.15.11.23.23; Mon, 15 Mar 2021 11:23:45 -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="ix3OM/YT"; 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 S238346AbhCOOXG (ORCPT + 99 others); Mon, 15 Mar 2021 10:23:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:37632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231977AbhCOOAP (ORCPT ); Mon, 15 Mar 2021 10:00:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 86A8264FA8; Mon, 15 Mar 2021 13:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816785; bh=W/t6Gj0I8407eSXPj5r784/zkUZ2XD3MUlJB77bxuhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ix3OM/YTE0zTXgVlM/AiZEtdwL+NuBQ7AINg3lM8EId7hc/MCbeK1F3B4uSl84gG5 pKcDOeSuunjDzA+4F3FOPXtYQSrYj3FGoI5eSecx/lHDFuIvSm8CDpIcsTdkhiWtBu uhb5FRIueP5giDUXPSZjhk3Y360PtRTxrQl49l2Q= 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.4 108/168] usb: dwc3: qcom: Honor wakeup enabled/disabled state Date: Mon, 15 Mar 2021 14:55:40 +0100 Message-Id: <20210315135553.909866543@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@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 @@ -251,8 +251,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; } @@ -265,7 +267,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]);