<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/arch/ia64/hp, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/arch/ia64/hp?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/arch/ia64/hp?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2021-08-09T15:13:05Z</updated>
<entry>
<title>ia64/sba_iommu: return error code from sba_map_sg_attrs()</title>
<updated>2021-08-09T15:13:05Z</updated>
<author>
<name>Martin Oliveira</name>
<email>martin.oliveira@eideticom.com</email>
</author>
<published>2021-07-29T20:15:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=62af5ca50c29a9be266656dfb88db6d439d129a1'/>
<id>urn:sha1:62af5ca50c29a9be266656dfb88db6d439d129a1</id>
<content type='text'>
The .map_sg() op now expects an error code instead of zero on failure.

In the case of a dma_mapping_error() return -EIO as the actual cause
is opaque here.

sba_coalesce_chunks() may only presently fail if sba_alloc_range()
fails, which in turn only fails if the iommu is out of mapping
resources, hence a -ENOMEM is used in that case.

Signed-off-by: Martin Oliveira &lt;martin.oliveira@eideticom.com&gt;
Signed-off-by: Logan Gunthorpe &lt;logang@deltatee.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Niklas Schnelle &lt;schnelle@linux.ibm.com&gt;
Cc: Thomas Bogendoerfer &lt;tsbogend@alpha.franken.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-mapping: split &lt;linux/dma-mapping.h&gt;</title>
<updated>2020-10-06T05:07:03Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-09-22T13:31:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=0a0f0d8be76dcd4390ff538e7060fda34db79717'/>
<id>urn:sha1:0a0f0d8be76dcd4390ff538e7060fda34db79717</id>
<content type='text'>
Split out all the bits that are purely for dma_map_ops implementations
and related code into a new &lt;linux/dma-map-ops.h&gt; header so that they
don't get pulled into all the drivers.  That also means the architecture
specific &lt;asm/dma-mapping.h&gt; is not pulled in by &lt;linux/dma-mapping.h&gt;
any more, which leads to a missing includes that were pulled in by the
x86 or arm versions in a few not overly portable drivers.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-mapping: add a new dma_alloc_pages API</title>
<updated>2020-09-25T04:20:47Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-09-01T11:34:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=efa70f2fdc842e63a0a13223e0e83cedcc2117f1'/>
<id>urn:sha1:efa70f2fdc842e63a0a13223e0e83cedcc2117f1</id>
<content type='text'>
This API is the equivalent of alloc_pages, except that the returned memory
is guaranteed to be DMA addressable by the passed in device.  The
implementation will also be used to provide a more sensible replacement
for DMA_ATTR_NON_CONSISTENT flag.

Additionally dma_alloc_noncoherent is switched over to use dma_alloc_pages
as its backend.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Thomas Bogendoerfer &lt;tsbogend@alpha.franken.de&gt; (MIPS part)
</content>
</entry>
<entry>
<title>dma-mapping: introduce dma_get_seg_boundary_nr_pages()</title>
<updated>2020-09-03T16:12:15Z</updated>
<author>
<name>Nicolin Chen</name>
<email>nicoleotsuka@gmail.com</email>
</author>
<published>2020-09-01T22:16:45Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=1e9d90dbed120ec98517428ffff4dacd9797e39d'/>
<id>urn:sha1:1e9d90dbed120ec98517428ffff4dacd9797e39d</id>
<content type='text'>
We found that callers of dma_get_seg_boundary mostly do an ALIGN
with page mask and then do a page shift to get number of pages:
    ALIGN(boundary + 1, 1 &lt;&lt; shift) &gt;&gt; shift

However, the boundary might be as large as ULONG_MAX, which means
that a device has no specific boundary limit. So either "+ 1" or
passing it to ALIGN() would potentially overflow.

According to kernel defines:
    #define ALIGN_MASK(x, mask) (((x) + (mask)) &amp; ~(mask))
    #define ALIGN(x, a)	ALIGN_MASK(x, (typeof(x))(a) - 1)

We can simplify the logic here into a helper function doing:
  ALIGN(boundary + 1, 1 &lt;&lt; shift) &gt;&gt; shift
= ALIGN_MASK(b + 1, (1 &lt;&lt; s) - 1) &gt;&gt; s
= {[b + 1 + (1 &lt;&lt; s) - 1] &amp; ~[(1 &lt;&lt; s) - 1]} &gt;&gt; s
= [b + 1 + (1 &lt;&lt; s) - 1] &gt;&gt; s
= [b + (1 &lt;&lt; s)] &gt;&gt; s
= (b &gt;&gt; s) + 1

This patch introduces and applies dma_get_seg_boundary_nr_pages()
as an overflow-free helper for the dma_get_seg_boundary() callers
to get numbers of pages. It also takes care of the NULL dev case
for non-DMA API callers.

