Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527468pxf; Mon, 15 Mar 2021 11:32:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1zymrQa3hM+7jribi+T+bo6k63J5dXESWZhO1fMibXnLkc37f7HI3ttjPp0chmX8z1126 X-Received: by 2002:a17:907:16a8:: with SMTP id hc40mr24545993ejc.40.1615833163313; Mon, 15 Mar 2021 11:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833163; cv=none; d=google.com; s=arc-20160816; b=LCdfVMwTFeRMbaQGNArzeVL0aWpw/q8eMlrWwamWh1+BrYGOYj3Hq6buT4+1HWzilh w4E0l+pXu0JCAKFWu9VdB3SrzVnXKnzFDuaLe9/fzz0ZFIexU4wDrBmoof27OKi4pjqZ yqm95lgJAbm4FIPIvvDv7iiLYhSsjynWc/OY7llS+E6iFURBBhXJoMOQNt9erBNe9B04 8sAe+IephZB9BDWYqhUWPmTTJg75PjwU7cUAOvuDeAgObqHvpwCye6ksOiQhGDTkMM7U yM021/DLFqi+U8406YMrztVIgyuDiQJTprg6oYxw+oUiVXOvm/Y1WSzwumaj0QG0quGf WJFg== 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=po8ax0FBntnUw8Dwj2PaAv3WU6rG7AlzHmKUPaC7Fcz8TRjWeFbDnPhk5liSe9aVY9 xKqjwUd5rWnBTHConHL52Y0yP8dt/C5RepBhfTzGTy3DvgFToU/WT2sAJZ0oYgLUiyQu i+kK+OUUcXVy24Oba1wi8ORg6u9SQVfqSgsGrmFj1dwPZgtgarPEb97sWc7IYPDj1b5+ o4JWDvcdpehwIsXox4UhBEDUKKxNS48otYeHbjnarSo+fCEVoB8WYcCO1jwD0FRlvInR ecxEWGLjuLiJHcWTTFcgjClAN/DRfNwNCChfidtHnV2r2v73fif2aHF/OlkhGVKxAhkR lqYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W3XZ0rz4; 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 g14si11625759edr.362.2021.03.15.11.32.21; Mon, 15 Mar 2021 11:32:43 -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=W3XZ0rz4; 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 S237132AbhCOOkC (ORCPT + 99 others); Mon, 15 Mar 2021 10:40:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:49082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233797AbhCOOC2 (ORCPT ); Mon, 15 Mar 2021 10:02:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BF02864E83; Mon, 15 Mar 2021 14:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816947; bh=18j29ErcnQ1AlvxdDfNzMhlNX3P38sse4hPA7HQqMC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W3XZ0rz4x2cYPF7fMPCANiCDvFWfTC9fLUaxLRIcZbQ56dQaZGusC2uNOnsv4MdkL bMV1SL2HcNyCJ5YVyGJt4If4oYa4zc/dV4dRIKxGaDNYF9/aZ5HoVfHG9nF4vil+P9 0r1U0S07kmdqSExJDHHKAbEhHkYEcwovYQSNuf98= 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.10 205/290] usb: dwc3: qcom: Honor wakeup enabled/disabled state Date: Mon, 15 Mar 2021 14:54:58 +0100 Message-Id: <20210315135548.849334267@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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]);