[2/3] ARM: at91: move platform-specific asm-offset.h to arch/arm/mach-at91
diff mbox series

Message ID 20190408075427.6052-2-yamada.masahiro@socionext.com
State New
Headers show
Series
  • [1/3] ARM: visit mach-* and plat-* directories when cleaning
Related show

Commit Message

Masahiro Yamada April 8, 2019, 7:54 a.m. UTC
<generated/at91_pm_data-offsets.h> is only generated and included
by arch/arm/mach-at91/, so it does not need to reside in the
globally visible include/generated/.

I moved and renamed it to arch/arm/mach-at91/pm_data-offsets.h
since the prefix 'at91_' is just redundant in mach-at91/.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Can this be applied to ARM-SOC tree in a series?
(with Ack from the platform sub-maintainer.)

at91_pm_data-offsets.h header does not need to reside in
include/generated/, but you may ask
"Why must it get out of include/generated/?"

My main motivation is to avoid a race condition in the currently
proposed patch:

https://lore.kernel.org/patchwork/patch/1052763/

This patch tries to embed some build artifacts into the kernel.

If arch/arm/mach-at91/ and kernel/ are built at the same time,
it may embed a truncated file.


 arch/arm/mach-at91/.gitignore   | 1 +
 arch/arm/mach-at91/Makefile     | 5 +++--
 arch/arm/mach-at91/pm_suspend.S | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/mach-at91/.gitignore

Comments

Alexandre Belloni April 15, 2019, 3:14 p.m. UTC | #1
On 08/04/2019 16:54:26+0900, Masahiro Yamada wrote:
> <generated/at91_pm_data-offsets.h> is only generated and included
> by arch/arm/mach-at91/, so it does not need to reside in the
> globally visible include/generated/.
> 
> I moved and renamed it to arch/arm/mach-at91/pm_data-offsets.h
> since the prefix 'at91_' is just redundant in mach-at91/.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> ---
> 
> Can this be applied to ARM-SOC tree in a series?
> (with Ack from the platform sub-maintainer.)
> 
> at91_pm_data-offsets.h header does not need to reside in
> include/generated/, but you may ask
> "Why must it get out of include/generated/?"
> 
> My main motivation is to avoid a race condition in the currently
> proposed patch:
> 
> https://lore.kernel.org/patchwork/patch/1052763/
> 
> This patch tries to embed some build artifacts into the kernel.
> 
> If arch/arm/mach-at91/ and kernel/ are built at the same time,
> it may embed a truncated file.
> 
> 
>  arch/arm/mach-at91/.gitignore   | 1 +
>  arch/arm/mach-at91/Makefile     | 5 +++--
>  arch/arm/mach-at91/pm_suspend.S | 2 +-
>  3 files changed, 5 insertions(+), 3 deletions(-)
>  create mode 100644 arch/arm/mach-at91/.gitignore
> 
> diff --git a/arch/arm/mach-at91/.gitignore b/arch/arm/mach-at91/.gitignore
> new file mode 100644
> index 000000000000..2ecd6f51c8a9
> --- /dev/null
> +++ b/arch/arm/mach-at91/.gitignore
> @@ -0,0 +1 @@
> +pm_data-offsets.h
> diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
> index 31b61f0e1c07..de64301dcff2 100644
> --- a/arch/arm/mach-at91/Makefile
> +++ b/arch/arm/mach-at91/Makefile
> @@ -19,9 +19,10 @@ ifeq ($(CONFIG_PM_DEBUG),y)
>  CFLAGS_pm.o += -DDEBUG
>  endif
>  
> -include/generated/at91_pm_data-offsets.h: arch/arm/mach-at91/pm_data-offsets.s FORCE
> +$(obj)/pm_data-offsets.h: $(obj)/pm_data-offsets.s FORCE
>  	$(call filechk,offsets,__PM_DATA_OFFSETS_H__)
>  
> -arch/arm/mach-at91/pm_suspend.o: include/generated/at91_pm_data-offsets.h
> +$(obj)/pm_suspend.o: $(obj)/pm_data-offsets.h
>  
>  targets += pm_data-offsets.s
> +clean-files += pm_data-offsets.h
> diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S
> index bfe1c4d06901..a31c1b20f3fa 100644
> --- a/arch/arm/mach-at91/pm_suspend.S
> +++ b/arch/arm/mach-at91/pm_suspend.S
> @@ -14,7 +14,7 @@
>  #include <linux/linkage.h>
>  #include <linux/clk/at91_pmc.h>
>  #include "pm.h"
> -#include "generated/at91_pm_data-offsets.h"
> +#include "pm_data-offsets.h"
>  
>  #define	SRAMC_SELF_FRESH_ACTIVE		0x01
>  #define	SRAMC_SELF_FRESH_EXIT		0x00
> -- 
> 2.17.1
>
Ludovic Desroches April 19, 2019, 11:39 a.m. UTC | #2
On Mon, Apr 15, 2019 at 05:14:50PM +0200, Alexandre Belloni wrote:
> External E-Mail
> 
> 
> On 08/04/2019 16:54:26+0900, Masahiro Yamada wrote:
> > <generated/at91_pm_data-offsets.h> is only generated and included
> > by arch/arm/mach-at91/, so it does not need to reside in the
> > globally visible include/generated/.
> > 
> > I moved and renamed it to arch/arm/mach-at91/pm_data-offsets.h
> > since the prefix 'at91_' is just redundant in mach-at91/.
> > 
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> 