Suggested-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicolin Chen &lt;nicoleotsuka@gmail.com&gt;
Acked-by: Niklas Schnelle &lt;schnelle@linux.ibm.com&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt; (powerpc)
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>docs: fix references for DMA*.txt files</title>
<updated>2020-06-26T16:01:32Z</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab+huawei@kernel.org</email>
</author>
<published>2020-06-23T07:09:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=985098a05eee6bf5caca7e997e02a5b15242cfa0'/>
<id>urn:sha1:985098a05eee6bf5caca7e997e02a5b15242cfa0</id>
<content type='text'>
As we moved those files to core-api, fix references to point
to their newer locations.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
Link: https://lore.kernel.org/r/37b2fd159fbc7655dbf33b3eb1215396a25f6344.1592895969.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
<entry>
<title>Merge tag 'dma-mapping-5.4' of git://git.infradead.org/users/hch/dma-mapping</title>
<updated>2019-09-19T20:27:23Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2019-09-19T20:27:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=671df189537883f36cf9c7d4f9495bfac0f86627'/>
<id>urn:sha1:671df189537883f36cf9c7d4f9495bfac0f86627</id>
<content type='text'>
Pull dma-mapping updates from Christoph Hellwig:

 - add dma-mapping and block layer helpers to take care of IOMMU merging
   for mmc plus subsequent fixups (Yoshihiro Shimoda)

 - rework handling of the pgprot bits for remapping (me)

 - take care of the dma direct infrastructure for swiotlb-xen (me)

 - improve the dma noncoherent remapping infrastructure (me)

 - better defaults for -&gt;mmap, -&gt;get_sgtable and -&gt;get_required_mask
   (me)

 - cleanup mmaping of coherent DMA allocations (me)

 - various misc cleanups (Andy Shevchenko, me)

* tag 'dma-mapping-5.4' of git://git.infradead.org/users/hch/dma-mapping: (41 commits)
  mmc: renesas_sdhi_internal_dmac: Add MMC_CAP2_MERGE_CAPABLE
  mmc: queue: Fix bigger segments usage
  arm64: use asm-generic/dma-mapping.h
  swiotlb-xen: merge xen_unmap_single into xen_swiotlb_unmap_page
  swiotlb-xen: simplify cache maintainance
  swiotlb-xen: use the same foreign page check everywhere
  swiotlb-xen: remove xen_swiotlb_dma_mmap and xen_swiotlb_dma_get_sgtable
  xen: remove the exports for xen_{create,destroy}_contiguous_region
  xen/arm: remove xen_dma_ops
  xen/arm: simplify dma_cache_maint
  xen/arm: use dev_is_dma_coherent
  xen/arm: consolidate page-coherent.h
  xen/arm: use dma-noncoherent.h calls for xen-swiotlb cache maintainance
  arm: remove wrappers for the generic dma remap helpers
  dma-mapping: introduce a dma_common_find_pages helper
  dma-mapping: always use VM_DMA_COHERENT for generic DMA remap
  vmalloc: lift the arm flag for coherent mappings to common code
  dma-mapping: provide a better default -&gt;get_required_mask
  dma-mapping: remove the dma_declare_coherent_memory export
  remoteproc: don't allow modular build
  ...
</content>
</entry>
<entry>
<title>dma-mapping: explicitly wire up -&gt;mmap and -&gt;get_sgtable</title>
<updated>2019-09-04T09:13:18Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-08-06T12:01:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f9f3232a7d0ab73a33d11f4056c5823010f03d55'/>
<id>urn:sha1:f9f3232a7d0ab73a33d11f4056c5823010f03d55</id>
<content type='text'>
While the default -&gt;mmap and -&gt;get_sgtable implementations work for the
majority of our dma_map_ops impementations they are inherently safe
for others that don't use the page allocator or CMA and/or use their
own way of remapping not covered by the common code.  So remove the
defaults if these methods are not wired up, but instead wire up the
default implementations for all safe instances.

Fixes: e1c7e324539a ("dma-mapping: always provide the dma_map_ops based implementation")
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>ia64: remove support for machvecs</title>
<updated>2019-08-16T21:32:26Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-08-13T07:25:12Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=df41017eafd267c08acbfff99d34e4f96bbfbc92'/>
<id>urn:sha1:df41017eafd267c08acbfff99d34e4f96bbfbc92</id>
<content type='text'>
The only thing remaining of the machvecs is a few checks if we are
running on an SGI UV system.  Replace those with the existing
is_uv_system() check that has been rewritten to simply check the
OEM ID directly.

That leaves us with a generic kernel that is as fast as the previous
DIG/ZX1/UV kernels, but can support all hardware.  Support for UV
and the HP SBA IOMMU is now optional based on new config options.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Link: https://lkml.kernel.org/r/20190813072514.23299-27-hch@lst.de
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</content>
</entry>
<entry>
<title>ia64: rework iommu probing</title>
<updated>2019-08-16T18:33:57Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-08-13T07:25:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=974f83ec1e5afeeb4c9028feb74ffa4ee70e71b7'/>
<id>urn:sha1:974f83ec1e5afeeb4c9028feb74ffa4ee70e71b7</id>
<content type='text'>
ia64 currently organizes the iommu probing along machves, which isn't
very helpful.  Instead just try to probe for Intel IOMMUs in mem_init
as they are properly described in ACPI and if none was found initialize
the swiotlb buffer.  The HP SBA handling is then only done delayed when
the actual hardware is probed. Only in the case that we actually found
usable IOMMUs we then set up the DMA ops and free the not needed
swiotlb buffer.  This scheme gets rid of the need for the dma_init
machvec operation, and the dig_vtd machvec.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Link: https://lkml.kernel.org/r/20190813072514.23299-24-hch@lst.de
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</content>
</entry>
<entry>
<title>ia64: remove the zx1 swiotlb machvec</title>
<updated>2019-08-16T18:33:57Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-08-13T07:25:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=df43acac8e32e2ee51a1e9376993c5ac18598d92'/>
<id>urn:sha1:df43acac8e32e2ee51a1e9376993c5ac18598d92</id>
<content type='text'>
The aim of this machvec is to support devices with &lt; 32-bit dma
masks.  But given that ia64 only has a ZONE_DMA32 and not a ZONE_DMA
that isn't supported by swiotlb either.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Link: https://lkml.kernel.org/r/20190813072514.23299-21-hch@lst.de
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</content>
</entry>
</feed>
