[alsa-devel] ALSA 1.0.17rc2 release
Hello all,
ALSA 1.0.17rc2 packages (except tools, oss, python - no changes) were released and are available for download on ALSA server.
Changes:
http://www.alsa-project.org/main/index.php/Changes_v1.0.17rc1_v1.0.17rc2
The alsa-driver compilation with 2.4 kernels should be fixed in this release.
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
On Monday 16 June 2008 10:24, Jaroslav Kysela wrote:
ALSA 1.0.17rc2 packages (except tools, oss, python - no changes) were released and are available for download on ALSA server.
The alsa-driver compilation with 2.4 kernels should be fixed in this release.
The posted ak4531_codec issues are fixed. I didn't get to post details of the other error, which still occurs with this 2.4.21-99 system:
In file included from memory.c:3: ../../alsa-kernel/pci/emu10k1/memory.c: In function `synth_alloc_pages': ../../alsa-kernel/pci/emu10k1/memory.c:466: error: `GFP_DMA32' undeclared (first use in this function) ../../alsa-kernel/pci/emu10k1/memory.c:466: error: (Each undeclared identifier is reported only once ../../alsa-kernel/pci/emu10k1/memory.c:466: error: for each function it appears in.) ../../alsa-kernel/pci/emu10k1/memory.c:467: warning: implicit declaration of function `page_to_pfn' make[2]: *** [memory.o] Error 1 make[2]: Leaving directory `/usr/share/alsa1.0.17rc2/alsa-driver-1.0.17rc2/ pci/emu10k1'
Alan
On Tuesday 17 June 2008 10:18, I wrote:
On Monday 16 June 2008 10:24, Jaroslav Kysela wrote:
ALSA 1.0.17rc2 packages (except tools, oss, python - no changes) were released and are available for download on ALSA server.
The alsa-driver compilation with 2.4 kernels should be fixed in this release.
The posted ak4531_codec issues are fixed. I didn't get to post details of the other error, which still occurs with this 2.4.21-99 system:
In file included from memory.c:3: ../../alsa-kernel/pci/emu10k1/memory.c: In function `synth_alloc_pages': ../../alsa-kernel/pci/emu10k1/memory.c:466: error: `GFP_DMA32' undeclared (first use in this function) ../../alsa-kernel/pci/emu10k1/memory.c:466: error: (Each undeclared identifier is reported only once ../../alsa-kernel/pci/emu10k1/memory.c:466: error: for each function it appears in.) ../../alsa-kernel/pci/emu10k1/memory.c:467: warning: implicit declaration of function `page_to_pfn' make[2]: *** [memory.o] Error 1 make[2]: Leaving directory `/usr/share/alsa1.0.17rc2/alsa-driver-1.0.17rc2/ pci/emu10k1'
I have just confirmed that pasting
#define GFP_DMA32 ((__force gfp_t)0x04u)
into /alsa-kernel/pci/emu10k1/memory.c (not a correct fix -just taken from 2.6.24 headers) enables build to complete. So there should be no other hidden issues.
Alan
At Tue, 17 Jun 2008 11:16:27 +0100, Alan Horstmann wrote:
On Tuesday 17 June 2008 10:18, I wrote:
On Monday 16 June 2008 10:24, Jaroslav Kysela wrote:
ALSA 1.0.17rc2 packages (except tools, oss, python - no changes) were released and are available for download on ALSA server.
The alsa-driver compilation with 2.4 kernels should be fixed in this release.
The posted ak4531_codec issues are fixed. I didn't get to post details of the other error, which still occurs with this 2.4.21-99 system:
In file included from memory.c:3: ../../alsa-kernel/pci/emu10k1/memory.c: In function `synth_alloc_pages': ../../alsa-kernel/pci/emu10k1/memory.c:466: error: `GFP_DMA32' undeclared (first use in this function) ../../alsa-kernel/pci/emu10k1/memory.c:466: error: (Each undeclared identifier is reported only once ../../alsa-kernel/pci/emu10k1/memory.c:466: error: for each function it appears in.) ../../alsa-kernel/pci/emu10k1/memory.c:467: warning: implicit declaration of function `page_to_pfn' make[2]: *** [memory.o] Error 1 make[2]: Leaving directory `/usr/share/alsa1.0.17rc2/alsa-driver-1.0.17rc2/ pci/emu10k1'
I have just confirmed that pasting
#define GFP_DMA32 ((__force gfp_t)0x04u)
into /alsa-kernel/pci/emu10k1/memory.c (not a correct fix -just taken from 2.6.24 headers) enables build to complete. So there should be no other hidden issues.
Could you check whether the tarball below works?
ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-snapshot.tar.bz2
Takashi
On Tuesday 17 June 2008 11:29, you wrote:
At Tue, 17 Jun 2008 11:16:27 +0100,
Alan Horstmann wrote:
On Tuesday 17 June 2008 10:18, I wrote:
On Monday 16 June 2008 10:24, Jaroslav Kysela wrote:
ALSA 1.0.17rc2 packages (except tools, oss, python - no changes) were released and are available for download on ALSA server.
The alsa-driver compilation with 2.4 kernels should be fixed in this release.
The posted ak4531_codec issues are fixed. I didn't get to post details of the other error, which still occurs with this 2.4.21-99 system:
In file included from memory.c:3: ../../alsa-kernel/pci/emu10k1/memory.c: In function `synth_alloc_pages': ../../alsa-kernel/pci/emu10k1/memory.c:466: error: `GFP_DMA32' undeclared (first use in this function) ../../alsa-kernel/pci/emu10k1/memory.c:466: error: (Each undeclared identifier is reported only once ../../alsa-kernel/pci/emu10k1/memory.c:466: error: for each function it appears in.) ../../alsa-kernel/pci/emu10k1/memory.c:467: warning: implicit declaration of function `page_to_pfn' make[2]: *** [memory.o] Error 1 make[2]: Leaving directory `/usr/share/alsa1.0.17rc2/alsa-driver-1.0.17rc2/ pci/emu10k1'
I have just confirmed that pasting
#define GFP_DMA32 ((__force gfp_t)0x04u)
into /alsa-kernel/pci/emu10k1/memory.c (not a correct fix -just taken from 2.6.24 headers) enables build to complete. So there should be no other hidden issues.
Could you check whether the tarball below works?
ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-sna pshot.tar.bz2
Yes that does build successfully.
However, I had noticed that GFP_DMA32 was also used by /pci/asihpi/ hpios_linux_kernel.c apparently without trouble. But it would appear that asihpi is not being built, and checking shows neither is CS5535audio or hda. Make just reports 'nothing to be done..' in these 3 cases. Is that intentional?
NB patch from Jaroslav also successful.
Alan
At Tue, 17 Jun 2008 14:51:06 +0100, Alan Horstmann wrote:
On Tuesday 17 June 2008 11:29, you wrote:
At Tue, 17 Jun 2008 11:16:27 +0100,
Alan Horstmann wrote:
On Tuesday 17 June 2008 10:18, I wrote:
On Monday 16 June 2008 10:24, Jaroslav Kysela wrote:
ALSA 1.0.17rc2 packages (except tools, oss, python - no changes) were released and are available for download on ALSA server.
The alsa-driver compilation with 2.4 kernels should be fixed in this release.
The posted ak4531_codec issues are fixed. I didn't get to post details of the other error, which still occurs with this 2.4.21-99 system:
In file included from memory.c:3: ../../alsa-kernel/pci/emu10k1/memory.c: In function `synth_alloc_pages': ../../alsa-kernel/pci/emu10k1/memory.c:466: error: `GFP_DMA32' undeclared (first use in this function) ../../alsa-kernel/pci/emu10k1/memory.c:466: error: (Each undeclared identifier is reported only once ../../alsa-kernel/pci/emu10k1/memory.c:466: error: for each function it appears in.) ../../alsa-kernel/pci/emu10k1/memory.c:467: warning: implicit declaration of function `page_to_pfn' make[2]: *** [memory.o] Error 1 make[2]: Leaving directory `/usr/share/alsa1.0.17rc2/alsa-driver-1.0.17rc2/ pci/emu10k1'
I have just confirmed that pasting
#define GFP_DMA32 ((__force gfp_t)0x04u)
into /alsa-kernel/pci/emu10k1/memory.c (not a correct fix -just taken from 2.6.24 headers) enables build to complete. So there should be no other hidden issues.
Could you check whether the tarball below works?
ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-sna pshot.tar.bz2
Yes that does build successfully.
However, I had noticed that GFP_DMA32 was also used by /pci/asihpi/ hpios_linux_kernel.c apparently without trouble.
Good catch. No problem for 2.4 kernels, though.
But it would appear that asihpi is not being built, and checking shows neither is CS5535audio or hda. Make just reports 'nothing to be done..' in these 3 cases. Is that intentional?
Yes. Some drivers aren't built for 2.4 kernels or older because it requires 2.6 (and newer) specific stuff intensively. See alsa-driver/kconfig-vers file.
Takashi
On Tue, 17 Jun 2008, Alan Horstmann wrote:
I have just confirmed that pasting
#define GFP_DMA32 ((__force gfp_t)0x04u)
into /alsa-kernel/pci/emu10k1/memory.c (not a correct fix -just taken from 2.6.24 headers) enables build to complete. So there should be no other hidden issues.
Could you try attached patch (also pasted bellow)?
Thanks, Jaroslav
diff --git a/configure.in b/configure.in index 1f24c7c..cf824be 100644 --- a/configure.in +++ b/configure.in @@ -2612,6 +2612,33 @@ if test "$CONFIG_HAVE_GFP_T" = "1"; then AC_DEFINE(CONFIG_HAVE_GFP_T) fi
+dnl Check for GFP_DMA32... +AC_MSG_CHECKING(for GFP_DMA32) +gfp_dma32="0" +ac_save_CFLAGS="$CFLAGS" +ac_save_CC="$CC" +CFLAGS="$KERNEL_CHECK_CFLAGS" +CC=$KCC +AC_TRY_COMPILE([ +#define __KERNEL__ +#include <linux/config.h> +#include <linux/types.h> +#include <linux/gfp.h> +],[ + int flags = GFP_DMA32; +], + AC_MSG_RESULT(yes);gfp_dma32="1", + AC_MSG_RESULT(no);gfp_dma32="0", + AC_MSG_RESULT(unknown);gfp_dma32="0" +) +CFLAGS=$ac_save_CFLAGS +CC=$ac_save_CC +CONFIG_HAVE_GFP_DMA32=$gfp_dma32 +dnl AC_SUBST(CONFIG_HAVE_GFP_DMA32) +if test "$CONFIG_HAVE_GFP_DMA32" = "1"; then + AC_DEFINE(CONFIG_HAVE_GFP_DMA32) +fi + dnl Check for init_utsname... if test "$kversion.$kpatchlevel" = "2.6" -a $ksublevel -ge 19; then CONFIG_HAVE_INIT_UTSNAME=1 diff --git a/include/adriver.h b/include/adriver.h index 0c32d0d..3f5f8d6 100644 --- a/include/adriver.h +++ b/include/adriver.h @@ -274,6 +274,10 @@ static inline struct proc_dir_entry *PDE(const struct inode *inode) typedef unsigned __nocast gfp_t; #endif
+#ifndef CONFIG_HAVE_GFP_DMA32 +#define GFP_DMA32 GFP_DMA +#endif + #include <linux/wait.h> #ifndef wait_event_timeout #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) diff --git a/include/config.h.in b/include/config.h.in index e5c4e02..23bee54 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -82,3 +82,4 @@ #undef CONFIG_SND_HAS_DEVICE_CREATE_DRVDATA #undef CONFIG_HAVE_IS_POWER_OF_2 #undef CONFIG_HAVE_DEPRECATED_CONFIG_H +#undef CONFIG_HAVE_GFP_DMA32
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
At Tue, 17 Jun 2008 13:42:40 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Alan Horstmann wrote:
I have just confirmed that pasting
#define GFP_DMA32 ((__force gfp_t)0x04u)
into /alsa-kernel/pci/emu10k1/memory.c (not a correct fix -just taken from 2.6.24 headers) enables build to complete. So there should be no other hidden issues.
Could you try attached patch (also pasted bellow)?
That's too overhead. A simple #ifndef GFP_DMA32 would work. And, GFP_DMA32 isn't GFP_DMA.
Takashi
Thanks, Jaroslav
diff --git a/configure.in b/configure.in index 1f24c7c..cf824be 100644 --- a/configure.in +++ b/configure.in @@ -2612,6 +2612,33 @@ if test "$CONFIG_HAVE_GFP_T" = "1"; then AC_DEFINE(CONFIG_HAVE_GFP_T) fi
+dnl Check for GFP_DMA32... +AC_MSG_CHECKING(for GFP_DMA32) +gfp_dma32="0" +ac_save_CFLAGS="$CFLAGS" +ac_save_CC="$CC" +CFLAGS="$KERNEL_CHECK_CFLAGS" +CC=$KCC +AC_TRY_COMPILE([ +#define __KERNEL__ +#include <linux/config.h> +#include <linux/types.h> +#include <linux/gfp.h> +],[
- int flags = GFP_DMA32;
+],
- AC_MSG_RESULT(yes);gfp_dma32="1",
- AC_MSG_RESULT(no);gfp_dma32="0",
- AC_MSG_RESULT(unknown);gfp_dma32="0"
+) +CFLAGS=$ac_save_CFLAGS +CC=$ac_save_CC +CONFIG_HAVE_GFP_DMA32=$gfp_dma32 +dnl AC_SUBST(CONFIG_HAVE_GFP_DMA32) +if test "$CONFIG_HAVE_GFP_DMA32" = "1"; then
- AC_DEFINE(CONFIG_HAVE_GFP_DMA32)
+fi
dnl Check for init_utsname... if test "$kversion.$kpatchlevel" = "2.6" -a $ksublevel -ge 19; then CONFIG_HAVE_INIT_UTSNAME=1 diff --git a/include/adriver.h b/include/adriver.h index 0c32d0d..3f5f8d6 100644 --- a/include/adriver.h +++ b/include/adriver.h @@ -274,6 +274,10 @@ static inline struct proc_dir_entry *PDE(const struct inode *inode) typedef unsigned __nocast gfp_t; #endif
+#ifndef CONFIG_HAVE_GFP_DMA32 +#define GFP_DMA32 GFP_DMA +#endif
#include <linux/wait.h> #ifndef wait_event_timeout #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) diff --git a/include/config.h.in b/include/config.h.in index e5c4e02..23bee54 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -82,3 +82,4 @@ #undef CONFIG_SND_HAS_DEVICE_CREATE_DRVDATA #undef CONFIG_HAVE_IS_POWER_OF_2 #undef CONFIG_HAVE_DEPRECATED_CONFIG_H +#undef CONFIG_HAVE_GFP_DMA32
Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
On Tue, 17 Jun 2008, Takashi Iwai wrote:
At Tue, 17 Jun 2008 13:42:40 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Alan Horstmann wrote:
I have just confirmed that pasting
#define GFP_DMA32 ((__force gfp_t)0x04u)
into /alsa-kernel/pci/emu10k1/memory.c (not a correct fix -just taken from 2.6.24 headers) enables build to complete. So there should be no other hidden issues.
Could you try attached patch (also pasted bellow)?
That's too overhead. A simple #ifndef GFP_DMA32 would work. And, GFP_DMA32 isn't GFP_DMA.
But old kernels with dma_mask < 0xffffffff sets GFP_DMA flag for page allocation. So there's no regression.
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
At Tue, 17 Jun 2008 14:12:06 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Takashi Iwai wrote:
At Tue, 17 Jun 2008 13:42:40 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Alan Horstmann wrote:
I have just confirmed that pasting
#define GFP_DMA32 ((__force gfp_t)0x04u)
into /alsa-kernel/pci/emu10k1/memory.c (not a correct fix -just taken from 2.6.24 headers) enables build to complete. So there should be no other hidden issues.
Could you try attached patch (also pasted bellow)?
That's too overhead. A simple #ifndef GFP_DMA32 would work. And, GFP_DMA32 isn't GFP_DMA.
But old kernels with dma_mask < 0xffffffff sets GFP_DMA flag for page allocation. So there's no regression.
GFP_DMA32 means to allocate from ZONE_DMA32 which was a part of ZONE_NORMAL.
Takashi
On Tue, 17 Jun 2008, Takashi Iwai wrote:
At Tue, 17 Jun 2008 14:12:06 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Takashi Iwai wrote:
At Tue, 17 Jun 2008 13:42:40 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Alan Horstmann wrote:
I have just confirmed that pasting
#define GFP_DMA32 ((__force gfp_t)0x04u)
into /alsa-kernel/pci/emu10k1/memory.c (not a correct fix -just taken from 2.6.24 headers) enables build to complete. So there should be no other hidden issues.
Could you try attached patch (also pasted bellow)?
That's too overhead. A simple #ifndef GFP_DMA32 would work. And, GFP_DMA32 isn't GFP_DMA.
But old kernels with dma_mask < 0xffffffff sets GFP_DMA flag for page allocation. So there's no regression.
GFP_DMA32 means to allocate from ZONE_DMA32 which was a part of ZONE_NORMAL.
Yes for 2.6, but 2.4 kernels do not have this flag. The function pci_alloc_consistent() was used before your patch "[ALSA] emu10k1 - simplify page allocation for synth" and pci_alloc_consistent() just uses GFP_DMA flag for page allocation when dma_mask < 32bit. So the result is same.
I agree that using GFP_DMA is a bit restriction, but I don't have a better easy solution for 2.4 kernels.
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
At Tue, 17 Jun 2008 15:23:03 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Takashi Iwai wrote:
At Tue, 17 Jun 2008 14:12:06 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Takashi Iwai wrote:
At Tue, 17 Jun 2008 13:42:40 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Alan Horstmann wrote:
I have just confirmed that pasting
#define GFP_DMA32 ((__force gfp_t)0x04u)
into /alsa-kernel/pci/emu10k1/memory.c (not a correct fix -just taken from 2.6.24 headers) enables build to complete. So there should be no other hidden issues.
Could you try attached patch (also pasted bellow)?
That's too overhead. A simple #ifndef GFP_DMA32 would work. And, GFP_DMA32 isn't GFP_DMA.
But old kernels with dma_mask < 0xffffffff sets GFP_DMA flag for page allocation. So there's no regression.
GFP_DMA32 means to allocate from ZONE_DMA32 which was a part of ZONE_NORMAL.
Yes for 2.6, but 2.4 kernels do not have this flag. The function pci_alloc_consistent() was used before your patch "[ALSA] emu10k1 - simplify page allocation for synth" and pci_alloc_consistent() just uses GFP_DMA flag for page allocation when dma_mask < 32bit. So the result is same.
No. pci_alloc_consistent() wasn't directly used, and there was already a hack for that in the memory allocator.
Takashi
On Tue, 17 Jun 2008, Takashi Iwai wrote:
At Tue, 17 Jun 2008 15:23:03 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Takashi Iwai wrote:
At Tue, 17 Jun 2008 14:12:06 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Takashi Iwai wrote:
At Tue, 17 Jun 2008 13:42:40 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Alan Horstmann wrote:
> I have just confirmed that pasting > > #define GFP_DMA32 ((__force gfp_t)0x04u) > > into /alsa-kernel/pci/emu10k1/memory.c (not a correct fix -just taken from > 2.6.24 headers) enables build to complete. So there should be no other > hidden issues.
Could you try attached patch (also pasted bellow)?
That's too overhead. A simple #ifndef GFP_DMA32 would work. And, GFP_DMA32 isn't GFP_DMA.
But old kernels with dma_mask < 0xffffffff sets GFP_DMA flag for page allocation. So there's no regression.
GFP_DMA32 means to allocate from ZONE_DMA32 which was a part of ZONE_NORMAL.
Yes for 2.6, but 2.4 kernels do not have this flag. The function pci_alloc_consistent() was used before your patch "[ALSA] emu10k1 - simplify page allocation for synth" and pci_alloc_consistent() just uses GFP_DMA flag for page allocation when dma_mask < 32bit. So the result is same.
No. pci_alloc_consistent() wasn't directly used, and there was already a hack for that in the memory allocator.
I missed it thanks. This patch should fix memory leak in pci/emu10k1/memory.c:
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c index 42943b4..759e29f 100644 --- a/sound/pci/emu10k1/memory.c +++ b/sound/pci/emu10k1/memory.c @@ -464,11 +464,17 @@ static int synth_alloc_pages(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk /* first try to allocate from <4GB zone */ struct page *p = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_NOWARN); - if (!p || (page_to_pfn(p) & ~(emu->dma_mask >> PAGE_SHIFT))) + if (!p || (page_to_pfn(p) & ~(emu->dma_mask >> PAGE_SHIFT))) { /* try to allocate from <16MB zone */ - p = alloc_page(GFP_ATOMIC | GFP_DMA | + struct page *p1 = + alloc_page(GFP_ATOMIC | GFP_DMA | __GFP_NORETRY | /* no OOM-killer */ __GFP_NOWARN); + /* free page outside dma_mask range */ + if (p) + free_page((unsigned long)page_address(p)); + p = p1; + } if (!p) { __synth_free_pages(emu, first_page, page - 1); return -ENOMEM;
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
At Tue, 17 Jun 2008 16:24:43 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Takashi Iwai wrote:
At Tue, 17 Jun 2008 15:23:03 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Takashi Iwai wrote:
At Tue, 17 Jun 2008 14:12:06 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 17 Jun 2008, Takashi Iwai wrote:
At Tue, 17 Jun 2008 13:42:40 +0200 (CEST), Jaroslav Kysela wrote: > > On Tue, 17 Jun 2008, Alan Horstmann wrote: > > > I have just confirmed that pasting > > > > #define GFP_DMA32 ((__force gfp_t)0x04u) > > > > into /alsa-kernel/pci/emu10k1/memory.c (not a correct fix -just taken from > > 2.6.24 headers) enables build to complete. So there should be no other > > hidden issues. > > Could you try attached patch (also pasted bellow)?
That's too overhead. A simple #ifndef GFP_DMA32 would work. And, GFP_DMA32 isn't GFP_DMA.
But old kernels with dma_mask < 0xffffffff sets GFP_DMA flag for page allocation. So there's no regression.
GFP_DMA32 means to allocate from ZONE_DMA32 which was a part of ZONE_NORMAL.
Yes for 2.6, but 2.4 kernels do not have this flag. The function pci_alloc_consistent() was used before your patch "[ALSA] emu10k1 - simplify page allocation for synth" and pci_alloc_consistent() just uses GFP_DMA flag for page allocation when dma_mask < 32bit. So the result is same.
No. pci_alloc_consistent() wasn't directly used, and there was already a hack for that in the memory allocator.
I missed it thanks. This patch should fix memory leak in pci/emu10k1/memory.c:
Yeah, indeed. Thanks.
Meanwhile, I cleaned it up too.
Takashi
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c index 42943b4..759e29f 100644 --- a/sound/pci/emu10k1/memory.c +++ b/sound/pci/emu10k1/memory.c @@ -464,11 +464,17 @@ static int synth_alloc_pages(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk /* first try to allocate from <4GB zone */ struct page *p = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_NOWARN);
if (!p || (page_to_pfn(p) & ~(emu->dma_mask >> PAGE_SHIFT)))
if (!p || (page_to_pfn(p) & ~(emu->dma_mask >> PAGE_SHIFT))) { /* try to allocate from <16MB zone */
p = alloc_page(GFP_ATOMIC | GFP_DMA |
struct page *p1 =
alloc_page(GFP_ATOMIC | GFP_DMA | __GFP_NORETRY | /* no OOM-killer */ __GFP_NOWARN);
/* free page outside dma_mask range */
if (p)
free_page((unsigned long)page_address(p));
p = p1;
}
if (!p) { __synth_free_pages(emu, first_page, page - 1); return -ENOMEM;
Jaroslav
Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
On Tue, 17 Jun 2008, Takashi Iwai wrote:
Yeah, indeed. Thanks.
Meanwhile, I cleaned it up too.
Yes, my patch was a bit complicated, because I assumed (not sure why) that second alloc_page uses same range as first one so the change to allocate page from lower area will be higher. But GFP_DMA takes page from another area so this "page hold" is not necessary. Thanks.
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
On Tuesday 17 June 2008 12:42, you wrote:
Could you try attached patch (also pasted bellow)?
Thanks, Jaroslav
diff --git a/configure.in b/configure.in index 1f24c7c..cf824be 100644 --- a/configure.in +++ b/configure.in @@ -2612,6 +2612,33 @@ if test "$CONFIG_HAVE_GFP_T" = "1"; then AC_DEFINE(CONFIG_HAVE_GFP_T) fi
+dnl Check for GFP_DMA32... +AC_MSG_CHECKING(for GFP_DMA32) +gfp_dma32="0" +ac_save_CFLAGS="$CFLAGS" +ac_save_CC="$CC" +CFLAGS="$KERNEL_CHECK_CFLAGS" +CC=$KCC +AC_TRY_COMPILE([ +#define __KERNEL__ +#include <linux/config.h> +#include <linux/types.h> +#include <linux/gfp.h> +],[
- int flags = GFP_DMA32;
+],
- AC_MSG_RESULT(yes);gfp_dma32="1",
- AC_MSG_RESULT(no);gfp_dma32="0",
- AC_MSG_RESULT(unknown);gfp_dma32="0"
+) +CFLAGS=$ac_save_CFLAGS +CC=$ac_save_CC +CONFIG_HAVE_GFP_DMA32=$gfp_dma32 +dnl AC_SUBST(CONFIG_HAVE_GFP_DMA32) +if test "$CONFIG_HAVE_GFP_DMA32" = "1"; then
- AC_DEFINE(CONFIG_HAVE_GFP_DMA32)
+fi
dnl Check for init_utsname... if test "$kversion.$kpatchlevel" = "2.6" -a $ksublevel -ge 19; then CONFIG_HAVE_INIT_UTSNAME=1 diff --git a/include/adriver.h b/include/adriver.h index 0c32d0d..3f5f8d6 100644 --- a/include/adriver.h +++ b/include/adriver.h @@ -274,6 +274,10 @@ static inline struct proc_dir_entry *PDE(const struct inode *inode) typedef unsigned __nocast gfp_t; #endif
+#ifndef CONFIG_HAVE_GFP_DMA32 +#define GFP_DMA32 GFP_DMA +#endif
#include <linux/wait.h> #ifndef wait_event_timeout #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) diff --git a/include/config.h.in b/include/config.h.in index e5c4e02..23bee54 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -82,3 +82,4 @@ #undef CONFIG_SND_HAS_DEVICE_CREATE_DRVDATA #undef CONFIG_HAVE_IS_POWER_OF_2 #undef CONFIG_HAVE_DEPRECATED_CONFIG_H +#undef CONFIG_HAVE_GFP_DMA32
Yes, that is successful, but see my note on reply to Takashi, copied to you.
Alan
On Mon, 16 Jun 2008 11:24:22 +0200 (CEST) Jaroslav Kysela perex@perex.cz wrote:
Hello all,
ALSA 1.0.17rc2 packages (except tools, oss, python - no changes) were released and are available for download on ALSA server.
Just like rc1, it doesn't compile the powermac driver (Linux Jay 2.6.25 #1 SMP Sat Apr 26 00:55:22 CEST 2008 ppc 7455, altivec supported PowerMac3,6 GNU/Linux). The patch below fixes the problem, but I'm not sure it's the right fix.
--- acinclude.m4__orig 2008-06-18 22:33:27.000000000 +0200 +++ acinclude.m4 2008-06-18 23:07:21.000000000 +0200 @@ -1914,8 +1914,9 @@ alsa_check_kconfig_option () { fi fi if ! ( test "$CONFIG_M68K" = "y" -o "$CONFIG_M68K" = "m" ) && - ( test "$CONFIG_PPC64" = "y" -o "$CONFIG_PPC64" = "m" ) || - ( test "$CONFIG_PPC32" = "y" -o "$CONFIG_PPC32" = "m" ); then + (( test "$CONFIG_PPC64" = "y" -o "$CONFIG_PPC64" = "m" ) || + ( test "$CONFIG_PPC32" = "y" -o "$CONFIG_PPC32" = "m" ) || + ( test "$CONFIG_PPC" = "y" -o "$CONFIG_PPC" = "m" )); then CONFIG_SND_PPC="y" fi if alsa_check_kconfig_card "powermac"; then
-- Giuliano.
On Wed, 18 Jun 2008, Giuliano Pochini wrote:
On Mon, 16 Jun 2008 11:24:22 +0200 (CEST) Jaroslav Kysela perex@perex.cz wrote:
Hello all,
ALSA 1.0.17rc2 packages (except tools, oss, python - no changes) were released and are available for download on ALSA server.
Just like rc1, it doesn't compile the powermac driver (Linux Jay 2.6.25 #1 SMP Sat Apr 26 00:55:22 CEST 2008 ppc 7455, altivec supported PowerMac3,6 GNU/Linux). The patch below fixes the problem, but I'm not sure it's the right fix.
Could you try this patch on fresh tree?
diff --git a/utils/mod-deps.c b/utils/mod-deps.c index baf21b8..8c9d2a6 100644 --- a/utils/mod-deps.c +++ b/utils/mod-deps.c @@ -130,6 +130,7 @@ static char *kernel_deps[] = { "SUPERH", "SUPERH64", "IA32_EMULATION", + "M68K", /* architecture specific */ "ARCH_*", "X86_PC9800", @@ -601,6 +602,10 @@ static struct cond *join_cond(struct cond *cond1, struct cond *cond2) while (cond1->next) cond1 = cond1->next; cond1->next = cond2; + cond2->left += 1; + while (cond2->next) + cond2 = cond2->next; + cond2->right += 1; return orig; }
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
On Thu, 19 Jun 2008 11:11:56 +0200 (CEST) Jaroslav Kysela perex@perex.cz wrote:
Just like rc1, it doesn't compile the powermac driver (Linux Jay 2.6.25 #1 SMP Sat Apr 26 00:55:22 CEST 2008 ppc 7455, altivec supported PowerMac3,6 GNU/Linux). The patch below fixes the problem, but I'm not sure it's the right fix.
Could you try this patch on fresh tree?
diff --git a/utils/mod-deps.c b/utils/mod-deps.c index baf21b8..8c9d2a6 100644 --- a/utils/mod-deps.c +++ b/utils/mod-deps.c @@ -130,6 +130,7 @@ static char *kernel_deps[] = { "SUPERH", "SUPERH64", "IA32_EMULATION",
- "M68K", /* architecture specific */ "ARCH_*", "X86_PC9800",
@@ -601,6 +602,10 @@ static struct cond *join_cond(struct cond *cond1, struct cond *cond2) while (cond1->next) cond1 = cond1->next; cond1->next = cond2;
- cond2->left += 1;
- while (cond2->next)
cond2 = cond2->next;
- cond2->right += 1; return orig;
}
No, it miscompiles the configure script: a couple of lines have a superfluous closing parenthesis. I fixed them, but it still didn't set CONFIG_SND_POWERMAC and CONFIG_SND_POWERMAC_AUTO_DRC.
-- Giuliano.
On Fri, 20 Jun 2008, Giuliano Pochini wrote:
On Thu, 19 Jun 2008 11:11:56 +0200 (CEST) Jaroslav Kysela perex@perex.cz wrote:
Just like rc1, it doesn't compile the powermac driver (Linux Jay 2.6.25 #1 SMP Sat Apr 26 00:55:22 CEST 2008 ppc 7455, altivec supported PowerMac3,6 GNU/Linux). The patch below fixes the problem, but I'm not sure it's the right fix.
Could you try this patch on fresh tree?
diff --git a/utils/mod-deps.c b/utils/mod-deps.c index baf21b8..8c9d2a6 100644 --- a/utils/mod-deps.c +++ b/utils/mod-deps.c @@ -130,6 +130,7 @@ static char *kernel_deps[] = { "SUPERH", "SUPERH64", "IA32_EMULATION",
- "M68K", /* architecture specific */ "ARCH_*", "X86_PC9800",
@@ -601,6 +602,10 @@ static struct cond *join_cond(struct cond *cond1, struct cond *cond2) while (cond1->next) cond1 = cond1->next; cond1->next = cond2;
- cond2->left += 1;
- while (cond2->next)
cond2 = cond2->next;
- cond2->right += 1; return orig;
}
No, it miscompiles the configure script: a couple of lines have a superfluous closing parenthesis. I fixed them, but it still didn't set CONFIG_SND_POWERMAC and CONFIG_SND_POWERMAC_AUTO_DRC.
Could you, please, send me your .config from kernel tree privately? Thanks.
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
I am now seeing this script miscompile issue as well on x86 hardware (Mandriva 2008 and Ubuntu 8.04 x86 32 bit editions). The second part of the mod-deps.c patch is generating an extra ) for the "fm801-tea575x-bool" test and the "usb-caiaq-input" test sections of acinclude.m4.
Tobin
On Sat, 2008-06-21 at 09:28 +0200, Jaroslav Kysela wrote:
On Fri, 20 Jun 2008, Giuliano Pochini wrote:
On Thu, 19 Jun 2008 11:11:56 +0200 (CEST) Jaroslav Kysela perex@perex.cz wrote:
Just like rc1, it doesn't compile the powermac driver (Linux Jay 2.6.25 #1 SMP Sat Apr 26 00:55:22 CEST 2008 ppc 7455, altivec supported PowerMac3,6 GNU/Linux). The patch below fixes the problem, but I'm not sure it's the right fix.
Could you try this patch on fresh tree?
diff --git a/utils/mod-deps.c b/utils/mod-deps.c index baf21b8..8c9d2a6 100644 --- a/utils/mod-deps.c +++ b/utils/mod-deps.c @@ -130,6 +130,7 @@ static char *kernel_deps[] = { "SUPERH", "SUPERH64", "IA32_EMULATION",
- "M68K", /* architecture specific */ "ARCH_*", "X86_PC9800",
@@ -601,6 +602,10 @@ static struct cond *join_cond(struct cond *cond1, struct cond *cond2) while (cond1->next) cond1 = cond1->next; cond1->next = cond2;
- cond2->left += 1;
- while (cond2->next)
cond2 = cond2->next;
- cond2->right += 1; return orig;
}
No, it miscompiles the configure script: a couple of lines have a superfluous closing parenthesis. I fixed them, but it still didn't set CONFIG_SND_POWERMAC and CONFIG_SND_POWERMAC_AUTO_DRC.
Could you, please, send me your .config from kernel tree privately? Thanks.
Jaroslav
Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
On Wed, 25 Jun 2008, Tobin Davis wrote:
I am now seeing this script miscompile issue as well on x86 hardware (Mandriva 2008 and Ubuntu 8.04 x86 32 bit editions). The second part of the mod-deps.c patch is generating an extra ) for the "fm801-tea575x-bool" test and the "usb-caiaq-input" test sections of acinclude.m4.
The patch on URL bellow should fix both PPC and parenthesis issues:
http://git.alsa-project.org/?p=alsa-driver.git;a=commitdiff;h=771f0681f80943...
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
participants (5)
-
Alan Horstmann
-
Giuliano Pochini
-
Jaroslav Kysela
-
Takashi Iwai
-
Tobin Davis