From patchwork Fri Aug 30 12:18:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 172687 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp543367ily; Fri, 30 Aug 2019 05:18:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlomeeiAKN741yldBwsWuQytQuGmEwhEiaPGpk8A+fDugj4LBAgiWj41i9MQ7Wx+xmpaGR X-Received: by 2002:a63:e148:: with SMTP id h8mr12789694pgk.275.1567167520987; Fri, 30 Aug 2019 05:18:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567167520; cv=none; d=google.com; s=arc-20160816; b=yQPP7eXI9kUOiSZiW18EpuImXoCVtT/OpZ2GQsV5IKx2zWAW7KyUA2nYgl8eAmDffn 4McqKeTYlhm8Hskb9KYX/jig4lxa0a5AbgxjApgdwcayZDNQgNnZ8aE0IfnJmaMmgusI ffNa0BGcARGMLN8fhn2BOz6SbK9oSE09QArLE8l66Q8y/HYRxX+NpODZfdsdDRrZuSVo mr1CKWx1iJJGCSmV7vkawiPQHyEPEmasSZJirloWzwEyCqibcSr+wE1mVLMW1UbeJQlV 4kqR80cgl4MoQTvSJoOwT/kSP4ykI5y/l1HMbFHV9O4CntHOjBnHlH31O2rU6Fm44TAA 316Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=piysbVL/wbtSd2fFes2OZDB9ILAzdFqjZ+wsv/1pBaY=; b=wNeJzvPYS2Tjr5XdT7Autgj21HuRiFYz8okpxXERAAC+Zf8cOh9MOel/vtHSd9LxTF W9D9eDCWezciXGKIklIQ2b56r8fZ6g4SxI7AcsKfzDSvIDr33JoXt/05wiFdSZSqvQsH 6suagZLj9qMCFx5wMGrhYF0YikAsGw3+wSr8n5mQX80QOfJDBnM8LpFT7Aobc85pwEhG klM6ofUVgaQ8J07JY6KMvvjzr4Zt8e1qlTAX1i7m+xhZ+OWlzngDuwmaLXm9jKrQwpPO THIuS4NLwxxEWNJPBM2NQ4BjQdgPmttGB3hekGF59S+N3bKpkYkcBfpZ5FWTKdC94LuU XoTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=r5o3eROL; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r193si1886576pfr.27.2019.08.30.05.18.40; Fri, 30 Aug 2019 05:18:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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=@ti.com header.s=ti-com-17Q1 header.b=r5o3eROL; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727788AbfH3MSk (ORCPT + 8 others); Fri, 30 Aug 2019 08:18:40 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:39242 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727620AbfH3MSk (ORCPT ); Fri, 30 Aug 2019 08:18:40 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x7UCIYFD119940; Fri, 30 Aug 2019 07:18:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1567167514; bh=piysbVL/wbtSd2fFes2OZDB9ILAzdFqjZ+wsv/1pBaY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=r5o3eROLDUFluJOeHbEFp2FjRUcOPEA5Nfzfmze8zmUUKDDu88qleCtUTywEd8DY4 pXAfVhPOJ596KB8xom86Ww7wrueLjReEkZ8AYt1RBKdo/aZFDX/uK8FnIu2Uqkgdlf SMoVUgI6Llm/lUsqivA7H9e+BV2vmhAcuZaQMMYg= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x7UCIYwS128444 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 30 Aug 2019 07:18:34 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 30 Aug 2019 07:18:33 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 30 Aug 2019 07:18:33 -0500 Received: from sokoban.bb.dnainternet.fi (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x7UCIP6J083824; Fri, 30 Aug 2019 07:18:31 -0500 From: Tero Kristo To: , , , , CC: , Subject: [PATCHv3 03/10] soc: ti: omap-prm: poll for reset complete during de-assert Date: Fri, 30 Aug 2019 15:18:09 +0300 Message-ID: <20190830121816.30034-4-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190830121816.30034-1-t-kristo@ti.com> References: <20190830121816.30034-1-t-kristo@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Poll for reset completion status during de-assertion of reset, otherwise the IP in question might be accessed before it has left reset properly. Signed-off-by: Tero Kristo --- drivers/soc/ti/omap_prm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.17.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/soc/ti/omap_prm.c b/drivers/soc/ti/omap_prm.c index ab0b66ad715d..d70f64e7a5c8 100644 --- a/drivers/soc/ti/omap_prm.c +++ b/drivers/soc/ti/omap_prm.c @@ -153,6 +153,18 @@ static int omap_reset_deassert(struct reset_controller_dev *rcdev, writel_relaxed(v, reset->prm->base + reset->prm->data->rstctrl); spin_unlock_irqrestore(&reset->lock, flags); + if (!has_rstst) + return 0; + + /* wait for the status to be set */ + ret = readl_relaxed_poll_timeout(reset->prm->base + + reset->prm->data->rstst, + v, v & BIT(st_bit), 1, + OMAP_RESET_MAX_WAIT); + if (ret) + pr_err("%s: timedout waiting for %s:%lu\n", __func__, + dev_name(rcdev->dev), id); + return 0; }