From patchwork Tue Oct 8 07:19:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 175455 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp5334638ill; Tue, 8 Oct 2019 00:19:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIJuqcys5qeOHjduUO/ABOTmrS7UQqFvPdF+qA7LTRH6DWb9K8LNk23U0DD1pvazaYpVbv X-Received: by 2002:a50:ab58:: with SMTP id t24mr32473330edc.131.1570519182406; Tue, 08 Oct 2019 00:19:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570519182; cv=none; d=google.com; s=arc-20160816; b=G/NsTA9Kl0zxMG0U/wxttUZXhwBrwCZcRalcGmJjThyFNDl+DSsAG41AscKe1AsD9O Sus6OGuvVdCYSbjNL/6/mN0BLJhGWJEB5e8mmAgOWt2p4iga6XbKQwa9B3vRFWU4qrs8 smFg4JYyJywkcMCfSWc9opYnC2iR64LDn18zZFbXvKOnTDscGxLyVEGbbeelGLlfJvbg 72TjEtMSTVsUnAIb44YN2RTJ2QQyjLni7HbIkmOt90ZThzMcIOSCW9WWDc4m8L9oNNpt LH7YLAC719UOIekm9eyDQHteHHh+Nq8G140mx5StRdHC+B4iNdvXD72kNBF4r7ZVlTJg Ciew== 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=Y7vuHmki0AitevIY4QTjUpFCGHBSgA345LWzYu3kdGg=; b=AI7/1r1iKLY0MGsxTyQxbf9w0nKjGKX6U8MlMjF8ewVOp/uEDE/lVFDJ56MwDoTpBp 7cZtnq4QfPqDcuw2kLSDrLAgUPiTct/clR71WV4K33eIUDDV0e6d4RAiG4TWay9mYXMx HuMcpJlrKyzyj8KcqL63Y+8TCiU9YNd3lIyjDdZMlJJis/LjDU63gsfjVS/iL6v0fzhW AeM2fcpLd3vAzXgmlCZs+k0xxp3kL8CEHyctD1G6OzgqhaFEB6KRuBiXXY92tbm+8E9z GR+m4RrY2wI4wtGoWxvSrDHL+KUbIqNnVh00UNBGZRTMWy271uPTuoeDJFzbM+6R27Vy s6xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=XxJVogC+; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-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 m24si8494415ejx.286.2019.10.08.00.19.42; Tue, 08 Oct 2019 00:19:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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=XxJVogC+; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-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 S1729740AbfJHHTg (ORCPT + 5 others); Tue, 8 Oct 2019 03:19:36 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:34656 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730156AbfJHHTg (ORCPT ); Tue, 8 Oct 2019 03:19:36 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x987JSWs025151; Tue, 8 Oct 2019 02:19:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1570519168; bh=Y7vuHmki0AitevIY4QTjUpFCGHBSgA345LWzYu3kdGg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=XxJVogC+ICfus+EQEnqmy4M/NgIF7sViXfL32XYZacWn9Xa0O2q8HGiaNCMhlMPLf ouaNimPomNW63vaSpcr9WxCBJrXvwVmCt/Hzx18a4yv7cqHZGfyvjw/QjyRilrLzO4 Lq2TdKLXy4Orr8R6ahaFDOiucPQoAopIJSJiIC/s= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x987JSIw073220 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 8 Oct 2019 02:19:28 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 8 Oct 2019 02:19:25 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE100.ent.ti.com (10.64.6.21) 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; Tue, 8 Oct 2019 02:19:25 -0500 Received: from sokoban.bb.dnainternet.fi (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x987JJj6027770; Tue, 8 Oct 2019 02:19:26 -0500 From: Tero Kristo To: , CC: , , , , Subject: [PATCHv7 3/9] soc: ti: omap-prm: poll for reset complete during de-assert Date: Tue, 8 Oct 2019 10:19:07 +0300 Message-ID: <20191008071913.28740-4-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191008071913.28740-1-t-kristo@ti.com> References: <20191008071913.28740-1-t-kristo@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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 Reviewed-by: Philipp Zabel diff --git a/drivers/soc/ti/omap_prm.c b/drivers/soc/ti/omap_prm.c index ab0b66ad715d..96fa2aad9b93 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__, + reset->prm->data->name, id); + return 0; }