Re: Failure to recreate virtual functions

2019-07-26 Thread Lu Baolu
Hi Vilad, On 7/27/19 12:30 AM, Vlad Buslov wrote: Hi Lu Baolu, Our mlx5 driver fails to recreate VFs when cmdline includes "intel_iommu=on iommu=pt" after recent merge of patch set "iommu/vt-d: Delegate DMA domain to generic iommu". I've bisected the failure to patch b7297783c2bb ("iommu/vt-d:

[PATCH v2 1/2] dma-contiguous: do not overwrite align in dma_alloc_contiguous()

2019-07-26 Thread Nicolin Chen
The dma_alloc_contiguous() limits align at CONFIG_CMA_ALIGNMENT for cma_alloc() however it does not restore it for the fallback routine. This will result in a size mismatch between the allocation and free when running into the fallback routines after cma_alloc() fails, if the align is larger than C

[PATCH v2 2/2] dma-contiguous: page-align the size in dma_free_contiguous()

2019-07-26 Thread Nicolin Chen
According to the original dma_direct_alloc_pages() code: { unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT; if (!dma_release_from_contiguous(dev, page, count)) __free_pages(page, get_order(size)); } The count parameter for dma_release_from_contiguous() was page

[PATCH v2 0/2] dma-contiguous: two bug fixes for dma_{alloc, free}_contiguous()

2019-07-26 Thread Nicolin Chen
There are two obvious bugs in these two functions. So having two patches to fix them. Changlog v1->v2: * PATCH-1: Confine cma_align inside the if-condition. * PATCH-1: Updated commit message to be precise for the corner case. * PATCH-2: Added Reviewed-by from Christoph. Nicolin Chen (2): dma

Re: [PATCH 1/2] dma-contiguous: do not overwrite align in dma_alloc_contiguous()

2019-07-26 Thread Nicolin Chen
On Fri, Jul 26, 2019 at 08:28:49AM +0200, Christoph Hellwig wrote: > On Thu, Jul 25, 2019 at 04:39:58PM -0700, Nicolin Chen wrote: > > The dma_alloc_contiguous() limits align at CONFIG_CMA_ALIGNMENT for > > cma_alloc() however it does not restore it for the fallback routine. > > This will result in

Re: [git pull] IOMMU Fixes for Linux v5.3-rc1

2019-07-26 Thread pr-tracker-bot
The pull request you sent on Fri, 26 Jul 2019 11:20:53 +0200: > git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git > tags/iommu-fixes-v5.3-rc1 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/b381c016c5cfea94f2ad22c0c2195306a70d54ac Thank you! -- Deet-doot-

RE: [PATCH 1/1] iommu/vt-d: Correctly check format of page table in debugfs

2019-07-26 Thread Prakhya, Sai Praneeth
> On 7/22/19 1:21 PM, Prakhya, Sai Praneeth wrote: > > Hi Allen, > > > >> diff --git a/drivers/iommu/intel-iommu-debugfs.c > >> b/drivers/iommu/intel- iommu-debugfs.c index > >> 73a552914455..e31c3b416351 100644 > >> --- a/drivers/iommu/intel-iommu-debugfs.c > >> +++ b/drivers/iommu/intel-iommu-deb

Re: [PATCH v8 1/6] vfio/type1: Introduce iova list and add iommu aperture validity check

2019-07-26 Thread Auger Eric
Hi Shameer, On 7/23/19 6:06 PM, Shameer Kolothum wrote: > This introduces an iova list that is valid for dma mappings. Make > sure the new iommu aperture window doesn't conflict with the current > one or with any existing dma mappings during attach. > > Signed-off-by: Shameer Kolothum Reviewed-b

Re: [PATCH v8 2/6] vfio/type1: Check reserved region conflict and update iova list

2019-07-26 Thread Auger Eric
Hi Shameer, On 7/23/19 6:06 PM, Shameer Kolothum wrote: > This retrieves the reserved regions associated with dev group and > checks for conflicts with any existing dma mappings. Also update > the iova list excluding the reserved regions. > > Reserved regions with type IOMMU_RESV_DIRECT_RELAXABLE

