Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3431293imu; Wed, 7 Nov 2018 10:12:56 -0800 (PST) X-Google-Smtp-Source: AJdET5eRwpOZObP9oypTuodDiw+6MPhp6GzgQt+o9pM06pcLV6NlBooGagEB0WVpPfqKHh5gvO0Q X-Received: by 2002:a63:6704:: with SMTP id b4mr1068750pgc.100.1541614375932; Wed, 07 Nov 2018 10:12:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541614375; cv=none; d=google.com; s=arc-20160816; b=LPs/ljKFN6qk/n2oTzAyPU3vAF4sbEwsoViCu0cW/E7LZulnFN1PG2Xcw2pLyGMjrg sgm8NAWjcVenVwVms0VSgwfR4HeF5lvo5eLQjurJTEPoxzjqCFGDlZSr5kKy4HuVZkdt JaBRi0zQK16wqFGnDHIlUtDjMOdnaQfgu4putfVPUfVUxlwgVoqGVoAp2l84xsdp+Fr9 IY/+X+hIgS8xtw7hiAPG139rivLsFTcDSFojYAgsUEi/KuDQM/cMq6JwbOsEdhjzk+cy KFDSRA30NAjDtFHAR0cEEyi775z5G5bcLCZ4XX8jQ+aATbdfXeY+l1UQQWrasucraHeo Pzgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=IBFBpjyx0j7uTb6KabNXrBmQ9ObkCpM5/6Twyw63m+Q=; b=Nfb43WB1XTd5uDqT2fLwHCH9vooGSvdBL5x4nrzVwtgXuAoMcHTORa3Ekqh+kBgmcG QPjcFkLHJYTyumGfT1hNcWe/Q24okMycBYpiQamf9GeeDKQwFYAfOryCGqduQKuBJuL7 W6B9cdHkkM0xjHerGiNVghb7FsSwMTrG1ikZpPMNJf2BAneHjWau0XqNb+cKIHT2Cntq KyIb+yc6bZstl7IyFkz22wM1gKy114n2TUkyUPEqRlXWEQ5aEODh1c0oU/jK5fFpkkWO zfNpXZ9ctgCa0ZMEwAKIv+/bnkRZiNo/uSkUz90uWlIWON82RXUiLlJ1gbrY4y0BOeRC Hk6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=szWZz43R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5-v6si1347913pfg.52.2018.11.07.10.12.40; Wed, 07 Nov 2018 10:12:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=szWZz43R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727715AbeKHDno (ORCPT + 99 others); Wed, 7 Nov 2018 22:43:44 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40550 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726356AbeKHDnn (ORCPT ); Wed, 7 Nov 2018 22:43:43 -0500 Received: by mail-pg1-f196.google.com with SMTP id z10so5769984pgp.7; Wed, 07 Nov 2018 10:12:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IBFBpjyx0j7uTb6KabNXrBmQ9ObkCpM5/6Twyw63m+Q=; b=szWZz43RBbIhg+kgH+sM98ohNnB3hdD9RBk8cZtu7ZJLSTiEi1boaWB7nG9ZjFYLhB TiaJOHilJigAznA/eP7vIlO0kS3cglH+PMPpZV2JNqx30hs9F44qyaZejwDS7kd8RX0K cm6AKwF9KIw6QTPOyhiGMp4BUiacdGdW5rHfeMENE0C3Wf/yS6+JeWUK5OdFYhfSYIVy CC0DTgjx+DV25Vtay6/AMbKlKYesIt8ZEa20i+fgh8HdMsYTIfzoN8Yx7TPDzWX9UCdu CSchXFM0/w3zmjtdSg8hxBwlB8ZLjTlc9VUkNkgdG7y3XNAEYgfoDfmmhrFJT6OBrCjM NUHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=IBFBpjyx0j7uTb6KabNXrBmQ9ObkCpM5/6Twyw63m+Q=; b=fbpGQVX7YIolg0qzIrG2oC/vTBuCOGMZPFwR17ELbWEM7z8DwV4v3Hi5lC/ZJcCdgz lxoT1M2/tqIurAR/+gO06unuqFlR+OpdBaI/WuXd+jDY9kvy3V7xHw2HBQEKhsr6rI97 gL0Y++r4Fnzsj87xdJLKsRpfa7DQI8xBCkK2mMlVVWD0VErJNSwkglzXsXwBiiARY/ZI iFtTqXDTbnRWZS8YPoxRZlhSnwaNpW+wbnHe07JG6/soEJeLz2BPOpeK6wPCzXzD4yj5 tDxfSGToAayg43Wt37VKuTXMeqTEHUiA5YDk7goU3IgYnTXa51CKP4O5tyuoM6dqL14K zMXQ== X-Gm-Message-State: AGRZ1gI7i+7lL4ejkcBe6O8tsItlnSXHfr9S9qaXmn5NV8XoqPT1ixuC ht8VM3uRgTQnCDDtqQ7k0Js= X-Received: by 2002:a63:224f:: with SMTP id t15mr1028020pgm.69.1541614329760; Wed, 07 Nov 2018 10:12:09 -0800 (PST) Received: from [10.69.78.41] ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id b14-v6sm1325762pgn.49.2018.11.07.10.12.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 10:12:08 -0800 (PST) Subject: Re: [PATCH V3 4/6] usb: ohci-platform: Add support for Broadcom STB SoC's To: Al Cooper , Florian Fainelli , Alan Stern Cc: Al Cooper , linux-kernel@vger.kernel.org, Alban Bedel , Alex Elder , Andrew Morton , Arnd Bergmann , Avi Fishman , bcm-kernel-feedback-list@broadcom.com, Bjorn Andersson , Chunfeng Yun , "David S. Miller" , devicetree@vger.kernel.org, Dmitry Osipenko , Greg Kroah-Hartman , "Gustavo A. R. Silva" , Hans de Goede , James Hogan , Jianguo Sun , Johan Hovold , Kees Cook , linux-usb@vger.kernel.org, Lu Baolu , Mark Rutland , Martin Blumenstingl , Mathias Nyman , Mathias Nyman , Mauro Carvalho Chehab , Rishabh Bhatnagar , Rob Herring , Roger Quadros References: <16a80878-58f7-1584-058e-0e0e49da61cb@gmail.com> <45134862-4b72-be72-533c-942c2bf70400@broadcom.com> From: Florian Fainelli Openpgp: preference=signencrypt Autocrypt: addr=f.fainelli@gmail.com; keydata= xsBNBFPAG8ABCAC3EO02urEwipgbUNJ1r6oI2Vr/+uE389lSEShN2PmL3MVnzhViSAtrYxeT M0Txqn1tOWoIc4QUl6Ggqf5KP6FoRkCrgMMTnUAINsINYXK+3OLe7HjP10h2jDRX4Ajs4Ghs JrZOBru6rH0YrgAhr6O5gG7NE1jhly+EsOa2MpwOiXO4DE/YKZGuVe6Bh87WqmILs9KvnNrQ PcycQnYKTVpqE95d4M824M5cuRB6D1GrYovCsjA9uxo22kPdOoQRAu5gBBn3AdtALFyQj9DQ KQuc39/i/Kt6XLZ/RsBc6qLs+p+JnEuPJngTSfWvzGjpx0nkwCMi4yBb+xk7Hki4kEslABEB AAHNKEZsb3JpYW4gRmFpbmVsbGkgPGZhaW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IAJaTef6hsUAESnlGDpC+ymL2RZdzAJx9lXjU4hhaFcyhznuyyMJq d3mehmLxsqDRvHDiqyD71w2Bnc838MVZw0pwBPdnb/h9Ocmp0lL/9hwSGWvy4az5lYVyoA9u 14UIzh0YNGu6jr0isd/LJAbHXqwJwWWs3y8PTrpEp68V6lv+aXt5gR03lJEAvIR1Awp4JJ/e Z5y12gQISp0X8xal9YhhDWER92YLYrO2b6Hc2S31lAupzfCw8lmZsP1PRz1GmF/KmDD9J9N/ b8IehhWQqrBQjMjn2K2XkvN75HnAMHKFYfHZR3ZHtK52ZP1crV7THtbtrnPXVDq+vO4QPmdC +SEACgkQgTG1xCm8ZqC6BwgAl3kRh7oozpjpG8jpO8en5CBtTl3G+OpKJK9qbQyzdCsuJ0K1 qe1wZPZbP/Y+VtmqSgnExBzjStt9drjFBK8liPQZalp2sMlS9S7csSy6cMLF1auZubAZEqpm tpXagbtgR12YOo57Reb83F5KhtwwiWdoTpXRTx/nM0cHtjjrImONhP8OzVMmjem/B68NY++/ qt0F5XTsP2zjd+tRLrFh3W4XEcLt1lhYmNmbJR/l6+vVbWAKDAtcbQ8SL2feqbPWV6VDyVKh ya/EEq0xtf84qEB+4/+IjCdOzDD3kDZJo+JBkDnU3LBXw4WCw3QhOXY+VnhOn2EcREN7qdAK w0j9Sw== Message-ID: Date: Wed, 7 Nov 2018 10:11:59 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <45134862-4b72-be72-533c-942c2bf70400@broadcom.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/7/2018 9:40 AM, Al Cooper wrote: > On 11/7/18 12:29 PM, Florian Fainelli wrote: >> On 11/7/18 8:27 AM, Alan Stern wrote: >>> 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. >> >> The very compatible string that is being allocated/defined for this >> controller carries that information already, that is, if you probe a >> "brcm,bcm7445-ohci" compatible then that means the controller has a >> dependency on the PHY to supply its clock. >> >> Adding a property vs. keying on the compatible string makes sense if you >> know there is at least a second consumer of that property (unless we >> make it a broadcom specific property, in which case, it really is >> redundant with the compatible string). >> >> Anyway, my grudge with that property was the name chosen initially, >> which included an action to be performed by an implementation as opposed >> to something purely descriptive. E.g: 'phy-supplies-clock' might be okay. >> >>> >>> Wouldn't this solve your issue? >> >> It would not change much except that there is no need to much with >> ohci-platform.c anymore, but ultimately that property needs to be read >> by ohci-hcd.c and acted on, which would likely lead to the same amount >> of changes as those present in patch #2 currently. >> > We also need this functionality in the EHCI and XHCI drivers and it's > not the ohci-hcd.c module that needs to know, it's the core/phy.c module > called from core/hcd.c. So in that regard the Device Tree property would actually scale a bit better in that you would no longer need to modify the various *hci-plat*.c files, if that is the way to go, then sure. -- Florian