[PATCH v4 3/3] iommu: arm-smmu-impl: Add sdm845 implementation hook

2019-08-22 Thread Vivek Gautam
Add reset hook for sdm845 based platforms to turn off the wait-for-safe sequence. Understanding how wait-for-safe logic affects USB and UFS performance on MTP845 and DB845 boards: Qcom's implementation of arm,mmu-500 adds a WAIT-FOR-SAFE logic to address under-performance issues in real-time clie

[PATCH v4 1/3] firmware: qcom_scm-64: Add atomic version of qcom_scm_call

2019-08-22 Thread Vivek Gautam
There are scnenarios where drivers are required to make a scm call in atomic context, such as in one of the qcom's arm-smmu-500 errata [1]. [1] ("https://source.codeaurora.org/quic/la/kernel/msm-4.9/ tree/drivers/iommu/arm-smmu.c?h=msm-4.9#n4842") Signed-off-by: Vivek Gautam Reviewed-by: B

[PATCH v4 2/3] firmware/qcom_scm: Add scm call to handle smmu errata

2019-08-22 Thread Vivek Gautam
Qcom's smmu-500 needs to toggle wait-for-safe sequence to handle TLB invalidation sync's. Few firmwares allow doing that through SCM interface. Add API to toggle wait for safe from firmware through a SCM call. Signed-off-by: Vivek Gautam Reviewed-by: Bjorn Andersson --- drivers/firmware/qcom_sc

[PATCH v4 0/3] Qcom smmu-500 wait-for-safe handling for sdm845

2019-08-22 Thread Vivek Gautam
Previous version of the patches are at [1]: Qcom's implementation of smmu-500 on sdm845 adds a hardware logic called wait-for-safe. This logic helps in meeting the invalidation requirements from 'real-time clients', such as display and camera. This wait-for-safe logic ensures that the invalidation

[PATCH v3 0/2] improve the concurrency of arm_smmu_atc_inv_domain()

2019-08-22 Thread Zhen Lei
v2 --> v3: As Will Deacon's suggestion, I changed the lock type of arm_smmu_domain.devices_lock from spinlock_t to rwlock_t, and I saw that the performance is all right. And further use nr_ats_masters to quickly check have no obvious effect, so I drop it. Here is the performance data tested on my

[PATCH v3 1/2] iommu/arm-smmu-v3: don't add a master into smmu_domain before it's ready

2019-08-22 Thread Zhen Lei
Once a master has been added into smmu_domain->devices, it may immediately be scaned in arm_smmu_unmap()-->arm_smmu_atc_inv_domain(). From a logical point of view, the master should be added into smmu_domain after it has completely initialized. Signed-off-by: Zhen Lei --- drivers/iommu/arm-smmu-

[PATCH v3 2/2] iommu/arm-smmu-v3: change the lock type of arm_smmu_domain.devices_lock

2019-08-22 Thread Zhen Lei
A master add into or remove from smmu_domain->devices only happened in arm_smmu_attach_dev()/arm_smmu_detach_dev(), the frequency of these operations is very low. But we traverse smmu_domain->devices list in arm_smmu_atc_inv_domain() are frequent. So change the protection from spinlock to rwlock ca

Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-22 Thread Will Deacon
On Thu, Aug 22, 2019 at 08:05:33PM +0800, Yong Wu wrote: > On Thu, 2019-08-22 at 12:28 +0100, Will Deacon wrote: > > Ok, great. Yong Wu -- are you ok respinning with the above + missing > > brackets? > > Of course I can. > > NearlyAll the interface in this file is prefixed with "arm_v7s_", so > d

Re: next take at setting up a dma mask by default for platform devices v2

2019-08-22 Thread Greg Kroah-Hartman
On Fri, Aug 16, 2019 at 08:24:29AM +0200, Christoph Hellwig wrote: > Hi all, > > this is another attempt to make sure the dma_mask pointer is always > initialized for platform devices. Not doing so lead to lots of > boilerplate code, and makes platform devices different from all our > major busse

[RFC PATCH] iommu/vt-d: Fix IOMMU field not populated on device hot re-plug

2019-08-22 Thread Janusz Krzysztofik
When a perfectly working i915 device is hot unplugged (via sysfs) and hot re-plugged again, its dev->archdata.iommu field is not populated again with an IOMMU pointer. As a result, the device probe fails on DMA mapping error during scratch page setup. It looks like that happens because devices ar

Re: [PATCH v2 1/4] iommu/arm-smmu: Introduce wrapper for writeq/readq

2019-08-22 Thread Robin Murphy
On 20/08/2019 13:08, Will Deacon wrote: Hi Gregory, Hanna, On Thu, Jul 11, 2019 at 05:02:39PM +0200, Gregory CLEMENT wrote: From: Hanna Hawa This patch introduces the smmu_writeq_relaxed/smmu_readq_relaxed helpers, as preparation to add specific Marvell work-around for accessing 64 bits width

Re: [PATCH v2 3/4] dt-bindings: iommu/arm, smmu: add compatible string for Marvell

