Skip to contentSkip to conversation

pvops dom0: no sound after boot; possibly causedby swiotlb

DISCUSSION [email protected] 2 participants 2 messages Feb 4, 2010 – Feb 5, 2010

lore
Share & tools
lore
#0 lore raw
Quoted 1 line

I am curious - if you dom0 is 64-bit, does the sound card work?

Yes with 64-bit pvops-dom0 the sound works fine without any patches.

Quoted 9 lines
Quoted 6 lines

Ooooh. I completly failed to notice that your dom0 was 32-bit.

But having that there would make the mask always be below 4GB, irregardless if the dom0 is 32 or 64-bit. Which is exactly what it does on bare-metal.

<sigh> That is actually incorrect. Looking at the dma_alloc_coherent_mask I missed the '!' and thought it would set it irregardless of what the previous value was. That is not the case.

No, your first statement was correct. It would always return the same mask for 32-bit and 64-bit, because of the 32-bitness of the return-variable 'dma_mask'.

So the following patch maybe would be more appropriate?

x86/xen/pci-swiotlb.c 2010-02-04 02:47:17.000000000 +0100 renamed from x86/xen/pci-swiotlb.c-org 2010-02-01 23:04:42.000000000 +0100 +4 -0
@@ -602,7 +602,11 @@ xen_swiotlb_alloc_coherent(struct device
        ret = (void *)vstart;
 
        if (hwdev != NULL && hwdev->coherent_dma_mask)
+#ifdef CONFIG_X86_32
+               mask = dma_alloc_coherent_mask(hwdev, flags);
+#else
                mask = hwdev->coherent_dma_mask;
+#endif
 
        else
                mask = DMA_BIT_MASK(32);
#1 lore raw
Quoted 3 lines

No, your first statement was correct. It would always return the same mask for 32-bit and 64-bit, because of the 32-bitness of the return-variable 'dma_mask'.

So the following patch maybe would be more appropriate?

I think it isn't neccessary. The 'dmal_alloc_coherent_mask' returns an unsigned long. On 32-bit 'unsigned long' is a 4-byte value, and on 64-bit that is 8-byte value. So I think your previous patch:
http://lists.xensource.com/archives/html/xen-devel/2010-02/msg00038.html
is correct as when it is compiled under 64-bit it would return a 64-bit value and when compiled under 32-bit, it would return a 32-bit value. This would mimick the behavior of upstream logic.