[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 2 Feb 2021 12:07:52 +0000
From: Robin Murphy <robin.murphy@....com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Jianxiong Gao <jxgao@...gle.com>
Cc: Keith Busch <kbusch@...nel.org>,
Erdem Aktas <erdemaktas@...gle.com>,
Marc Orr <marcorr@...gle.com>, Christoph Hellwig <hch@....de>,
m.szyprowski@...sung.com, gregkh@...uxfoundation.org,
Saravana Kannan <saravanak@...gle.com>,
heikki.krogerus@...ux.intel.com, rafael.j.wysocki@...el.com,
dan.j.williams@...el.com, bgolaszewski@...libre.com,
jroedel@...e.de, iommu@...ts.linux-foundation.org,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>, axboe@...com,
sagi@...mberg.me, linux-nvme@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 3/3] Adding device_dma_parameters->offset_preserve_mask
to NVMe driver.
On 2021-02-02 11:21, Andy Shevchenko wrote:
> On Mon, Feb 01, 2021 at 04:25:55PM -0800, Jianxiong Gao wrote:
>
>> + if (dma_set_min_align_mask(dev->dev, NVME_CTRL_PAGE_SIZE - 1))
>
> Side note: we have DMA_BIT_MASK(), please use it.
FWIW I'd actually disagree on that point. Conceptually, this is a very
different thing from dev->{coherent_}dma_mask. It does not need to
handle everything up to 2^64-1 correctly without overflow issues, and
data alignments typically *are* defined in terms of sizes rather than
numbers of bits.
In fact, it might be neat to just have callers pass a size directly to a
dma_set_min_align() interface which asserts that it is a power of two
and stores it as a mask internally.
Robin.
>
>> + dev_warn(dev->dev, "dma_set_min_align_mask failed to
>> set offset\n");
>
Powered by blists - more mailing lists