Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966175AbdGUByM (ORCPT ); Thu, 20 Jul 2017 21:54:12 -0400 Received: from lucky1.263xmail.com ([211.157.147.132]:41771 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964851AbdGUByK (ORCPT ); Thu, 20 Jul 2017 21:54:10 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: <4fda08a1e3bcae87b61d5e8d54358bbb> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Cc: Joerg Roedel , Heiko Stuebner , shawn.lin@rock-chips.com, linux-rockchip@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] iommu/rockchip: ignore isp mmu reset operation To: Simon Xue References: <1500600921-102537-1-git-send-email-xxm@rock-chips.com> <1500600921-102537-2-git-send-email-xxm@rock-chips.com> From: Shawn Lin Message-ID: Date: Fri, 21 Jul 2017 09:54:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1500600921-102537-2-git-send-email-xxm@rock-chips.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1620 Lines: 52 Hi Simon, On 2017/7/21 9:35, Simon Xue wrote: > From: Simon > > 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 > --- > 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 b38283e..47c00b9 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"); > + Please update Documentation/devicetree/bindings/iommu/rockchip,iommu.txt as well. And please use '-' instead of '_' for DT property. > err = iommu_device_sysfs_add(&iommu->iommu, dev, NULL, dev_name(dev)); > if (err) > return err; >