Applied in at91-soc. Let me know if it's an issue, I plan to do the PR
soon.

Regards

Ludovic

> > ---
> > 
> > Can this be applied to ARM-SOC tree in a series?
> > (with Ack from the platform sub-maintainer.)
> > 
> > at91_pm_data-offsets.h header does not need to reside in
> > include/generated/, but you may ask
> > "Why must it get out of include/generated/?"
> > 
> > My main motivation is to avoid a race condition in the currently
> > proposed patch:
> > 
> > https://lore.kernel.org/patchwork/patch/1052763/
> > 
> > This patch tries to embed some build artifacts into the kernel.
> > 
> > If arch/arm/mach-at91/ and kernel/ are built at the same time,
> > it may embed a truncated file.
> > 
> > 
> >  arch/arm/mach-at91/.gitignore   | 1 +
> >  arch/arm/mach-at91/Makefile     | 5 +++--
> >  arch/arm/mach-at91/pm_suspend.S | 2 +-
> >  3 files changed, 5 insertions(+), 3 deletions(-)
> >  create mode 100644 arch/arm/mach-at91/.gitignore
> > 
> > diff --git a/arch/arm/mach-at91/.gitignore b/arch/arm/mach-at91/.gitignore
> > new file mode 100644
> > index 000000000000..2ecd6f51c8a9
> > --- /dev/null
> > +++ b/arch/arm/mach-at91/.gitignore
> > @@ -0,0 +1 @@
> > +pm_data-offsets.h
> > diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
> > index 31b61f0e1c07..de64301dcff2 100644
> > --- a/arch/arm/mach-at91/Makefile
> > +++ b/arch/arm/mach-at91/Makefile
> > @@ -19,9 +19,10 @@ ifeq ($(CONFIG_PM_DEBUG),y)
> >  CFLAGS_pm.o += -DDEBUG
> >  endif
> >  
> > -include/generated/at91_pm_data-offsets.h: arch/arm/mach-at91/pm_data-offsets.s FORCE
> > +$(obj)/pm_data-offsets.h: $(obj)/pm_data-offsets.s FORCE
> >  	$(call filechk,offsets,__PM_DATA_OFFSETS_H__)
> >  
> > -arch/arm/mach-at91/pm_suspend.o: include/generated/at91_pm_data-offsets.h
> > +$(obj)/pm_suspend.o: $(obj)/pm_data-offsets.h
> >  
> >  targets += pm_data-offsets.s
> > +clean-files += pm_data-offsets.h
> > diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S
> > index bfe1c4d06901..a31c1b20f3fa 100644
> > --- a/arch/arm/mach-at91/pm_suspend.S
> > +++ b/arch/arm/mach-at91/pm_suspend.S
> > @@ -14,7 +14,7 @@
> >  #include <linux/linkage.h>
> >  #include <linux/clk/at91_pmc.h>
> >  #include "pm.h"
> > -#include "generated/at91_pm_data-offsets.h"
> > +#include "pm_data-offsets.h"
> >  
> >  #define	SRAMC_SELF_FRESH_ACTIVE		0x01
> >  #define	SRAMC_SELF_FRESH_EXIT		0x00
> > -- 
> > 2.17.1
> > 
> 
> -- 
> Alexandre Belloni, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
Masahiro Yamada April 19, 2019, 11:10 p.m. UTC | #3
On Sat, Apr 20, 2019 at 4:03 AM Ludovic Desroches
<ludovic.desroches@microchip.com> wrote:
>
> On Mon, Apr 15, 2019 at 05:14:50PM +0200, Alexandre Belloni wrote:
> > External E-Mail
> >
> >
> > On 08/04/2019 16:54:26+0900, Masahiro Yamada wrote:
> > > <generated/at91_pm_data-offsets.h> is only generated and included
> > > by arch/arm/mach-at91/, so it does not need to reside in the
> > > globally visible include/generated/.
> > >
> > > I moved and renamed it to arch/arm/mach-at91/pm_data-offsets.h
> > > since the prefix 'at91_' is just redundant in mach-at91/.
> > >
> > > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> >
>
> Applied in at91-soc. Let me know if it's an issue, I plan to do the PR
> soon.


