Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp52621ybl; Tue, 7 Jan 2020 14:00:43 -0800 (PST) X-Google-Smtp-Source: APXvYqz4nj8EtKZQIKDGvGwMgyG81DPW+84wzzOLB21NXt3+ljrgf1myXKzFHateDy5Iab8nlhii X-Received: by 2002:a05:6830:18e3:: with SMTP id d3mr1868524otf.190.1578434443048; Tue, 07 Jan 2020 14:00:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578434443; cv=none; d=google.com; s=arc-20160816; b=vkQYsIwVX0h3nsgslNKRqd6Xwt9rU1+VMYOBzjXe49toEbnTYUChrbgG4pTjx5B0uW yTB/KcSaO1HNOPUcilmSwGyrUMlAoSvqVdVuDDYLk+WEkBjrzWCg5XKcYD0OERQKJSI+ 9NUohZzCTlurhseM0fi4kgaXTz/m/6wp3xOVq/yziLjGilsdd6p2IsapWpyPIumXDiFw J/EZfmMsPFyqhjb8rQYJ3s0hJcdV8QZKIeX5D532wN8Bv6rkIFB5wut8HaIW3WAGkBZp t6+EKpUkj6U0mPfKB1MSIHeGG9Y3biL/bJwJWTihuFmKiuVeJuCoVj7g+8/dyWfCaLzS yJBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=yutx2dlnBvm58zNmlkCTgUj8XTO4HUbwh0s78sEJVHQ=; b=jql/sNWMiJAlm7OnZXzqjTVYfz+Iqy6wSKAstlUg6S4viCpTSHYVeU802CpzuT782S JNbsoklbwyQyXznlfjvb2AfBrhJebqqVdp5RUP3ZZ3f5/o6Bz/men1Szbv/K7JKIu2ge WEvf3i3zBVu0598RKEammdcoFWn9TOdn2yn2WhnSktl+b3GLY2M2o2z0n4z9sHx3zR35 EFztKZPWgfYaZ2w8bS1ZzkEE4SIf++G/RAnVNbyrJbdyHD8uy8bhF8+3ntLfgABXcscX n2JOr2/T8snRSPL5W/iS5jUyvQKlOkr92ftK+pSElb49Eayo6bn4It5JB8iNo+7CiGFM Q7zA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q28si580094oij.149.2020.01.07.14.00.30; Tue, 07 Jan 2020 14:00:43 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727289AbgAGV6g convert rfc822-to-8bit (ORCPT + 99 others); Tue, 7 Jan 2020 16:58:36 -0500 Received: from 9.mo177.mail-out.ovh.net ([46.105.72.238]:55808 "EHLO 9.mo177.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726462AbgAGV6g (ORCPT ); Tue, 7 Jan 2020 16:58:36 -0500 X-Greylist: delayed 25226 seconds by postgrey-1.27 at vger.kernel.org; Tue, 07 Jan 2020 16:58:36 EST Received: from player718.ha.ovh.net (unknown [10.109.143.3]) by mo177.mail-out.ovh.net (Postfix) with ESMTP id 9438A11BEDE for ; Tue, 7 Jan 2020 20:29:22 +0100 (CET) Received: from armadeus.com (91-171-241-78.subs.proxad.net [91.171.241.78]) (Authenticated sender: sebastien.szymanski@armadeus.com) by player718.ha.ovh.net (Postfix) with ESMTPSA id 08099DDDD523; Tue, 7 Jan 2020 19:29:13 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: [PATCH AUTOSEL 4.19 102/177] nvmem: imx-ocotp: reset error status on probe From: =?utf-8?Q?S=C3=A9bastien_Szymanski?= In-Reply-To: <2dc7001f362358dfdcbef080118b23cabaa03a40.camel@pengutronix.de> Date: Tue, 7 Jan 2020 20:29:12 +0100 Cc: Sasha Levin , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Greg Kroah-Hartman , Srinivas Kandagatla , linux-arm-kernel@lists.infradead.org, Fabio Estevam Content-Transfer-Encoding: 8BIT Message-Id: References: <20191210213221.11921-1-sashal@kernel.org> <20191210213221.11921-102-sashal@kernel.org> <2dc7001f362358dfdcbef080118b23cabaa03a40.camel@pengutronix.de> To: Lucas Stach X-Mailer: Apple Mail (2.3608.40.2.2.4) X-Ovh-Tracer-Id: 15857737239658386631 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrvdehiedgtdekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurheptggguffhjgffgffkfhfvofesthhqmhdthhdtjeenucfhrhhomhepuforsggrshhtihgvnhgpufiihihmrghnshhkihcuoehsvggsrghsthhivghnrdhsiiihmhgrnhhskhhisegrrhhmrgguvghushdrtghomheqnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghdpphgrshhtvggsihhnrdgtohhmnecukfhppedtrddtrddtrddtpdeluddrudejuddrvdeguddrjeeknecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehplhgrhigvrhejudekrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshgvsggrshhtihgvnhdrshiihihmrghnshhkihesrghrmhgruggvuhhsrdgtohhmpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lucas, > On 7 Jan 2020, at 18:53, Lucas Stach wrote: > > Hi Sébastien, > > On Di, 2020-01-07 at 15:50 +0100, Sébastien Szymanski wrote: >> On 12/10/19 10:31 PM, Sasha Levin wrote: >>> From: Lucas Stach >>> >>> [ Upstream commit c33c585f1b3a99d53920bdac614aca461d8db06f ] >>> >>> If software running before the OCOTP driver is loaded left the >>> controller with the error status pending, the driver will never >>> be able to complete the read timing setup. Reset the error status >>> on probe to make sure the controller is in usable state. >>> >>> Signed-off-by: Lucas Stach >>> Signed-off-by: Srinivas Kandagatla >>> Link: https://lore.kernel.org/r/20191029114240.14905-6-srinivas.kandagatla@linaro.org >>> Signed-off-by: Greg Kroah-Hartman >>> Signed-off-by: Sasha Levin >>> --- >>> drivers/nvmem/imx-ocotp.c | 4 ++++ >>> 1 file changed, 4 insertions(+) >>> >>> diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c >>> index afb429a417fe0..926d9cc080cf4 100644 >>> --- a/drivers/nvmem/imx-ocotp.c >>> +++ b/drivers/nvmem/imx-ocotp.c >>> @@ -466,6 +466,10 @@ static int imx_ocotp_probe(struct platform_device *pdev) >>> if (IS_ERR(priv->clk)) >>> return PTR_ERR(priv->clk); >>> >>> + clk_prepare_enable(priv->clk); >>> + imx_ocotp_clr_err_if_set(priv->base); >>> + clk_disable_unprepare(priv->clk); >>> + >>> priv->params = of_device_get_match_data(&pdev->dev); >>> imx_ocotp_nvmem_config.size = 4 * priv->params->nregs; >>> imx_ocotp_nvmem_config.dev = dev; >>> >> >> Hi, >> >> This patch makes kernel 4.19.{92,93} hang at boot on my i.MX6ULL based >> board. It hanks at >> >> [ 3.730078] cpu cpu0: Linked as a consumer to regulator.2 >> [ 3.737760] cpu cpu0: Linked as a consumer to regulator.3 >> >> Full boot log is here: https://pastebin.com/TS8EFxkr >> >> The config is imx_v6_v7_defconfig. >> >> Reverting it makes the kernels boot again. > > Can you check if it actually hangs in imx_ocotp_clr_err_if_set(), or if > the clk_disable_unprepare() is the culprit? > > If the clock disable hangs the system there is a missing clock > reference somewhere else that we need to track down. Yes, the system hangs in the imx6q-cpufreq driver, here: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/cpufreq/imx6q-cpufreq.c?h=v4.19.93#n322 Kernel 5.4.8 works thanks to commits: 2733fb0d0699 (“cpufreq: imx6q: read OCOTP through nvmem for imx6ul/imx6ull”) 92f0eb08c66a ("ARM: dts: imx6ul: use nvmem-cells for cpu speed grading”) Regards, -- Sébastien Szymanski, Armadeus Systems Software engineer > > Regards, > Lucas >