From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9889C25B08 for ; Thu, 4 Aug 2022 15:35:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239962AbiHDPfU (ORCPT ); Thu, 4 Aug 2022 11:35:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235453AbiHDPfQ (ORCPT ); Thu, 4 Aug 2022 11:35:16 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD16EB00 for ; Thu, 4 Aug 2022 08:35:14 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id w10so246745plq.0 for ; Thu, 04 Aug 2022 08:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YMwmJ3SYguFGWEp4hAm2rBYWGtLtJTCvpovU/AIVn0A=; b=Qtnq39uHyzvlwnd38DbC3LwcEUpjMXF+hgHHimscG103l15xTzdeAhdQsEhHrCXXc6 jZmcYvbCNSHRH02uVnFirKaBpXJB1Nt7yHmZSmHLABRrEcxUe/GNWK5CbueaHG9IMAfR 6mm9ZApgk6ZbXDRVcrk6xsfiBn9g5yH+QxTSw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YMwmJ3SYguFGWEp4hAm2rBYWGtLtJTCvpovU/AIVn0A=; b=bSJ/i7OnHIYE/Aqopam5tOMyYiIB/psvgYHSiQV0Q+z0WFzFwsX4L9bNuVJ0dw52pu wXleRipD5+RZDRFpEY+LuvB+1ttIKPi0j6d2u91wxj5VaAqeiy0V6GEMsk+vO6Oph9Hb uwSfqlP8GKHyw3w3USjVLtdcFd1k/tNb5LQXYS0IsYMBcmPpGxHJizYAyj4kwwfw3rjK 23KfpMYxv1388vQueLrBbqUIhaZu5hhVzwUntsnkJWFhlkq7l7cCKIXmdA2cNoXf9mGk xCrOHfMpZBoEqRCBVKjBVFC3j75UjFV+OIlp4auqcU9vA70vmkUqt83wIMwvLvHkx0Sh +wgw== X-Gm-Message-State: ACgBeo1za4k6qfqsn7vQpAsKesp6NbJjbR50kxLKXVCNI+yBWMY5aGul 6oQRlWfGJVe1FRp4Rabj9Wxnrg== X-Google-Smtp-Source: AA6agR5eBcmtuswpC9ZyuRauPZ9fC4Eka3LZy92marD/sOH7rjs76EIMqw+kflXgFAwfE3jtieqwBA== X-Received: by 2002:a17:902:a418:b0:16c:9ee2:8a02 with SMTP id p24-20020a170902a41800b0016c9ee28a02mr2453212plq.46.1659627313991; Thu, 04 Aug 2022 08:35:13 -0700 (PDT) Received: from localhost ([2620:15c:11a:202:87c4:32ca:84b6:e942]) by smtp.gmail.com with UTF8SMTPSA id j9-20020a17090a31c900b001ef7c7564fdsm3870037pjf.21.2022.08.04.08.35.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Aug 2022 08:35:13 -0700 (PDT) Date: Thu, 4 Aug 2022 08:35:10 -0700 From: Matthias Kaehlcke To: Johan Hovold Cc: Johan Hovold , Greg Kroah-Hartman , Felipe Balbi , Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Manivannan Sadhasivam , Konrad Dybcio , Krishna Kurapati , Stephen Boyd , Doug Anderson , Pavankumar Kondeti , quic_ppratap@quicinc.com, quic_vpulyala@quicinc.com, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/8] usb: dwc3: qcom: fix runtime PM wakeup Message-ID: References: <20220802151404.1797-1-johan+linaro@kernel.org> <20220802151404.1797-5-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Thu, Aug 04, 2022 at 09:35:16AM +0200, Johan Hovold wrote: > On Wed, Aug 03, 2022 at 02:58:33PM -0700, Matthias Kaehlcke wrote: > > On Tue, Aug 02, 2022 at 05:14:00PM +0200, Johan Hovold wrote: > > > A device must enable wakeups during runtime suspend regardless of > > > whether it is capable and allowed to wake the system up from system > > > suspend. > > > > > > Fixes: 2664deb09306 ("usb: dwc3: qcom: Honor wakeup enabled/disabled state") > > > Signed-off-by: Johan Hovold > > > > Ah, I wasn't aware that the same wakeup mechanism is used in runtime suspend. > > > > In how far is runtime PM actually supported/used by this driver? The device is > > set 'active' in _probe(), and there are no other pm_runtime_* calls, except > > in dwc3_qcom_remove() and qcom_dwc3_resume_irq(). How does the device get from > > 'active' into 'suspended'? > > It will be runtime suspended when the child (core) device suspends, but > you need to enable runtime PM through sysfs first. Thanks for the clarification. After enabling runtime suspend for the dwc3 core, dwc3 glue and the xHCI the dwc3-qcom enters autosuspend when the delay expires. > And the controller is resumed in the wakeup-interrupt handler for the > runtime PM case. > > It seems to work ok, and it looks like the driver has supported this > since it was first merged. With and without your patch dwc3-qcom enters autosuspend and stays there. USB devices like a mouse or a USB to Ethernet adapter keep working while the glue is suspended. How is the runtime resume triggered for the dwc3 glue? Sorry if my questions are very basic, so far I haven't dealt much with autosuspend and I'm trying to get a better understanding in the context of the dwc3 and why it is currently broken.