Re: [PATCH v8 3/6] vfio/type1: Update iova list on detach

2019-07-26 Thread Auger Eric
Hi Shameer, On 7/23/19 6:06 PM, Shameer Kolothum wrote: > Get a copy of iova list on _group_detach and try to update the list. > On success replace the current one with the copy. Leave the list as > it is if update fails. > > Signed-off-by: Shameer Kolothum Reviewed-by: Eric Auger Thanks Eric

Failure to recreate virtual functions

2019-07-26 Thread Vlad Buslov
Hi Lu Baolu, Our mlx5 driver fails to recreate VFs when cmdline includes "intel_iommu=on iommu=pt" after recent merge of patch set "iommu/vt-d: Delegate DMA domain to generic iommu". I've bisected the failure to patch b7297783c2bb ("iommu/vt-d: Remove duplicated code for device hotplug"). Here is

Re: [RFC, v3 9/9] media: platform: Add Mediatek ISP P1 shared memory device

2019-07-26 Thread Tomasz Figa
On Fri, Jul 26, 2019 at 8:59 PM Jungo Lin wrote: > > Hi Robin: > > On Fri, 2019-07-26 at 12:04 +0100, Robin Murphy wrote: > > On 26/07/2019 08:42, Tomasz Figa wrote: > > > On Fri, Jul 26, 2019 at 4:41 PM Christoph Hellwig > > > wrote: > > >> > > >> On Fri, Jul 26, 2019 at 02:15:14PM +0900, Tomas

[PATCH AUTOSEL 5.2 84/85] dma-direct: correct the physical addr in dma_direct_sync_sg_for_cpu/device

2019-07-26 Thread Sasha Levin
From: Fugang Duan [ Upstream commit 449fa54d6815be8c2c1f68fa9dbbae9384a7c03e ] dma_map_sg() may use swiotlb buffer when the kernel command line includes "swiotlb=force" or the dma_addr is out of dev->dma_mask range. After DMA complete the memory moving from device to memory, then user call dma_

[PATCH AUTOSEL 5.2 18/85] swiotlb: fix phys_addr_t overflow warning

2019-07-26 Thread Sasha Levin
From: Arnd Bergmann [ Upstream commit 9c106119f6538f65bdddb7948a157d90625effa7 ] On architectures that have a larger dma_addr_t than phys_addr_t, the swiotlb_tbl_map_single() function truncates its return code in the failure path, making it impossible to identify the error later, as we compare t

Re: [PATCH] iommu: arm-smmu-v3: Mark expected switch fall-through

2019-07-26 Thread Robin Murphy
On 26/07/2019 12:28, Anders Roxell wrote: When fall-through warnings was enabled by default, commit d93512ef0f0e That commit ID only exists in a handful of old linux-next tags. ("Makefile: Globally enable fall-through warning"), the following warning was starting to show up: ../drivers/iommu

Re: [RFC, v3 9/9] media: platform: Add Mediatek ISP P1 shared memory device

2019-07-26 Thread Jungo Lin
Hi Robin: On Fri, 2019-07-26 at 12:04 +0100, Robin Murphy wrote: > On 26/07/2019 08:42, Tomasz Figa wrote: > > On Fri, Jul 26, 2019 at 4:41 PM Christoph Hellwig > > wrote: > >> > >> On Fri, Jul 26, 2019 at 02:15:14PM +0900, Tomasz Figa wrote: > >>> Could you try dma_get_sgtable() with the SCP st

[PATCH] iommu: arm-smmu-v3: Mark expected switch fall-through

2019-07-26 Thread Anders Roxell
When fall-through warnings was enabled by default, commit d93512ef0f0e ("Makefile: Globally enable fall-through warning"), the following warning was starting to show up: ../drivers/iommu/arm-smmu-v3.c: In function ‘arm_smmu_write_strtab_ent’: ../drivers/iommu/arm-smmu-v3.c:1189:7: warning: this st