There is one minor issue.

If you apply 2/3 (this one) alone,
arch/arm/mach-at91/pm_data-offsets.h is not cleaned.


1/3 fixes the "make clean" issue:
https://lkml.org/lkml/2019/4/8/153


That is why I sent this as a series
in order to avoid the regression of cleaning.



Thanks.

Masahiro Yamada


> Regards
>
> Ludovic
>
> > > ---
> > >
> > > Can this be applied to ARM-SOC tree in a series?
> > > (with Ack from the platform sub-maintainer.)
> > >
> > > at91_pm_data-offsets.h header does not need to reside in
> > > include/generated/, but you may ask
> > > "Why must it get out of include/generated/?"
> > >
> > > My main motivation is to avoid a race condition in the currently
> > > proposed patch:
> > >
> > > https://lore.kernel.org/patchwork/patch/1052763/
> > >
> > > This patch tries to embed some build artifacts into the kernel.
> > >
> > > If arch/arm/mach-at91/ and kernel/ are built at the same time,
> > > it may embed a truncated file.
> > >
> > >
> > >  arch/arm/mach-at91/.gitignore   | 1 +
> > >  arch/arm/mach-at91/Makefile     | 5 +++--
> > >  arch/arm/mach-at91/pm_suspend.S | 2 +-
> > >  3 files changed, 5 insertions(+), 3 deletions(-)
> > >  create mode 100644 arch/arm/mach-at91/.gitignore
> > >
> > > diff --git a/arch/arm/mach-at91/.gitignore b/arch/arm/mach-at91/.gitignore
> > > new file mode 100644
> > > index 000000000000..2ecd6f51c8a9
> > > --- /dev/null
> > > +++ b/arch/arm/mach-at91/.gitignore
> > > @@ -0,0 +1 @@
> > > +pm_data-offsets.h
> > > diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
> > > index 31b61f0e1c07..de64301dcff2 100644
> > > --- a/arch/arm/mach-at91/Makefile
> > > +++ b/arch/arm/mach-at91/Makefile
> > > @@ -19,9 +19,10 @@ ifeq ($(CONFIG_PM_DEBUG),y)
> > >  CFLAGS_pm.o += -DDEBUG
> > >  endif
> > >
> > > -include/generated/at91_pm_data-offsets.h: arch/arm/mach-at91/pm_data-offsets.s FORCE
> > > +$(obj)/pm_data-offsets.h: $(obj)/pm_data-offsets.s FORCE
> > >     $(call filechk,offsets,__PM_DATA_OFFSETS_H__)
> > >
> > > -arch/arm/mach-at91/pm_suspend.o: include/generated/at91_pm_data-offsets.h
> > > +$(obj)/pm_suspend.o: $(obj)/pm_data-offsets.h
> > >
> > >  targets += pm_data-offsets.s
> > > +clean-files += pm_data-offsets.h
> > > diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S
> > > index bfe1c4d06901..a31c1b20f3fa 100644
> > > --- a/arch/arm/mach-at91/pm_suspend.S
> > > +++ b/arch/arm/mach-at91/pm_suspend.S
> > > @@ -14,7 +14,7 @@
> > >  #include <linux/linkage.h>
> > >  #include <linux/clk/at91_pmc.h>
> > >  #include "pm.h"
> > > -#include "generated/at91_pm_data-offsets.h"
> > > +#include "pm_data-offsets.h"
> > >
> > >  #define    SRAMC_SELF_FRESH_ACTIVE         0x01
> > >  #define    SRAMC_SELF_FRESH_EXIT           0x00
> > > --
> > > 2.17.1
> > >
> >
> > --
> > Alexandre Belloni, Bootlin
> > Embedded Linux and Kernel engineering
> > https://bootlin.com
> >
Masahiro Yamada April 23, 2019, 4:29 a.m. UTC | #4
On Sat, Apr 20, 2019 at 8:10 AM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> On Sat, Apr 20, 2019 at 4:03 AM Ludovic Desroches
> <ludovic.desroches@microchip.com> wrote:
> >
> > On Mon, Apr 15, 2019 at 05:14:50PM +0200, Alexandre Belloni wrote:
> > > External E-Mail
> > >
> > >
> > > On 08/04/2019 16:54:26+0900, Masahiro Yamada wrote:
> > > > <generated/at91_pm_data-offsets.h> is only generated and included
> > > > by arch/arm/mach-at91/, so it does not need to reside in the
> > > > globally visible include/generated/.
> > > >
> > > > I moved and renamed it to arch/arm/mach-at91/pm_data-offsets.h
> > > > since the prefix 'at91_' is just redundant in mach-at91/.
> > > >
> > > > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > > Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > >
> >
> > Applied in at91-soc. Let me know if it's an issue, I plan to do the PR
> > soon.

