Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5916318ybl; Tue, 10 Dec 2019 13:42:15 -0800 (PST) X-Google-Smtp-Source: APXvYqxKbSRqwgQAlp8/NaNEFf965g0CVyc30477haBUtVlCXtG0LgOjmvwH8/Vjk1rgsrgdPSgB X-Received: by 2002:a05:6830:18d7:: with SMTP id v23mr26353469ote.213.1576014135859; Tue, 10 Dec 2019 13:42:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576014135; cv=none; d=google.com; s=arc-20160816; b=cGArAWyEK+Xub7SyfbvkxD08EyGjbhC+hAuRYywP1fvbfCiEEI+mPYIJoPYzo0fF/0 6oHzv7X43CoyUJWCmGLneqQ2XAk4ZgJT2Fb4z6DHUl57jDeJUDuE9ysDnu982QGMuIk3 6h/yT/iiwtXmqZ8r0wHaRbecdgzAjgXrVoKtKuzFaI8Tv02tZVukXdypflpULBJFpglm SKwWn6b7qvzPLk8XlHL7RjDdqjsqGwFnAa7Sk9bK5ITsJLeXsl9F6ntymykKkgxLMoQu xxM9D6T12VT1qZqEOODnOe5NaRXnE+34LXm31KUJq/8PWzpsrAwR4CreDgngP99LJvsm QK5w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XOm1L/1xLpetHptyO6AUE3GUSdxmOustnnDmdERXnEY=; b=OlwFTDXVDfFMTKVTrBjcWi8fKzZatwrRhUR2NlDqj41TeCWCxOLIN5f82FsCJSP7v7 9nGcFCkuaUiHmhCXs/cCWeBLlHc06GJAKLFDYd8isRUazevjvszDIprNo/RnW/p6tRzy QKfd/RmUPh8SAi6Ocnr56kR5IftIg8lFG4tqRUGpR26IrmaeriOEyAOwG/eqsqqFvTu3 hUmmv2z77xre+Jz2XHnZhC139j0Ie2crT2WDxe/wGtGqMrHspic1bKe0yG2gmPd83ye8 Mwz+2ocfLPNS+D6cnByPSQS+lUUvHEQfvF3z/xLz6jD+q8xz8DUz04X/cdqBsMet+5BL tATA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="et2Ys//I"; 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 f81si2589832oig.110.2019.12.10.13.42.04; Tue, 10 Dec 2019 13:42:15 -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=@kernel.org header.s=default header.b="et2Ys//I"; 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 S1730194AbfLJVlC (ORCPT + 99 others); Tue, 10 Dec 2019 16:41:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:39534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730027AbfLJVeZ (ORCPT ); Tue, 10 Dec 2019 16:34:25 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A09C22464; Tue, 10 Dec 2019 21:34:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576013665; bh=BaOJLlsaJCuwyylSLKMNeU454E8WKcHKVG/Ej1RBeow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=et2Ys//IG+GzwStFn7P/tad0zhDqBmKUZjpwfveO4NTs8Lzp/Cx0WCHbWY5ATWNF+ 5LrxVnJG4eli+LX4lkSRHp1M/NYptX0Fmu8qNtdnTousvlYkkpVM1MO5cOj5qPq9Nn SM3N1ZPGXi2tWtPt3untK0DW8yWCJpMW2Q6HVBYs= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Lucas Stach , Srinivas Kandagatla , Greg Kroah-Hartman , Sasha Levin , linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 4.19 102/177] nvmem: imx-ocotp: reset error status on probe Date: Tue, 10 Dec 2019 16:31:06 -0500 Message-Id: <20191210213221.11921-102-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191210213221.11921-1-sashal@kernel.org> References: <20191210213221.11921-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.20.1