The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH RESEND v3] fsl-ifc: add missing include on ARM64
@ 2015-12-11 19:55 Lijun Pan
  2015-12-15 23:18 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Lijun Pan @ 2015-12-11 19:55 UTC (permalink / raw)
  To: arnd, gregkh, linux-kernel; +Cc: Lijun.Pan2000, Lijun Pan

Need to include sched.h to fix the following compilation error
if FSL_IFC is enabled on ARM64 machine.

In file included from include/linux/mmzone.h:9:0,
                 from include/linux/gfp.h:5,
                 from include/linux/kmod.h:22,
                 from include/linux/module.h:13,
                 from drivers/memory/fsl_ifc.c:22:
drivers/memory/fsl_ifc.c: In function ‘check_nand_stat’:
include/linux/wait.h:165:35: error: ‘TASK_NORMAL’ undeclared (first use in this function)
 #define wake_up(x)   __wake_up(x, TASK_NORMAL, 1, NULL)
                                   ^
drivers/memory/fsl_ifc.c:136:3: note: in expansion of macro ‘wake_up’
   wake_up(&ctrl->nand_wait);
   ^
include/linux/wait.h:165:35: note: each undeclared identifier is reported only once for each function it appears in
 #define wake_up(x)   __wake_up(x, TASK_NORMAL, 1, NULL)
                                   ^
drivers/memory/fsl_ifc.c:136:3: note: in expansion of macro ‘wake_up’
   wake_up(&ctrl->nand_wait);
   ^

Analysis is as follows:
I put some instrumental code and get the
following .h files inclusion sequence:

In file included from ./arch/arm64/include/asm/compat.h:25:0,
                 from ./arch/arm64/include/asm/stat.h:23,
                 from include/linux/stat.h:5,
                 from include/linux/module.h:10,
                 from drivers/memory/fsl_ifc.c:23:
include/linux/sched.h:113:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘struct’
 struct sched_attr {
 ^

CONFIG_COMPAT=y is enabled while 39 and 48 bit VA is selected.
When 42 bit VA is selected, it does not enable CONFIG_COMPAT=y

In ./arch/arm64/include/asm/stat.h:23, it has
"#ifdef CONFIG_COMPAT"
"#include <asm/compat.h>"
"..."
"#endif"

Since ./arch/arm64/include/asm/stat.h does not
include ./arch/arm64/include/asm/compat.h,
then it will not include include/linux/sched.h
Hence we have to manually add "#include <linux/sched.h>"
in drivers/memory/fsl_ifc.c

Signed-off-by: Lijun Pan <Lijun.Pan@freescale.com>
---
v3: change the subject title to better reflect the commit message
    insert linux/sched.h in more appropriate place among all .h files
    articulate CONFIG_COMPAT=y is set in 39/48 bit VA
v2: reordering the include .h files according to Arnd's suggestion
    detailing why linux/sched.h is needed.

 drivers/memory/fsl_ifc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/memory/fsl_ifc.c b/drivers/memory/fsl_ifc.c
index e87459f..acd1460 100644
--- a/drivers/memory/fsl_ifc.c
+++ b/drivers/memory/fsl_ifc.c
@@ -22,6 +22,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/compiler.h>
+#include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
 #include <linux/slab.h>
-- 
2.3.3


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

* Re: [PATCH RESEND v3] fsl-ifc: add missing include on ARM64
  2015-12-11 19:55 [PATCH RESEND v3] fsl-ifc: add missing include on ARM64 Lijun Pan
@ 2015-12-15 23:18 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2015-12-15 23:18 UTC (permalink / raw)
  To: Lijun Pan; +Cc: gregkh, linux-kernel, Lijun.Pan2000

On Friday 11 December 2015 13:55:02 Lijun Pan wrote:
> Need to include sched.h to fix the following compilation error
> if FSL_IFC is enabled on ARM64 machine.
> 
> In file included from include/linux/mmzone.h:9:0,
>                  from include/linux/gfp.h:5,
>                  from include/linux/kmod.h:22,
>                  from include/linux/module.h:13,
>                  from drivers/memory/fsl_ifc.c:22:
> drivers/memory/fsl_ifc.c: In function ‘check_nand_stat’:
> include/linux/wait.h:165:35: error: ‘TASK_NORMAL’ undeclared (first use in this function)
>  #define wake_up(x)   __wake_up(x, TASK_NORMAL, 1, NULL)
>                                    ^
> drivers/memory/fsl_ifc.c:136:3: note: in expansion of macro ‘wake_up’
>    wake_up(&ctrl->nand_wait);
>    ^
> include/linux/wait.h:165:35: note: each undeclared identifier is reported only once for each function it appears in
>  #define wake_up(x)   __wake_up(x, TASK_NORMAL, 1, NULL)
>                                    ^
> drivers/memory/fsl_ifc.c:136:3: note: in expansion of macro ‘wake_up’
>    wake_up(&ctrl->nand_wait);
>    ^
> 
> Analysis is as follows:
> I put some instrumental code and get the
> following .h files inclusion sequence:
> 
> In file included from ./arch/arm64/include/asm/compat.h:25:0,
>                  from ./arch/arm64/include/asm/stat.h:23,
>                  from include/linux/stat.h:5,
>                  from include/linux/module.h:10,
>                  from drivers/memory/fsl_ifc.c:23:
> include/linux/sched.h:113:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘struct’
>  struct sched_attr {
>  ^
> 
> CONFIG_COMPAT=y is enabled while 39 and 48 bit VA is selected.
> When 42 bit VA is selected, it does not enable CONFIG_COMPAT=y
> 
> In ./arch/arm64/include/asm/stat.h:23, it has
> "#ifdef CONFIG_COMPAT"
> "#include <asm/compat.h>"
> "..."
> "#endif"
> 
> Since ./arch/arm64/include/asm/stat.h does not
> include ./arch/arm64/include/asm/compat.h,
> then it will not include include/linux/sched.h
> Hence we have to manually add "#include <linux/sched.h>"
> in drivers/memory/fsl_ifc.c
> 
> Signed-off-by: Lijun Pan <Lijun.Pan@freescale.com>
> 

I've applied this to the fixes branch of arm-soc now.

Thanks,

	Arnd

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

end of thread, other threads:[~2015-12-15 23:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-11 19:55 [PATCH RESEND v3] fsl-ifc: add missing include on ARM64 Lijun Pan
2015-12-15 23:18 ` Arnd Bergmann

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