linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jens Axboe <axboe@kernel.dk>, Keith Busch <kbusch@kernel.org>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-nvme@lists.infradead.org
Subject: [PATCH 1/3] blk-mq-dma: migrate to dma_map_phys instead of map_page
Date: Fri, 17 Oct 2025 08:31:58 +0300	[thread overview]
Message-ID: <20251017-block-with-mmio-v1-1-3f486904db5e@nvidia.com> (raw)
In-Reply-To: <20251017-block-with-mmio-v1-0-3f486904db5e@nvidia.com>

From: Leon Romanovsky <leonro@nvidia.com>

After introduction of dma_map_phys(), there is no need to convert
from physical address to struct page in order to map page. So let's
use it directly.

Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 block/blk-mq-dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/blk-mq-dma.c b/block/blk-mq-dma.c
index 449950029872..4ba7b0323da4 100644
--- a/block/blk-mq-dma.c
+++ b/block/blk-mq-dma.c
@@ -93,8 +93,8 @@ static bool blk_dma_map_bus(struct blk_dma_iter *iter, struct phys_vec *vec)
 static bool blk_dma_map_direct(struct request *req, struct device *dma_dev,
 		struct blk_dma_iter *iter, struct phys_vec *vec)
 {
-	iter->addr = dma_map_page(dma_dev, phys_to_page(vec->paddr),
-			offset_in_page(vec->paddr), vec->len, rq_dma_dir(req));
+	iter->addr = dma_map_phys(dma_dev, vec->paddr, vec->len,
+			rq_dma_dir(req), 0);
 	if (dma_mapping_error(dma_dev, iter->addr)) {
 		iter->status = BLK_STS_RESOURCE;
 		return false;

-- 
2.51.0


  reply	other threads:[~2025-10-17  5:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17  5:31 [PATCH 0/3] block: Enable proper MMIO memory handling for P2P DMA Leon Romanovsky
2025-10-17  5:31 ` Leon Romanovsky [this message]
2025-10-17  6:18   ` [PATCH 1/3] blk-mq-dma: migrate to dma_map_phys instead of map_page Christoph Hellwig
2025-10-19 14:40     ` Leon Romanovsky
2025-10-17  5:31 ` [PATCH 2/3] nvme-pci: unmap MMIO pages with appropriate interface Leon Romanovsky
2025-10-17  6:20   ` Christoph Hellwig
2025-10-20  7:53     ` Leon Romanovsky
2025-10-17  5:32 ` [PATCH 3/3] block-dma: properly take MMIO path Leon Romanovsky
2025-10-17  6:25   ` Christoph Hellwig
2025-10-20  8:52     ` Leon Romanovsky
2025-10-20 12:30       ` Christoph Hellwig
2025-10-20 14:53         ` Leon Romanovsky
2025-10-20  8:56     ` Leon Romanovsky

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=20251017-block-with-mmio-v1-1-3f486904db5e@nvidia.com \
    --to=leon@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).