linux/drivers
Ronny Hegewald b5031ed1be xen: Use correct masking in xen_swiotlb_alloc_coherent.
When running 32-bit pvops-dom0 and a driver tries to allocate a coherent
DMA-memory the xen swiotlb-implementation returned memory beyond 4GB.

The underlaying reason is that if the supplied driver passes in a
DMA_BIT_MASK(64) ( hwdev->coherent_dma_mask is set to 0xffffffffffffffff)
our dma_mask will be u64 set to 0xffffffffffffffff even if we set it to
DMA_BIT_MASK(32) previously. Meaning we do not reset the upper bits.
By using the dma_alloc_coherent_mask function - it does the proper casting
and we get 0xfffffffff.

This caused 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
dma_alloc_coherent_mask.

This patch adds the same functionality to xen swiotlb and is a rebase of the
original patch from Ronny Hegewald which never got upstream b/c the
underlaying reason was not understood until now.

The original email with the original patch is in:
http://old-list-archives.xen.org/archives/html/xen-devel/2010-02/msg00038.html
the original thread from where the discussion started is in:
http://old-list-archives.xen.org/archives/html/xen-devel/2010-01/msg00928.html

Signed-off-by: Ronny Hegewald <ronny.hegewald@online.de>
Signed-off-by: Stefano Panella <stefano.panella@citrix.com>
Acked-By: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: stable@vger.kernel.org
2012-09-05 10:50:27 -04:00
..
accessibility
acpi Merge branch 'master' [vanilla Linus master] into libata-dev.git/upstream 2012-07-25 15:58:48 -04:00
amba
ata [libata] pata_cmd64x: whitespace cleanup 2012-07-25 16:07:40 -04:00
atm
auxdisplay
base Driver core merge for 3.6-rc1 2012-07-26 11:25:33 -07:00
bcma bcma: fix invalid PMU chip control masks 2012-07-26 12:46:54 -07:00
block Power management updates for 3.6 2012-07-22 13:36:52 -07:00
bluetooth Bluetooth: Introduce a flags variable to Three-wire UART state 2012-07-17 14:49:24 -03:00
cdrom
char Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2012-07-26 13:00:59 -07:00
clk The common clk framework changes for 3.6 include a small number of core 2012-07-24 16:40:57 -07:00
clocksource arm-soc: new SoC support 2012-07-23 16:31:31 -07:00
connector drivers: connector: fixed coding style issues 2012-07-16 23:23:52 -07:00
cpufreq Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-07-24 13:34:56 -07:00
cpuidle Merge branch 'pm-domains' 2012-07-19 00:03:17 +02:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2012-07-26 13:00:59 -07:00
dca
devfreq
dio
dma Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-07-24 17:12:54 -07:00
edac
eisa
extcon extcon: MAX77693: Add extcon-max77693 driver to support Maxim MAX77693 MUIC device 2012-07-17 10:34:56 -07:00
firewire
firmware
gpio arm-soc: sparse IRQ conversion 2012-07-23 17:36:02 -07:00
gpu gma500,cdv: Fix the brightness base 2012-07-16 09:20:33 -07:00
hid Merge branch 'next' into for-linus 2012-07-24 22:43:04 -07:00
hsi
hv Drivers: hv: Change the hex constant to a decimal constant 2012-07-19 15:27:33 -07:00
hwmon Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-07-24 13:34:56 -07:00
hwspinlock
i2c i2c-omap: Add support for I2C_M_STOP message flag 2012-07-24 14:13:59 +02:00
ide
idle
ieee802154
iio iio: fix pointer cast warning 2012-07-15 17:33:17 +01:00
infiniband InfiniBand/RDMA changes for the 3.6 merge window: 2012-07-24 13:56:26 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2012-07-26 12:59:53 -07:00
iommu IOMMU Updates for Linux v3.6-rc1 2012-07-24 16:24:11 -07:00
isdn ISDN: Add check for usb_alloc_urb() result 2012-07-18 09:40:54 -07:00
leds
lguest
macintosh
md Three fixes for device-mapper discard processing: 2012-07-20 11:51:22 -07:00
media Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-07-24 13:34:56 -07:00
memory
memstick
message
mfd Linux 3.5-rc7 2012-07-15 21:49:21 +01:00
misc CHAR/MISC patches for 3.6-rc1 2012-07-26 12:15:41 -07:00
mmc Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-07-24 17:12:54 -07:00
mtd Change the default amount of eraseblocks which UBI reserves for bad block 2012-07-23 15:53:06 -07:00
net PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
nfc
nubus
of Devicetree updates for 3.6 2012-07-24 14:07:22 -07:00
oprofile
parisc PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
parport
pci PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
pcmcia
pinctrl Pin control changes for v3.6: 2012-07-24 14:05:46 -07:00
platform Power management updates for 3.6 2012-07-22 13:36:52 -07:00
pnp
power Driver core merge for 3.6-rc1 2012-07-26 11:25:33 -07:00
pps
ps3
ptp
rapidio
regulator SCSI misc on 20120724 2012-07-24 18:11:22 -07:00
remoteproc
rpmsg rpmsg: fix dependency on initialization order 2012-07-17 13:10:38 +03:00
rtc arm-soc: device tree description updates 2012-07-23 16:17:43 -07:00
s390 KVM updates for the 3.6 merge window 2012-07-24 12:01:20 -07:00
sbus
scsi Merge branch 'master' [vanilla Linus master] into libata-dev.git/upstream 2012-07-25 15:58:48 -04:00
sfi
sh Merge branch 'common/pinctrl' into sh-latest 2012-07-20 16:42:59 +09:00
sn
spi spi: Updates for 3.6 2012-07-26 12:57:41 -07:00
ssb
staging Staging tree patches for 3.6-rc1 2012-07-26 11:14:49 -07:00
target iscsi-target: Drop bogus struct file usage for iSCSI/SCTP 2012-07-21 02:44:13 -07:00
tc
thermal
tty Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-07-24 17:12:54 -07:00
uio
usb USB patches for 3.6-rc1 2012-07-26 10:23:47 -07:00
uwb
vhost vhost: make vhost work queue visible 2012-07-22 01:22:23 +03:00
video Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-07-24 13:34:56 -07:00
virt
virtio [SCSI] virtio-scsi: Add vdrv->scan for post VIRTIO_CONFIG_S_DRIVER_OK LUN scanning 2012-07-20 08:59:03 +01:00
vlynq
vme VME: Prevent D16 cycles being split into 8-bit blocks 2012-07-19 15:39:39 -07:00
w1 Driver core merge for 3.6-rc1 2012-07-26 11:25:33 -07:00
watchdog Merge git://www.linux-watchdog.org/linux-watchdog 2012-07-24 13:26:08 -07:00
xen xen: Use correct masking in xen_swiotlb_alloc_coherent. 2012-09-05 10:50:27 -04:00
zorro
Kconfig
Makefile