Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3082604ybl; Sun, 12 Jan 2020 09:19:15 -0800 (PST) X-Google-Smtp-Source: APXvYqwSOj/3tjBcqJGyAXb17Dr6VUuKdrg3Y74h1dYbxwDr1noxAdGX8CZxX5YGBoIO1gG2ZhCg X-Received: by 2002:a05:6830:1d91:: with SMTP id y17mr9837481oti.276.1578849555274; Sun, 12 Jan 2020 09:19:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578849555; cv=none; d=google.com; s=arc-20160816; b=XiB8XX0AaRBxPuExZ571N6slgYUdJnI4B5qRuTJ2tMOoO0zSAs1EQC2A1CgwCBV4t0 S5Bm9BYyQ5bjKXRMfYufMG6+4ga2+XiR/RV3JKEYGxLaYhtKnz7ZTfuEX6nGiDDIJQlM aMqTYeXNp4gJYHdXJiHYILWmlFe96oCaifDht72HAMi1yMRNHqEH/UeNxAexnO9V0VdE f0Eu0ykdGxaQmURk8QzWj63i6+A2J69skJAJzdlymoWC3NWnXNxqTVsX19fjrSSIE5b3 5uueN41dbY7urAzdhIoiJvNl2609a23Yh3Q49tNb6AKreqXGGNqKrgww8IXJ4mTPTS9l /yxQ== 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=DKcajWqETcYxz0G58Z+vZAfLySB6HXY6m/67CXA4AZc=; b=cVQpieNuADqeZjfZ5bzgbmv+R4P1BHH+uuXyhv+GEqW5YbmNlJLxjcnYBXuxt8E+wK BlVihwd7WKU3jGzfOxW+qn06ajoSfLhloy/sjP9GGIkqRo2YrOgQduVlEVWKJye3eTkY ArzKJmCxValmAQJYhXuMgpamD1vV84gs20Ha32eOcGg7FTFEO0ULCLrlWUOEDGp+tt52 37L3bVgQDtcuyQRdew9aKoMGtu3+fKRmrj2K32KAvaUPpNjjJp9iNfp6qlwxkDI9Kemv SQZrtZ8NNfBYPoEWZQvQoNtYcyEqmv5+XaJRwvO/9vuykHqORhOIdGORCVFNmCV7JnC0 BVXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tivx4iE8; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g9si5696848otq.68.2020.01.12.09.19.03; Sun, 12 Jan 2020 09:19:15 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=tivx4iE8; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733190AbgALRRx (ORCPT + 99 others); Sun, 12 Jan 2020 12:17:53 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:42027 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733154AbgALRRr (ORCPT ); Sun, 12 Jan 2020 12:17:47 -0500 Received: by mail-lj1-f196.google.com with SMTP id y4so7417766ljj.9; Sun, 12 Jan 2020 09:17:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DKcajWqETcYxz0G58Z+vZAfLySB6HXY6m/67CXA4AZc=; b=tivx4iE8IykK+6ikNZHoI/BIg8DBp4x46ck+nK3H3zTq9KoLSDtoJNqqNlGxfCNCe0 AETCKBXZdhbN4mRYhWJZqIJ4X0n8+d3HtNSYEKXLYUAhjHTXHfsxwBUY5fP6XPmVNBqU cyN2XZF05myd52rVhKh52L7jnZXUx6Www0py6dAJULk9gWtLIW11TKqDmpLdY+LzfsIR YogFkc7ppH+tBemPzLXT7K3F8YTV3jrTuHMR9F+ZaNddqTL3Ukx+UMFHpqWNpoqwrWL1 4Z9rTi9pHV5uLyqngL45JnTXIzNFys0vlcrYe+gYp/MzyhStftZyNQdoCrOJAEdKC5ez Y+Pw== 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=DKcajWqETcYxz0G58Z+vZAfLySB6HXY6m/67CXA4AZc=; b=sd+d37JLvdhbvZCl3uuqAvW/xoNWfvE0RhitQumawg9iQjOMUxPG9qnOEFEOkfntM8 8uxsQS6SxjiZHBpboT/s2f7w8cBksXq3iKd4fmuP1pgWuvDkSoNJNob0f98vku5DiFyD sO+P2QX3QQLEnVlvbJVyZx/4QYxqvbhuIvTnJ3Ql1SbnAgN2C0Z7ksyHeb+4LMRsiwUN +ettaVy6ipI3h3xxEinvhurbD+sJyFDxbFbFPow07+ZNtOGltb+eBcPPqGNYRlaNbmDE R+hnN138h9Ymd468x1kEKU3r/PDEkbCv4j3FnrhP5el7mggomj9HMKcwQANTW/tTBgsN yBYw== X-Gm-Message-State: APjAAAVIvFq/mBLKhxnq7/r+e3kNPBK1UEOjVClxTmkYHjakbngjG11D bAGqmuUeBJmVrSIADRd1xvc= X-Received: by 2002:a2e:6c13:: with SMTP id h19mr8193248ljc.221.1578849464799; Sun, 12 Jan 2020 09:17:44 -0800 (PST) Received: from localhost.localdomain (79-139-233-37.dynamic.spd-mgts.ru. [79.139.233.37]) by smtp.gmail.com with ESMTPSA id i13sm4506628ljg.89.2020.01.12.09.17.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 09:17:44 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Laxman Dewangan , Mikko Perttunen , Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 6/8] i2c: tegra: Use relaxed versions of readl/writel Date: Sun, 12 Jan 2020 20:14:28 +0300 Message-Id: <20200112171430.27219-7-digetx@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200112171430.27219-1-digetx@gmail.com> References: <20200112171430.27219-1-digetx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is nothing to synchronize in regards to memory accesses for PIO transfers and for DMA transfers the DMA API takes care of the syncing. Tested-by: Thierry Reding Signed-off-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index e0eb8f5dcd6b..1a390e1bff72 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -284,12 +284,12 @@ struct tegra_i2c_dev { static void dvc_writel(struct tegra_i2c_dev *i2c_dev, u32 val, unsigned long reg) { - writel(val, i2c_dev->base + reg); + writel_relaxed(val, i2c_dev->base + reg); } static u32 dvc_readl(struct tegra_i2c_dev *i2c_dev, unsigned long reg) { - return readl(i2c_dev->base + reg); + return readl_relaxed(i2c_dev->base + reg); } /* @@ -307,16 +307,16 @@ static unsigned long tegra_i2c_reg_addr(struct tegra_i2c_dev *i2c_dev, static void i2c_writel(struct tegra_i2c_dev *i2c_dev, u32 val, unsigned long reg) { - writel(val, i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg)); + writel_relaxed(val, i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg)); /* Read back register to make sure that register writes completed */ if (reg != I2C_TX_FIFO) - readl(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg)); + readl_relaxed(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg)); } static u32 i2c_readl(struct tegra_i2c_dev *i2c_dev, unsigned long reg) { - return readl(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg)); + return readl_relaxed(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg)); } static void i2c_writesl(struct tegra_i2c_dev *i2c_dev, void *data, @@ -689,12 +689,13 @@ static int tegra_i2c_wait_for_config_load(struct tegra_i2c_dev *i2c_dev) i2c_writel(i2c_dev, I2C_MSTR_CONFIG_LOAD, I2C_CONFIG_LOAD); if (i2c_dev->is_curr_atomic_xfer) - err = readl_poll_timeout_atomic(addr, val, val == 0, - 1000, - I2C_CONFIG_LOAD_TIMEOUT); + err = readl_relaxed_poll_timeout_atomic( + addr, val, val == 0, 1000, + I2C_CONFIG_LOAD_TIMEOUT); else - err = readl_poll_timeout(addr, val, val == 0, 1000, - I2C_CONFIG_LOAD_TIMEOUT); + err = readl_relaxed_poll_timeout( + addr, val, val == 0, 1000, + I2C_CONFIG_LOAD_TIMEOUT); if (err) { dev_warn(i2c_dev->dev, -- 2.24.0