Re: [PATCH v7 16/21] memory: mtk-smi: Add bus_sel for mt8183

2019-06-20 Thread Pi-Hsun Shih
On Thu, Jun 20, 2019 at 7:38 PM Matthias Brugger wrote: > > CCing Sascha > > On 20/06/2019 11:35, Matthias Brugger wrote: > > > > > > On 13/06/2019 10:14, Pi-Hsun Shih wrote: > >> Hi, > >> When I tested this patch series (Based on linux 5.2.0-rc2, and with > >> various other patch series about

[PATCH] Revert "iommu/vt-d: Fix lock inversion between iommu->lock and device_domain_lock"

2019-06-20 Thread Peter Xu
This reverts commit 7560cc3ca7d9d11555f80c830544e463fcdb28b8. With 5.2.0-rc5 I can easily trigger this with lockdep and iommu=pt: == WARNING: possible circular locking dependency detected 5.2.0-rc5 #78 Not tainted

Re: VT-d deadlock issue on device_domain_lock and iommu lock (5.2-rc5)

2019-06-20 Thread Peter Xu
On Fri, Jun 21, 2019 at 09:58:28AM +0800, Lu Baolu wrote: > Hi Peter, > > I agree with you that 7560cc3ca7d9 ("iommu/vt-d: Fix lock inversion between > iommu->lock and device_domain_lock") isn't a good fix. There > is also another thread, https://lkml.org/lkml/2019/6/18/996, which > reported

Re: VT-d deadlock issue on device_domain_lock and iommu lock (5.2-rc5)

2019-06-20 Thread Lu Baolu
Hi Peter, I agree with you that 7560cc3ca7d9 ("iommu/vt-d: Fix lock inversion between iommu->lock and device_domain_lock") isn't a good fix. There is also another thread, https://lkml.org/lkml/2019/6/18/996, which reported this. I think we can revert this patch now. I will try to reproduce

Re: [PATCH v2 05/12] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put

2019-06-20 Thread Matthias Brugger
On 10/06/2019 14:55, Yong Wu wrote: > MediaTek IOMMU has already added device_link between the consumer > and smi-larb device. If the jpg device call the pm_runtime_get_sync, > the smi-larb's pm_runtime_get_sync also be called automatically. Please help me out find this relation. I seem to

Re: [PATCH v7 20/21] iommu/mediatek: Fix iova_to_phys PA start for 4GB mode

2019-06-20 Thread Yong Wu
On Tue, 2019-06-18 at 18:35 +0200, Matthias Brugger wrote: > > On 10/06/2019 14:17, Yong Wu wrote: > > In the 4GB mode, the physical address is remapped, > > > > Here is the detailed remap relationship. > > CPU PA ->HW PA > > 0x4000_ 0x1_4000_ (Add bit32) > >

Re: [PATCH v7 19/21] iommu/mediatek: Rename enable_4GB to dram_is_4gb

2019-06-20 Thread Yong Wu
On Tue, 2019-06-18 at 18:06 +0200, Matthias Brugger wrote: > > On 10/06/2019 14:17, Yong Wu wrote: > > This patch only rename the variable name from enable_4GB to > > dram_is_4gb for readable. > > From my understanding this is true when available RAM > 4GB so I think the > name > should be

Re: [PATCH v7 17/21] memory: mtk-smi: Get rid of need_larbid

2019-06-20 Thread Yong Wu
On Tue, 2019-06-18 at 15:45 +0200, Matthias Brugger wrote: > > On 10/06/2019 14:17, Yong Wu wrote: > > The "mediatek,larb-id" has already been parsed in MTK IOMMU driver. > > It's no need to parse it again in SMI driver. Only clean some codes. > > This patch is fit for all the current mt2701,

Re: [PATCH v7 16/21] memory: mtk-smi: Add bus_sel for mt8183

2019-06-20 Thread Matthias Brugger
CCing Sascha On 20/06/2019 11:35, Matthias Brugger wrote: > > > On 13/06/2019 10:14, Pi-Hsun Shih wrote: >> Hi, >> When I tested this patch series (Based on linux 5.2.0-rc2, and with >> various other patch series about MT8183) with lockdep enabled, and I'm >> seeing the following lockdep

Re: use exact allocation for dma coherent memory

2019-06-20 Thread Christoph Hellwig
On Wed, Jun 19, 2019 at 01:29:03PM -0300, Jason Gunthorpe wrote: > > Yes. This will blow up badly on many platforms, as sq->queue > > might be vmapped, ioremapped, come from a pool without page backing. > > Gah, this addr gets fed into io_remap_pfn_range/remap_pfn_range too.. > > Potnuri, you

VT-d deadlock issue on device_domain_lock and iommu lock (5.2-rc5)

2019-06-20 Thread Peter Xu
Hi, With 5.2.0-rc5 I can easily trigger this with lockdep: Jun 20 14:37:37 xz-x1 kernel: == Jun 20 14:37:37 xz-x1 kernel: WARNING: possible circular locking dependency detected Jun 20 14:37:37

Re: [PATCH v7 16/21] memory: mtk-smi: Add bus_sel for mt8183

2019-06-20 Thread Matthias Brugger
On 13/06/2019 10:14, Pi-Hsun Shih wrote: > Hi, > When I tested this patch series (Based on linux 5.2.0-rc2, and with > various other patch series about MT8183) with lockdep enabled, and I'm > seeing the following lockdep warning on boot. > > By bisecting the commits, the first commit that

[RFC PATCH v7 4/5] block: add a helper function to merge the segments

2019-06-20 Thread Yoshihiro Shimoda
This patch adds a helper function whether a queue can merge the segments by the DMA MAP layer (e.g. via IOMMU). Signed-off-by: Yoshihiro Shimoda --- block/blk-settings.c | 22 ++ include/linux/blkdev.h | 2 ++ 2 files changed, 24 insertions(+) diff --git

[RFC PATCH v7 0/5] treewide: improve R-Car SDHI performance

2019-06-20 Thread Yoshihiro Shimoda
This patch series is based on iommu.git / next branch. Since SDHI host internal DMAC of the R-Car Gen3 cannot handle two or more segments, the performance rate (especially, eMMC HS400 reading) is not good. However, if IOMMU is enabled on the DMAC, since IOMMU will map multiple scatter gather

[RFC PATCH v7 1/5] dma: Introduce dma_get_merge_boundary()

2019-06-20 Thread Yoshihiro Shimoda
This patch adds a new DMA API "dma_get_merge_boundary". This function returns the DMA merge boundary if the DMA layer can merge the segments. This patch also adds the implementation for a new dma_map_ops pointer. Signed-off-by: Yoshihiro Shimoda --- Documentation/DMA-API.txt | 8

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

2019-06-20 Thread Yoshihiro Shimoda
This patch sorts the headers in alphabetic order to ease the maintenance for this part. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Wolfram Sang --- block/blk-settings.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/block/blk-settings.c

[RFC PATCH v7 5/5] mmc: queue: Use bigger segments if DMA MAP layer can merge the segments

2019-06-20 Thread Yoshihiro Shimoda
When the max_segs of a mmc host is smaller than 512, the mmc subsystem tries to use 512 segments if DMA MAP layer can merge the segments, and then the mmc subsystem exposes such information to the block layer by using blk_queue_can_use_dma_map_merging(). Signed-off-by: Yoshihiro Shimoda ---

[RFC PATCH v7 2/5] iommu/dma: Add a new dma_map_ops of get_merge_boundary()

2019-06-20 Thread Yoshihiro Shimoda
This patch adds a new dma_map_ops of get_merge_boundary() to expose the DMA merge boundary if the domain type is IOMMU_DOMAIN_DMA. Signed-off-by: Yoshihiro Shimoda --- drivers/iommu/dma-iommu.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/iommu/dma-iommu.c