Commit b316e4d7 authored by Federico Vaga's avatar Federico Vaga

drv: always mask segment_size

The max_segment_size must be a multiple of PAGE_SIZE. So mask it with
PAGE_MASK to avoid problems.
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 095365df
......@@ -397,11 +397,11 @@ static int zfad_dma_prep_slave_sg(struct dma_chan *dchan,
max_segment_size = min(zfad_block->block->datalen + PAGE_SIZE, /* PAGE aligned */
(size_t)dma_get_max_seg_size(dchan->device->dev));
max_segment_size &= PAGE_MASK; /* to make alloc_table happy */
/* Find something that fits in the [SW-]IOMMU */
do {
dev_dbg(&fa->pdev->dev, "DMA max segment %ld\n",
max_segment_size);
max_segment_size &= PAGE_MASK; /* to make alloc_table happy */
err = fa->sg_alloc_table_from_pages(&zfad_block->sgt, pages,
nr_pages,
offset_in_page(zfad_block->block->data),
......
Markdown is supported
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