| Age | Commit message (Collapse) | Author |
|
commit 932e9dec380c67ec15ac3eb073bb55797d8b4801 upstream.
When running a 32bit kernel the hda_intel driver is still reporting
a 64bit dma_mask if the HW supports it.
From sound/pci/hda/hda_intel.c:
/* allow 64bit DMA address if supported by H/W */
if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))
pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64));
else {
pci_set_dma_mask(pci, DMA_BIT_MASK(32));
pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32));
}
which means when there is a call to dma_alloc_coherent from
snd_malloc_dev_pages a machine address bigger than 32bit can be returned.
This can be true in particular if running the 32bit kernel as a pv dom0
under the Xen Hypervisor or PAE on bare metal.
The problem is that when calling setup_bdle to program the BLE the
dma_addr_t returned from the dma_alloc_coherent is wrongly truncated
from snd_sgbuf_get_addr if running a 32bit kernel:
static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab,
size_t offset)
{
struct snd_sg_buf *sgbuf = dmab->private_data;
dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr;
addr &= PAGE_MASK;
return addr + offset % PAGE_SIZE;
}
where PAGE_MASK in a 32bit kernel is zeroing the upper 32bit af addr.
Without this patch the HW will fetch the 32bit truncated address,
which is not the one obtained from dma_alloc_coherent and will result
to a non working audio but can corrupt host memory at a random location.
The current patch apply to v3.13-rc3-74-g6c843f5
Signed-off-by: Stefano Panella <stefano.panella@citrix.com>
Reviewed-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|
Using SG-buffers with dma_alloc_coherent() is often very inefficient
on non-coherent architectures because a tracking record could be
allocated in addition for each dma_alloc_coherent() call.
Instead, simply disable SG-buffers but just allocate normal continuous
buffers on non-supported (currently all but x86) architectures.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
sound/core/memalloc.c
|
|
No longer used.
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Most hardwares have limited buffer-descriptor table length. This
also restricts the max buffer size of the sound driver.
For example, snd-hda-intel has 1MB buffer size limit, and this is
because it can have at most 256 BDL entries. For supporting larger
buffers, we need to allocate larger pages even for sg-buffers.
This patch changes the sgbuf allocation code to try to allocate
larger pages first. At each head of the allocated pages, the
number of allocated pages is stored in the lowest bits of the
corresponding entry of the table addr field. This change isn't
visible as long as the driver uses snd_sgbuf_get_addr() helper.
Also, the patch adds a new function, snd_pcm_sgbuf_get_chunk_size().
This returns the size of the chunk on continuous pages starting at
the given position offset. If the chunk reaches to a non-continuous
page, it returns the size to the boundary.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
Clean up SG-buffer helper functions and macros. Helpers take substream
as arguments now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Memalloc module,PCM Midlevel,CS46xx driver,EMU10K1/EMU10K2 driver
ALSA Core,YMFPCI driver,Sound Scape driver,ATIIXP driver
ATIIXP-modem driver,BT87x driver,ENS1370/1+ driver,ES1968 driver
Intel8x0 driver,Intel8x0-modem driver,VIA82xx driver,KORG1212 driver
MIXART driver,RME HDSP driver,RME9652 driver,Trident driver
Clean up DMA buffer allocation routines.
- snd_dma_alloc_pages*() take the device type and device pointer
directly as arguments. snd_dma_free_pages() takes only dma_buffer
instance.
- snd_dma_device struct is removed in each driver's instance (no longer
needed due to the change above).
- snd_malloc_pages_fallback() is removed since it's no longer used.
- The buffer reservation / preallocation in snd-page-alloc module is
performed only when the buffer id is given. Normal PCM buffers won't
be reserved any more (unless the driver specifies). The module keeps
the linked list of free-reserved buffers, instead of the whole buffers
Reservation is done via snd_dma_reserve_buf(), and retrieved via
snd_dma_get_reserved_buf()).
- Other misc clean-ups/fixes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
Memalloc module,PCM Midlevel,ALSA Core,CMI8330 driver,ES18xx driver
Sound Scape driver,AD1816A driver,AD1848 driver,CS4231 driver
ES1688 driver,GUS Library,Opti9xx drivers,SB16/AWE driver,SB8 driver
ALS4000 driver,AZT3328 driver,BT87x driver,CMIPCI driver,CS4281 driver
ENS1370/1+ driver,ES1938 driver,ES1968 driver,FM801 driver
Intel8x0 driver,Maestro3 driver,RME32 driver,RME96 driver
SonicVibes driver,VIA82xx driver,ALI5451 driver,CS46xx driver
EMU10K1/EMU10K2 driver,ICE1712 driver,ICE1724 driver,KORG1212 driver
MIXART driver,RME HDSP driver,RME9652 driver,Trident driver
YMFPCI driver,Sound Core PDAudioCF driver,USB generic driver
- clean up the DMA code again.
now only struct device pointer is handled for every BUS type.
the pointer must be given via the corresponding macro snd_dma_xxx_data().
- added the hack for dma_alloc_coherent() to accept dev = NULL for ISA
buffers.
- added the missing include files.
|
|
Memalloc module,ALSA Core
- fixed the lock up with SG-buffer handler.
- removed non-existing export symbol.
- clean up ifdefs.
|
|
Big DMA cleanup originated by Russell King <rmk+alsa@arm.linux.org.uk>
* Russel
- introduced 'struct device' support for 2.6 dma_alloc_coherent()
* Jaroslav
- removed all bus-specific allocation functions
- extended snd_dma_alloc_pages/snd_dma_free_pages to handle all bus types
- recoded all (or almost all) device drivers
- sgbuf functions are bus independent now
|
|
- documentation
- control API - added multi-elements to reduce memory usage
- improved preallocation of DMA buffers
- CS46xx driver - added support for secondary codec
- HDSP driver - big update
- firmware is loaded with hdsptool now
- pmac driver updates (fixed oops and beep stuff)
- VIA82xx driver updated
- ymfpci driver updated
- drivers updated to new PnP layer
- wavefront, ad1816a, cs423x, es18xx, interwave, opl3sa2, cmi8330
|
|
|
|
- created snd-page-alloc module
- moved all page allocation code there
- preserves preallocated DMA buffers for devices
- USB audio driver updated
- AC'97 - better modem initialization code
- timer API - enhanced (added pause and more event notifications)
- splitted ice1724 code from ice1712 to own module
- general
- timerstamp cleanups (timeval -> timespec)
- C99-like cleanups
- trident driver
- more workaround for wrong IRQ acks
- OSS sequencer emulation
- fixed OOPS (wrong free order)
- more compatible with level 1 of sequencer (/dev/sequencer)
- CS46xx driver updated
- intel8x0 driver updated
- emu10k1 driver updated
|