Received: by 10.223.185.116 with SMTP id b49csp7417631wrg; Thu, 1 Mar 2018 05:20:16 -0800 (PST) X-Google-Smtp-Source: AG47ELsndLeS5BioTjbdIDln6ySLG89iqeNyf1E63770WlrznrtEz+p9t+B4mBMznM0QZQcUMSL9 X-Received: by 2002:a17:902:7c16:: with SMTP id x22-v6mr1916802pll.23.1519910416201; Thu, 01 Mar 2018 05:20:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519910416; cv=none; d=google.com; s=arc-20160816; b=HGOWvVjbL4Qvnabo55yM2jdXaZXiDiX4MGOT2AYLat8zVYxysSj6shvLfq/vSs2Tom 8M16pruAru/+RJKyTczxUs/CmFvurhdYANDtKN1Ha4ZGgdEZtXfaGv/8B1iPDDv0SZKu W5CHN88ePflZ0dqFoGrH/nAVjqZIdM9Wq9ENk0euf4JKen/9KpLjW3urSpjuxRAbQb95 O6lbrUUFCDIU58xCs06NZAtGC+kyGTKIhdk/+tg6CxW1E/Iixgw4o2EamaZtu1GAHmDi GjD+rrRPofwvh7cgNsz/ypkHCTe4Z5dFIIEhd3EZlZdXJ+UiAnICjuyHeY1ObOc4N9Cw Hzew== 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:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=VD+stVBglYsvdCc6uslQZ0svjQnpSohoUMft1FVSQqQ=; b=pRXN7w9fbLVwhRW/MqwCtQnAAOnJXtLws027dhysFC6J39DYvlhh1hNR466frsPmJV Hkevdsmh3PLvxrRPg4UnSYjVzW1vTOMBmami6xT6QlDpSW8RO8d2OSdRdpERiXpwEVLz aSrLChyI4QDLHAi/edlgcYGZpIROnhMCc9nQaE5HteuQUinW+QKmToMq4LkHOO+2yhLN 7vw0a2flpJIuFUkhm0u9SQ5Yo8iXs4Jal12elH0Hj1vu2gCzaTwHCQhBEHkABywq0Lyb +VecRlANAza7xTXEAcYsLASfKumK+yatWWFNw0xAqnvqJ9bMnC6nqoJO1REcTb2Yocmg F1aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uTAqX3ZT; 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 k8-v6si3021978pli.490.2018.03.01.05.20.01; Thu, 01 Mar 2018 05:20:16 -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=uTAqX3ZT; 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 S1030675AbeCANTT (ORCPT + 99 others); Thu, 1 Mar 2018 08:19:19 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:39989 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030496AbeCANTQ (ORCPT ); Thu, 1 Mar 2018 08:19:16 -0500 Received: by mail-pf0-f194.google.com with SMTP id x1so547083pfh.7; Thu, 01 Mar 2018 05:19:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=VD+stVBglYsvdCc6uslQZ0svjQnpSohoUMft1FVSQqQ=; b=uTAqX3ZT9d3Rk8+vWMEnj3r9U4a3E1Yi/4xa0J3sOfZx3GscqPrJNa3SWEc5hOO3Rx +Mzf6P4WDc86DW+bMiIeE3rbC3rf1/rolrOu4dwP+6pESeK8/NUF3pHRId1F9LBJJ4y+ 0VxT4yEwWCc5uuCCmoBXGQW2aIh3UIjuL6J/6vSH1CxOc6Lwy8/wv8laSuBmZ21k4EFT dgMcUACk5eSKZXsoudNLQsvtp+1g2mtNFdT6EOe4HzWTyc8Np6lNhBPMeDh3F71g7ji/ G2aYmvagz1rZh3VXl/NDm+htHJHOV5f1rRoGP1P4BGEYGyFLixx9ShiBSXraWsskLaT8 axgw== 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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VD+stVBglYsvdCc6uslQZ0svjQnpSohoUMft1FVSQqQ=; b=E60ts9uAPHmgcKXIKYar/9ZOb+EfNmRMWUWayLCeLXgvcWCZj0dek1jX0y2xHLSCdS U43Zsn4E37W1oMgko8TKxfF48DNtndeC4dGXaKSioFsNvElOIo56pxWydqdQpgFvTCHt sI/fzt7tPgSNasagBX4LBi4uBkvo1JgNJ1FsCsZ0Zxtvr/zKycN6OkZqMF5b43NQ06+e gQ3Z0Kqy2GlDgo0lEIPh7VrEEd2uvuwPAbOSz5zd1bv5xo/F5AKOLcVxMoFeanojlz7F h3bsbibh2fFi3/dkoaKn2sTvltdSpd2vE8X4nnA654jAp/RCzS+AQ0P/0JkwIVSY4iMI oG/Q== X-Gm-Message-State: APf1xPCwnPXlLXjZN9/crNtrt1OWB7r23X2irlxrUTCDOKQq/j3AswvT ewbmZDIzsW4sIBMioJxMGt12aqSN X-Received: by 10.98.248.7 with SMTP id d7mr1934192pfh.117.1519910355620; Thu, 01 Mar 2018 05:19:15 -0800 (PST) Received: from [192.168.1.145] (ppp109-252-55-234.pppoe.spdop.ru. [109.252.55.234]) by smtp.googlemail.com with ESMTPSA id s86sm4017146pfi.4.2018.03.01.05.19.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 05:19:14 -0800 (PST) Subject: Re: [PATCH] clk: tegra: fix pllu rate configuration To: Peter De Schrijver Cc: Marcel Ziswiler , "linux-tegra@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "jonathanh@nvidia.com" , "mturquette@baylibre.com" , "pgaikwad@nvidia.com" , "sboyd@kernel.org" , "thierry.reding@gmail.com" , "linux-clk@vger.kernel.org" References: <20180222230451.15515-1-marcel@ziswiler.com> <31f039e8-9afc-22d1-d478-a7f41db0dace@gmail.com> <1519686262.6374.3.camel@toradex.com> <20180228093620.GC6190@tbergstrom-lnx.Nvidia.com> <20180228141448.GD6190@tbergstrom-lnx.Nvidia.com> <7d8d77ca-e18d-6e37-1aca-6dd7c6e1964d@gmail.com> <20180301074129.GG6190@tbergstrom-lnx.Nvidia.com> From: Dmitry Osipenko Message-ID: <028b0ba5-33b9-d12e-77ba-aebbfa91a5fb@gmail.com> Date: Thu, 1 Mar 2018 16:19:03 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180301074129.GG6190@tbergstrom-lnx.Nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01.03.2018 10:41, Peter De Schrijver wrote: > On Wed, Feb 28, 2018 at 08:20:47PM +0300, Dmitry Osipenko wrote: >> On 28.02.2018 17:14, Peter De Schrijver wrote: >>> On Wed, Feb 28, 2018 at 03:00:23PM +0300, Dmitry Osipenko wrote: >>>> On 28.02.2018 12:36, Peter De Schrijver wrote: >>>>> On Tue, Feb 27, 2018 at 02:59:11PM +0300, Dmitry Osipenko wrote: >>>>>> On 27.02.2018 02:04, Marcel Ziswiler wrote: >>>>>>> On Mon, 2018-02-26 at 15:42 +0300, Dmitry Osipenko wrote: >>>>>>>> On 23.02.2018 02:04, Marcel Ziswiler wrote: >>>>>>>>> Turns out latest upstream U-Boot does not configure/enable pllu >>>>>>>>> which >>>>>>>>> leaves it at some default rate of 500 kHz: >>>>>>>>> >>>>>>>>> root@apalis-t30:~# cat /sys/kernel/debug/clk/clk_summary | grep >>>>>>>>> pll_u >>>>>>>>> pll_u 3 3 0 500000 >>>>>>>>> 0 >>>>>>>>> >>>>>>>>> Of course this won't quite work leading to the following messages: >>>>>>>>> >>>>>>>>> [ 6.559593] usb 2-1: new full-speed USB device number 2 using >>>>>>>>> tegra- >>>>>>>>> ehci >>>>>>>>> [ 11.759173] usb 2-1: device descriptor read/64, error -110 >>>>>>>>> [ 27.119453] usb 2-1: device descriptor read/64, error -110 >>>>>>>>> [ 27.389217] usb 2-1: new full-speed USB device number 3 using >>>>>>>>> tegra- >>>>>>>>> ehci >>>>>>>>> [ 32.559454] usb 2-1: device descriptor read/64, error -110 >>>>>>>>> [ 47.929777] usb 2-1: device descriptor read/64, error -110 >>>>>>>>> [ 48.049658] usb usb2-port1: attempt power cycle >>>>>>>>> [ 48.759475] usb 2-1: new full-speed USB device number 4 using >>>>>>>>> tegra- >>>>>>>>> ehci >>>>>>>>> [ 59.349457] usb 2-1: device not accepting address 4, error -110 >>>>>>>>> [ 59.509449] usb 2-1: new full-speed USB device number 5 using >>>>>>>>> tegra- >>>>>>>>> ehci >>>>>>>>> [ 70.069457] usb 2-1: device not accepting address 5, error -110 >>>>>>>>> [ 70.079721] usb usb2-port1: unable to enumerate USB device >>>>>>>>> >>>>>>>>> Fix this by actually allowing the rate also being set from within >>>>>>>>> the Linux kernel. >>>>> >>>>> I think the best solution to this problem would be to make pll_u a fixed >>>>> clock and enable it and program the rate if it's not enabled at boot. >>>> >>>> Oh, right. PLL_U rate is actually configurable, somehow I missed it in TRM >>>> yesterday.. So set/round_rate() for PLL_U are actually needed and the patch is >>>> correct. Seems only T20 misses PLL_U in the init table, probably worth to add it >>>> there. >>>> >>> >>> AFAIK we only use one rate ever? >> >> IIUC, PLL_U has 3 outputs and output dividers are fixed in HW. So yes, we are >> setting PLL_U to one rate - 480MHz to get out1-480MHz, out2-60MHz and out3-12MHz. >> > > Indeed. And given that it's hw controlled anyway, I don't see why we can't make > it a fixed clock and handle the init at kernel boot depending on what the > bootloader has done. We can, I just don't think you can demand from Mark to do it. This patch is fine on its own, everything else could be done later. On the other hand, it's USB driver responsibility to do the right thing. Why just not to correct the driver? It would be kinda weird to mask one driver bug by adding workaround to another. So I'd even suggest to go other way round by implementing PLL lock polling and removing PLL_U enabling/disabling from the USB PHY driver (if it's really fully-controlled by HW).