Re: [RFC PATCH v4 04/21] x86/hpet: Add hpet_set_comparator() for periodic and one-shot modes

2019-06-14 Thread Thomas Gleixner
On Thu, 23 May 2019, Ricardo Neri wrote: > +/** > + * hpet_set_comparator() - Helper function for setting comparator register > + * @num: The timer ID > + * @cmp: The value to be written to the comparator/accumulator > + * @period: The value to be written to the period (0 = oneshot mode)

Re: [PATCH 7/7] arc: use the generic remapping allocator for coherent DMA allocations

2019-06-14 Thread Eugeniy Paltsev
Hi Christoph, Regular question - do you have any public git repository with all this dma changes? I want to test it for ARC. Pretty sure the [PATCH 2/7] arc: remove the partial DMA_ATTR_NON_CONSISTENT support is fine. Not so sure about [PATCH 7/7] arc: use the generic remapping allocator for

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

2019-06-14 Thread Frank Lee
Need me to make them a patch? MBR, Yangtao ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [Intel-gfx] [PATCH 03/16] drm/i915: stop using drm_pci_alloc

2019-06-14 Thread Ville Syrjälä
On Fri, Jun 14, 2019 at 03:47:13PM +0200, Christoph Hellwig wrote: > Remove usage of the legacy drm PCI DMA wrappers, and with that the > incorrect usage cocktail of __GFP_COMP, virt_to_page on DMA allocation > and SetPageReserved. > > Signed-off-by: Christoph Hellwig > --- >

Re: [git pull] IOMMU Fixes for Linux v5.2-rc4

2019-06-14 Thread pr-tracker-bot
The pull request you sent on Fri, 14 Jun 2019 11:39:15 +0200: > git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git > tags/iommu-fixes-v5.2-rc4 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/c78ad1be4b4d65eb214421b90a788abf3c85c3ea Thank you! --

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

2019-06-14 Thread Thomas Gleixner
On Thu, 13 Jun 2019, Ricardo Neri wrote: > 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

Re: [RFC PATCH v4 03/21] x86/hpet: Calculate ticks-per-second in a separate function

2019-06-14 Thread Thomas Gleixner
On Fri, 14 Jun 2019, Thomas Gleixner wrote: > On Thu, 23 May 2019, Ricardo Neri wrote: > > int hpet_alloc(struct hpet_data *hdp) > > { > > u64 cap, mcfg; > > @@ -844,7 +867,6 @@ int hpet_alloc(struct hpet_data *hdp) > > struct hpets *hpetp; > > struct hpet __iomem *hpet; > >

Re: [RFC PATCH v4 03/21] x86/hpet: Calculate ticks-per-second in a separate function

2019-06-14 Thread Thomas Gleixner
On Thu, 23 May 2019, Ricardo Neri wrote: > > +u64 hpet_get_ticks_per_sec(u64 hpet_caps) > +{ > + u64 ticks_per_sec, period; > + > + period = (hpet_caps & HPET_COUNTER_CLK_PERIOD_MASK) >> > + HPET_COUNTER_CLK_PERIOD_SHIFT; /* fs, 10^-15 */ > + > + /* > + * The

Re: [PATCH 12/16] staging/comedi: mark as broken

2019-06-14 Thread Christoph Hellwig
On Fri, Jun 14, 2019 at 05:30:32PM +0200, Greg KH wrote: > On Fri, Jun 14, 2019 at 04:48:57PM +0200, Christoph Hellwig wrote: > > On Fri, Jun 14, 2019 at 04:02:39PM +0200, Greg KH wrote: > > > Perhaps a hint as to how we can fix this up? This is the first time > > > I've heard of the comedi code

Re: [PATCH 12/16] staging/comedi: mark as broken

2019-06-14 Thread Greg KH
On Fri, Jun 14, 2019 at 04:48:57PM +0200, Christoph Hellwig wrote: > On Fri, Jun 14, 2019 at 04:02:39PM +0200, Greg KH wrote: > > Perhaps a hint as to how we can fix this up? This is the first time > > I've heard of the comedi code not handling dma properly. > > It can be fixed by: > > a)

RE: [PATCH 16/16] dma-mapping: use exact allocation in dma_alloc_contiguous

2019-06-14 Thread David Laight
From: Robin Murphy > Sent: 14 June 2019 16:06 ... > Well, apart from the bit in DMA-API-HOWTO which has said this since > forever (well, before Git history, at least): > > "The CPU virtual address and the DMA address are both > guaranteed to be aligned to the smallest PAGE_SIZE order which > is

Re: [PATCH 16/16] dma-mapping: use exact allocation in dma_alloc_contiguous

2019-06-14 Thread 'Christoph Hellwig'
On Fri, Jun 14, 2019 at 04:05:33PM +0100, Robin Murphy wrote: > That said, I don't believe this particular patch should make any > appreciable difference - alloc_pages_exact() is still going to give back > the same base address as the rounded up over-allocation would, and > PAGE_ALIGN()ing the

Re: [PATCH 16/16] dma-mapping: use exact allocation in dma_alloc_contiguous

2019-06-14 Thread 'Christoph Hellwig'
On Fri, Jun 14, 2019 at 03:01:22PM +, David Laight wrote: > I'm pretty sure there is a lot of code out there that makes that assumption. > Without it many drivers will have to allocate almost double the > amount of memory they actually need in order to get the required alignment. > So instead

Re: [PATCH 16/16] dma-mapping: use exact allocation in dma_alloc_contiguous

2019-06-14 Thread Robin Murphy
On 14/06/2019 15:50, 'Christoph Hellwig' wrote: On Fri, Jun 14, 2019 at 02:15:44PM +, David Laight wrote: Does this still guarantee that requests for 16k will not cross a 16k boundary? It looks like you are losing the alignment parameter. The DMA API never gave you alignment guarantees to

RE: [PATCH 16/16] dma-mapping: use exact allocation in dma_alloc_contiguous

2019-06-14 Thread David Laight
From: 'Christoph Hellwig' > Sent: 14 June 2019 15:50 > To: David Laight > On Fri, Jun 14, 2019 at 02:15:44PM +, David Laight wrote: > > Does this still guarantee that requests for 16k will not cross a 16k > > boundary? > > It looks like you are losing the alignment parameter. > > The DMA API

Re: [PATCH 16/16] dma-mapping: use exact allocation in dma_alloc_contiguous

2019-06-14 Thread 'Christoph Hellwig'
On Fri, Jun 14, 2019 at 02:15:44PM +, David Laight wrote: > Does this still guarantee that requests for 16k will not cross a 16k boundary? > It looks like you are losing the alignment parameter. The DMA API never gave you alignment guarantees to start with, and you can get not naturally

Re: [PATCH 12/16] staging/comedi: mark as broken

2019-06-14 Thread Christoph Hellwig
On Fri, Jun 14, 2019 at 04:02:39PM +0200, Greg KH wrote: > Perhaps a hint as to how we can fix this up? This is the first time > I've heard of the comedi code not handling dma properly. It can be fixed by: a) never calling virt_to_page (or vmalloc_to_page for that matter) on dma allocation

[PATCH 7/7] arc: use the generic remapping allocator for coherent DMA allocations

2019-06-14 Thread Christoph Hellwig
Replace the code that sets up uncached PTEs with the generic vmap based remapping code. It also provides an atomic pool for allocations from non-blocking context, which we not properly supported by the existing arc code. Signed-off-by: Christoph Hellwig --- arch/arc/Kconfig | 2 ++

[PATCH 5/7] dma-direct: handle DMA_ATTR_NON_CONSISTENT in common code

2019-06-14 Thread Christoph Hellwig
Only call into arch_dma_alloc if we require an uncached mapping, and remove the parisc code manually doing normal cached DMA_ATTR_NON_CONSISTENT allocations. Signed-off-by: Christoph Hellwig --- arch/parisc/kernel/pci-dma.c | 48 ++-- kernel/dma/direct.c

[PATCH 6/7] dma-direct: handle DMA_ATTR_NO_KERNEL_MAPPING in common code

2019-06-14 Thread Christoph Hellwig
DMA_ATTR_NO_KERNEL_MAPPING is generally implemented by allocating normal cacheable pages or CMA memory, and then returning the page pointer as the opaque handle. Lift that code from the xtensa and generic dma remapping implementations into the generic dma-direct code so that we don't even call

[PATCH 4/7] dma-mapping: add a dma_alloc_need_uncached helper

2019-06-14 Thread Christoph Hellwig
Check if we need to allocate uncached memory for a device given the allocation flags. Switch over the uncached segment check to this helper to deal with architectures that do not support the dma_cache_sync operation and thus should not returned cacheable memory for DMA_ATTR_NON_CONSISTENT

[PATCH 3/7] openrisc: remove the partial DMA_ATTR_NON_CONSISTENT support

2019-06-14 Thread Christoph Hellwig
The openrisc DMA code supports DMA_ATTR_NON_CONSISTENT allocations, but does not provide a cache_sync operation. This means any user of it will never be able to actually transfer cache ownership and thus cause coherency bugs. Signed-off-by: Christoph Hellwig --- arch/openrisc/kernel/dma.c | 22

[PATCH 1/7] arm-nommu: remove the partial DMA_ATTR_NON_CONSISTENT support

2019-06-14 Thread Christoph Hellwig
The arm-nommu DMA code supports DMA_ATTR_NON_CONSISTENT allocations, but does not provide a cache_sync operation. This means any user of it will never be able to actually transfer cache ownership and thus cause coherency bugs. Signed-off-by: Christoph Hellwig ---

[PATCH 2/7] arc: remove the partial DMA_ATTR_NON_CONSISTENT support

2019-06-14 Thread Christoph Hellwig
The arc DMA code supports DMA_ATTR_NON_CONSISTENT allocations, but does not provide a cache_sync operation. This means any user of it will never be able to actually transfer cache ownership and thus cause coherency bugs. Signed-off-by: Christoph Hellwig --- arch/arc/mm/dma.c | 21

Re: How to resolve an issue in swiotlb environment?

2019-06-14 Thread Alan Stern
On Thu, 13 Jun 2019, shuah wrote: > > Great! So all we have to do is fix vhci-hcd. Then we can remove all > > the virt_boundary_mask stuff from usb-storage and uas entirely. > > > > (I'm assuming wireless USB isn't a genuine issue. As far as I know, it > > is pretty much abandoned at this

handle "special" dma allocation in common code

2019-06-14 Thread Christoph Hellwig
Hi all,, this series ensures that the common dma-direct code handles the somewhat special allocation types requested by the DMA_ATTR_NON_CONSISTENT and DMA_ATTR_NO_KERNEL_MAPPING flags directly. To do so it also removes three partial and thus broken implementations of DMA_ATTR_NON_CONSISTENT.

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

2019-06-14 Thread Greg Kroah-Hartman
On Fri, Jun 14, 2019 at 12:10:10PM +0200, Rafael J. Wysocki wrote: > On Fri, Jun 14, 2019 at 11:39 AM Thierry Reding > wrote: > > > > On Fri, Jun 14, 2019 at 11:10:58AM +0200, Greg Kroah-Hartman wrote: > > > On Thu, Jun 13, 2019 at 07:00:11PM +0200, Thierry Reding wrote: > > > > From: Thierry

RE: [PATCH 16/16] dma-mapping: use exact allocation in dma_alloc_contiguous

2019-06-14 Thread David Laight
From: Christoph Hellwig > Sent: 14 June 2019 14:47 > > Many architectures (e.g. arm, m68 and sh) have always used exact > allocation in their dma coherent allocator, which avoids a lot of > memory waste especially for larger allocations. Lift this behavior > into the generic allocator so that

Re: [PATCH 12/16] staging/comedi: mark as broken

2019-06-14 Thread Greg KH
On Fri, Jun 14, 2019 at 03:47:22PM +0200, Christoph Hellwig wrote: > comedi_buf.c abuse the DMA API in gravely broken ways, as it assumes it > can call virt_to_page on the result, and the just remap it as uncached > using vmap. Disable the driver until this API abuse has been fixed. > >

[PATCH 13/16] mm: rename alloc_pages_exact_nid to alloc_pages_exact_node

2019-06-14 Thread Christoph Hellwig
This fits in with the naming scheme used by alloc_pages_node. Signed-off-by: Christoph Hellwig --- include/linux/gfp.h | 2 +- mm/page_alloc.c | 4 ++-- mm/page_ext.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index

[PATCH 16/16] dma-mapping: use exact allocation in dma_alloc_contiguous

2019-06-14 Thread Christoph Hellwig
Many architectures (e.g. arm, m68 and sh) have always used exact allocation in their dma coherent allocator, which avoids a lot of memory waste especially for larger allocations. Lift this behavior into the generic allocator so that dma-direct and the generic IOMMU code benefit from this behavior

[PATCH 14/16] mm: use alloc_pages_exact_node to implement alloc_pages_exact

2019-06-14 Thread Christoph Hellwig
No need to duplicate the logic over two functions that are almost the same. Signed-off-by: Christoph Hellwig --- include/linux/gfp.h | 5 +++-- mm/page_alloc.c | 39 +++ 2 files changed, 10 insertions(+), 34 deletions(-) diff --git a/include/linux/gfp.h

[PATCH 15/16] dma-mapping: clear __GFP_COMP in dma_alloc_attrs

2019-06-14 Thread Christoph Hellwig
Lift the code to clear __GFP_COMP from arm into the common DMA allocator path. For one this fixes the various other patches that call alloc_pages_exact or split_page in case a bogus driver passes the argument, and it also prepares for doing exact allocation in the generic dma-direct allocator.

[PATCH 12/16] staging/comedi: mark as broken

2019-06-14 Thread Christoph Hellwig
comedi_buf.c abuse the DMA API in gravely broken ways, as it assumes it can call virt_to_page on the result, and the just remap it as uncached using vmap. Disable the driver until this API abuse has been fixed. Signed-off-by: Christoph Hellwig --- drivers/staging/comedi/Kconfig | 1 + 1 file

[PATCH 11/16] s390/ism: stop passing bogus gfp flags arguments to dma_alloc_coherent

2019-06-14 Thread Christoph Hellwig
dma_alloc_coherent is not just the page allocator. The only valid arguments to pass are either GFP_ATOMIC or GFP_ATOMIC with possible modifiers of __GFP_NORETRY or __GFP_NOWARN. Signed-off-by: Christoph Hellwig --- drivers/s390/net/ism_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH 10/16] iwlwifi: stop passing bogus gfp flags arguments to dma_alloc_coherent

2019-06-14 Thread Christoph Hellwig
dma_alloc_coherent is not just the page allocator. The only valid arguments to pass are either GFP_ATOMIC or GFP_ATOMIC with possible modifiers of __GFP_NORETRY or __GFP_NOWARN. Signed-off-by: Christoph Hellwig --- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 3 +--

[PATCH 09/16] cnic: stop passing bogus gfp flags arguments to dma_alloc_coherent

2019-06-14 Thread Christoph Hellwig
dma_alloc_coherent is not just the page allocator. The only valid arguments to pass are either GFP_ATOMIC or GFP_ATOMIC with possible modifiers of __GFP_NORETRY or __GFP_NOWARN. Signed-off-by: Christoph Hellwig --- drivers/net/ethernet/broadcom/cnic.c | 4 ++-- 1 file changed, 2 insertions(+),

[PATCH 07/16] IB/hfi1: stop passing bogus gfp flags arguments to dma_alloc_coherent

2019-06-14 Thread Christoph Hellwig
dma_alloc_coherent is not just the page allocator. The only valid arguments to pass are either GFP_ATOMIC or GFP_ATOMIC with possible modifiers of __GFP_NORETRY or __GFP_NOWARN. Signed-off-by: Christoph Hellwig --- drivers/infiniband/hw/hfi1/init.c | 22 +++--- 1 file changed,

[PATCH 04/16] drm: move drm_pci_{alloc,free} to drm_legacy

2019-06-14 Thread Christoph Hellwig
These functions are rather broken in that they try to pass __GFP_COMP to dma_alloc_coherent, call virt_to_page on the return value and mess with PageReserved. And not actually used by any modern driver. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/drm_bufs.c | 85

[PATCH 08/16] IB/qib: stop passing bogus gfp flags arguments to dma_alloc_coherent

2019-06-14 Thread Christoph Hellwig
dma_alloc_coherent is not just the page allocator. The only valid arguments to pass are either GFP_ATOMIC or GFP_ATOMIC with possible modifiers of __GFP_NORETRY or __GFP_NOWARN. Signed-off-by: Christoph Hellwig --- drivers/infiniband/hw/qib/qib_iba6120.c | 2 +-

[PATCH 05/16] drm: don't mark pages returned from drm_pci_alloc reserved

2019-06-14 Thread Christoph Hellwig
We are not allowed to call virt_to_page on pages returned from dma_alloc_coherent, as in many cases the virtual address returned is aactually a kernel direct mapping. Also there generally is no need to mark dma memory as reserved. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/drm_bufs.c

[PATCH 06/16] drm: don't pass __GFP_COMP to dma_alloc_coherent in drm_pci_alloc

2019-06-14 Thread Christoph Hellwig
The memory returned from dma_alloc_coherent is opaqueue to the user, thus the exact way of page refcounting shall not matter either. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/drm_bufs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_bufs.c

[PATCH 03/16] drm/i915: stop using drm_pci_alloc

2019-06-14 Thread Christoph Hellwig
Remove usage of the legacy drm PCI DMA wrappers, and with that the incorrect usage cocktail of __GFP_COMP, virt_to_page on DMA allocation and SetPageReserved. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/i915_gem.c| 30 +-

[PATCH 02/16] drm/ati_pcigart: stop using drm_pci_alloc

2019-06-14 Thread Christoph Hellwig
Remove usage of the legacy drm PCI DMA wrappers, and with that the incorrect usage cocktail of __GFP_COMP, virt_to_page on DMA allocation and SetPageReserved. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/ati_pcigart.c | 27 +++ include/drm/ati_pcigart.h | 5

[PATCH 01/16] media: videobuf-dma-contig: use dma_mmap_coherent

2019-06-14 Thread Christoph Hellwig
dma_alloc_coherent does not return a physical address, but a DMA address, which might be remapped or have an offset. Passing this DMA address to vm_iomap_memory is completely bogus. Use the proper dma_mmap_coherent helper instead, and stop passing __GFP_COMP to dma_alloc_coherent, as the memory

use exact allocation for dma coherent memory

2019-06-14 Thread Christoph Hellwig
Hi all, various architectures have used exact memory allocations for dma allocations for a long time, but x86 and thus the common code based on it kept using our normal power of two allocator, which tends to waste a lot of memory for certain allocations. Switching to a slightly cleaned up

Re: [PATCH v8 23/29] vfio: VFIO_IOMMU_CACHE_INVALIDATE

2019-06-14 Thread Auger Eric
Hi Liu, On 6/14/19 2:38 PM, Liu, Yi L wrote: > Hi Eric, > >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: Monday, May 27, 2019 12:10 AM >> Subject: [PATCH v8 23/29] vfio: VFIO_IOMMU_CACHE_INVALIDATE >> >> From: "Liu, Yi L" >> >> When the guest "owns" the stage 1 translation

Re: status of the calgary iommu driver

2019-06-14 Thread Christoph Hellwig
On Wed, May 08, 2019 at 06:56:46PM +0100, Jon Mason wrote: > I do have a system. So, it could be tested. However given the age of > the HW, I would say it is not worth the effort to update and it would > be best to remove it from the kernel. > > I can send a patch to do this, unless you would

RE: [PATCH v8 23/29] vfio: VFIO_IOMMU_CACHE_INVALIDATE

2019-06-14 Thread Liu, Yi L
Hi Eric, > From: Eric Auger [mailto:eric.au...@redhat.com] > Sent: Monday, May 27, 2019 12:10 AM > Subject: [PATCH v8 23/29] vfio: VFIO_IOMMU_CACHE_INVALIDATE > > From: "Liu, Yi L" > > When the guest "owns" the stage 1 translation structures, the host IOMMU > driver > has no knowledge of

Re: [PATCH] dma-remap: Avoid de-referencing NULL atomic_pool

2019-06-14 Thread Christoph Hellwig
Thanks, applied to the dma-mapping for-next branch. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH] iommu/dma: Apply dma_{alloc,free}_contiguous functions

2019-06-14 Thread Christoph Hellwig
On Fri, Jun 14, 2019 at 11:42:54AM +0100, Robin Murphy wrote: > On 06/06/2019 07:28, Christoph Hellwig wrote: >> Looks fine to me. Robin, any comments? > > AFAICS this looks like the obvious conversion, so... no? :) Yep. Just want to make sure I don't apply dma-iommu patches without your

Re: [PATCH] iommu/dma: Apply dma_{alloc,free}_contiguous functions

2019-06-14 Thread Christoph Hellwig
Thanks, applied to the dma-mapping for-next branch.

Re: [RFC] switch nds32 to use the generic remapping DMA allocator

2019-06-14 Thread Christoph Hellwig
On Fri, Jun 14, 2019 at 07:35:29PM +0800, Greentime Hu wrote: > It looks good to me. I just verified in nds32 platform and it works fine. > Should I put it in my next-tree or you will pick it up in your tree? :) Either way works for me, let me know what you prefer.

Re: [RFC] switch nds32 to use the generic remapping DMA allocator

2019-06-14 Thread Greentime Hu
Christoph Hellwig 於 2019年6月14日 週五 下午6:09寫道: > > Hi Greentime and Vicent, > > can you take a look at the (untested) patch below? It converts nds32 > to use the generic remapping DMA allocator, which is also used by > arm64 and csky. Hi Christoph, It looks good to me. I just verified in nds32

Re: [PATCH] iommu/dma: Apply dma_{alloc,free}_contiguous functions

2019-06-14 Thread Robin Murphy
On 06/06/2019 07:28, Christoph Hellwig wrote: Looks fine to me. Robin, any comments? AFAICS this looks like the obvious conversion, so... no? :) On Mon, Jun 03, 2019 at 03:52:59PM -0700, Nicolin Chen wrote: This patch replaces dma_{alloc,release}_from_contiguous() with

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

2019-06-14 Thread Wolfram Sang
> > + host->can_merge = 1; > > + else > > + host->can_merge = 0; > > + > > can_merge seems a little too generic a name to me. Maybe can_iommu_merge? Ack. signature.asc Description: PGP signature

[PATCH 2/2] m68k: implement arch_dma_prep_coherent

2019-06-14 Thread Christoph Hellwig
When we remap memory as non-cached to be used as a DMA coherent buffer we should writeback all cache and invalidate the cache lines so that we make sure we have a clean slate. Implement this using the cache_push() helper. Signed-off-by: Christoph Hellwig --- arch/m68k/Kconfig | 1 +

[PATCH 1/2] m68k: use the generic dma coherent remap allocator

2019-06-14 Thread Christoph Hellwig
This switche to using common code for the DMA allocations, including potential use of the CMA allocator if configure. Also add a comment where the existing behavior seems to be lacking. Signed-off-by: Christoph Hellwig --- arch/m68k/Kconfig | 2 ++ arch/m68k/kernel/dma.c | 59

[RFC] switch m68k to use the generic remapping DMA allocator

2019-06-14 Thread Christoph Hellwig
Hi Geert and Greg, can you take a look at the (untested) patches below? They convert m68k to use the generic remapping DMA allocator, which is also used by arm64 and csky. ___ iommu mailing list iommu@lists.linux-foundation.org

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

2019-06-14 Thread Rafael J. Wysocki
On Fri, Jun 14, 2019 at 11:39 AM Thierry Reding wrote: > > On Fri, Jun 14, 2019 at 11:10:58AM +0200, Greg Kroah-Hartman wrote: > > On Thu, Jun 13, 2019 at 07:00:11PM +0200, Thierry Reding wrote: > > > From: Thierry Reding > > > [cut] > > To avoid further back and forth, what exactly is it that

[PATCH] nds32: use the generic remapping allocator for coherent DMA allocations

2019-06-14 Thread Christoph Hellwig
Replace the code that sets up uncached PTEs with the generic vmap based remapping code. It also provides an atomic pool for allocations from non-blocking context, which we not properly supported by the existing nds32 code. Signed-off-by: Christoph Hellwig --- arch/nds32/Kconfig | 2 +

[RFC] switch nds32 to use the generic remapping DMA allocator

2019-06-14 Thread Christoph Hellwig
Hi Greentime and Vicent, can you take a look at the (untested) patch below? It converts nds32 to use the generic remapping DMA allocator, which is also used by arm64 and csky.

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

2019-06-14 Thread Robin Murphy
On 13/06/2019 11:20, Yoshihiro Shimoda wrote: 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

Re: [PATCH 2/2] swiotlb: Return consistent SWIOTLB segments/nr_tbl

2019-06-14 Thread Christoph Hellwig
On Tue, Jun 11, 2019 at 10:58:25AM -0700, Florian Fainelli wrote: > With a specifically contrived memory layout where there is no physical > memory available to the kernel below the 4GB boundary, we will fail to > perform the initial swiotlb_init() call and set no_iotlb_memory to true. > > There

Re: [PATCH 1/2] swiotlb: Group identical cleanup in swiotlb_cleanup()

2019-06-14 Thread Christoph Hellwig
On Tue, Jun 11, 2019 at 10:58:24AM -0700, Florian Fainelli wrote: > Avoid repeating the zeroing of global swiotlb variables in two locations > and introduce swiotlb_cleanup() to do that. > > Signed-off-by: Florian Fainelli Looks good, Reviewed-by: Christoph Hellwig

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

2019-06-14 Thread Robin Murphy
On 13/06/2019 11:20, 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. Heh, seeing this gave me a genuine déjà vu moment... ...but it turns out I actually *have* reviewed this patch

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

2019-06-14 Thread Thierry Reding
On Fri, Jun 14, 2019 at 11:10:58AM +0200, Greg Kroah-Hartman wrote: > On Thu, Jun 13, 2019 at 07:00:11PM +0200, 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

[git pull] IOMMU Fixes for Linux v5.2-rc4

2019-06-14 Thread Joerg Roedel
Hi Linus, The following changes since commit cd6c84d8f0cdc911df435bb075ba22ce3c605b07: Linux 5.2-rc2 (2019-05-26 16:49:19 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v5.2-rc4 for you to fetch changes up to

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

2019-06-14 Thread Vivek Gautam
On 6/14/2019 9:35 AM, Bjorn Andersson wrote: 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

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

2019-06-14 Thread Greg Kroah-Hartman
On Thu, Jun 13, 2019 at 07:00:11PM +0200, 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. > >

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

2019-06-14 Thread Rafael J. Wysocki
On Thu, Jun 13, 2019 at 7:00 PM 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

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

2019-06-14 Thread Vivek Gautam
On 6/14/2019 9:36 AM, Bjorn Andersson wrote: 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

Re: [PATCH 1/2] dma-mapping: truncate dma masks to what dma_addr_t can hold

2019-06-14 Thread Christoph Hellwig
If I don't hear anything back in the next days I will just merge these patches, please comment. On Wed, May 29, 2019 at 02:22:19PM +0200, Christoph Hellwig wrote: > Russell, > > any additional comments on this series? > > On Tue, May 21, 2019 at 03:15:03PM +0200, Christoph Hellwig wrote: > > On

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

2019-06-14 Thread Auger Eric
Hi jean, On 5/30/19 7:09 PM, Jean-Philippe Brucker wrote: > The virtio IOMMU is a para-virtualized device, allowing to send IOMMU > requests such as map/unmap over virtio transport without emulating page > tables. This implementation handles ATTACH, DETACH, MAP and UNMAP > requests. > > The bulk

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

2019-06-14 Thread Geert Uytterhoeven
Hi Christoph, On Fri, Jun 14, 2019 at 9:18 AM Christoph Hellwig wrote: > On Thu, Jun 13, 2019 at 10:35:44PM +0200, Geert Uytterhoeven wrote: > > I'm always triggered by the use of min_t() and other casts: > > mmc->max_blk_size and mmc->max_blk_count are both unsigned int. > >

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

2019-06-14 Thread Christoph Hellwig
On Thu, Jun 13, 2019 at 07:20:15PM +0900, Yoshihiro Shimoda wrote: > +static unsigned int mmc_get_max_segments(struct mmc_host *host) > +{ > + return host->can_merge ? BLK_MAX_SEGMENTS : host->max_segs; > +} Note that BLK_MAX_SEGMENTS is really a little misnamed, it just is a

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

2019-06-14 Thread Christoph Hellwig
I'm a little worried about this directly calling into the iommu API instead of going through the DMA mapping code. We still have plenty of iommus not using the iommu layer for DMA mapping. But at least this code is in the block layer and not the driver, so maybe we can live with it.

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

2019-06-14 Thread Christoph Hellwig
On Thu, Jun 13, 2019 at 10:35:44PM +0200, Geert Uytterhoeven wrote: > I'm always triggered by the use of min_t() and other casts: > mmc->max_blk_size and mmc->max_blk_count are both unsigned int. > dma_max_mapping_size() returns size_t, which can be 64-bit. > > 1) Can the multiplication

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

2019-06-14 Thread Christoph Hellwig
On Thu, Jun 13, 2019 at 09:37:59PM +0200, Wolfram Sang wrote: > What about making this a 'static inline' in the iommu header file? I'd > think it is simple enough and would save us the EXPORT symbol. Agreed, this seems simple enought for an inline.

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

2019-06-14 Thread Christoph Hellwig
Thomas Gleixner is doing automated SPDX conversion that directly got to Linux at the moment. I'd avoid doing more manual ones for now as it will just create conflicts.

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

2019-06-14 Thread h...@lst.de
On Fri, Jun 14, 2019 at 06:11:00AM +, Tan, Ley Foon wrote: > On Fri, 2019-06-14 at 07:44 +0200, Christoph Hellwig wrote: > > 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.gi

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

2019-06-14 Thread Krzysztof Kozlowski
On Thu, 13 Jun 2019 at 18:27, Yangtao Li wrote: > > 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(-) Splitting this per driver is too much... it is not necessary. Such

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

2019-06-14 Thread Tan, Ley Foon
On Fri, 2019-06-14 at 07:44 +0200, Christoph Hellwig wrote: > 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.gi > > t/sh > > ortlog/refs/heads/for-next > > > > [PATCH 1/2] nios2: use the