From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC9292550A3; Tue, 2 Sep 2025 21:59:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756850381; cv=none; b=reXV5f+5OMjBuk5DqMxJehtewVbJ12SLVFwfxvywZhoSsB0BaMHPYlcM2pz0xdaQaLlPuHqQ2CN9XHYodMeG5duM894BmMpL1LQl3+CMRtE+ubmmLvu0LrJvMtE75Ok9YpbgVI7tpGWFno4Yh52TVykaPvCIScff47i4rmTj9wQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756850381; c=relaxed/simple; bh=zUOixGI5e23gDVx/zmq/5QWAYGpvZZ1gzj0irhRA2AU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VgbH5uDI/2QVhMi2LizJeLKPm+fa/+rummUVILiUu1HgZHWFI3zma08dYZ9uuLxno7yGg3aTPCBhP3TmYsIQmGpeT4aaFCdcW248LG8DYhjQiANP4BnXZNWqIT+oB+3Se5X466BoQsqrKcOEzk3yctzI5+BuFRy9CVfI/lCnUTw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t/Eu3Rve; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="t/Eu3Rve" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A15CEC4CEED; Tue, 2 Sep 2025 21:59:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756850381; bh=zUOixGI5e23gDVx/zmq/5QWAYGpvZZ1gzj0irhRA2AU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t/Eu3RveeWFJ7QPQZS0HMJnJ18RJisbVk4Pk4B2mkUogsXCsDnOh5nmkT6QJ4KkpV WAD5v3cszsJls2vJneW0RL/RKpho+ZzAZhFpATDVsn7wwLvJDFu6zSx6RUEKSctSsY MYZrvd5dFbrPEZmkILy8ZxDbNlA6Ej38GRHuRquE0I86IxDtV1kdU0Sm1EDnwtGqEF c1keYzFalxZPfGjORlUbEIAtFrtMdhOixv+lPDaKzXO5a+aOyNEdMKgtKZcG+wqmef IRgJjgP6zlr77O2RCDhrfy6xxK73ZGX0o3JyM4rB09vZuyTewz4+/r6JUDL31Kg2Mp O1zPH9rjxq5Aw== Date: Tue, 2 Sep 2025 15:59:37 -0600 From: Keith Busch To: Marek Szyprowski Cc: Leon Romanovsky , Leon Romanovsky , Jason Gunthorpe , Abdiel Janulgue , Alexander Potapenko , Alex Gaynor , Andrew Morton , Christoph Hellwig , Danilo Krummrich , iommu@lists.linux.dev, Jason Wang , Jens Axboe , Joerg Roedel , Jonathan Corbet , Juergen Gross , kasan-dev@googlegroups.com, linux-block@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nvme@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-trace-kernel@vger.kernel.org, Madhavan Srinivasan , Masami Hiramatsu , Michael Ellerman , "Michael S. Tsirkin" , Miguel Ojeda , Robin Murphy , rust-for-linux@vger.kernel.org, Sagi Grimberg , Stefano Stabellini , Steven Rostedt , virtualization@lists.linux.dev, Will Deacon , xen-devel@lists.xenproject.org Subject: Re: [PATCH v4 14/16] block-dma: migrate to dma_map_phys instead of map_page Message-ID: References: <22b824931bc8ba090979ab902e4c1c2ec8327b65.1755624249.git.leon@kernel.org> <2d8e67b2-4ab2-4c1f-9ef3-470810f99d07@samsung.com> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2d8e67b2-4ab2-4c1f-9ef3-470810f99d07@samsung.com> On Tue, Sep 02, 2025 at 10:49:48PM +0200, Marek Szyprowski wrote: > On 19.08.2025 19:36, Leon Romanovsky wrote: > > @@ -87,8 +87,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; > > I wonder where is the corresponding dma_unmap_page() call and its change > to dma_unmap_phys()... You can't do that in the generic layer, so it's up to the caller. The dma addrs that blk_dma_iter yield are used in a caller specific structure. For example, for NVMe, it goes into an NVMe PRP. The generic layer doesn't know what that is, so the driver has to provide the unmapping.