Received: by 10.223.185.116 with SMTP id b49csp6094816wrg; Wed, 28 Feb 2018 04:01:36 -0800 (PST) X-Google-Smtp-Source: AG47ELuN+3DOr20bzwPsqZctEnQTdnFkpdLp42o4HKs68O1/vGHaUgTyedDkhRMYJyTm09UmYlla X-Received: by 2002:a17:902:5327:: with SMTP id b36-v6mr4812107pli.332.1519819296317; Wed, 28 Feb 2018 04:01:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519819296; cv=none; d=google.com; s=arc-20160816; b=VH8cu7g9t5C5beUItE1WIoKJ/KcThNUmbk+t3Eoe4VsDEfSZhw0PQaGS0PMGDu/e3X /B9uetLEm7ouEfx4j+zwh/wKVavyGI0n/jbJ/eqjacGdrlFVY6kkPKVsezRT7Z2MPybZ ayBRHaAXkpNLJTC6+ErSJOSzuZqabpxNZIBo1JlH4cvB7URUUEICOrkSvRX9+csCvkS/ nopRvjv7ltP0/zU88EUJrXkxK1iBLq1oun/OdFqMvRsmiyBlvdT2c1gHIL6Ll4ZNn9an fmQP0mYr3+w5aVoBmPxC2SHSj9gRb475znqQ9hGhR4iIB4pzG2COJvFAiekXka3Xui6g hC/A== 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=scwmQgXHsAiVsMs4ag6wl93RM12Xhod53MnjUcidPIg=; b=b4BqmvI43lRgL27LBWPq/KBCG3rsnHw9TvdBaTuRxljsJgg7CAWXdCLK3eoWSlKa2V 56FLhahnKVnva2uPwAo1oFbTTjtvAxzM7kn7zJVQ3RWaj4upmXXXVhl/4fmr/+VcsiBJ 3XhWOQKUCJ7WCCTQxGNu/2AcLHvU0W/7vh3z//WY8N57ZSBnbmXqIleDSeqNSnDrhMU4 QCA+Dp9TwQT82w1p39eZ+CXM8A06keWNAuW2SlF58QaAxswT9qhA/JvCWaeTuNTH+3eu 4GAUymPuWbfjuPuhJ9YIIMDh4hoGFjpJgTqATHSPf4EPTwzei5XXd6zrIAVAQSg9PZzw G15Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kvtXeJSI; 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 59-v6si1189879pla.203.2018.02.28.04.01.18; Wed, 28 Feb 2018 04:01:36 -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=kvtXeJSI; 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 S1752478AbeB1MAc (ORCPT + 99 others); Wed, 28 Feb 2018 07:00:32 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:41171 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752390AbeB1MA2 (ORCPT ); Wed, 28 Feb 2018 07:00:28 -0500 Received: by mail-lf0-f68.google.com with SMTP id m69so3106074lfe.8; Wed, 28 Feb 2018 04:00:27 -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=scwmQgXHsAiVsMs4ag6wl93RM12Xhod53MnjUcidPIg=; b=kvtXeJSIkA6sp7k5/dktDsu+1PNawiLZKyUIEVtkBbj8vgD50m78L1WR9ZDOKOKiHW L2hmkhLYxGaJpkR4DwIPnQ2VcfYz8JEtolQOOzyMLwkPA1hb6hJOR2HXn6ctA9QD9GXf 4aSWpAPfud6CPV/zqm5nkFMFqej+MeMXPScM0ZG6nrX6zAGXwdEXi6D34h9msXmXHXZL g70Hr3I9lwwSqOF+o7iC96Tgk6JSq5T3CEnJ/YMl6KlfEoDnOuIoMFqE5ljN3Hoo4CeX O+UMBuZ197ngHCOIgwyOUAJAVxciSrxxjY9OgvckNrdSNQ4Pu4RQ3aF6XNxlDM1EMb9K 3FRA== 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=scwmQgXHsAiVsMs4ag6wl93RM12Xhod53MnjUcidPIg=; b=PvopglqPuu1AwdVOsgCH1xpsMxLK1XPvY9nFQLpp70zBxTAa03YF/hcdOgSDUQQwhm 0gn8p7iAn7ZKRrnNhdb6Xptrhr68bmCAm2RTCJmUxvGIaYxi8KfYaXAGLYmmU0Zbq+j6 Tib51JAIg2JrEQkfnH2KOD2MNDe4KVnw6jUxvfnpCFNm0ELXgCDNci4F/Y4YEEYhFqZR v7kRb3wwfcyMtc7kSP+8DBYs6t6gvIOh6pdJtUBj+vpSxsnkYkw/aE7diyXbr31y8cCR 9v2LsX3dh9II1thFIjDpap/1mHG9eRu3SZzTQyV+JK4c6DAaK7BeCP9mVNV2msnQHPhS Bnyw== X-Gm-Message-State: APf1xPDchhJGnVhQYrYPTNDWWA6jSzvX2VYoL+cV/3JuWZ6jmC4pYZA8 UCR1GoSWkqzYdMlldVNKKaikpVs5 X-Received: by 10.46.21.21 with SMTP id s21mr6976625ljd.58.1519819226081; Wed, 28 Feb 2018 04:00:26 -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 77sm324155ljz.67.2018.02.28.04.00.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Feb 2018 04:00:25 -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> From: Dmitry Osipenko Message-ID: Date: Wed, 28 Feb 2018 15:00:23 +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: <20180228093620.GC6190@tbergstrom-lnx.Nvidia.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 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. > This is how it's done for Tegra210. The reason is that the USB IP blocks > can control the pll_u state in hw. This means that if sw would disable > and then re-enable the pll_u clock, but there is no USB activity, pll_u > will still be disable and therefor not lock, causing an error. Today > this is worked around by not polling the lock bit for pll_u, but a better > solution would be to just remove all sw controls for pll_u. SW controls could be removed, but I don't think it is really necessary as in our case SW is the PHY driver and we know what it does. Alternatively we can enable PLL_U in the init table to keep it "always" enabled.