Skip to contentSkip to conversation

ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally

PATCH Superseded Pierre-Louis Bossart 4 participants 8 messages Jul 25, 2018 – Jul 30, 2018 Sound

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally

Make this helper inline function available for all platforms. This helps solve 0-day compilation issues when CONFIG_SND_DMA_SGBUF is not defined.

---
 include/sound/memalloc.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
include/sound/memalloc.h +8 -8
index 9c3db3dce32b..c669900e6cbe 100644
@@ -67,6 +67,14 @@ struct snd_dma_buffer {
 	void *private_data;	/* private for allocator; don't touch */
 };
 
+/*
+ * return the pages matching with the given byte size
+ */
+static inline unsigned int snd_sgbuf_aligned_pages(size_t size)
+{
+	return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
+}
+
 #ifdef CONFIG_SND_DMA_SGBUF
 /*
  * Scatter-Gather generic device pages
@@ -90,14 +98,6 @@ struct snd_sg_buf {
 	struct device *dev;
 };
 
-/*
- * return the pages matching with the given byte size
- */
-static inline unsigned int snd_sgbuf_aligned_pages(size_t size)
-{
-	return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
-}
-
 /*
  * return the physical address at the corresponding offset
  */
Signature · 1 line
2.14.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Pierre-Louis Bossart

Make this helper inline function available for all platforms. This helps solve 0-day compilation issues when CONFIG_SND_DMA_SGBUF is not defined.

Currently it's triggered only by the new Intel patches, so no urgent material.

I can put this to for-next branch, or to another immutable branch, so that Mark can pull in. Or, it's fine that Mark applies to his tree together with other Intel patches, too. Mark, what's your preference?

In the last case, feel free to take my ack:

thanks,

Takashi

Quoted 41 lines
---
 include/sound/memalloc.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
include/sound/memalloc.h +8 -8
index 9c3db3dce32b..c669900e6cbe 100644
@@ -67,6 +67,14 @@ struct snd_dma_buffer {
 	void *private_data;	/* private for allocator; don't touch */
 };
 
+/*
+ * return the pages matching with the given byte size
+ */
+static inline unsigned int snd_sgbuf_aligned_pages(size_t size)
+{
+	return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
+}
+
 #ifdef CONFIG_SND_DMA_SGBUF
 /*
  * Scatter-Gather generic device pages
@@ -90,14 +98,6 @@ struct snd_sg_buf {
 	struct device *dev;
 };
 
-/*
- * return the pages matching with the given byte size
- */
-static inline unsigned int snd_sgbuf_aligned_pages(size_t size)
-{
-	return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
-}
-
 /*
  * return the physical address at the corresponding offset
  */
Signature · 1 line
2.14.1
#2 lore raw
Quoted 6 lines · Takashi Iwai

I can put this to for-next branch, or to another immutable branch, so that Mark can pull in. Or, it's fine that Mark applies to his tree together with other Intel patches, too. Mark, what's your preference?

In the last case, feel free to take my ack:

Since I can just do it immediately I applied it and pushed out a signed tag for it:

The following changes since commit ce397d215ccd07b8ae3f71db689aedb85d56ab40:

Linux 4.18-rc1 (2018-06-17 08:04:49 +0900)

are available in the Git repository at:

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git tags/alsa-add-snd-sgbuf-aligned-pages

for you to fetch changes up to 4cae99d9b5305ab8cccc839fccceb81ec9e5abda:

ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally (2018-07-26 17:05:29 +0100)

----------------------------------------------------------------
ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally

Make this helper inline function available for all platforms. This helps solve 0-day compilation issues when CONFIG_SND_DMA_SGBUF is not defined.

----------------------------------------------------------------
Pierre-Louis Bossart (1):
ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally

 include/sound/memalloc.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
#3 lore raw
In reply to Pierre-Louis Bossart
I love your patch! Yet something to improve:

Hi Pierre-Louis,

I love your patch! Yet something to improve:

[auto build test ERROR on sound/for-next]
[also build test ERROR on v4.18-rc6 next-20180725]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Pierre-Louis-Bossart/ALSA-memalloc-declare-snd_sgbuf_aligned_pages-unconditionally/20180726-192035
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: alpha-allyesconfig (attached as .config)
compiler: alpha-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=alpha

All errors (new ones prefixed by >>):

In file included from include/sound/pcm.h:27:0,

                    from sound/core/pcm_iec958.c:11:
   include/sound/memalloc.h: In function 'snd_sgbuf_aligned_pages':
>> include/sound/memalloc.h:75:17: error: 'PAGE_SIZE' undeclared (first use in this function); did you mean 'TASK_SIZE'?
     return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
                    ^~~~~~~~~
                    TASK_SIZE
   include/sound/memalloc.h:75:17: note: each undeclared identifier is reported only once for each function it appears in
>> include/sound/memalloc.h:75:35: error: 'PAGE_SHIFT' undeclared (first use in this function); did you mean 'PAGE_SIZE'?
     return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
                                      ^~~~~~~~~~
                                      PAGE_SIZE

vim +75 include/sound/memalloc.h

    69	
    70	/*
    71	 * return the pages matching with the given byte size
    72	 */
    73	static inline unsigned int snd_sgbuf_aligned_pages(size_t size)
    74	{
  > 75		return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
    76	}
    77	

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#4 lore raw
Quoted 21 lines · kbuild test robot

