On Wed, Sep 21, 2022 at 04:28:32PM -0700, Bart Van Assche wrote: > Hi Jens, Christoph and Ming, > > As we know the Linux kernel block layer does not support DMA segment sizes > that are smaller than the page size. From block/blk-settings.c: > > void blk_queue_max_segment_size(struct request_queue *q, > unsigned int max_size) > { > if (max_size < PAGE_SIZE) { > max_size = PAGE_SIZE; > printk(KERN_INFO "%s: set to minimum %d\n", > __func__, max_size); > } > > /* see blk_queue_virt_boundary() for the explanation */ > WARN_ON_ONCE(q->limits.virt_boundary_mask); > > q->limits.max_segment_size = max_size; > } > > I have been asked to add support for DMA segment sizes that are smaller than > the page size to support a UFS controller with a maximum DMA segment size of > 4 KiB and a page size > 4 KiB (my understanding of the JEDEC UFS host > controller specification is that UFS host controllers should support a > maximum DMA segment size of 256 KiB). Does anyone want to comment on this > before I start working on a patch series? If the hardware's DMA segment is smaller than a page, why doesn't the driver just split a kernel's larger segment into whatever representation the hardware wants? We do that in nvme, at least.