linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Xue <xxm@rock-chips.com>
To: Joerg Roedel <joro@8bytes.org>, Heiko Stuebner <heiko@sntech.de>
Cc: linux-rockchip@lists.infradead.org,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	Simon <xxm@rock-chips.com>
Subject: [PATCH V2 3/3] iommu/rockchip: ignore isp mmu reset operation
Date: Fri, 21 Jul 2017 14:27:10 +0800	[thread overview]
Message-ID: <1500618430-114821-3-git-send-email-xxm@rock-chips.com> (raw)
In-Reply-To: <1500618430-114821-1-git-send-email-xxm@rock-chips.com>

From: Simon <xxm@rock-chips.com>

ISP mmu can't support reset operation, it won't get the
expected result when reset, but rest functions work normally.
Add this patch as a WA for this issue.

Signed-off-by: Simon <xxm@rock-chips.com>
---
changes since V1:
 - use '-' instead of '_' for DT property.

 drivers/iommu/rockchip-iommu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index 3c462c0..3c6dc81 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -92,6 +92,7 @@ struct rk_iommu {
 	int num_mmu;
 	int *irq;
 	int num_irq;
+	bool reset_disabled;
 	struct iommu_device iommu;
 	struct list_head node; /* entry in rk_iommu_domain.iommus */
 	struct iommu_domain *domain; /* domain to which iommu is attached */
@@ -415,6 +416,9 @@ static int rk_iommu_force_reset(struct rk_iommu *iommu)
 	int ret, i;
 	u32 dte_addr;
 
+	if (iommu->reset_disabled)
+		return 0;
+
 	/*
 	 * Check if register DTE_ADDR is working by writing DTE_ADDR_DUMMY
 	 * and verifying that upper 5 nybbles are read back.
@@ -1177,6 +1181,9 @@ static int rk_iommu_probe(struct platform_device *pdev)
 		}
 	}
 
+	iommu->reset_disabled = device_property_read_bool(dev,
+					"rk-iommu,disable-reset-quirk");
+
 	err = iommu_device_sysfs_add(&iommu->iommu, dev, NULL, dev_name(dev));
 	if (err)
 		return err;
-- 
1.9.1

  parent reply	other threads:[~2017-07-21  6:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-21  6:27 [PATCH V2 1/3] Docs: dt: rockchip: add rk-iommu,disable-reset-quirk property Simon Xue
2017-07-21  6:27 ` [PATCH V2 2/3] iommu/rockchip: add multi irqs support Simon Xue
2017-07-21  7:07   ` Heiko Stuebner
2017-07-21  7:54     ` xxm
2017-07-21 18:37       ` Heiko Stuebner
2017-07-21  6:27 ` Simon Xue [this message]
2017-07-21  6:57 ` [PATCH V2 1/3] Docs: dt: rockchip: add rk-iommu,disable-reset-quirk property Heiko Stuebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1500618430-114821-3-git-send-email-xxm@rock-chips.com \
    --to=xxm@rock-chips.com \
    --cc=heiko@sntech.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).