Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp506781ybl; Tue, 7 Jan 2020 09:55:34 -0800 (PST) X-Google-Smtp-Source: APXvYqyrS1BMflrPFcamkFJv1OZxlueBBKjpsOeY5N2J1tlvBp41nQy1w4gHQ0pZpl9MdnWbQ4tq X-Received: by 2002:a9d:754a:: with SMTP id b10mr976482otl.273.1578419734623; Tue, 07 Jan 2020 09:55:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578419734; cv=none; d=google.com; s=arc-20160816; b=uZEkVhEAFKTxFFOAPD/V5V2Fu2nWJIUwJwp3Ixj+H/14mn5lkFllOIMHTukgvt3Qk9 O3jPldECwUDlz750F8NGXiBYiX3MOQM1cm14cxyQrgOWBt1A5IcYoY6L4HvpgDcSz9xq urrmxZ+lkeH2iR8K/y8Ye/zkRw7DNONLzOzmWrcRgqpACq5kgQW+nJFUbLslw8q6OdBX 8nfCzyaMLh1gbe3U+SdXgY6uN7VLULHUXJT4Py1fpoeRW402NNlxodv5eGtFbqOAaTqH gY1lDEghApD9ZGpQmF8MizbjXLmXTH6G1KJOVBwciKCw9lxjLgoAkKOhOKV03aXpAswX Ayqg== 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:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=WpAUI7VOgEcjxp3yfsQQkJnh772a4hqbN4V2DZIRNkQ=; b=dN5rjXk0XEvOHwwU76uSy6Nl9IRb5FbaxyKqWN0pTwIipdG6wk8Ok16oOwEBdwwcBE T+keVeEmRt6LDh0omTZHHTo7fmiWx3FHAe045715nYzx23rVcEj4iLU3GANVvJh9nn7e ln8hABQwxmSZyLMoD5BFBmKfgPbb8tgQP+hRpEzxOFgXUJ3ZeYLifCYg2ldeZZDNVVsW 6FirTm/ZzlugNhwUFolQ0Jj++RprILTDJApOuNI8q/UC2YpzIEYfb2Zh4CwI+vVkJdbr NL5l3uE51vgZmgkf5ikjEkHAYKmt0obkudabJ3RKDohAMLxgtqCiIwzeQtTKt6ztONqF Xa8Q== 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 d6si249867otq.41.2020.01.07.09.55.21; Tue, 07 Jan 2020 09:55:34 -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 S1728494AbgAGRxh (ORCPT + 99 others); Tue, 7 Jan 2020 12:53:37 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:58511 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728266AbgAGRxg (ORCPT ); Tue, 7 Jan 2020 12:53:36 -0500 Received: from kresse.hi.pengutronix.de ([2001:67c:670:100:1d::2a]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1iot2q-0000OS-Nf; Tue, 07 Jan 2020 18:53:32 +0100 Message-ID: <2dc7001f362358dfdcbef080118b23cabaa03a40.camel@pengutronix.de> Subject: Re: [PATCH AUTOSEL 4.19 102/177] nvmem: imx-ocotp: reset error status on probe From: Lucas Stach To: =?ISO-8859-1?Q?S=E9bastien?= Szymanski , Sasha Levin , linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Srinivas Kandagatla , linux-arm-kernel@lists.infradead.org, Fabio Estevam Date: Tue, 07 Jan 2020 18:53:32 +0100 In-Reply-To: References: <20191210213221.11921-1-sashal@kernel.org> <20191210213221.11921-102-sashal@kernel.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::2a X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Regards, Lucas