All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leonro@nvidia.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>, <iommu@lists.linux.dev>,
	Juergen Gross <jgross@suse.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v4 5/6] xen: swiotlb: Switch to physical address mapping callbacks
Date: Fri, 19 Sep 2025 18:17:23 +0300	[thread overview]
Message-ID: <20250919151723.GG10800@unreal> (raw)
In-Reply-To: <997c0122a24c355b4d7ee353902041a7617f4c9e.1758203802.git.leon@kernel.org>

On Thu, Sep 18, 2025 at 05:09:28PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
> 
> Combine resource and page mappings routines to one function
> and remove .map_resource/.unmap_resource callbacks completely.
> 
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> ---
>  drivers/xen/swiotlb-xen.c | 63 ++++++++++++++++++---------------------
>  1 file changed, 29 insertions(+), 34 deletions(-)

<...>

> +	if (attrs & DMA_ATTR_MMIO) {
> +		if (unlikely(!dma_capable(dev, phys, size, false))) {
> +			dev_err_once(
> +				dev,
> +				"DMA addr %pad+%zu overflow (mask %llx, bus limit %llx).\n",
> +				&dma_addr, size, *dev->dma_mask,
> +				dev->bus_dma_limit);
> +			WARN_ON_ONCE(1);
> +			return DMA_MAPPING_ERROR;
> +		}
> +		return phys;
> +	}

This need to be fixed by the following change (dma_addr->phys):

diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 48936179c940b..ccf25027bec19 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -215,8 +215,8 @@ static dma_addr_t xen_swiotlb_map_phys(struct device *dev, phys_addr_t phys,
                if (unlikely(!dma_capable(dev, phys, size, false))) {
                        dev_err_once(
                                dev,
-                               "DMA addr %pad+%zu overflow (mask %llx, bus limit %llx).\n",
-                               &dma_addr, size, *dev->dma_mask,
+                               "DMA addr %pa+%zu overflow (mask %llx, bus limit %llx).\n",
+                               &phys, size, *dev->dma_mask,
                                dev->bus_dma_limit);
                        WARN_ON_ONCE(1);
                        return DMA_MAPPING_ERROR;

Thanks


  reply	other threads:[~2025-09-19 15:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18 14:09 [PATCH v4 0/6] Preparation to .map_page and .unmap_page removal Leon Romanovsky
2025-09-18 14:09 ` [PATCH v4 1/6] dma-mapping: prepare dma_map_ops to conversion to physical address Leon Romanovsky
2025-09-18 14:09 ` [PATCH v4 2/6] dma-mapping: convert dummy ops to physical address mapping Leon Romanovsky
2025-09-18 14:09 ` [PATCH v4 3/6] ARM: dma-mapping: Reduce struct page exposure in arch_sync_dma*() Leon Romanovsky
2025-09-29 17:37   ` Jason Gunthorpe
2025-09-18 14:09 ` [PATCH v4 4/6] ARM: dma-mapping: Switch to physical address mapping callbacks Leon Romanovsky
2025-09-18 14:09 ` [PATCH v4 5/6] xen: swiotlb: " Leon Romanovsky
2025-09-19 15:17   ` Leon Romanovsky [this message]
2025-09-29 17:39   ` Jason Gunthorpe
2025-09-18 14:09 ` [PATCH v4 6/6] dma-mapping: remove unused mapping resource callbacks 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=20250919151723.GG10800@unreal \
    --to=leonro@nvidia.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=jgross@suse.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=m.szyprowski@samsung.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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.