Sorry. A more fatal issue is this breaks O= build.

Could you drop it?

Thanks.



>
>
> There is one minor issue.
>
> If you apply 2/3 (this one) alone,
> arch/arm/mach-at91/pm_data-offsets.h is not cleaned.
>
>
> 1/3 fixes the "make clean" issue:
> https://lkml.org/lkml/2019/4/8/153
>
>
> That is why I sent this as a series
> in order to avoid the regression of cleaning.
>
>
>
> Thanks.
>
> Masahiro Yamada
>
>
> > Regards
> >
> > Ludovic
> >
> > > > ---
> > > >
> > > > Can this be applied to ARM-SOC tree in a series?
> > > > (with Ack from the platform sub-maintainer.)
> > > >
> > > > at91_pm_data-offsets.h header does not need to reside in
> > > > include/generated/, but you may ask
> > > > "Why must it get out of include/generated/?"
> > > >
> > > > My main motivation is to avoid a race condition in the currently
> > > > proposed patch:
> > > >
> > > > https://lore.kernel.org/patchwork/patch/1052763/
> > > >
> > > > This patch tries to embed some build artifacts into the kernel.
> > > >
> > > > If arch/arm/mach-at91/ and kernel/ are built at the same time,
> > > > it may embed a truncated file.
> > > >
> > > >
> > > >  arch/arm/mach-at91/.gitignore   | 1 +
> > > >  arch/arm/mach-at91/Makefile     | 5 +++--
> > > >  arch/arm/mach-at91/pm_suspend.S | 2 +-
> > > >  3 files changed, 5 insertions(+), 3 deletions(-)
> > > >  create mode 100644 arch/arm/mach-at91/.gitignore
> > > >
> > > > diff --git a/arch/arm/mach-at91/.gitignore b/arch/arm/mach-at91/.gitignore
> > > > new file mode 100644
> > > > index 000000000000..2ecd6f51c8a9
> > > > --- /dev/null
> > > > +++ b/arch/arm/mach-at91/.gitignore
> > > > @@ -0,0 +1 @@
> > > > +pm_data-offsets.h
> > > > diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
> > > > index 31b61f0e1c07..de64301dcff2 100644
> > > > --- a/arch/arm/mach-at91/Makefile
> > > > +++ b/arch/arm/mach-at91/Makefile
> > > > @@ -19,9 +19,10 @@ ifeq ($(CONFIG_PM_DEBUG),y)
> > > >  CFLAGS_pm.o += -DDEBUG
> > > >  endif
> > > >
> > > > -include/generated/at91_pm_data-offsets.h: arch/arm/mach-at91/pm_data-offsets.s FORCE
> > > > +$(obj)/pm_data-offsets.h: $(obj)/pm_data-offsets.s FORCE
> > > >     $(call filechk,offsets,__PM_DATA_OFFSETS_H__)
> > > >
> > > > -arch/arm/mach-at91/pm_suspend.o: include/generated/at91_pm_data-offsets.h
> > > > +$(obj)/pm_suspend.o: $(obj)/pm_data-offsets.h
> > > >
> > > >  targets += pm_data-offsets.s
> > > > +clean-files += pm_data-offsets.h
> > > > diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S
> > > > index bfe1c4d06901..a31c1b20f3fa 100644
> > > > --- a/arch/arm/mach-at91/pm_suspend.S
> > > > +++ b/arch/arm/mach-at91/pm_suspend.S
> > > > @@ -14,7 +14,7 @@
> > > >  #include <linux/linkage.h>
> > > >  #include <linux/clk/at91_pmc.h>
> > > >  #include "pm.h"
> > > > -#include "generated/at91_pm_data-offsets.h"
> > > > +#include "pm_data-offsets.h"
> > > >
> > > >  #define    SRAMC_SELF_FRESH_ACTIVE         0x01
> > > >  #define    SRAMC_SELF_FRESH_EXIT           0x00
> > > > --
> > > > 2.17.1
> > > >
> > >
> > > --
> > > Alexandre Belloni, Bootlin
> > > Embedded Linux and Kernel engineering
> > > https://bootlin.com
> > >
>
>
>
> --
> Best Regards
> Masahiro Yamada

