On Thu, Jul 21, 2022 at 06:43:07PM +0100, Robert Beckett wrote: > + max_segment = dma_max_mapping_size(i915->drm.dev); > + max_segment = max_t(size_t, max_segment, PAGE_SIZE) >> PAGE_SHIFT; dma_max_mapping_size is always larger than PAGE_SIZE, so I don't think the max is needed. Otherwise this loks good: Reviewed-by: Christoph Hellwig <hch@xxxxxx>