<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/sound/memalloc.h, branch v3.4.106</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.106</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.106'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-12-20T15:34:19Z</updated>
<entry>
<title>ALSA: memalloc.h - fix wrong truncation of dma_addr_t</title>
<updated>2013-12-20T15:34:19Z</updated>
<author>
<name>Stefano Panella</name>
<email>stefano.panella@citrix.com</email>
</author>
<published>2013-12-10T14:20:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=50a715f272de5c786e76607a3cd21489388c5a03'/>
<id>urn:sha1:50a715f272de5c786e76607a3cd21489388c5a03</id>
<content type='text'>
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 &amp; ICH6_GCAP_64OK) &amp;&amp; !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-&gt;private_data;
        dma_addr_t addr = sgbuf-&gt;table[offset &gt;&gt; PAGE_SHIFT].addr;
        addr &amp;= 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 &lt;stefano.panella@citrix.com&gt;
Reviewed-by: Frediano Ziglio &lt;frediano.ziglio@citrix.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ALSA: Fix SG-buffer DMA with non-coherent architectures</title>
<updated>2009-07-08T12:20:20Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2008-06-17T14:39:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cc6a8acdeee932f6911d8b236d2c7d6bcc4616f6'/>
<id>urn:sha1:cc6a8acdeee932f6911d8b236d2c7d6bcc4616f6</id>
<content type='text'>
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 &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6</title>
<updated>2008-10-11T19:39:35Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2008-10-11T19:39:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=56c5d900dbb8e042bfad035d18433476931d8f93'/>
<id>urn:sha1:56c5d900dbb8e042bfad035d18433476931d8f93</id>
<content type='text'>
Conflicts:

	sound/core/memalloc.c
</content>
</entry>
<entry>
<title>alsa: Remove special SBUS dma support code.</title>
<updated>2008-08-29T09:14:58Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2008-08-27T07:33:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=759ee81be6d87c150ea2b300c221b4fec8b5f646'/>
<id>urn:sha1:759ee81be6d87c150ea2b300c221b4fec8b5f646</id>
<content type='text'>
No longer used.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ALSA: Allocate larger pages in sgbuf</title>
<updated>2008-08-25T07:57:38Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2008-07-30T13:13:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=51e9f2e665bf2b6a01be275d64c336d942c59a66'/>
<id>urn:sha1:51e9f2e665bf2b6a01be275d64c336d942c59a66</id>
<content type='text'>
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 &lt;tiwai@suse.de&gt;
Signed-off-by: Jaroslav Kysela &lt;perex@perex.cz&gt;
</content>
</entry>
<entry>
<title>ALSA: Clean up SG-buffer helper functions and macros</title>
<updated>2008-08-25T07:57:18Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2008-08-21T11:00:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=77a23f2695bb2de0cd74599400dc55109c531b72'/>
<id>urn:sha1:77a23f2695bb2de0cd74599400dc55109c531b72</id>
<content type='text'>
Clean up SG-buffer helper functions and macros.  Helpers take substream
as arguments now.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Jaroslav Kysela &lt;perex@perex.cz&gt;
</content>
</entry>
<entry>
<title>[ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz</title>
<updated>2007-10-16T14:51:18Z</updated>
<author>
<name>Jaroslav Kysela</name>
<email>perex@perex.cz</email>
</author>
<published>2007-10-15T07:50:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c1017a4cdb68ae5368fbc9ee42c77f1f5dca8916'/>
<id>urn:sha1:c1017a4cdb68ae5368fbc9ee42c77f1f5dca8916</id>
<content type='text'>
Signed-off-by: Jaroslav Kysela &lt;perex@perex.cz&gt;
</content>
</entry>
<entry>
<title>[PATCH] gfp_t: sound</title>
<updated>2005-10-28T15:16:50Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2005-10-21T07:22:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1ef64e670e3bc27e0c3c83810ca36e19924c35c6'/>
<id>urn:sha1:1ef64e670e3bc27e0c3c83810ca36e19924c35c6</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>ALSA CVS update</title>
<updated>2004-08-02T13:21:26Z</updated>
<author>
<name>Jaroslav Kysela</name>
<email>perex@suse.cz</email>
</author>
<published>2004-08-02T13:21:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e65a6793a1263449acdcf61b951d5ea43b54f38d'/>
<id>urn:sha1:e65a6793a1263449acdcf61b951d5ea43b54f38d</id>
<content type='text'>
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 &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA CVS update - Takashi Iwai &lt;tiwai@suse.de&gt;</title>
<updated>2004-03-07T12:37:02Z</updated>
<author>
<name>Jaroslav Kysela</name>
<email>perex@suse.cz</email>
</author>
<published>2004-03-07T12:37:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=28beb648ea4403f13f2802d482d8265709b505b0'/>
<id>urn:sha1:28beb648ea4403f13f2802d482d8265709b505b0</id>
<content type='text'>
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.
</content>
</entry>
</feed>
