Home
last modified time | relevance | path

Searched hist:"9 a40401c" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/lib/
H A Dscatterlist.c9a40401c Fri Oct 16 06:46:01 CDT 2020 Jason Gunthorpe <jgg@nvidia.com> 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: Jason Gunthorpe <jgg@nvidia.com>
9a40401c Fri Oct 16 06:46:01 CDT 2020 Jason Gunthorpe <jgg@nvidia.com> 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: Jason Gunthorpe <jgg@nvidia.com>