archive mirror
 help / color / mirror / Atom feed
From: Stefano Panella <>
To: <>, <>,
Cc: Stefano Panella <>
Subject: [PATCH 1/1] XEN: Use correct masking in xen_swiotlb_alloc_coherent.
Date: Fri, 31 Aug 2012 10:57:52 +0100	[thread overview]
Message-ID: <> (raw)

When running 32-bit pvops-dom0 and a driver tries to allocate a coherent
DMA-memory the xen swiotlb-implementation returned memory beyond 4GB.

This caused for example not working sound on a system with 4 GB and a 64-bit
compatible sound-card with sets the DMA-mask to 64bit.

On bare-metal and the forward-ported xen-dom0 patches from OpenSuse a coherent
DMA-memory is always allocated inside the 32-bit address-range by calling

This patch adds the same functionality to xen swiotlb and is a rebase of the
original patch from Ronny Hegewald which never got upstream for some reason.

The original email with the original patch is in:

the original thread from where the deiscussion started is in:

Signed-off-by: Ronny Hegewald
Signed-off-by: Stefano Panella <>
 drivers/xen/swiotlb-xen.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 1afb4fb..4d51948 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -232,7 +232,7 @@ xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
 		return ret;
 	if (hwdev && hwdev->coherent_dma_mask)
-		dma_mask = hwdev->coherent_dma_mask;
+		dma_mask = dma_alloc_coherent_mask(hwdev, flags);
 	phys = virt_to_phys(ret);
 	dev_addr = xen_phys_to_bus(phys);

             reply	other threads:[~2012-08-31  9:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31  9:57 Stefano Panella [this message]
2012-08-31 12:47 ` [Xen-devel] [PATCH 1/1] XEN: Use correct masking in xen_swiotlb_alloc_coherent David Vrabel
2012-08-31 16:40   ` Konrad Rzeszutek Wilk
2012-09-04 14:07     ` Stefano Panella
2012-09-04 14:37       ` Konrad Rzeszutek Wilk
2012-09-04 14:55         ` David Vrabel
2012-09-04 15:12           ` Stefano Panella
2012-09-04 16:44             ` David Vrabel
2012-09-04 16:40               ` Konrad Rzeszutek Wilk
2012-09-05 13:13                 ` Stefano Panella
2012-09-05 14:33       ` Konrad Rzeszutek Wilk

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:

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

  git send-email \ \ \ \ \ \

* 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).