[PATCH 04/14] x86: use generic swiotlb_ops

2018-03-19 Thread Christoph Hellwig
The generic swiotlb dma ops were based on the x86 ones and provide equivalent functionality, so use them. Also fix the sta2x11 case. For that SOC the dma map ops need an additional physical to dma address translations. For swiotlb buffers that is done throught the phys_to_dma helper, but the sta

Re: [PATCH 04/14] x86: use generic swiotlb_ops

2018-03-15 Thread Thomas Gleixner
On Thu, 15 Mar 2018, Christoph Hellwig wrote: > On Thu, Mar 15, 2018 at 01:52:14PM +0100, Thomas Gleixner wrote: > > Yeah, I know that the standard defines it, but that doesn't mean it makes > > sense. At least not to me. > > It makes sense in that it logically is a boolean but we only want > to

Re: [PATCH 04/14] x86: use generic swiotlb_ops

2018-03-15 Thread Christoph Hellwig
On Thu, Mar 15, 2018 at 01:52:14PM +0100, Thomas Gleixner wrote: > Yeah, I know that the standard defines it, but that doesn't mean it makes > sense. At least not to me. It makes sense in that it logically is a boolean but we only want to allocate 1 bit for it, unlike the normal ABI allocations of

Re: [PATCH 04/14] x86: use generic swiotlb_ops

2018-03-15 Thread Thomas Gleixner
On Thu, 15 Mar 2018, Christoph Hellwig wrote: > On Thu, Mar 15, 2018 at 10:00:57AM +0100, Thomas Gleixner wrote: > > On Wed, 14 Mar 2018, Christoph Hellwig wrote: > > > #if defined(CONFIG_INTEL_IOMMU) || defined(CONFIG_AMD_IOMMU) > > > void *iommu; /* hook for IOMMU specific extension */ > > >

Re: [PATCH 04/14] x86: use generic swiotlb_ops

2018-03-15 Thread Christoph Hellwig
On Thu, Mar 15, 2018 at 10:00:57AM +0100, Thomas Gleixner wrote: > On Wed, 14 Mar 2018, Christoph Hellwig wrote: > > #if defined(CONFIG_INTEL_IOMMU) || defined(CONFIG_AMD_IOMMU) > > void *iommu; /* hook for IOMMU specific extension */ > > #endif > > +#ifdef CONFIG_STA2X11 > > + bool is_sta2

Re: [PATCH 04/14] x86: use generic swiotlb_ops

2018-03-15 Thread Thomas Gleixner
On Wed, 14 Mar 2018, Christoph Hellwig wrote: > #if defined(CONFIG_INTEL_IOMMU) || defined(CONFIG_AMD_IOMMU) > void *iommu; /* hook for IOMMU specific extension */ > #endif > +#ifdef CONFIG_STA2X11 > + bool is_sta2x11 : 1; Huch? Please use either bool or an unsigned int based bitfield.

[PATCH 04/14] x86: use generic swiotlb_ops

2018-03-14 Thread Christoph Hellwig
The generic swiotlb dma ops were based on the x86 ones and provide equivalent functionality, so use them. Also fix the sta2x11 case. For that SOC the dma map ops need an additional physical to dma address translations. For swiotlb buffers that is done throught the phys_to_dma helper, but the sta