2019-08-22 Thread Robin Murphy
On 11/07/2019 16:02, Gregory CLEMENT wrote: From: Hanna Hawa Add specific compatible string for Marvell usage due errata of accessing 64bits registers of ARM SMMU, in AP806. AP806 SoC uses the generic ARM-MMU500, and there's no specific implementation of Marvell, this compatible is used for er

Re: [PATCH v10 23/23] iommu/mediatek: Clean up struct mtk_smi_iommu

2019-08-22 Thread Matthias Brugger
On 21/08/2019 15:53, Yong Wu wrote: > Remove the "struct mtk_smi_iommu" to simplify the code since it has only > one item in it right now. > > Signed-off-by: Yong Wu Reviewed-by: Matthias Brugger > --- > drivers/iommu/mtk_iommu.c| 4 ++-- > drivers/iommu/mtk_iommu.h| 6 +++--- > dr

Re: [PATCH v2 7/8] iommu/arm-smmu-v3: Avoid locking on invalidation path when not using ATS

2019-08-22 Thread Robin Murphy
On 21/08/2019 16:17, Will Deacon wrote: When ATS is not in use, we can avoid taking the 'devices_lock' for the domain on the invalidation path by simply caching the number of ATS masters currently attached. The fiddly part is handling a concurrent ->attach() of an ATS-enabled master to a domain t

Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-22 Thread Yong Wu
Thanks very much for viewing this so quickly. On Thu, 2019-08-22 at 12:28 +0100, Will Deacon wrote: > On Thu, Aug 22, 2019 at 11:57:11AM +0100, Robin Murphy wrote: > > On 2019-08-22 11:17 am, Will Deacon wrote: > > > On Thu, Aug 22, 2019 at 11:08:58AM +0100, Robin Murphy wrote: > > > > On 2019-0

Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-22 Thread Will Deacon
On Thu, Aug 22, 2019 at 11:57:11AM +0100, Robin Murphy wrote: > On 2019-08-22 11:17 am, Will Deacon wrote: > > On Thu, Aug 22, 2019 at 11:08:58AM +0100, Robin Murphy wrote: > > > On 2019-08-22 9:56 am, Yong Wu wrote: > > > > On Wed, 2019-08-21 at 16:24 +0100, Will Deacon wrote: > > > > > On Wed, Au

Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-22 Thread Robin Murphy
On 2019-08-22 11:17 am, Will Deacon wrote: On Thu, Aug 22, 2019 at 11:08:58AM +0100, Robin Murphy wrote: On 2019-08-22 9:56 am, Yong Wu wrote: On Wed, 2019-08-21 at 16:24 +0100, Will Deacon wrote: On Wed, Aug 21, 2019 at 09:53:12PM +0800, Yong Wu wrote: MediaTek extend the arm v7s descriptor

Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-22 Thread Will Deacon
On Thu, Aug 22, 2019 at 11:08:58AM +0100, Robin Murphy wrote: > On 2019-08-22 9:56 am, Yong Wu wrote: > > On Wed, 2019-08-21 at 16:24 +0100, Will Deacon wrote: > > > On Wed, Aug 21, 2019 at 09:53:12PM +0800, Yong Wu wrote: > > > > MediaTek extend the arm v7s descriptor to support up to 34 bits PA w

Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-22 Thread Robin Murphy
On 2019-08-22 9:56 am, Yong Wu wrote: On Wed, 2019-08-21 at 16:24 +0100, Will Deacon wrote: On Wed, Aug 21, 2019 at 09:53:12PM +0800, Yong Wu wrote: MediaTek extend the arm v7s descriptor to support up to 34 bits PA where the bit32 and bit33 are encoded in the bit9 and bit4 of the PTE respectiv

Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-22 Thread Will Deacon
On Thu, Aug 22, 2019 at 04:56:26PM +0800, Yong Wu wrote: > On Wed, 2019-08-21 at 16:24 +0100, Will Deacon wrote: > > On Wed, Aug 21, 2019 at 09:53:12PM +0800, Yong Wu wrote: > > > MediaTek extend the arm v7s descriptor to support up to 34 bits PA where > > > the bit32 and bit33 are encoded in the b

Re: [PATCH v9 3/5] block: sort headers on blk-setting.c

2019-08-22 Thread Wolfram Sang
Hi Jens, thanks for the feedback. > Please just drop this patch. OK, we will do. And patch 4/5? Is it OK or do you need some more time to think about it? Regards, Wolfram signature.asc Description: PGP signature ___ iommu mailing list iommu@lis

Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-22 Thread Yong Wu
On Wed, 2019-08-21 at 16:34 +0100, Robin Murphy wrote: > On 21/08/2019 16:24, Will Deacon wrote: > > On Wed, Aug 21, 2019 at 09:53:12PM +0800, Yong Wu wrote: > >> MediaTek extend the arm v7s descriptor to support up to 34 bits PA where > >> the bit32 and bit33 are encoded in the bit9 and bit4 of th

Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-22 Thread Yong Wu
On Wed, 2019-08-21 at 16:24 +0100, Will Deacon wrote: > On Wed, Aug 21, 2019 at 09:53:12PM +0800, Yong Wu wrote: > > MediaTek extend the arm v7s descriptor to support up to 34 bits PA where > > the bit32 and bit33 are encoded in the bit9 and bit4 of the PTE > > respectively. Meanwhile the iova stil