Skip to content
Commit 9a40401c authored by Jason Gunthorpe's avatar Jason Gunthorpe
Browse files

lib/scatterlist: Do not limit max_segment to PAGE_ALIGNED values



The main intention of the max_segment argument to
__sg_alloc_table_from_pages() is to match the DMA layer segment size set
by dma_set_max_seg_size().

Restricting the input to be page aligned makes it impossible to just
connect the DMA layer to this API.

The only reason for a page alignment here is because the algorithm will
overshoot the max_segment if it is not a multiple of PAGE_SIZE. Simply fix
the alignment before starting and don't expose this implementation detail
to the callers.

A future patch will completely remove SCATTERLIST_MAX_SEGMENT.

Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 16e7483e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment