All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ronny.Hegewald@online.de
To: konrad.wilk@oracle.com
Cc: xen-devel@lists.xensource.com
Subject: Re: pvops dom0: no sound after boot; possibly causedby swiotlb
Date: Mon, 01 Feb 2010 21:54:02 +0100	[thread overview]
Message-ID: <5670117.3805321265057642467.JavaMail.servlet@kundenserver> (raw)

>Well, since you are volunteering. The problem sounds like the sound card
>allocates a buffer from the region above 4GB and tries to DMA to it.
>Keep in mind that on most machines, when you have 4GB, 768 MB of it are 
>offset
>past the 4GB mark. You have these two mega regions: 0-3.3GB, 4GB-4.7GB,
>the 3.3GB to 4GB is called the PCI hole.

I added some log-messages in the sound-driver and indeed, it allocates memory from above 4GB.

On bare metal and with dom0 based on the forward-ported xen-patches from gentoo the dma-memory is allocated in the 4GB range.

When i checked the dma-memory allocation in the driver i noticed that depending if the sound-card reports that it is 64bit-compatible the driver sets the dma_mask to 64, else to 32 (by calling pci_set_consistent_dma_mask).

So i changed the driver that it always sets the dma-mask to 32 - and the sound worked without the need to start a domU. 

Which left the question why it didnt worked out of the box on pvops-dom0.

So i followed the code for the dma-allocation from the sound-driver and found the problem in the xen-swiotlb code in arch/x86/xen/pci-swiotlb.

Bare metal and the forward-ported dom0 both call dma_alloc_coherent_mask if they try to allocate coherent dma-memory - pvops dom0 doesnt. This call sets the DMA-mask to 24 bit when __GFP_DMA is set, else to 32-bit. 

I guess this is the right fix for pvops-dom0 too? I will sent a proper patch for that soon.

             reply	other threads:[~2010-02-01 20:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-01 20:54 Ronny.Hegewald [this message]
2010-02-01 21:52 ` pvops dom0: no sound after boot; possibly causedby swiotlb Konrad Rzeszutek Wilk
  -- strict thread matches above, loose matches on Subject: below --
2010-02-04  0:55 Ronny.Hegewald
2010-02-05 16:24 ` Konrad Rzeszutek Wilk
2010-01-26 19:27 Ronny.Hegewald

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=5670117.3805321265057642467.JavaMail.servlet@kundenserver \
    --to=ronny.hegewald@online.de \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.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.