LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/msi: fix section mismatch warning
@ 2015-10-21  5:56 Denis Kirjanov
  2015-10-21  6:34 ` Arnd Bergmann
  2015-10-21  6:42 ` Stephen Rothwell
  0 siblings, 2 replies; 4+ messages in thread
From: Denis Kirjanov @ 2015-10-21  5:56 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Stephen Rothwell, linuxppc-dev, Denis Kirjanov

Building with CONFIG_DEBUG_SECTION_MISMATCH
gives the following warning:

WARNING: vmlinux.o(.text+0x41fa8): Section mismatch in reference from
the function .msi_bitmap_alloc() to the function
.init.text:.memblock_virt_alloc_try_nid()
The function .msi_bitmap_alloc() references
the function __init .memblock_virt_alloc_try_nid().
This is often because .msi_bitmap_alloc lacks a __init
annotation or the annotation of .memblock_virt_alloc_try_nid is wrong.

Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
---
 arch/powerpc/include/asm/msi_bitmap.h | 2 +-
 arch/powerpc/sysdev/msi_bitmap.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/msi_bitmap.h b/arch/powerpc/include/asm/msi_bitmap.h
index 1ec7125..fbd3424 100644
--- a/arch/powerpc/include/asm/msi_bitmap.h
+++ b/arch/powerpc/include/asm/msi_bitmap.h
@@ -29,7 +29,7 @@ void msi_bitmap_reserve_hwirq(struct msi_bitmap *bmp, unsigned int hwirq);
 
 int msi_bitmap_reserve_dt_hwirqs(struct msi_bitmap *bmp);
 
-int msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
+int __init_refok msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
 		     struct device_node *of_node);
 void msi_bitmap_free(struct msi_bitmap *bmp);
 
diff --git a/arch/powerpc/sysdev/msi_bitmap.c b/arch/powerpc/sysdev/msi_bitmap.c
index 1a826f3..ed5234e 100644
--- a/arch/powerpc/sysdev/msi_bitmap.c
+++ b/arch/powerpc/sysdev/msi_bitmap.c
@@ -112,7 +112,7 @@ int msi_bitmap_reserve_dt_hwirqs(struct msi_bitmap *bmp)
 	return 0;
 }
 
-int msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
+int __init_refok msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
 		     struct device_node *of_node)
 {
 	int size;
-- 
2.4.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/msi: fix section mismatch warning
  2015-10-21  5:56 [PATCH] powerpc/msi: fix section mismatch warning Denis Kirjanov
@ 2015-10-21  6:34 ` Arnd Bergmann
  2015-10-21  8:19   ` Denis Kirjanov
  2015-10-21  6:42 ` Stephen Rothwell
  1 sibling, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2015-10-21  6:34 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: Denis Kirjanov, Michael Ellerman, Stephen Rothwell, linuxppc-dev

On Wednesday 21 October 2015 08:56:44 Denis Kirjanov wrote:
> Building with CONFIG_DEBUG_SECTION_MISMATCH
> gives the following warning:
> 
> WARNING: vmlinux.o(.text+0x41fa8): Section mismatch in reference from
> the function .msi_bitmap_alloc() to the function
> .init.text:.memblock_virt_alloc_try_nid()
> The function .msi_bitmap_alloc() references
> the function __init .memblock_virt_alloc_try_nid().
> This is often because .msi_bitmap_alloc lacks a __init
> annotation or the annotation of .memblock_virt_alloc_try_nid is wrong.
> 
> Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
> 

A patch like this usually requires an explanation why the warning is
a false positive and why there is no way to solve it besides suppressing
the warning.

	Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/msi: fix section mismatch warning
  2015-10-21  5:56 [PATCH] powerpc/msi: fix section mismatch warning Denis Kirjanov
  2015-10-21  6:34 ` Arnd Bergmann
@ 2015-10-21  6:42 ` Stephen Rothwell
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2015-10-21  6:42 UTC (permalink / raw)
  To: Denis Kirjanov; +Cc: Michael Ellerman, linuxppc-dev

Hi Denis,

On Wed, 21 Oct 2015 08:56:44 +0300 Denis Kirjanov <kda@linux-powerpc.org> wrote:
>
> diff --git a/arch/powerpc/include/asm/msi_bitmap.h b/arch/powerpc/include/asm/msi_bitmap.h
> index 1ec7125..fbd3424 100644
> --- a/arch/powerpc/include/asm/msi_bitmap.h
> +++ b/arch/powerpc/include/asm/msi_bitmap.h
> @@ -29,7 +29,7 @@ void msi_bitmap_reserve_hwirq(struct msi_bitmap *bmp, unsigned int hwirq);
>  
>  int msi_bitmap_reserve_dt_hwirqs(struct msi_bitmap *bmp);
>  
> -int msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
> +int __init_refok msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
>  		     struct device_node *of_node);

I am pretty sure that we don't want or need the annotation in the header file.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/msi: fix section mismatch warning
  2015-10-21  6:34 ` Arnd Bergmann
@ 2015-10-21  8:19   ` Denis Kirjanov
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kirjanov @ 2015-10-21  8:19 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linuxppc-dev, Michael Ellerman, Stephen Rothwell, linuxppc-dev

On 10/21/15, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wednesday 21 October 2015 08:56:44 Denis Kirjanov wrote:
>> Building with CONFIG_DEBUG_SECTION_MISMATCH
>> gives the following warning:
>>
>> WARNING: vmlinux.o(.text+0x41fa8): Section mismatch in reference from
>> the function .msi_bitmap_alloc() to the function
>> .init.text:.memblock_virt_alloc_try_nid()
>> The function .msi_bitmap_alloc() references
>> the function __init .memblock_virt_alloc_try_nid().
>> This is often because .msi_bitmap_alloc lacks a __init
>> annotation or the annotation of .memblock_virt_alloc_try_nid is wrong.
>>
>> Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
>>
>
> A patch like this usually requires an explanation why the warning is
> a false positive and why there is no way to solve it besides suppressing
> the warning.

Because memory allocation in msi_bitmap_alloc use either slab allocator or
memblock boot-time allocator so that's why we need the __init_refok
for the latter case. I'll add it to the patch description

>
> 	Arnd
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-21  8:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-21  5:56 [PATCH] powerpc/msi: fix section mismatch warning Denis Kirjanov
2015-10-21  6:34 ` Arnd Bergmann
2015-10-21  8:19   ` Denis Kirjanov
2015-10-21  6:42 ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox