Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7474686ybh; Thu, 8 Aug 2019 16:49:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgy+AEkScfui/QUBPtFYCpg6KvHTJx4gMrQmaBd1IfAjuuXKd6ZdVh+fzSfAm8p9TtboXT X-Received: by 2002:a17:902:40e:: with SMTP id 14mr5949017ple.323.1565308195961; Thu, 08 Aug 2019 16:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565308195; cv=none; d=google.com; s=arc-20160816; b=YgaQ197knRhtPGr6fF9dJAiqfAq3y5iwWo3mEN0bv3C6PEt7FUiXDdkdMDaaZaGoAb RZfbbY9sGdI/Gv0b6TK+nFV6yhBWYUr1NtQrUCbWVDIVyAt9Z0WfoFJMOKaXTEjhI43x 7JxeP7cG2qLFIwj3XmXrOJWESMqbu6W6e7Hw9XCgkLKU/AneNeZddFkfZ3puRB7eCQ+N bLDBNQ64XrCPG6NOj3jx37hwdRrjYx2yISOjuQ355SerJ5xERW4aZkd2es/NKFX4CSe+ 3YNisfIKx21pnWmQ5r8y5Nmm2FUZMHjjrxzyoDpXORW+64OMsPexcuBFc8k5Fpioxy3C FYFA== 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=T0hWkMA7tg/ATUVmKaM0W8R8UCCke0gXGlSnoSao7QA=; b=N0i79jQZ3jo5DCQo5VVw8fQ2F0JikfCGNJJkjOk3qeVk+Ld4PjZCStfurkx2gx6fRd sMSBt/ni3OjMNw6vIZ88SZJRP/Mks70mmPPEo5o9ME3QbrfWtG4wr+ax65/M6RPCpc2t WOYpAON/iPUCW2N/LTygnIfsZzsqtCtPV2qzbrlQtiAQ/UZ3CkYnQ97LcKrZKu7unKae xAMSkul1TkCf4ExdTF72msl+nx/ABWHE4M9NzEZX9myC+O3RkI/FSt84EwFMarwzR0Wh zZWFtlgxikC15aDY0AUn2q848PAcwfD8+rINFgO5XGOGGJtDEayDRch/2Hg3ENFuoQci 0Jww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=dW5zAICI; 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 z5si2899593pjp.101.2019.08.08.16.49.40; Thu, 08 Aug 2019 16:49:55 -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=dW5zAICI; 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 S2404893AbfHHXrF (ORCPT + 99 others); Thu, 8 Aug 2019 19:47:05 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:12811 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404428AbfHHXrD (ORCPT ); Thu, 8 Aug 2019 19:47:03 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 08 Aug 2019 16:47:04 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 08 Aug 2019 16:47:02 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 08 Aug 2019 16:47:02 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL104.nvidia.com (172.18.146.11) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 8 Aug 2019 23:47:02 +0000 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 8 Aug 2019 23:47:02 +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; Thu, 8 Aug 2019 23:47:02 +0000 Received: from skomatineni-linux.nvidia.com (Not Verified[10.110.103.110]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Thu, 08 Aug 2019 16:47:01 -0700 From: Sowjanya Komatineni To: , , , , , , , CC: , , , , , , , , , , , , , , , , , , Subject: [PATCH v8 01/21] pinctrl: tegra: Fix write barrier placement in pmx_writel Date: Thu, 8 Aug 2019 16:46:40 -0700 Message-ID: <1565308020-31952-2-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1565308020-31952-1-git-send-email-skomatineni@nvidia.com> References: <1565308020-31952-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=1565308024; bh=T0hWkMA7tg/ATUVmKaM0W8R8UCCke0gXGlSnoSao7QA=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=dW5zAICIci4d3L+OGJSb36xBzsKxNRj2JDnWjg0uLubLbv1IqliyrOlSBVkkep1z8 RKdl9krgJwXV8NPBxgk6Tlp6TePx/QMvGf03PajVYd3zheR74ceO9ksOTydeMv4k5D 1jG/duE0z19uikiPkMoeaztomqnBzJVuT1UUbbsEczIA3s5ly24OO6RzHzICqMKb3u ZNW+j3tvhQK/a5/eQB/CzBEDxD3A4uGIDtrixS8eAy7sF/LE/bf9VD5+1lHgRhWWow smDE5IHiW57sSVqUfZXRKfF8GdnVNoIeJisBRNILhfEJztMox4WYJLTGeg99ykJzJq chrlqcNHZcIxQ== 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 rather. This patch has fix to replace writel with writel_relaxed followed by a write barrier to ensure write operation before the barrier is completed for successful pinctrl change. 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..982ee634b3b1 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 */ + wmb(); } static int tegra_pinctrl_get_groups_count(struct pinctrl_dev *pctldev) -- 2.7.4