Hi Pierre-Louis,

I love your patch! Yet something to improve:

[auto build test ERROR on sound/for-next]
[also build test ERROR on v4.18-rc6 next-20180725]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Pierre-Louis-Bossart/ALSA-memalloc-declare-snd_sgbuf_aligned_pages-unconditionally/20180726-192035
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: alpha-allyesconfig (attached as .config)
compiler: alpha-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=alpha

All errors (new ones prefixed by >>):

Quoted 7 lines

In file included from include/sound/pcm.h:27:0,

                    from sound/core/pcm_iec958.c:11:

include/sound/memalloc.h: In function 'snd_sgbuf_aligned_pages':

Quoted 1 line
Quoted 1 line

include/sound/memalloc.h:75:17: error: 'PAGE_SIZE' undeclared (first use in this function); did you mean 'TASK_SIZE'?

     return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
                    ^~~~~~~~~
                    TASK_SIZE

OK, we need to include <asm/page.h> in this header file.

Pierre, care to resend with the fix?

thanks,

Takashi

#5 lore raw
Quoted 26 lines · Takashi Iwai
Quoted 24 lines · kbuild test robot

Hi Pierre-Louis,

I love your patch! Yet something to improve:

[auto build test ERROR on sound/for-next]
[also build test ERROR on v4.18-rc6 next-20180725]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Pierre-Louis-Bossart/ALSA-memalloc-declare-snd_sgbuf_aligned_pages-unconditionally/20180726-192035
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: alpha-allyesconfig (attached as .config)
compiler: alpha-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=alpha

All errors (new ones prefixed by >>):

In file included from include/sound/pcm.h:27:0,
from sound/core/pcm_iec958.c:11:
include/sound/memalloc.h: In function 'snd_sgbuf_aligned_pages':

Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line

include/sound/memalloc.h:75:17: error: 'PAGE_SIZE' undeclared (first use in this function); did you mean 'TASK_SIZE'?

      return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
                     ^~~~~~~~~
                     TASK_SIZE

OK, we need to include <asm/page.h> in this header file.

Pierre, care to resend with the fix?

yes, will do later today.

#6 lore raw
In reply to Pierre-Louis Bossart
I love your patch! Yet something to improve:

Hi Pierre-Louis,

I love your patch! Yet something to improve:

[auto build test ERROR on sound/for-next]
[also build test ERROR on v4.18-rc6 next-20180725]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Pierre-Louis-Bossart/ALSA-memalloc-declare-snd_sgbuf_aligned_pages-unconditionally/20180726-192035
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: microblaze-allmodconfig (attached as .config)
compiler: microblaze-linux-gcc (GCC) 8.1.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=8.1.0 make.cross ARCH=microblaze

All errors (new ones prefixed by >>):

In file included from include/sound/pcm.h:27,

                    from sound/core/pcm_iec958.c:11:
   include/sound/memalloc.h: In function 'snd_sgbuf_aligned_pages':
   include/sound/memalloc.h:75:17: error: 'PAGE_SIZE' undeclared (first use in this function); did you mean 'TASK_SIZE'?
     return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
                    ^~~~~~~~~
                    TASK_SIZE
   include/sound/memalloc.h:75:17: note: each undeclared identifier is reported only once for each function it appears in
>> include/sound/memalloc.h:75:35: error: 'PAGE_SHIFT' undeclared (first use in this function); did you mean 'NMI_SHIFT'?
     return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
                                      ^~~~~~~~~~
                                      NMI_SHIFT

vim +75 include/sound/memalloc.h

    69	
    70	/*
    71	 * return the pages matching with the given byte size
    72	 */
    73	static inline unsigned int snd_sgbuf_aligned_pages(size_t size)
    74	{
  > 75		return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
    76	}
    77	

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#7 lore raw

Applied "ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally" to the asoc tree

In reply to Pierre-Louis Bossart

The patch

ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 4cae99d9b5305ab8cccc839fccceb81ec9e5abda Mon Sep 17 00:00:00 2001

From: Pierre-Louis Bossart <[email protected]>
Date: Wed, 25 Jul 2018 15:15:56 -0500
Subject: [PATCH] ALSA: memalloc: declare snd_sgbuf_aligned_pages()
unconditionally

Make this helper inline function available for all platforms. This helps solve 0-day compilation issues when CONFIG_SND_DMA_SGBUF is not defined.

---
 include/sound/memalloc.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
include/sound/memalloc.h +8 -8
index 9c3db3dce32b..c669900e6cbe 100644
@@ -67,6 +67,14 @@ struct snd_dma_buffer {
 	void *private_data;	/* private for allocator; don't touch */
 };
 
+/*
+ * return the pages matching with the given byte size
+ */
+static inline unsigned int snd_sgbuf_aligned_pages(size_t size)
+{
+	return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
+}
+
 #ifdef CONFIG_SND_DMA_SGBUF
 /*
  * Scatter-Gather generic device pages
@@ -90,14 +98,6 @@ struct snd_sg_buf {
 	struct device *dev;
 };
 
-/*
- * return the pages matching with the given byte size
- */
-static inline unsigned int snd_sgbuf_aligned_pages(size_t size)
-{
-	return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
-}
-
 /*
  * return the physical address at the corresponding offset
  */
Signature · 1 line
2.18.0