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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F53BC433E2 for ; Thu, 17 Sep 2020 16:06:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 434E322464 for ; Thu, 17 Sep 2020 16:06:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="d7RlsgYH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728230AbgIQQG0 (ORCPT ); Thu, 17 Sep 2020 12:06:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728285AbgIQQDU (ORCPT ); Thu, 17 Sep 2020 12:03:20 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BE2BC061353 for ; Thu, 17 Sep 2020 08:54:08 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id 34so1586034pgo.13 for ; Thu, 17 Sep 2020 08:54:08 -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=SLbdaPRsUm17Oxy4TshTtUDtovCxhCm/CCE1+IYwJv8=; b=d7RlsgYHVPiVpsrOpvAWEc4RvTmn1+NdIwLr6SDhRJVU1RnMyCgMfxJ1KWUX88M71x EiuWvXsBPc1t1n+DA4dM4TZB6/w+CJJ4wJ0xQXy7zQ/dWeWNHofW1gzGdH28Z8h/Vh1y 7fqvBfBwFXFjgEnzwLmO0AtTXxY2rKi+dbGAE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=SLbdaPRsUm17Oxy4TshTtUDtovCxhCm/CCE1+IYwJv8=; b=K4ycPQ3FUs32RQX2zYWHUesCNwk9vEecWXlHfBQsOnnodekrW870/9a/JIln39YllY pc+m8MtGdZgnZ8ThWBcLOwiiffed+6vwb0lkojU6PNi6KUF9Mw8bQnCc7IuhJqno1IVc t5S9VNkH/8ovnDuuemxBEptofMRbmOqLgIIY5fWQ00RIjquCM+BL4lLkx9adGlOTM6wT yTJY98NEWfjlvRmasH2hmDoL+HBlDCwzb3vzwAIxdpx8zm9P4hDF7FL25bcrxrZxdEnA uALbcSAs90XU4EFYDaGYpCslVTMRVbT6u9YycQsQWpUm/pQWk3ODgLzzA5aTC0aKqvWP TuDQ== X-Gm-Message-State: AOAM532R3J6vH383E2MkqcAMp3DgpjgEwX6Vpb0SNzFo5AZOXVYt9Nbm D6Gxg8ZuFnUG3LmiZolYJsttdQ== X-Google-Smtp-Source: ABdhPJx3sAJiavm4slDW3NkgOwvuqia4sXV+vKNmPQVo6YaTKWma2qu3v9hvtwlfbebcMPf1/2VNiA== X-Received: by 2002:a65:4984:: with SMTP id r4mr22470809pgs.261.1600358044925; Thu, 17 Sep 2020 08:54:04 -0700 (PDT) Received: from localhost ([2620:15c:202:1:f693:9fff:fef4:e70a]) by smtp.gmail.com with ESMTPSA id 1sm21247pfx.126.2020.09.17.08.54.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Sep 2020 08:54:04 -0700 (PDT) Date: Thu, 17 Sep 2020 08:54:03 -0700 From: Matthias Kaehlcke To: Peter Chen Cc: Greg Kroah-Hartman , Rob Herring , Frank Rowand , Alan Stern , Krzysztof Kozlowski , Bastien Nocera , Ravi Chandra Sadineni , "linux-usb@vger.kernel.org" , Stephen Boyd , "devicetree@vger.kernel.org" , Douglas Anderson , "linux-kernel@vger.kernel.org" , "Alexander A. Klimov" , Masahiro Yamada Subject: Re: [PATCH 2/2] USB: misc: Add onboard_usb_hub driver Message-ID: <20200917155403.GA21107@google.com> References: <20200914112716.2.I7c9a1f1d6ced41dd8310e8a03da666a32364e790@changeid> <20200915025426.GA17450@b29397-desktop> <20200915050207.GF2022397@google.com> <20200915230345.GF2771744@google.com> <20200916081821.GA14376@b29397-desktop> <20200916191607.GB3560556@google.com> <20200917002646.GA23310@b29397-desktop> <20200917004758.GD3560556@google.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: devicetree@vger.kernel.org On Thu, Sep 17, 2020 at 01:24:30AM +0000, Peter Chen wrote: > > > > > > > > > > You may need both (glue & xhci), it depends on system design, and > > > usually, these two kinds of wakeup setting isn't conflict. > > > > Ok, thanks. So if I understand correctly the onboard hub driver should check the > > wakeup state of the xHCI to determine if remote wakeup is enabled for the > > controller (after all it doesn't know anything about the platform device). > > Wakeup might not work properly if it is disabled for the platform device, but it's > > the responsability of the board software/config to make sure it is enabled > > (possibly this could be done by making the dwc3-qcom driver understand the > > 'wakeup-source' property, as the xhci-mtk driver does). > > No, every level should handle its own wakeup setting. You may have to do this since the USB bus and platform bus > are two different buses, you should not visit device structure across the bus. And you don't need a device tree property > to do it. For platform driver, you could use device_may_wakeup, for onboard hub power driver, you could use > usb_wakeup_enabled_descendants since you need to cover descendants. > > The purpose of these two wakeup logic is different, for USB bus, it is used to tell USB devices to enable remote wakeup > and do not power off its regulator; for platform bus, it is used to tell the controller to enable its wakeup setting and keep > the regulator for its USB controller and USB PHY (if needed). Sorry, I didn't express myself clearly. With the platform device I was referring to the dwc3-qcom ('glue') in this case, which could check it's own 'wakeup-source' attribute to enable wakeup at boot. The driver currently enables wakeup statically. The onboard_hub driver is agnostic of this device.