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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 E3684C3279D for ; Wed, 7 Oct 2020 01:00:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93BA720679 for ; Wed, 7 Oct 2020 01:00:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726949AbgJGBAZ (ORCPT ); Tue, 6 Oct 2020 21:00:25 -0400 Received: from netrider.rowland.org ([192.131.102.5]:41871 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726919AbgJGBAZ (ORCPT ); Tue, 6 Oct 2020 21:00:25 -0400 Received: (qmail 438874 invoked by uid 1000); 6 Oct 2020 21:00:23 -0400 Date: Tue, 6 Oct 2020 21:00:23 -0400 From: Alan Stern To: Matthias Kaehlcke Cc: Doug Anderson , Rob Herring , Greg Kroah-Hartman , Frank Rowand , "linux-kernel@vger.kernel.org" , Linux USB List , Bastien Nocera , Stephen Boyd , Ravi Chandra Sadineni , Krzysztof Kozlowski , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Peter Chen Subject: Re: [PATCH v4 1/2] dt-bindings: usb: Add binding for discrete onboard USB hubs Message-ID: <20201007010023.GA438733@rowland.harvard.edu> References: <20201006004510.GD4135817@google.com> <20201006141820.GA416765@rowland.harvard.edu> <20201006165957.GA191572@google.com> <20201006171524.GB423499@rowland.harvard.edu> <20201006192536.GB191572@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201006192536.GB191572@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Tue, Oct 06, 2020 at 12:25:36PM -0700, Matthias Kaehlcke wrote: > On Tue, Oct 06, 2020 at 01:15:24PM -0400, Alan Stern wrote: > > You don't need a platform device or a new driver to do this. The code > > can go in the existing hub driver. > > Maybe. IIUC currently USB drivers don't support/use suspend_late. Could that > be added? It would simplify matters, otherwise all hubs need to know their > peers and check in suspend if they are the last hub standing, only then the > power can be switched off. It would be simpler if a single instance (e.g. the > hub with the DT entries) is in control. Adding suspend_late would be a little painful. But you don't really need it; you just need to make the "master" hub wait for its peer to suspend, which is easy to do. And hubs would need to know their peers in any case, because you have to check if any devices attached to the peer have wakeup enabled. > > Incidentally, the peering information is already present in sysfs, > > although it is associated with a device's port on its upstream hub > > rather than with the device itself. > > That might also help the hub driver to determine its peers without needing the > 'companion-hubs' property. It wouldn't hurt to have that property anyway. The determination of peer ports doesn't always work right, because it depends on information provided by the firmware and that information isn't always correct. Alan Stern