Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3451539pxb; Mon, 1 Nov 2021 14:06:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiqXA85jArDTqnnwp1HwQYzx59/gqxFACtl9HHCN9q1iicaWBX5wQOqrWVVwB6dqJAteA8 X-Received: by 2002:a02:9990:: with SMTP id a16mr1185499jal.133.1635800805400; Mon, 01 Nov 2021 14:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635800805; cv=none; d=google.com; s=arc-20160816; b=ycmnYnUiaOfTFU275GYQD+FxuWpbljeh44GOj/Ls0ugtt+F6xsQ4upRK6X9arV+5WK +F5gGBMUJ+/rRrzbz65ZYljTTpAf137Q7rIwxx0Lx7brGR1d8WmMlRPHfDzyxBIv0ORb 2Ht/VPIxh0hJG1JuCMRH6Et7+9/24yw3XvK0MURee/mirDZvN6Ghc8m2NfVrc2scg/bV ze2B6RoweoB1C67ANxtoVR8hqghr9Nlknhpvequ9GGqZGWb0xiyikMvmGRZr4gAtfx0m 5PKu2Hj4RzM77Pwwf9mLtx4+BLJJL9SyY0+kxI3jjexPqVlIx+2wNTNPOSV2nnn7PoeJ fb4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=v746gIRw4x6w6whi0eejVKvGEzFDafBMr3o6GGyDCJ0=; b=DF4L6o6SstgOnPawa8xULZdnfe+nEakZPInAFp6PkXk9jPxLGYIjGlY75/au6hGeLH PhwfP2l/cZgnjRAsiSyWgWnkgsyd7iG8P5nCDt46gxd7DUn6ZTVNwav4oPyD39pkp9AR 2A91tRUWKot5jeErbm9YxdnsMAOSc64Y3tp1QmTkOgrUkJ3YRvx23tDdpl75xNUS1tUC heOeSepkigIG8nafVOBdrzyeJexEmDgnr68VhFr4bPnHJWid8oUJ1bEjGFxL3FyGc8BO K03j+/4ibzOB3RgpsfW1APGuEw+X1QuAIWeiWtYXoOhw+RgvZvz/Iu1Mx0G3BUI5K4Bj c5dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=AWHwBOSz; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si28209162iov.79.2021.11.01.14.06.32; Mon, 01 Nov 2021 14:06: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=@chromium.org header.s=google header.b=AWHwBOSz; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229541AbhKAVH5 (ORCPT + 99 others); Mon, 1 Nov 2021 17:07:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230317AbhKAVH4 (ORCPT ); Mon, 1 Nov 2021 17:07:56 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBFCCC061766 for ; Mon, 1 Nov 2021 14:05:21 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id r5so12665782pls.1 for ; Mon, 01 Nov 2021 14:05:21 -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=v746gIRw4x6w6whi0eejVKvGEzFDafBMr3o6GGyDCJ0=; b=AWHwBOSzCJlF13ayRM+Lt2V27tz9OejIOGqHJteYh7Z32UaztRaeTSYQFBpDTIPvGi KRReYsQ+U99ElLPrAAfm45NwZiRFK9WtR/F3Oq/8K9UnkkuVCHuRq4A4i89yScV7LJLu mggGwUrlIxQhxsg6wn02H/6zrd8ZAb9Dw9AoY= 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=v746gIRw4x6w6whi0eejVKvGEzFDafBMr3o6GGyDCJ0=; b=bbNVRVZ2N9Hg+P/e3RO+7Yei9nuq3EeeWLdjmCKV6fHAkO3i2tWf75J1aYc/HQylIw jTFQn3alE5fW1o0aWKbsR5hq9CDvw3if6f9dyino8EG8SKAoGx8Yb1UiMMInQPA3EmAJ 6VeKechibOP/qtAKr9B8qLYlGu2zaOQTSjP3ChkljvxP9jFAyEyypBjpy/7/91eSvjkw QHUw/eLZ3EEKlRyvwE4dG5zxr+erJhuy4CpjBJD77299FIT+2MgdJzGYI+5baYTgp5+d eyUWbArYI2bPG+xmXclyjbRWuBxBbpr4DCh43INu1/rw+7HxZEAIamLdK3IIvKoyKSeb sbBA== X-Gm-Message-State: AOAM530fu5m76aUsVUbgsGPSXaF9JJzNvTW5RxNbiLefoYCgmFxUtEY2 XDoRQViwfWbGEEjaXpF5k+NVOQ== X-Received: by 2002:a17:90b:1d8f:: with SMTP id pf15mr1532052pjb.70.1635800721350; Mon, 01 Nov 2021 14:05:21 -0700 (PDT) Received: from localhost ([2620:15c:202:201:6278:520b:a2e1:4ece]) by smtp.gmail.com with UTF8SMTPSA id p23sm297902pjg.55.2021.11.01.14.05.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Nov 2021 14:05:20 -0700 (PDT) Date: Mon, 1 Nov 2021 14:05:19 -0700 From: Matthias Kaehlcke To: Bjorn Andersson Cc: Sandeep Maheswaram , Andy Gross , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , Mathias Nyman , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, quic_pkondeti@quicinc.com, quic_ppratap@quicinc.com Subject: Re: [PATCH v9 1/5] usb: host: xhci: plat: Add suspend quirk for dwc3 controller Message-ID: References: <1635753224-23975-1-git-send-email-quic_c_sanm@quicinc.com> <1635753224-23975-2-git-send-email-quic_c_sanm@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 01, 2021 at 01:50:31PM -0700, Bjorn Andersson wrote: > On Mon 01 Nov 11:59 PDT 2021, Matthias Kaehlcke wrote: > > > Hi Sandeep, > > > > On Mon, Nov 01, 2021 at 01:23:40PM +0530, Sandeep Maheswaram wrote: > > > During suspend check if any wakeup capable devices are connected to the > > > controller (directly or through hubs), and set the wakeup capable property > > > for xhci plat device. > > > > > > Signed-off-by: Sandeep Maheswaram > > > --- > > > drivers/usb/host/xhci-plat.c | 12 ++++++++++++ > > > 1 file changed, 12 insertions(+) > > > > > > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c > > > index c1edcc9..7ab272b 100644 > > > --- a/drivers/usb/host/xhci-plat.c > > > +++ b/drivers/usb/host/xhci-plat.c > > > @@ -431,6 +431,14 @@ static int xhci_plat_remove(struct platform_device *dev) > > > return 0; > > > } > > > > > > +static void xhci_dwc3_suspend_quirk(struct usb_hcd *hcd, struct device *dev) > > > +{ > > > + if (usb_wakeup_enabled_descendants(hcd->self.root_hub)) > > > + device_set_wakeup_capable(dev, true); > > > + else > > > + device_set_wakeup_capable(dev, false); > > > > IIUC wakeup capability is typically a static property that reflects the > > actual hardware (or firmware) support for wakeup. In that sense it doesn't > > seem a good idea to change it dynamically at suspend time, depending on > > what is connected to the bus. I understand though that the odd split > > of the dwc3 driver makes it hard to do things properly ... > > > > Earlier in this discussion Felipe suggested to add a function like > > device_children_wakeup_capable(), to avoid having to call > > usb_wakeup_enabled_descendants() from the dwc3 drivers. > > > > Below is an initial implementation for device_children_wakeup_capable(), > > could you try if calling it from dwc3_suspend/resume_common() and > > dwc3_qcom_suspend() would work instead of relying on the wakeup > > capability? > > > > Thanks > > > > Matthias > > > > From 97c838334045ed67c3943f8e035ac70acd12b89b Mon Sep 17 00:00:00 2001 > > From: Matthias Kaehlcke > > Date: Mon, 1 Nov 2021 11:37:19 -0700 > > Subject: [PATCH] PM / wakeup: Add device_children_wakeup_capable() > > > > Add device_children_wakeup_capable() which checks whether the device itself > > or one if its descendants is wakeup capable. > > > > Change-Id: Ib359eb5ac8650ddf9889c7d1f77707f50777fe99 > > Suggested-by: Felipe Balbi > > Signed-off-by: Matthias Kaehlcke > > Looks neat and useful. > > Reviewed-by: Bjorn Andersson Thanks! > (Without the Change-Id of course...) Sure, I usually use patman to send patches upstream, which filters the Change-Id if present, forgot to remove it when copying and pasting the patch manually.