From patchwork Tue Oct 29 11:42:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 178014 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp4746311ill; Tue, 29 Oct 2019 04:43:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMJKk6bI6fzEqui9j2rFCvuCXWMcIm1qx8G2ZDVYwntD9uhmks+DYHj4BH+oNds70M5Wv3 X-Received: by 2002:a17:906:298f:: with SMTP id x15mr2794788eje.50.1572349426055; Tue, 29 Oct 2019 04:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572349426; cv=none; d=google.com; s=arc-20160816; b=B88NQ8PMrjD8GCFdUBx4ZhKt2jMp9R9v9YSu5mBi3aT6475wtHSWMW3FkvG/pjxqA5 KOP29CM6IZSE1WuOI4I3QHQGBgB2j0tYG8kA19aVZHKoGuZQCJ1bQgaTbqJHTgmrkUAE lHExYlAXuOPgwiVLunKf0aIBXbh38fmd6igbu6ExfBaVE5LInQrXudwQJ8hBfLzSD4Al giGNOJolkp/rOI5Bml6xgfmFam2VZoLm37gQHviS0QU2GtSBs+Nyy4Pd0eifStonPjiB pVCwKGkSL/DyqfdG4aW7foxknjt1bNdo+FXme8KiGEAV82eTolWhljuCRunrXkpIeI6F MIww== 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=QzRJPD/1HGldywpr2/SZcm47DrBumEiDLx/FHjXP3jg=; b=f5WShjVotQ0ZINFqWVd3q0B/RRReq7vuvKWO0gOs4I9idG6MxuXYnWMqPabYHRRWMv D43JCCHTCubxhNPdKGBeIIYX5mtXoHHsIyZ2gwNFw3zyEuHug1TSgkZz6xa1Jizx+CqQ LS1P6dsGtdYUf4lvncAIoltM5OQ0U983dYsK7fXxiGHbFs7ugjG1VtRexHSIzbSB9mn9 Am7bkzyR21/oVACv6nUHxodN5VXRV3TzU6eV2l7n1WbUyHdCLY1Eayh2WsP/7KSNY1PA +OmkmfCGZxNiS89SXaXWHUiurYj43L8akxwaoGD0Fge7m8ZFFo7wl/byZSOfPioz+V0/ 7J6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nVPcvWXa; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m33si3723131edc.126.2019.10.29.04.43.45; Tue, 29 Oct 2019 04:43:46 -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=@linaro.org header.s=google header.b=nVPcvWXa; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733145AbfJ2Lnm (ORCPT + 26 others); Tue, 29 Oct 2019 07:43:42 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:43149 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732186AbfJ2Lnj (ORCPT ); Tue, 29 Oct 2019 07:43:39 -0400 Received: by mail-wr1-f67.google.com with SMTP id n1so5814875wra.10 for ; Tue, 29 Oct 2019 04:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QzRJPD/1HGldywpr2/SZcm47DrBumEiDLx/FHjXP3jg=; b=nVPcvWXaGDmiEurjXX9F2sU/zrnuaMQomuye3kEdvlC0gsQRugtHZLRRgPbONylqq7 KrHB1hsyc0qAcRXuq1sphNGEhfrQFbZd6IQiejeChPrvUlTXRpIjThoKbZ698vvhOcDL h5+WcaLbrhdzw/yUdORO2K9nEGR1OWak8GzgwVK+SErUEeZ6cR23g0nUCJu632gc+AfB 9iAjsiKGaMxn5Zt7WO9aXTaNFZXo2oxvRiZu5ys5Hd/VlcbWnWlFshcOO9oEAk4U0GNg TCIBMmg/7YwzmU2t2qHtoYCm553UPSgqa93Fpv1rY9UwYFFkNYZ56G5weeMO79FKOuDc fTdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QzRJPD/1HGldywpr2/SZcm47DrBumEiDLx/FHjXP3jg=; b=OrQLdttfb3JroL3v4JbLsF7uyYiIMuNXx+iUP1Utm+T8vq/K+o1Helt8cEozg3i1tt 7twTB/5uZJn99cmth5wnIj10uXMynLNRj1+eSHuwptxq/ORGR8ZgYzeAugKIvRxnvY7h 5S3TPxWvHDlZuJlJSRWyA8nDjxrp+v9uSPxe9KrUHhdSzYgJmTrg8LwrhM7C4ztoMNee OmsLLf3eaBXYPLbD+IloxjooxbyWE0k+udiZi2n65n7mbGX05OA1ahP948ZiwzIGEz// t/8mpinD5lBbCtWJ7zm/V5NDIY2wJDAeMatchQd05VWyGvP2Ay3RVq/BI4sdA1iRLitg KoXw== X-Gm-Message-State: APjAAAVmJgmWdHJsuS9QQOetvwxyYe1Qo8BFQz96Jy7g7mniVjMP3xK+ JHTy5Cj06LYgrw+sThxBW8g+QQ== X-Received: by 2002:adf:f342:: with SMTP id e2mr20681695wrp.61.1572349417802; Tue, 29 Oct 2019 04:43:37 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id q25sm26559864wra.3.2019.10.29.04.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 04:43:36 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Lucas Stach , Srinivas Kandagatla Subject: [PATCH 05/10] nvmem: imx-ocotp: reset error status on probe Date: Tue, 29 Oct 2019 11:42:35 +0000 Message-Id: <20191029114240.14905-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191029114240.14905-1-srinivas.kandagatla@linaro.org> References: <20191029114240.14905-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lucas Stach 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 --- drivers/nvmem/imx-ocotp.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.21.0 diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index dff2f3c357f5..fc40555ca4cd 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -521,6 +521,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;