Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1318497ybl; Fri, 16 Aug 2019 12:45:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwicg6MylpkkmQb9/kZHZSHI8Z/ZTRu/SzpG+0f/6d0ZSKoy3F0U//sivO7ivHWH0ziIhmR X-Received: by 2002:a17:90a:24ed:: with SMTP id i100mr8793374pje.47.1565984737288; Fri, 16 Aug 2019 12:45:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565984737; cv=none; d=google.com; s=arc-20160816; b=Z4ZIoAaqXAAe6LBt8v2MbXqtiXrcRQhJOPuji4aWPO1t5+3ugF0OUbFwyaB79US3Te +0gBW3+pERUjvrYY4+ZV3kvwzIYnBylAVx8XFEkCNajBgaraWNxT+mM+kbyVPLIIs8Jg FDgLvRbp96vX33XAE0hb5yeduRv6pW9L52ZNLOGugVqqGkD8yeUQ0XY0Nov6tyPc6bP+ sCdK+AQdweGSP4wWxu4u9+tCWaeguTbB0AeTvimVlHZ/AjDeEYHV7yiCCNvvV3Rmth54 JOJ0bIwXRhLx6GKkjon8y8wJP030YSJcdeAG7zItoApp6RrgZp/ZZYsLyWz0q/9Rr0bD pFYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=LRXUJq1cTFbzfeezsn818DA4+S8ppkUj0Iryfiwmlns=; b=N04aNm8ikixVSXPOYsqlVZXrjoNQslnvuxJ4N8Yh1MV68t55nKkRq1qRRmT3H/3mbz vWweV4/iiwDciq8hOCd9McjnQRdYWQGKPWMZP0lAdOw2mnlEvlXkkMX7NlHVgrX3R1YK +eUapqDlh7E5BzdUjAn0r7pjybgJ2ZlxOqEKfzUyAuBBMjsBpLrsEBWWMOsl3lmecKfY 2aebJJ8jM8DM5XI6fICecRqXGQGQLagjRvLQzqDIfYugseijSVo9N8dSAl67S2OSbxLP WubuJjs5djOmI5nEDEqNNekTEpPSHfFdQjB2Qi0N1dYRHICnOiAX43Kzon33h6z4edy7 gE8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=NXYkpe7x; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si508674pjs.64.2019.08.16.12.45.21; Fri, 16 Aug 2019 12:45:37 -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=@nvidia.com header.s=n1 header.b=NXYkpe7x; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727647AbfHPTmW (ORCPT + 99 others); Fri, 16 Aug 2019 15:42:22 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:13067 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727557AbfHPTmV (ORCPT ); Fri, 16 Aug 2019 15:42:21 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 16 Aug 2019 12:42:18 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 16 Aug 2019 12:42:15 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 16 Aug 2019 12:42:15 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 16 Aug 2019 19:42:15 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 16 Aug 2019 19:42:15 +0000 Received: from skomatineni-linux.nvidia.com (Not Verified[10.2.166.126]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Fri, 16 Aug 2019 12:42:15 -0700 From: Sowjanya Komatineni To: , , , , , , , CC: , , , , , , , , , , , , , , , , , , Subject: [PATCH v9 01/22] pinctrl: tegra: Fix write barrier placement in pmx_writel Date: Fri, 16 Aug 2019 12:41:46 -0700 Message-ID: <1565984527-5272-2-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1565984527-5272-1-git-send-email-skomatineni@nvidia.com> References: <1565984527-5272-1-git-send-email-skomatineni@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1565984538; bh=LRXUJq1cTFbzfeezsn818DA4+S8ppkUj0Iryfiwmlns=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=NXYkpe7xHVtcvZ9vVUsiyEFsVfc3RN7Z5aurCECgjUPDUsusHq9zvfjZpIVQTRoQ9 ms4uy395JP/nPagssX8pQb33Qp0O8WXSd+MXFqUakIo5TbL88FwZ+ByLsBymt+zm0u q1OyRAIeoZxT6jpphdEnbj89xmvVN+fKMoHOa95/dE1rcvPuG+aSYqHBCaRQpvmF4J gXvLBS5HcKedvXqbfa/z1pe1cQ8+TQrGs8j3OhTLLrGtQE/kJro1gkpwe56YogKtZY hmsFyUv66PzmDPKDH0MdmbJPQIxZxQhL0/rbVFv+e2vT4Ud7kjhCIR1OWya+e9z8Zw zjdGP0IF0+6Dw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pmx_writel uses writel which inserts write barrier before the register write. This patch has fix to replace writel with writel_relaxed followed by a readback and memory barrier to ensure write operation is completed for successful pinctrl change. Acked-by: Thierry Reding Reviewed-by: Dmitry Osipenko Signed-off-by: Sowjanya Komatineni --- drivers/pinctrl/tegra/pinctrl-tegra.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c b/drivers/pinctrl/tegra/pinctrl-tegra.c index e3a237534281..5e3c00137d71 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c @@ -32,7 +32,9 @@ static inline u32 pmx_readl(struct tegra_pmx *pmx, u32 bank, u32 reg) static inline void pmx_writel(struct tegra_pmx *pmx, u32 val, u32 bank, u32 reg) { - writel(val, pmx->regs[bank] + reg); + writel_relaxed(val, pmx->regs[bank] + reg); + /* make sure pinmux register write completed */ + pmx_readl(pmx, bank, reg); } static int tegra_pinctrl_get_groups_count(struct pinctrl_dev *pctldev) -- 2.7.4