Re: [RFC][PATCH] dma-mapping: align default segment_boundary_mask with dma_mask

From: Nicolin Chen
Date: Mon Mar 16 2020 - 17:44:53 EST


Hi Christoph,

On Mon, Mar 16, 2020 at 01:48:50PM +0100, Christoph Hellwig wrote:
> On Fri, Mar 13, 2020 at 05:00:07PM -0700, Nicolin Chen wrote:
> > @@ -736,7 +736,7 @@ static inline unsigned long dma_get_seg_boundary(struct device *dev)
> > {
> > if (dev->dma_parms && dev->dma_parms->segment_boundary_mask)
> > return dev->dma_parms->segment_boundary_mask;
> > - return DMA_BIT_MASK(32);
> > + return (unsigned long)dma_get_mask(dev);
>
> Just thinking out loud after my reply - shouldn't we just return ULONG_MAX
> by default here to mark this as no limit?

Yea, ULONG_MAX (saying no limit) sounds good to me.