All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jianxiong Gao <jxgao@google.com>
Cc: Keith Busch <kbusch@kernel.org>,
	Erdem Aktas <erdemaktas@google.com>,
	Marc Orr <marcorr@google.com>, Christoph Hellwig <hch@lst.de>,
	m.szyprowski@samsung.com, gregkh@linuxfoundation.org,
	Saravana Kannan <saravanak@google.com>,
	heikki.krogerus@linux.intel.com, rafael.j.wysocki@intel.com,
	dan.j.williams@intel.com, bgolaszewski@baylibre.com,
	jroedel@suse.de, iommu@lists.linux-foundation.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	axboe@fb.com, sagi@grimberg.me, linux-nvme@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 3/3] Adding device_dma_parameters->offset_preserve_mask to NVMe driver.
Date: Tue, 2 Feb 2021 12:07:52 +0000	[thread overview]
Message-ID: <a34328d1-3918-1eca-b632-57be6a40baee@arm.com> (raw)
In-Reply-To: <YBk1pUbQ/JZQ7WZe@smile.fi.intel.com>

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");
> 

WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jianxiong Gao <jxgao@google.com>
Cc: heikki.krogerus@linux.intel.com, sagi@grimberg.me,
	Saravana Kannan <saravanak@google.com>,
	bgolaszewski@baylibre.com, Marc Orr <marcorr@google.com>,
	gregkh@linuxfoundation.org, rafael.j.wysocki@intel.com,
	linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	axboe@fb.com, Erdem Aktas <erdemaktas@google.com>,
	iommu@lists.linux-foundation.org, jroedel@suse.de,
	Keith Busch <kbusch@kernel.org>,
	dan.j.williams@intel.com, Christoph Hellwig <hch@lst.de>,
	m.szyprowski@samsung.com
Subject: Re: [PATCH V2 3/3] Adding device_dma_parameters->offset_preserve_mask to NVMe driver.
Date: Tue, 2 Feb 2021 12:07:52 +0000	[thread overview]
Message-ID: <a34328d1-3918-1eca-b632-57be6a40baee@arm.com> (raw)
In-Reply-To: <YBk1pUbQ/JZQ7WZe@smile.fi.intel.com>

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");
> 

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jianxiong Gao <jxgao@google.com>
Cc: heikki.krogerus@linux.intel.com, sagi@grimberg.me,
	Saravana Kannan <saravanak@google.com>,
	bgolaszewski@baylibre.com, Marc Orr <marcorr@google.com>,
	gregkh@linuxfoundation.org, rafael.j.wysocki@intel.com,
	linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	axboe@fb.com, iommu@lists.linux-foundation.org, jroedel@suse.de,
	Keith Busch <kbusch@kernel.org>,
	dan.j.williams@intel.com, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH V2 3/3] Adding device_dma_parameters->offset_preserve_mask to NVMe driver.
Date: Tue, 2 Feb 2021 12:07:52 +0000	[thread overview]
Message-ID: <a34328d1-3918-1eca-b632-57be6a40baee@arm.com> (raw)
In-Reply-To: <YBk1pUbQ/JZQ7WZe@smile.fi.intel.com>

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");
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2021-02-02 12:10 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 18:30 [PATCH V2 0/3] SWIOTLB: Preserve swiotlb map offset when needed Jianxiong Gao
2021-02-01 18:30 ` Jianxiong Gao via iommu
2021-02-01 18:30 ` Jianxiong Gao
2021-02-01 18:30 ` [PATCH V2 1/3] Adding page_offset_mask to device_dma_parameters Jianxiong Gao
2021-02-01 18:30   ` Jianxiong Gao via iommu
2021-02-01 18:30   ` Jianxiong Gao
2021-02-01 18:30 ` [PATCH V2 2/3] Add swiotlb offset preserving mapping when dma_dma_parameters->page_offset_mask is non zero Jianxiong Gao
2021-02-01 18:30   ` Jianxiong Gao via iommu
2021-02-01 18:30   ` Jianxiong Gao
2021-02-01 18:30 ` [PATCH V2 3/3] Adding device_dma_parameters->offset_preserve_mask to NVMe driver Jianxiong Gao
2021-02-01 18:30   ` Jianxiong Gao via iommu
2021-02-01 18:30   ` Jianxiong Gao
2021-02-01 18:55   ` Andy Shevchenko
2021-02-01 18:55     ` Andy Shevchenko
2021-02-01 18:55     ` Andy Shevchenko
2021-02-01 19:35     ` Jianxiong Gao
2021-02-01 19:35       ` Jianxiong Gao via iommu
2021-02-01 19:35       ` Jianxiong Gao
2021-02-01 20:57   ` Keith Busch
2021-02-01 20:57     ` Keith Busch
2021-02-01 20:57     ` Keith Busch
2021-02-01 21:16     ` Jianxiong Gao via iommu
2021-02-01 21:22       ` Jianxiong Gao
2021-02-01 21:22         ` Jianxiong Gao via iommu
2021-02-01 21:22         ` Jianxiong Gao
2021-02-01 23:59         ` Chaitanya Kulkarni
2021-02-01 23:59           ` Chaitanya Kulkarni
2021-02-01 23:59           ` Chaitanya Kulkarni
2021-02-02  0:25         ` Jianxiong Gao
2021-02-02  0:25           ` Jianxiong Gao via iommu
2021-02-02  0:25           ` Jianxiong Gao
2021-02-02 11:21           ` Andy Shevchenko
2021-02-02 11:21             ` Andy Shevchenko
2021-02-02 11:21             ` Andy Shevchenko
2021-02-02 12:07             ` Robin Murphy [this message]
2021-02-02 12:07               ` Robin Murphy
2021-02-02 12:07               ` Robin Murphy
2021-02-03 13:37         ` Christoph Hellwig
2021-02-03 13:37           ` Christoph Hellwig
2021-02-03 13:37           ` Christoph Hellwig
2021-02-03 16:47           ` Jianxiong Gao
2021-02-03 16:47             ` Jianxiong Gao via iommu
2021-02-03 16:47             ` Jianxiong Gao
2021-02-02 11:53 ` [PATCH V2 0/3] SWIOTLB: Preserve swiotlb map offset when needed Greg KH
2021-02-02 11:53   ` Greg KH
2021-02-02 11:53   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a34328d1-3918-1eca-b632-57be6a40baee@arm.com \
    --to=robin.murphy@arm.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=axboe@fb.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=dan.j.williams@intel.com \
    --cc=erdemaktas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jroedel@suse.de \
    --cc=jxgao@google.com \
    --cc=kbusch@kernel.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=m.szyprowski@samsung.com \
    --cc=marcorr@google.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=sagi@grimberg.me \
    --cc=saravanak@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.