Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5490703pxb; Wed, 26 Jan 2022 13:16:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmultq6So7Vqm2dwS4m/erzO8FWwc1dm/gbPvSlS+jJGMRHQZXk+SrhAa+IHgoJh3PDCYy X-Received: by 2002:a17:90b:1c88:: with SMTP id oo8mr10570463pjb.218.1643231802548; Wed, 26 Jan 2022 13:16:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643231802; cv=none; d=google.com; s=arc-20160816; b=OuK/Ch+gUxIDTdu9q5FmR3ycxTEBTQiHDWEgyVpp7iMztjMGjgZE4fQToQk40Ti8df MNUEZxprNqAnD9psm53QBCuFAYY63gT+FDeFN8GmgWBwgl4gWIahsD6msRVGZGESW4E5 6ROpN/QwslEbsGdPCq+rx4HdnHSB/IS9PH4b/HVGruj4u1uKP4GQ1OxJLPDNayxPmt7+ PDGyV5CiXr2ZJwWAGUIvodtUeEqpiwlQlN7b413LGxs9chTRIfKRqphG/5Qdn7ac8KZm MojVCDmIAm7pK9r4vkEZI6ClWJcA+l5zRoL8PU/wxVTmdHBFP1g9+ci2+BxytnLp35Qx F3zg== 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=x51B7IsM78f+pd+GbI5zeB62IzMmb7iuxVbfQ9UCMwk=; b=ysBTEpMjYkE3usEYfVDdsDVq/blAAYItjp+FjNbtTCkLiNY09QmNdaOE4cjmMmtxyL 5olNN+QFUgepCwmWIM64kPycRfWmF/i/GKk6HYmkrI4C1ImOH+6HpG/Pr8M0YKkJvDPt ggREHhs54ONNxHTfRLlGphY90JI4AE3ibFgg1tLpAfyGyQ8Per4fIecxTkuscZaRUzT0 XU7j/iuJlNfvXSJJ9OSCcdikisyeP59BUiy0IC77V6VwVu+9Ls1GbDaOcHO2Tl7LWjrd TD3rSXxyWPSOwrGtGjlQCjq4GVdwiHhqYm+JLgGZAevjqMNkZmd2KamV4JHPZQW4L0mM fg6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c0uK1RuC; 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 e18si236370plj.334.2022.01.26.13.16.30; Wed, 26 Jan 2022 13:16:42 -0800 (PST) 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=c0uK1RuC; 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 S234178AbiAZMrp (ORCPT + 99 others); Wed, 26 Jan 2022 07:47:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241485AbiAZMrn (ORCPT ); Wed, 26 Jan 2022 07:47:43 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82F30C06161C; Wed, 26 Jan 2022 04:47:43 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4C282B81CBB; Wed, 26 Jan 2022 12:47:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6868FC340E8; Wed, 26 Jan 2022 12:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643201261; bh=kIGlnjBGTh6zIi8iQ/JDAw3h8p25VHindX4jPD66GFg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c0uK1RuCsPKh/QTSlnPL83IiSk78/+JZRoyeh57+QWFfbiRqccJNrgZ0Dnf2b9Yo/ h6uDeuhPyLLAnVAXxgaDZYMBu/P9N2EvxozlGidQXpwtQHl46uz1RzltIpzFVZQQ2E EJknWiOb1z2UziaYloaM9xMyZjiX2Ys9vS8lY/io= Date: Wed, 26 Jan 2022 13:47:38 +0100 From: Greg Kroah-Hartman To: Sandeep Maheswaram Cc: Felipe Balbi , Stephen Boyd , Doug Anderson , Matthias Kaehlcke , 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 v10 1/6] usb: host: xhci: plat: Add suspend quirk for dwc3 controller Message-ID: References: <1642398248-21753-1-git-send-email-quic_c_sanm@quicinc.com> <1642398248-21753-2-git-send-email-quic_c_sanm@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1642398248-21753-2-git-send-email-quic_c_sanm@quicinc.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 17, 2022 at 11:14:03AM +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 enable property > for xhci plat device. > > Signed-off-by: Sandeep Maheswaram > Signed-off-by: Matthias Kaehlcke > Reviewed-by: Bjorn Andersson > --- > Change device_set_wakeup_capable to device_set_wakeup_enable as > wakeup capable false was deleting the sysfs property. > > 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..1c8fadb 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_enable(dev, true); > + else > + device_set_wakeup_enable(dev, false); > +} > + > static int __maybe_unused xhci_plat_suspend(struct device *dev) > { > struct usb_hcd *hcd = dev_get_drvdata(dev); > @@ -440,6 +448,10 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev) > ret = xhci_priv_suspend_quirk(hcd); > if (ret) > return ret; > + > + if (of_device_is_compatible(dev->parent->of_node, "snps,dwc3")) > + xhci_dwc3_suspend_quirk(hcd, dev); I still think that checking for this type of thing needs to be in the platform specific driver, not in the generic one. thanks, greg k-h