Revert "Revert "driver core: add a min_align_mask field to struct device_dma_parameters""
This reverts commit 0ddd59c5da
.
Bring back the commit in 5.10.35 that broke the kabi.
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iec8941b9cb1766c585a9b0ddb5bf55051235d5e1
This commit is contained in:

committed by
Todd Kjos

parent
4d55905007
commit
20fa297001
@@ -291,6 +291,7 @@ struct device_dma_parameters {
|
|||||||
* sg limitations.
|
* sg limitations.
|
||||||
*/
|
*/
|
||||||
unsigned int max_segment_size;
|
unsigned int max_segment_size;
|
||||||
|
unsigned int min_align_mask;
|
||||||
unsigned long segment_boundary_mask;
|
unsigned long segment_boundary_mask;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -517,6 +517,22 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline unsigned int dma_get_min_align_mask(struct device *dev)
|
||||||
|
{
|
||||||
|
if (dev->dma_parms)
|
||||||
|
return dev->dma_parms->min_align_mask;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int dma_set_min_align_mask(struct device *dev,
|
||||||
|
unsigned int min_align_mask)
|
||||||
|
{
|
||||||
|
if (WARN_ON_ONCE(!dev->dma_parms))
|
||||||
|
return -EIO;
|
||||||
|
dev->dma_parms->min_align_mask = min_align_mask;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int dma_get_cache_alignment(void)
|
static inline int dma_get_cache_alignment(void)
|
||||||
{
|
{
|
||||||
#ifdef ARCH_DMA_MINALIGN
|
#ifdef ARCH_DMA_MINALIGN
|
||||||
|
Reference in New Issue
Block a user