* [PATCH] fix ALSA compilation on Sparc32
@ 2007-08-30 9:26 Markus Dahms
2007-08-30 10:09 ` Alan Cox
2007-08-30 11:50 ` Takashi Iwai
0 siblings, 2 replies; 4+ messages in thread
From: Markus Dahms @ 2007-08-30 9:26 UTC (permalink / raw)
To: sparclinux; +Cc: linux-kernel
The dma_alloc_coherent and dma_free_coherent function seem to be not
available on sparc(32) architecture. It is not used by SBus sound
drivers, so it's disabled via #ifndef for CONFIG_SPARC32.
Signed-off-by: Markus Dahms <mad@automagically.de>
---
It is tested on a SparcStation 5 with the cs4231 driver. The ALSA list
should have been CCed, but as it is subscriber-only I skipped it.
--- linux-2.6/sound/core/memalloc.c 2007-08-30 10:59:50.000000000 +0200
+++ linux-2.6/sound/core/memalloc.c.patched 2007-08-23 18:41:41.000000000 +0200
@@ -205,6 +205,8 @@ void snd_free_pages(void *ptr, size_t si
*
*/
+#ifndef CONFIG_SPARC32
+
/* allocate the coherent DMA pages */
static void *snd_malloc_dev_pages(struct device *dev, size_t size, dma_addr_t *dma)
{
@@ -239,6 +241,8 @@ static void snd_free_dev_pages(struct de
dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma);
}
+#endif
+
#ifdef CONFIG_SBUS
static void *snd_malloc_sbus_pages(struct device *dev, size_t size,
@@ -311,9 +315,11 @@ int snd_dma_alloc_pages(int type, struct
dmab->area = snd_malloc_sbus_pages(device, size, &dmab->addr);
break;
#endif
+#ifndef CONFIG_SPARC32
case SNDRV_DMA_TYPE_DEV:
dmab->area = snd_malloc_dev_pages(device, size, &dmab->addr);
break;
+#endif
case SNDRV_DMA_TYPE_DEV_SG:
snd_malloc_sgbuf_pages(device, size, dmab, NULL);
break;
@@ -382,9 +388,11 @@ void snd_dma_free_pages(struct snd_dma_b
snd_free_sbus_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
break;
#endif
+#ifndef CONFIG_SPARC32
case SNDRV_DMA_TYPE_DEV:
snd_free_dev_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
break;
+#endif
case SNDRV_DMA_TYPE_DEV_SG:
snd_free_sgbuf_pages(dmab);
break;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fix ALSA compilation on Sparc32
2007-08-30 9:26 [PATCH] fix ALSA compilation on Sparc32 Markus Dahms
@ 2007-08-30 10:09 ` Alan Cox
2007-08-30 10:52 ` Takashi Iwai
2007-08-30 11:50 ` Takashi Iwai
1 sibling, 1 reply; 4+ messages in thread
From: Alan Cox @ 2007-08-30 10:09 UTC (permalink / raw)
To: Markus Dahms; +Cc: sparclinux, linux-kernel
On Thu, 30 Aug 2007 11:26:04 +0200
Markus Dahms <mad@automagically.de> wrote:
> The dma_alloc_coherent and dma_free_coherent function seem to be not
> available on sparc(32) architecture. It is not used by SBus sound
> drivers, so it's disabled via #ifndef for CONFIG_SPARC32.
It would probably look a lot cleaner if you either provided dummy
dma_alloc_coherent/free coherent inlines for SPARC32, fixed it (if
sparc32 can do coherent DMA) or if you must ifdef it provide dummy
functions in the memalloc code so its a single ifdef
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fix ALSA compilation on Sparc32
2007-08-30 10:09 ` Alan Cox
@ 2007-08-30 10:52 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2007-08-30 10:52 UTC (permalink / raw)
To: Alan Cox; +Cc: Markus Dahms, sparclinux, linux-kernel
At Thu, 30 Aug 2007 11:09:39 +0100,
Alan Cox wrote:
>
> On Thu, 30 Aug 2007 11:26:04 +0200
> Markus Dahms <mad@automagically.de> wrote:
>
> > The dma_alloc_coherent and dma_free_coherent function seem to be not
> > available on sparc(32) architecture. It is not used by SBus sound
> > drivers, so it's disabled via #ifndef for CONFIG_SPARC32.
>
> It would probably look a lot cleaner if you either provided dummy
> dma_alloc_coherent/free coherent inlines for SPARC32, fixed it (if
> sparc32 can do coherent DMA) or if you must ifdef it provide dummy
> functions in the memalloc code so its a single ifdef
It's been indeed inline on 2.6.22 or ealier in
include/asm-generic/dma-mapping.h, but it's changed to extern without
defining functions.
I don't think it's a good idea to have function declarations even
though we surely know that there are no real function definitions...
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fix ALSA compilation on Sparc32
2007-08-30 9:26 [PATCH] fix ALSA compilation on Sparc32 Markus Dahms
2007-08-30 10:09 ` Alan Cox
@ 2007-08-30 11:50 ` Takashi Iwai
1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2007-08-30 11:50 UTC (permalink / raw)
To: Markus Dahms; +Cc: perex, sparclinux, linux-kernel
At Thu, 30 Aug 2007 11:26:04 +0200,
Markus Dahms wrote:
>
> The dma_alloc_coherent and dma_free_coherent function seem to be not
> available on sparc(32) architecture. It is not used by SBus sound
> drivers, so it's disabled via #ifndef for CONFIG_SPARC32.
>
> Signed-off-by: Markus Dahms <mad@automagically.de>
Actually, the fix has been in ALSA tree (found in git-alsa.patch in mm
tree) since long time ago, but it was never pushed.
Jaroslav, could you push the fixes please...?
thanks,
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-08-30 11:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-30 9:26 [PATCH] fix ALSA compilation on Sparc32 Markus Dahms
2007-08-30 10:09 ` Alan Cox
2007-08-30 10:52 ` Takashi Iwai
2007-08-30 11:50 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®