Re: [RFC] weird semantics of SG_DXFER_TO_FROM_DEV in BLK_DEV_SKD (drivers/block/skd*)

From: Christoph Hellwig
Date: Thu Apr 07 2016 - 11:55:40 EST


On Tue, Apr 05, 2016 at 12:45:08AM +0100, Al Viro wrote:
> AFAICS, what we need there is simply
> nr_pages = iov_iter_npages(iter);
> alignment = iov_iter_alignment(iter);
> if (alignment & (queue_dma_alignment(q) | q->dma_pad_mask))
> copy = true;
> and I really wonder if we care about special-casing the situation when the
> ends are not aligned to queue_virt_boundary(q). If we don't, we might as
> well add queue_virt_boundary(q) to the mask we are checking. If we do,
> it's not hard to add a variant that would calculate both the alignment and
> alignment for internal boundaries...

I suspect this is the right thing to do. Care to send a patch to Jens?