<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/sound/memalloc.h, branch v3.10.44</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.44</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.44'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-12-20T15:45:06Z</updated>
<entry>
<title>ALSA: memalloc.h - fix wrong truncation of dma_addr_t</title>
<updated>2013-12-20T15:45:06Z</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=44b8b7a7f2e76dd1aea131bcf79417252a1f3f11'/>
<id>urn:sha1:44b8b7a7f2e76dd1aea131bcf79417252a1f3f11</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: Force a cast to silence a warning from "sparse"</title>
<updated>2013-01-29T14:08:43Z</updated>
<author>
<name>Antonio Ospite</name>
<email>ao2@amarulasolutions.com</email>
</author>
<published>2013-01-29T11:56:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=019d80db5727707faa2108fcd4fbbfac9defb3a6'/>
<id>urn:sha1:019d80db5727707faa2108fcd4fbbfac9defb3a6</id>
<content type='text'>
Some audio drivers are calling snd_dma_continuous_data(GFP_KERNEL)
which makes "sparse" give a warning:

  $ make C=2 M=sound/usb modules
    ...
  sound/usb/6fire/pcm.c:625:25: warning: cast from restricted gfp_t
  sound/usb/caiaq/audio.c:845:41: warning: cast from restricted gfp_t
  sound/usb/usx2y/usbusx2yaudio.c:997:54: warning: cast from restricted gfp_t
  sound/usb/usx2y/usbusx2yaudio.c:1001:54: warning: cast from restricted gfp_t
  sound/usb/usx2y/usx2yhwdeppcm.c:774:54: warning: cast from restricted gfp_t
  sound/usb/usx2y/usx2yhwdeppcm.c:778:54: warning: cast from restricted gfp_t

Add __force to the cast to silence the warning.

Signed-off-by: Antonio Ospite &lt;ao2@amarulasolutions.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: Make snd_sgbuf_get_{ptr|addr}() available for non-SG cases</title>
<updated>2012-09-23T09:24:42Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2012-09-21T03:29:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9d069dc00b02b886abe3cab5e369140f7cd78965'/>
<id>urn:sha1:9d069dc00b02b886abe3cab5e369140f7cd78965</id>
<content type='text'>
Passing struct snd_dma_buffer pointer instead, so that they work no
matter whether real SG buffer is used or not.

This is a preliminary work for the HD-audio DSP loader code.

Signed-off-by: Ian Minett &lt;ian_minett@creativelabs.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&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>
</feed>
