The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Meelis Roos <mroos@linux.ee>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>,
	sparclinux@vger.kernel.org
Subject: Re: ALSA & missing dma_*_coherent on sparc32
Date: Thu, 26 Jul 2007 14:15:43 +0200	[thread overview]
Message-ID: <s5h6447uzrk.wl%tiwai@suse.de> (raw)
In-Reply-To: <Pine.SOC.4.64.0707261501130.24473@math.ut.ee>

At Thu, 26 Jul 2007 15:02:51 +0300 (EEST),
Meelis Roos wrote:
> 
> > > ERROR: "dma_free_coherent" [sound/core/snd-page-alloc.ko] undefined!
> > > ERROR: "dma_alloc_coherent" [sound/core/snd-page-alloc.ko] undefined!
> > 
> > Could you show .config?  Does it have CONFIG_HAS_DMA?
> 
> No, CONFIG_NO_DMA=y - and this was recently changed on sparc32 IIRC.

OK, then could you try the patch below?


Takashi

===
[ALSA] Fix build error without CONFIG_HAS_DMA

The recent change of include/asm-generic/dma-mapping-broken.h breaks
the build without CONFIG_HAS_DMA.  This patch is an ad hoc fix.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
diff -r 4750a3aa4b2c sound/core/Makefile
--- a/sound/core/Makefile	Thu Jul 26 11:49:22 2007 +0200
+++ b/sound/core/Makefile	Thu Jul 26 14:12:58 2007 +0200
@@ -14,7 +14,10 @@ snd-pcm-objs := pcm.o pcm_native.o pcm_l
 snd-pcm-objs := pcm.o pcm_native.o pcm_lib.o pcm_timer.o pcm_misc.o \
 		pcm_memory.o
 
-snd-page-alloc-objs := memalloc.o sgbuf.o
+snd-page-alloc-objs := memalloc.o
+ifeq ($(CONFIG_HAS_DMA),y)
+snd-page-alloc-objs += sgbuf.o
+endif
 
 snd-rawmidi-objs  := rawmidi.o
 snd-timer-objs    := timer.o
diff -r 4750a3aa4b2c core/memalloc.c
--- a/sound/core/memalloc.c	Thu Jul 26 11:49:22 2007 +0200
+++ b/sound/core/memalloc.c	Thu Jul 26 14:12:58 2007 +0200
@@ -205,6 +205,7 @@ void snd_free_pages(void *ptr, size_t si
  *
  */
 
+#ifdef CONFIG_HAS_DMA
 /* allocate the coherent DMA pages */
 static void *snd_malloc_dev_pages(struct device *dev, size_t size, dma_addr_t *dma)
 {
@@ -238,6 +239,7 @@ static void snd_free_dev_pages(struct de
 	dec_snd_pages(pg);
 	dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma);
 }
+#endif /* CONFIG_HAS_DMA */
 
 #ifdef CONFIG_SBUS
 
@@ -311,12 +313,14 @@ int snd_dma_alloc_pages(int type, struct
 		dmab->area = snd_malloc_sbus_pages(device, size, &dmab->addr);
 		break;
 #endif
+#ifdef CONFIG_HAS_DMA
 	case SNDRV_DMA_TYPE_DEV:
 		dmab->area = snd_malloc_dev_pages(device, size, &dmab->addr);
 		break;
 	case SNDRV_DMA_TYPE_DEV_SG:
 		snd_malloc_sgbuf_pages(device, size, dmab, NULL);
 		break;
+#endif
 	default:
 		printk(KERN_ERR "snd-malloc: invalid device type %d\n", type);
 		dmab->area = NULL;
@@ -382,12 +386,14 @@ void snd_dma_free_pages(struct snd_dma_b
 		snd_free_sbus_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
 		break;
 #endif
+#ifdef CONFIG_HAS_DMA
 	case SNDRV_DMA_TYPE_DEV:
 		snd_free_dev_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
 		break;
 	case SNDRV_DMA_TYPE_DEV_SG:
 		snd_free_sgbuf_pages(dmab);
 		break;
+#endif
 	default:
 		printk(KERN_ERR "snd-malloc: invalid device type %d\n", dmab->dev.type);
 	}

  reply	other threads:[~2007-07-26 12:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-26 10:21 ALSA & missing dma_*_coherent on sparc32 Meelis Roos
2007-07-26 11:50 ` Takashi Iwai
2007-07-26 12:02   ` Meelis Roos
2007-07-26 12:15     ` Takashi Iwai [this message]
2007-07-26 12:58       ` Sam Ravnborg
2007-07-26 13:04         ` Takashi Iwai
2007-07-27  9:58           ` Meelis Roos
2007-07-27 10:33             ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5h6447uzrk.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mroos@linux.ee \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox