diff options
author | Robin Murphy <[email protected]> | 2015-11-06 16:32:51 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2015-11-06 17:50:42 -0800 |
commit | 002edb6f6f2a79bea50de11260ddc9572e6db731 (patch) | |
tree | 045566a75985092e4044a30b5b2363a6e7c92583 /lib/mpi/mpiutil.c | |
parent | 8639b46139b0e4ea3b1ab1c274e410ee327f1d89 (diff) |
dma-mapping: tidy up dma_parms default handling
Many DMA controllers and other devices set max_segment_size to
indicate their scatter-gather capability, but have no interest in
segment_boundary_mask. However, the existence of a dma_parms structure
precludes the use of any default value, leaving them as zeros (assuming
a properly kzalloc'ed structure). If a well-behaved IOMMU (or SWIOTLB)
then tries to respect this by ensuring a mapped segment does not cross
a zero-byte boundary, hilarity ensues.
Since zero is a nonsensical value for either parameter, treat it as an
indicator for "default", as might be expected. In the process, clean up
a bit by replacing the bare constants with slightly more meaningful
macros and removing the superfluous "else" statements.
[[email protected]: dma-mapping.h needs sizes.h for SZ_64K]
Signed-off-by: Robin Murphy <[email protected]>
Reviewed-by: Sumit Semwal <[email protected]>
Acked-by: Marek Szyprowski <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Sakari Ailus <[email protected]>
Cc: Russell King <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/mpi/mpiutil.c')
0 files changed, 0 insertions, 0 deletions