[PATCH v3 0/3] xen/swiotlb: fix an issue and improve swiotlb-xen

2019-06-13 Thread Juergen Gross
While hunting an issue in swiotlb-xen I stumbled over a wrong test and found some areas for improvement. Juergen Gross (3): xen/swiotlb: fix condition for calling xen_destroy_contiguous_region() xen/swiotlb: simplify range_straddles_page_boundary() xen/swiotlb: remember having called

[PATCH v3 1/3] xen/swiotlb: fix condition for calling xen_destroy_contiguous_region()

2019-06-13 Thread Juergen Gross
The condition in xen_swiotlb_free_coherent() for deciding whether to call xen_destroy_contiguous_region() is wrong: in case the region to be freed is not contiguous calling xen_destroy_contiguous_region() is the wrong thing to do: it would result in inconsistent mappings of multiple PFNs to the

[PATCH v3 2/3] xen/swiotlb: simplify range_straddles_page_boundary()

2019-06-13 Thread Juergen Gross
range_straddles_page_boundary() is open coding several macros from include/xen/page.h. Use those instead. Additionally there is no need to have check_pages_physically_contiguous() as a separate function as it is used only once, so merge it into range_straddles_page_boundary(). Signed-off-by:

[PATCH v3 3/3] xen/swiotlb: remember having called xen_create_contiguous_region()

2019-06-13 Thread Juergen Gross
Instead of always calling xen_destroy_contiguous_region() in case the memory is DMA-able for the used device, do so only in case it has been made DMA-able via xen_create_contiguous_region() before. This will avoid a lot of xen_destroy_contiguous_region() calls for 64-bit capable devices. As the

Re: switch nios2 and microblaze to use the generic uncached segement support

2019-06-13 Thread Christoph Hellwig
On Fri, Jun 14, 2019 at 09:40:34AM +0800, Ley Foon Tan wrote: > Hi Christoph > > Can this patch in http://git.infradead.org/users/hch/dma-mapping.git/sh > ortlog/refs/heads/for-next > > [PATCH 1/2] nios2: use the generic uncached segment support in dma- > direct Hi Ley Foon, I don't understand

Re: [PATCH v3 4/4] arm64: dts/sdm845: Enable FW implemented safe sequence handler on MTP

2019-06-13 Thread Bjorn Andersson
On Wed 12 Jun 00:15 PDT 2019, Vivek Gautam wrote: > Indicate on MTP SDM845 that firmware implements handler to > TLB invalidate erratum SCM call where SAFE sequence is toggled > to achieve optimum performance on real-time clients, such as > display and camera. > > Signed-off-by: Vivek Gautam

Re: [PATCH v3 3/4] iommu/arm-smmu: Add support to handle Qcom's wait-for-safe logic

2019-06-13 Thread Bjorn Andersson
On Wed 12 Jun 00:15 PDT 2019, Vivek Gautam wrote: > Qcom's implementation of arm,mmu-500 adds a WAIT-FOR-SAFE logic > to address under-performance issues in real-time clients, such as > Display, and Camera. > On receiving an invalidation requests, the SMMU forwards SAFE request > to these clients

Re: switch nios2 and microblaze to use the generic uncached segement support

2019-06-13 Thread Ley Foon Tan
On Mon, 2019-06-03 at 08:53 +0200, Christoph Hellwig wrote: > Hi all, > > can you take a look at this series?  It switches niops2 and > microblaze to > use the generic dma layer support for uncached segements. > > The dma mapping for-next git tree that includes the support is > available > here:

Re: [RFC PATCH v4 05/21] x86/hpet: Reserve timer for the HPET hardlockup detector

2019-06-13 Thread Ricardo Neri
On Tue, Jun 11, 2019 at 09:54:25PM +0200, Thomas Gleixner wrote: > On Thu, 23 May 2019, Ricardo Neri wrote: > > > HPET timer 2 will be used to drive the HPET-based hardlockup detector. > > Reserve such timer to ensure it cannot be used by user space programs or > > for clock events. > > > > When

Re: How to resolve an issue in swiotlb environment?