Patch
diff mbox series

diff --git a/arch/arm/mach-at91/.gitignore b/arch/arm/mach-at91/.gitignore
new file mode 100644
index 000000000000..2ecd6f51c8a9
--- /dev/null
+++ b/arch/arm/mach-at91/.gitignore
@@ -0,0 +1 @@ 
+pm_data-offsets.h
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 31b61f0e1c07..de64301dcff2 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -19,9 +19,10 @@  ifeq ($(CONFIG_PM_DEBUG),y)
 CFLAGS_pm.o += -DDEBUG
 endif
 
-include/generated/at91_pm_data-offsets.h: arch/arm/mach-at91/pm_data-offsets.s FORCE
+$(obj)/pm_data-offsets.h: $(obj)/pm_data-offsets.s FORCE
 	$(call filechk,offsets,__PM_DATA_OFFSETS_H__)
 
-arch/arm/mach-at91/pm_suspend.o: include/generated/at91_pm_data-offsets.h
+$(obj)/pm_suspend.o: $(obj)/pm_data-offsets.h
 
 targets += pm_data-offsets.s
+clean-files += pm_data-offsets.h
diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S
index bfe1c4d06901..a31c1b20f3fa 100644
--- a/arch/arm/mach-at91/pm_suspend.S
+++ b/arch/arm/mach-at91/pm_suspend.S
@@ -14,7 +14,7 @@ 
 #include <linux/linkage.h>
 #include <linux/clk/at91_pmc.h>
 #include "pm.h"
-#include "generated/at91_pm_data-offsets.h"
+#include "pm_data-offsets.h"
 
 #define	SRAMC_SELF_FRESH_ACTIVE		0x01
 #define	SRAMC_SELF_FRESH_EXIT		0x00