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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham 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 4E5D8C46465 for ; Wed, 7 Nov 2018 16:27:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2195820892 for ; Wed, 7 Nov 2018 16:27:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2195820892 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731412AbeKHB6b (ORCPT ); Wed, 7 Nov 2018 20:58:31 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:47698 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1731373AbeKHB6b (ORCPT ); Wed, 7 Nov 2018 20:58:31 -0500 Received: (qmail 3451 invoked by uid 2102); 7 Nov 2018 11:27:26 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 7 Nov 2018 11:27:26 -0500 Date: Wed, 7 Nov 2018 11:27:26 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Al Cooper cc: Florian Fainelli , Al Cooper , , Alban Bedel , Alex Elder , Andrew Morton , Arnd Bergmann , Avi Fishman , , Bjorn Andersson , Chunfeng Yun , "David S. Miller" , , Dmitry Osipenko , Greg Kroah-Hartman , "Gustavo A. R. Silva" , Hans de Goede , James Hogan , Jianguo Sun , Johan Hovold , Kees Cook , , Lu Baolu , Mark Rutland , Martin Blumenstingl , Mathias Nyman , Mathias Nyman , Mauro Carvalho Chehab , Rishabh Bhatnagar , Rob Herring , Roger Quadros Subject: Re: [PATCH V3 4/6] usb: ohci-platform: Add support for Broadcom STB SoC's In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Nov 2018, Al Cooper wrote: > On 11/7/18 10:23 AM, Alan Stern wrote: > > On Tue, 6 Nov 2018, Florian Fainelli wrote: > > > >> On 11/6/18 1:40 PM, Al Cooper wrote: > >>> On 11/6/18 11:08 AM, Alan Stern wrote: > >>>> On Mon, 5 Nov 2018, Al Cooper wrote: > >>>> > >>>>> Add support for Broadcom STB SoC's to the ohci platform driver. > >>>>> > >>>>> Signed-off-by: Al Cooper > >>>>> --- > >>>> > >>>>> @@ -177,6 +189,8 @@ static int ohci_platform_probe(struct > >>>>> platform_device *dev) > >>>>>           ohci->flags |= OHCI_QUIRK_FRAME_NO; > >>>>>       if (pdata->num_ports) > >>>>>           ohci->num_ports = pdata->num_ports; > >>>>> +    if (pdata->suspend_without_phy_exit) > >>>>> +        hcd->suspend_without_phy_exit = 1; > >>>> > >>>> Sorry if I missed this in the earlier discussions...  Is there any > >>>> possibility of adding a DT binding that could express this requirement, > >>>> instead of putting it in the platform data? > >>>> > >>>> Alan Stern > >>>> > >>> > >>> Alan, > >>> > >>> That was my original approach but internal review suggested that I use > >>> pdata instead. Below is my original patch for: > >> > >> And the reason for that suggestion was really because it was percevied > >> as encoding a driver behavior as a Device Tree property as opposed to > >> describing something that was inherently and strictly a hardware > >> behavior (therefore suitable for Device Tree). > > > > Right. The best way to approach this problem is to identify and > > characterize the hardware behavior which makes this override necessary. > > Then _that_ can be added to DT, since it will be a property of the > > hardware rather than of the driver. > > > >>> Add the ability to skip calling the PHY's exit routine on suspend > >>> and the PHY's init routine on resume. This is to handle a USB PHY > >>> that should have it's power_off function called on suspend but cannot > >>> have it's exit function called because on exit it will disable the > >>> PHY to the point where register accesses to the Host Controllers > >>> using the PHY will be disabled and the host drivers will crash. > > > > What's special about this PHY? Why does the exit function mess the PHY > > up? Or to put it another way, why doesn't the exit function mess up > > other PHYs in the same way? > > > > For that matter, can we change the code so that suspend doesn't call > > the exit function for _any_ PHY? Will just calling the power_off > > function be good enough? If not, then why not? > > > > Alan Stern > > > > In our USB hardware the USB PHY supplies a clock for the EHCI/OHCI and > XHCI host controllers and if the PHY is totally shut down the EHCI, OHCI > and XHCI registers will cause an exception if accessed and cause the > EHCI, OHCI and XHCI drivers to crash. There is always talk of fixing > this in the hardware by adding an aux clock that will takeover when the > PHY clock is shut down, but this hasn't happened yet. It seems like > "exit on suspend" still makes sense on systems that don't have this > problem (additional power savings?) so removing the exit on suspend for > all systems is not a good idea. Then in theory you should be able to add a Device Tree property which says that the PHY provides a clock for the USB host controller. That is strictly a property of the hardware; it has nothing to do with the driver. Therefore it is appropriate for DT. Wouldn't this solve your issue? Alan Stern