2019-06-13 Thread shuah
On 6/13/19 11:16 AM, Alan Stern wrote: On Thu, 13 Jun 2019, Christoph Hellwig wrote: On Wed, Jun 12, 2019 at 10:43:11AM -0400, Alan Stern wrote: Would it be okay to rely on the assumption that USB block devices never have block size < 512? (We could even add code to the driver to enforce

Re: [RFC 1/2] iommu: arm-smmu: Handoff SMR registers and context banks

2019-06-13 Thread Bjorn Andersson
On Thu 13 Jun 04:23 PDT 2019, Robin Murphy wrote: > On 05/06/2019 22:08, Bjorn Andersson wrote: > > Boot splash screen or EFI framebuffer requires the display hardware to > > operate while the Linux iommu driver probes. Therefore, we cannot simply > > wipe out the SMR register settings programmed

[PATCH v4 5/5] iommu/amd: Convert AMD iommu driver to the dma-iommu api

2019-06-13 Thread Tom Murphy
Convert the AMD iommu driver to the dma-iommu api. Remove the iova handling and reserve region code from the AMD iommu driver. Signed-off-by: Tom Murphy --- drivers/iommu/Kconfig | 1 + drivers/iommu/amd_iommu.c | 677 -- 2 files changed, 68

[PATCH v4 0/5] iommu/amd: Convert the AMD iommu driver to the dma-iommu api

2019-06-13 Thread Tom Murphy
Convert the AMD iommu driver to the dma-iommu api. Remove the iova handling and reserve region code from the AMD iommu driver. Change-log: V4: -Rebase on top of linux-next -Split the removing of the unnecessary locking in the amd iommu driver into a seperate patch -refactor the "iommu/dma-iommu:

[PATCH v4 4/5] iommu/dma-iommu: Use the dev->coherent_dma_mask

2019-06-13 Thread Tom Murphy
Use the dev->coherent_dma_mask when allocating in the dma-iommu ops api. Signed-off-by: Tom Murphy --- drivers/iommu/dma-iommu.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index

[PATCH v4 3/5] iommu/dma-iommu: Handle deferred devices

2019-06-13 Thread Tom Murphy
Handle devices which defer their attach to the iommu in the dma-iommu api Signed-off-by: Tom Murphy --- drivers/iommu/dma-iommu.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index

[PATCH v4 1/5] iommu/amd: Remove unnecessary locking from AMD iommu driver

2019-06-13 Thread Tom Murphy
We can remove the mutex lock from amd_iommu_map and amd_iommu_unmap. iommu_map doesn’t lock while mapping and so no two calls should touch the same iova range. The AMD driver already handles the page table page allocations without locks so we can safely remove the locks. Signed-off-by: Tom Murphy

[PATCH v4 2/5] iommu: Add gfp parameter to iommu_ops::map

2019-06-13 Thread Tom Murphy
Add a gfp_t parameter to the iommu_ops::map function. Remove the needless locking in the AMD iommu driver. The iommu_ops::map function (or the iommu_map function which calls it) was always supposed to be sleepable (according to Joerg's comment in this thread:

[PATCH v3] iommu/amd: Flush not present cache in iommu_map_page

2019-06-13 Thread Tom Murphy
check if there is a not-present cache present and flush it if there is. Signed-off-by: Tom Murphy --- v3: --applied Qian Cai's "iommu/amd: fix a null-ptr-deref in map_sg()" fix drivers/iommu/amd_iommu.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git

Re: [RFC PATCH v6 4/5] mmc: tmio: Use dma_max_mapping_size() instead of a workaround

2019-06-13 Thread Geert Uytterhoeven
Hi Shimoda-san, On Thu, Jun 13, 2019 at 5:37 PM Yoshihiro Shimoda wrote: > Since the commit 133d624b1cee ("dma: Introduce dma_max_mapping_size()") > provides a helper function to get the max mapping size, we can use > the function instead of the workaround code for swiotlb. > > Signed-off-by:

Re: [RFC PATCH v6 5/5] mmc: queue: Use bigger segments if IOMMU can merge the segments

2019-06-13 Thread Wolfram Sang
> - blk_queue_max_segments(mq->queue, host->max_segs); > + /* blk_queue_can_use_iommu_merging() should succeed if can_merge = 1 */ > + if (host->can_merge && > + !blk_queue_can_use_iommu_merging(mq->queue, mmc_dev(host))) > + WARN_ON(1); > +

Re: [RFC PATCH v6 4/5] mmc: tmio: Use dma_max_mapping_size() instead of a workaround

2019-06-13 Thread Wolfram Sang
On Thu, Jun 13, 2019 at 07:20:14PM +0900, Yoshihiro Shimoda wrote: > Since the commit 133d624b1cee ("dma: Introduce dma_max_mapping_size()") > provides a helper function to get the max mapping size, we can use > the function instead of the workaround code for swiotlb. > > Signed-off-by: Yoshihiro

Re: [RFC PATCH v6 2/5] block: sort headers on blk-setting.c

2019-06-13 Thread Wolfram Sang
On Thu, Jun 13, 2019 at 07:20:12PM +0900, Yoshihiro Shimoda wrote: > This patch sorts the headers in alphabetic order to ease > the maintenance for this part. > > Signed-off-by: Yoshihiro Shimoda Yup, I got the same result :) Reviewed-by: Wolfram Sang signature.asc Description: PGP

Re: [RFC PATCH v6 1/5] iommu: add an exported function to get minimum page size for a domain

2019-06-13 Thread Wolfram Sang
On Thu, Jun 13, 2019 at 07:20:11PM +0900, Yoshihiro Shimoda wrote: > This patch adds an exported function to get minimum page size for > a domain. This patch also modifies similar codes on the iommu.c. > > Signed-off-by: Yoshihiro Shimoda > --- > drivers/iommu/iommu.c | 18 +++--- >

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

2019-06-13 Thread Wolfram Sang
On Thu, Jun 13, 2019 at 07:20:10PM +0900, Yoshihiro Shimoda wrote: > 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

Re: [PATCH 09/10] iommu/rockchip: convert to SPDX license tags

2019-06-13 Thread Heiko Stübner
Am Donnerstag, 13. Juni 2019, 18:27:02 CEST schrieb Yangtao Li: > Updates license to use SPDX-License-Identifier. > > Signed-off-by: Yangtao Li Acked-by: Heiko Stuebner

Re: How to resolve an issue in swiotlb environment?

2019-06-13 Thread Greg KH
On Thu, Jun 13, 2019 at 01:16:32PM -0400, Alan Stern wrote: > On Thu, 13 Jun 2019, Christoph Hellwig wrote: > > > On Wed, Jun 12, 2019 at 10:43:11AM -0400, Alan Stern wrote: > > > Would it be okay to rely on the assumption that USB block devices never > > > have block size < 512? (We could even

Re: [PATCH 03/10] iommu/omap: convert to SPDX license tags

2019-06-13 Thread Suman Anna via iommu
Hi Yangtao, On 6/13/19 11:26 AM, Yangtao Li wrote: > Updates license to use SPDX-License-Identifier. > > Signed-off-by: Yangtao Li Thanks for the patch. Can you also update another related file while at this. Will leave it to Joerg if he prefers it as a separate patch, or folded into this

Re: How to resolve an issue in swiotlb environment?

2019-06-13 Thread Alan Stern
On Thu, 13 Jun 2019, Christoph Hellwig wrote: > On Wed, Jun 12, 2019 at 10:43:11AM -0400, Alan Stern wrote: > > Would it be okay to rely on the assumption that USB block devices never > > have block size < 512? (We could even add code to the driver to > > enforce this, although refusing to

Re: [PATCH v2] driver: core: Allow subsystems to continue deferring probe

2019-06-13 Thread Rob Herring
On Thu, Jun 13, 2019 at 11:00 AM Thierry Reding wrote: > > From: Thierry Reding > > Some subsystems, such as pinctrl, allow continuing to defer probe > indefinitely. This is useful for devices that depend on resources > provided by devices that are only probed after the init stage. > > One

[PATCH v2] driver: core: Allow subsystems to continue deferring probe

2019-06-13 Thread Thierry Reding
From: Thierry Reding Some subsystems, such as pinctrl, allow continuing to defer probe indefinitely. This is useful for devices that depend on resources provided by devices that are only probed after the init stage. One example of this can be seen on Tegra, where the DPAUX hardware contains

Re: How to resolve an issue in swiotlb environment?

2019-06-13 Thread Martin K. Petersen
Christoph, > sd.c only supports a few specific sector size, and none of them is > < 512 bytes: Yep, while sd.c in theory supported 256-byte logical blocks a while back, that code was removed since the block layer always operates on units of 512 bytes. -- Martin K. Petersen Oracle Linux

Re: [PATCH 03/10] iommu/omap: convert to SPDX license tags

2019-06-13 Thread Frank Lee
On Fri, Jun 14, 2019 at 12:39 AM Suman Anna wrote: > > Hi Yangtao, > > On 6/13/19 11:26 AM, Yangtao Li wrote: > > Updates license to use SPDX-License-Identifier. > > > > Signed-off-by: Yangtao Li > > Thanks for the patch. Can you also update another related file > while at this. Will leave it to

[PATCH v2] iommu/omap: convert to SPDX license tags

2019-06-13 Thread Yangtao Li
Updates license to use SPDX-License-Identifier. Signed-off-by: Yangtao Li Acked-by: Suman Anna --- v2: -add include/linux/platform_data/iommu-omap.h --- drivers/iommu/omap-iommu-debug.c | 5 + drivers/iommu/omap-iommu.c | 5 + drivers/iommu/omap-iommu.h

Re: [PATCH 05/10] iommu/dma-iommu: convert to SPDX license tags

2019-06-13 Thread Robin Murphy
On 13/06/2019 17:26, Yangtao Li wrote: Updates license to use SPDX-License-Identifier. A more complete version of this (which also covers the header) is already queued in -next. Robin. Signed-off-by: Yangtao Li --- drivers/iommu/dma-iommu.c | 13 + 1 file changed, 1

Re: [PATCH 07/10] iommu/io-pgtable-arm: convert to SPDX license tags

2019-06-13 Thread Will Deacon
On Thu, Jun 13, 2019 at 12:27:00PM -0400, Yangtao Li wrote: > Updates license to use SPDX-License-Identifier. > > Signed-off-by: Yangtao Li > --- > drivers/iommu/io-pgtable-arm.c | 13 + > 1 file changed, 1 insertion(+), 12 deletions(-) Acked-by: Will Deacon Will

Re: [PATCH 02/10] iommu/io-pgtable: convert to SPDX license tags

2019-06-13 Thread Will Deacon
On Thu, Jun 13, 2019 at 12:26:55PM -0400, Yangtao Li wrote: > Updates license to use SPDX-License-Identifier. > > Signed-off-by: Yangtao Li > --- > drivers/iommu/io-pgtable.c | 13 + > 1 file changed, 1 insertion(+), 12 deletions(-) Acked-by: Will Deacon Will

Re: [PATCH 10/10] iommu/tegra-smmu: convert to SPDX license tags

2019-06-13 Thread Thierry Reding
On Thu, Jun 13, 2019 at 12:27:03PM -0400, Yangtao Li wrote: > Updates license to use SPDX-License-Identifier. > > Signed-off-by: Yangtao Li > --- > drivers/iommu/tegra-smmu.c | 5 + > 1 file changed, 1 insertion(+), 4 deletions(-) Acked-by: Thierry Reding signature.asc Description: PGP

[PATCH 08/10] iommu/sysfs: convert to SPDX license tags

2019-06-13 Thread Yangtao Li
Updates license to use SPDX-License-Identifier. Signed-off-by: Yangtao Li --- drivers/iommu/iommu-sysfs.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iommu/iommu-sysfs.c b/drivers/iommu/iommu-sysfs.c index 44127d54e943..a193758c8122 100644 ---

[PATCH 07/10] iommu/io-pgtable-arm: convert to SPDX license tags

2019-06-13 Thread Yangtao Li
Updates license to use SPDX-License-Identifier. Signed-off-by: Yangtao Li --- drivers/iommu/io-pgtable-arm.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index 4e21efbc4459..6282c45eefaa 100644

[PATCH 10/10] iommu/tegra-smmu: convert to SPDX license tags

2019-06-13 Thread Yangtao Li
Updates license to use SPDX-License-Identifier. Signed-off-by: Yangtao Li --- drivers/iommu/tegra-smmu.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 463ee08f7d3a..9a50ca4ec65c 100644 ---

[PATCH 09/10] iommu/rockchip: convert to SPDX license tags

2019-06-13 Thread Yangtao Li
Updates license to use SPDX-License-Identifier. Signed-off-by: Yangtao Li --- drivers/iommu/rockchip-iommu.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 77d4bd93fe4b..9c4c6eb7d42b 100644 ---

[PATCH 06/10] iommu/io-pgtable-arm-v7s: convert to SPDX license tags

2019-06-13 Thread Yangtao Li
Updates license to use SPDX-License-Identifier. Signed-off-by: Yangtao Li --- drivers/iommu/io-pgtable-arm-v7s.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c index

[PATCH 05/10] iommu/dma-iommu: convert to SPDX license tags

2019-06-13 Thread Yangtao Li
Updates license to use SPDX-License-Identifier. Signed-off-by: Yangtao Li --- drivers/iommu/dma-iommu.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 129c4badf9ae..2d76bac43b82 100644 ---

[PATCH 04/10] iommu/qcom: convert to SPDX license tags

2019-06-13 Thread Yangtao Li
Updates license to use SPDX-License-Identifier. Signed-off-by: Yangtao Li --- drivers/iommu/qcom_iommu.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c index 8cdd3f059513..ad913720d7dd 100644 ---

[PATCH 03/10] iommu/omap: convert to SPDX license tags

2019-06-13 Thread Yangtao Li
Updates license to use SPDX-License-Identifier. Signed-off-by: Yangtao Li --- drivers/iommu/omap-iommu-debug.c | 5 + drivers/iommu/omap-iommu.c | 5 + drivers/iommu/omap-iommu.h | 5 + drivers/iommu/omap-iopgtable.h | 5 + 4 files changed, 4 insertions(+), 16

[PATCH 01/10] iommu/exynos: convert to SPDX license tags

2019-06-13 Thread Yangtao Li
Updates license to use SPDX-License-Identifier. Signed-off-by: Yangtao Li --- drivers/iommu/exynos-iommu.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 05c6bc099d62..938a33d2f89d 100644 ---

[PATCH 02/10] iommu/io-pgtable: convert to SPDX license tags

2019-06-13 Thread Yangtao Li
Updates license to use SPDX-License-Identifier. Signed-off-by: Yangtao Li --- drivers/iommu/io-pgtable.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/iommu/io-pgtable.c b/drivers/iommu/io-pgtable.c index 5227cfdbb65b..3c84ff1901ea 100644 ---

Re: [PATCH v8 0/7] Add virtio-iommu driver

2019-06-13 Thread Auger Eric
Hi, On 5/30/19 7:09 PM, Jean-Philippe Brucker wrote: > Implement the virtio-iommu driver, following specification v0.12 [1]. > Since last version [2] we've worked on improving the specification, > which resulted in the following changes to the interface: > * Remove the EXEC flag. > * Add feature

Re: [PATCH v5 00/10] Support using MSI interrupts in ntb_transport

2019-06-13 Thread Logan Gunthorpe
On 2019-06-13 7:30 a.m., Jon Mason wrote: > On Thu, May 23, 2019 at 04:30:50PM -0600, Logan Gunthorpe wrote: >> This is another resend as there has been no feedback since v4. >> Seems Jon has been MIA this past cycle so hopefully he appears on the >> list soon. >> >> I've addressed the feedback

Re: [PATCH v5 00/10] Support using MSI interrupts in ntb_transport

2019-06-13 Thread Jon Mason
On Thu, May 23, 2019 at 04:30:50PM -0600, Logan Gunthorpe wrote: > This is another resend as there has been no feedback since v4. > Seems Jon has been MIA this past cycle so hopefully he appears on the > list soon. > > I've addressed the feedback so far and rebased on the latest kernel > and

Re: [RFC 1/2] iommu: arm-smmu: Handoff SMR registers and context banks

2019-06-13 Thread Robin Murphy
On 05/06/2019 22:08, Bjorn Andersson wrote: Boot splash screen or EFI framebuffer requires the display hardware to operate while the Linux iommu driver probes. Therefore, we cannot simply wipe out the SMR register settings programmed by the bootloader. Detect which SMR registers are in use

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

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

[RFC PATCH v6 3/5] block: add a helper function to merge the segments by an IOMMU

2019-06-13 Thread Yoshihiro Shimoda
This patch adds a helper function whether a queue can merge the segments by an IOMMU. Signed-off-by: Yoshihiro Shimoda --- block/blk-settings.c | 28 include/linux/blkdev.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/block/blk-settings.c

[RFC PATCH v6 5/5] mmc: queue: Use bigger segments if IOMMU can merge the segments

2019-06-13 Thread Yoshihiro Shimoda
If max_segs of a mmc host is smaller than BLK_MAX_SEGMENTS, the mmc subsystem tries to use such bigger segments by using IOMMU subsystem, and then the mmc subsystem exposes such information to the block layer by using blk_queue_can_use_iommu_merging(). Signed-off-by: Yoshihiro Shimoda ---

[RFC PATCH v6 4/5] mmc: tmio: Use dma_max_mapping_size() instead of a workaround

2019-06-13 Thread Yoshihiro Shimoda
Since the commit 133d624b1cee ("dma: Introduce dma_max_mapping_size()") provides a helper function to get the max mapping size, we can use the function instead of the workaround code for swiotlb. Signed-off-by: Yoshihiro Shimoda --- drivers/mmc/host/tmio_mmc_core.c | 17 - 1

[RFC PATCH v6 1/5] iommu: add an exported function to get minimum page size for a domain

2019-06-13 Thread Yoshihiro Shimoda
This patch adds an exported function to get minimum page size for a domain. This patch also modifies similar codes on the iommu.c. Signed-off-by: Yoshihiro Shimoda --- drivers/iommu/iommu.c | 18 +++--- include/linux/iommu.h | 1 + 2 files changed, 16 insertions(+), 3 deletions(-)

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

2019-06-13 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

[PATCH v9 5/7] iommu/vt-d: add support for IOMMU default DMA mode build options

2019-06-13 Thread Zhen Lei
The default DMA mode of INTEL IOMMU is LAZY, this patch make it can be set to STRICT at build time. It can be overridden by boot option. There is no functional change. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 2 +- drivers/iommu/intel-iommu.c | 2 +- 2 files changed, 2

[PATCH v9 7/7] ia64: hide build option IOMMU_DEFAULT_PASSTHROUGH

2019-06-13 Thread Zhen Lei
The DMA mode PASSTHROUGH is not used on ia64. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 70741fd73b07785..63506f1cad3d149 100644 --- a/drivers/iommu/Kconfig +++

[PATCH v9 3/7] s390/pci: add support for IOMMU default DMA mode build options

2019-06-13 Thread Zhen Lei
The default DMA mode is LAZY on s390, this patch make it can be set to STRICT at build time. It can be overridden by boot option. There is no functional change. Signed-off-by: Zhen Lei Acked-by: Sebastian Ott --- arch/s390/pci/pci_dma.c | 2 +- drivers/iommu/Kconfig | 2 ++ 2 files changed,

[PATCH v9 2/7] x86/dma: use IS_ENABLED() to simplify the code

2019-06-13 Thread Zhen Lei
Remove the ifdefs around CONFIG_IOMMU_DEFAULT_PASSTHROUGH to improve readablity. Signed-off-by: Zhen Lei --- arch/x86/kernel/pci-dma.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index

[PATCH v9 6/7] iommu/amd: add support for IOMMU default DMA mode build options

2019-06-13 Thread Zhen Lei
The default DMA mode of AMD IOMMU is LAZY, this patch make it can be set to STRICT at build time. It can be overridden by boot option. There is no functional change. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 2 +- drivers/iommu/amd_iommu_init.c | 2 +- 2 files changed, 2

[PATCH v9 1/7] iommu: enhance IOMMU default DMA mode build options

2019-06-13 Thread Zhen Lei
First, add build option IOMMU_DEFAULT_{LAZY|STRICT}, so that we have the opportunity to set {lazy|strict} mode as default at build time. Then put the three config options in an choice, make people can only choose one of the three at a time. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 44

[PATCH v9 4/7] powernv/iommu: add support for IOMMU default DMA mode build options

2019-06-13 Thread Zhen Lei
The default DMA mode is PASSTHROUGH on powernv, this patch make it can be set to STRICT at build time. It can be overridden by boot option. There is no functional change. Signed-off-by: Zhen Lei --- arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++- drivers/iommu/Kconfig |

[PATCH v9 0/7] iommu: enhance IOMMU default DMA mode build options

2019-06-13 Thread Zhen Lei
v8--> v9 1. Fix some text editing errors v7--> v8 1. Split into multiple small patches base on ARCHs or IOMMU drivers. 2. Hide the unsupported build options on the related ARCH or IOMMU. v6 --> v7: 1. Fix some text editing errors v5 --> v6: 1. give up adding boot option iommu.dma_mode v4 -->

Re: [PATCH v8 1/7] iommu: enhance IOMMU default DMA mode build options

2019-06-13 Thread Leizhen (ThunderTown)
On 2019/5/31 18:42, John Garry wrote: > -config IOMMU_DEFAULT_PASSTHROUGH -    bool "IOMMU passthrough by default" +choice +    prompt "IOMMU default DMA mode" depends on IOMMU_API -    help -  Enable passthrough by default, removing the need to

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

2019-06-13 Thread Pi-Hsun Shih
(Sorry for the possibly double-posting, my last mail got rejected by some mailing lists.) 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

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

2019-06-13 Thread Pi-Hsun Shih
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 introduce this warning is this patch. The warning also

Re: How to resolve an issue in swiotlb environment?

2019-06-13 Thread Christoph Hellwig
On Wed, Jun 12, 2019 at 10:43:11AM -0400, Alan Stern wrote: > Would it be okay to rely on the assumption that USB block devices never > have block size < 512? (We could even add code to the driver to > enforce this, although refusing to handle such devices at all might be > worse than getting