Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1598575imm; Tue, 15 May 2018 23:42:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpUDSAP1UYZvBsKKRaDmJ0DtgKncqKeL5tDne7sAoyxhwuwRVEJYDlham2H2QwsAnrSF6hc X-Received: by 2002:a17:902:7c0e:: with SMTP id x14-v6mr15080734pll.389.1526452933209; Tue, 15 May 2018 23:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526452933; cv=none; d=google.com; s=arc-20160816; b=duZfyBlTdlKA8Kp7WBL8C3rkWtIU+DrM6i6mXpUAuBQXDARLOEsPkWRNl3ekKEKXiq PJoO/WLy7NM2ReJE77r5gPFeAH4XrdUH+2NmxJtxFhf2le3Y5VwgD+TLiBXZpvYzbIIs YIN+voIeAELImQw5ANvuLUbApclW3NTQcm/IVhVqceXsDyHqpc19blleb1/cOc5EUflq gdDKct2YlhQnc7COpdOT5FrRuONXyHOAHL76rm190Kl75mAKFKKfxu3aysNVhnYcqQy2 VndAbJT+AGuKaYYHOb9Vf7xPs3ACNuEX+ktRPTXgbVRdEnZL+rNU/Je+vrP1RWzHkliY gaaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=KRxQlj4QEKgcI4Agb76VR+UKoU9wZbR2ki3Ox0M1zK4=; b=IYydknKbkLOvk+vbind22AhygpQxthBo62EyW4z5liM4RY6Xaz4KJ3hH7zcVutJw2g D3hfDTLh7j9gqwqnSHajB/Kjb5bo7XEE/iDsEdz1Bnd0xGNK8I3RbsVl/H3XwxAdPg8P JYRyuHk/StjtNZGqfZj07KMdvijPiNIhNG7ns5XaDSDTDKEU+sEuLnGiov63SxKJjfNV YMYdCODKnfQOgvzLH2LjmwVqnwqkCp6Pe0RJ2sMDTW4xC7dUMm5vuZBiJn6D9Uis18Hq b79QiRUewh4yQSnX06bXjrX6cAOUgNuffYNDv6lv+War+Mwp81ZBuzgFFZPWpzQvX+um /bLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NGL3PJBi; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12-v6si1888798plr.42.2018.05.15.23.41.59; Tue, 15 May 2018 23:42:13 -0700 (PDT) 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=@kernel.org header.s=default header.b=NGL3PJBi; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752490AbeEPGju (ORCPT + 99 others); Wed, 16 May 2018 02:39:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:39980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752433AbeEPGjt (ORCPT ); Wed, 16 May 2018 02:39:49 -0400 Received: from localhost (unknown [104.132.1.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B4BC120677; Wed, 16 May 2018 06:39:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526452788; bh=KRxQlj4QEKgcI4Agb76VR+UKoU9wZbR2ki3Ox0M1zK4=; h=To:From:In-Reply-To:Cc:References:Subject:Date:From; b=NGL3PJBiSULBdCayGhqHfQX6fsCHiIkrnTLkv3fePi6YyXDXykhE50IbMsreMPk8O Iao8FIIgurojFPGSEGv/U37LXKPa7d5m9vw6uvfWjQFOzhkiQfrK7YdgxozokzTaZZ O+17VDjTTSLZHerUkuinwOV7xBngmbl/UyVD4SjQ= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Alexandre Belloni , Boris Brezillon , Greg Kroah-Hartman , Marcin Ziemianowicz , Nicolas Ferre From: Stephen Boyd In-Reply-To: <20180429190111.14247-1-marcin@ziemianowicz.com> Cc: Marcin Ziemianowicz , stable@vger.kernel.org, Boris Brezillon , Michael Turquette , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20180429190111.14247-1-marcin@ziemianowicz.com> Message-ID: <152645278298.237094.13637070780064221668@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH V4] clk: at91: PLL recalc_rate() now using cached MUL and DIV values Date: Tue, 15 May 2018 23:39:42 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Marcin Ziemianowicz (2018-04-29 12:01:11) > When a USB device is connected to the USB host port on the SAM9N12 then > you get "-62" error which seems to indicate USB replies from the device > are timing out. Based on a logic sniffer, I saw the USB bus was running > at half speed. > = > The PLL code uses cached MUL and DIV values which get set in set_rate() > and applied in prepare(), but the recalc_rate() function instead > queries the hardware instead of using these cached values. Therefore, > if recalc_rate() is called between a set_rate() and prepare(), the > wrong frequency is calculated and later the USB clock divider for the > SAM9N12 SOC will be configured for an incorrect clock. > = > In my case, the PLL hardware was set to 96 Mhz before the OHCI > driver loads, and therefore the usb clock divider was being set > to /2 even though the OHCI driver set the PLL to 48 Mhz. > = > As an alternative explanation, I noticed this was fixed in the past by > 87e2ed338f1b ("clk: at91: fix recalc_rate implementation of PLL > driver") but the bug was later re-introduced by 1bdf02326b71 ("clk: > at91: make use of syscon/regmap internally"). > = > Fixes: 1bdf02326b71 ("clk: at91: make use of syscon/regmap internally) > Cc: > Signed-off-by: Marcin Ziemianowicz > --- Applied to clk-next