Re: [RFC, v3 9/9] media: platform: Add Mediatek ISP P1 shared memory device

2019-07-26 Thread Robin Murphy
On 26/07/2019 08:42, Tomasz Figa wrote: On Fri, Jul 26, 2019 at 4:41 PM Christoph Hellwig wrote: On Fri, Jul 26, 2019 at 02:15:14PM +0900, Tomasz Figa wrote: Could you try dma_get_sgtable() with the SCP struct device and then dma_map_sg() with the P1 struct device? Please don't do that. dm

[git pull] IOMMU Fixes for Linux v5.3-rc1

2019-07-26 Thread Joerg Roedel
Hi Linus, The following changes since commit 5f9e832c137075045d15cd6899ab0505cfb2ca4b: Linus 5.3-rc1 (2019-07-21 14:05:38 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v5.3-rc1 for you to fetch changes up to 66

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

2019-07-26 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 Reviewed-by: Simon Horman --- block/blk-settings.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/block/blk-setti

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

2019-07-26 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 Reviewed-by: Christoph Hellwig Reviewed-by: Simon Horman --- block/blk-settings.c | 22 ++ include/linux/blkdev.h | 2 ++ 2 fi

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

2019-07-26 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 Reviewed-by: Christoph Hellwig Reviewed-by: Simon

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

2019-07-26 Thread Yoshihiro Shimoda
This patch series is based on linux-next.git / next-20190726 tag. 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

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

2019-07-26 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 Reviewed-

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

2019-07-26 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 Reviewed-by: Simon Horman --- drivers/iommu/dma-iommu.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/io

Re: [RFC,v3 8/9] media: platform: Add Mediatek ISP P1 SCP communication

2019-07-26 Thread Jungo Lin
Hi, Tomasz: On Thu, 2019-07-25 at 19:56 +0900, Tomasz Figa wrote: > Hi Jungo, > > On Sun, Jul 21, 2019 at 11:18 AM Jungo Lin wrote: > [snip] > > > > + wake_up_interruptible(&isp_ctx->composer_tx_thread.wq); > > > > + isp_ctx->composer_tx_thread.thread = NULL; > > > > + } >

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

2019-07-26 Thread Yoshihiro Shimoda
Hello! > From: Sergei Shtylyov, Sent: Tuesday, July 23, 2019 5:17 PM > > Hello! > > On 23.07.2019 8:26, Yoshihiro Shimoda wrote: > > > 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: Yo

Re: [RFC, v3 9/9] media: platform: Add Mediatek ISP P1 shared memory device

2019-07-26 Thread Tomasz Figa
On Fri, Jul 26, 2019 at 4:41 PM Christoph Hellwig wrote: > > On Fri, Jul 26, 2019 at 02:15:14PM +0900, Tomasz Figa wrote: > > Could you try dma_get_sgtable() with the SCP struct device and then > > dma_map_sg() with the P1 struct device? > > Please don't do that. dma_get_sgtable is a pretty broke

Re: [RFC, v3 9/9] media: platform: Add Mediatek ISP P1 shared memory device

2019-07-26 Thread Christoph Hellwig
On Fri, Jul 26, 2019 at 02:15:14PM +0900, Tomasz Figa wrote: > Could you try dma_get_sgtable() with the SCP struct device and then > dma_map_sg() with the P1 struct device? Please don't do that. dma_get_sgtable is a pretty broken API (see the common near the arm implementation) and we should not

Re: [RFC,v3 7/9] media: platform: Add Mediatek ISP P1 device driver

2019-07-26 Thread Jungo Lin
Hi, Tomasz: On Thu, 2019-07-25 at 18:23 +0900, Tomasz Figa wrote: > .Hi Jungo, > > On Sat, Jul 20, 2019 at 6:58 PM Jungo Lin wrote: > > > > Hi, Tomasz: > > > > On Wed, 2019-07-10 at 18:56 +0900, Tomasz Figa wrote: > > > Hi Jungo, > > > > > > On Tue, Jun 11, 2019 at 11:53:42AM +0800, Jungo Lin wr