Skip to contentSkip to conversation

Fix drivers/memory O= build

BUG Russell King - ARM Linux 5 participants 10 messages Apr 6, 2018 – Apr 11, 2018

Subsystems (7)
lore
Share & tools
lore

Russell King - ARM Linux

author maintainer
#0 lore raw

When building a kernel with split object directories, the following failure occurs:

.../drivers/memory/emif-asm-offsets.c:1:0: fatal error: can't open drivers/memory/emif-asm-offsets.s for writing: No such file or directory compilation terminated.
drivers/memory/Makefile.asm-offsets:2: recipe for target 'drivers/memory/emif-asm-offsets.s' failed
make[2]: *** [drivers/memory/emif-asm-offsets.s] Error 1
.../Makefile:1060: recipe for target 'arch/arm/mach-omap2' failed
make[1]: *** [arch/arm/mach-omap2] Error 2

This prevents any kernel being built that includes decending into arch/arm/mach-omap2 with split object directories.

This is a regression.

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
maintainer
#1 lore raw
Quoted 10 lines · Russell King - ARM Linux

When building a kernel with split object directories, the following failure occurs:

.../drivers/memory/emif-asm-offsets.c:1:0: fatal error: can't open drivers/memory/emif-asm-offsets.s for writing: No such file or directory compilation terminated.
drivers/memory/Makefile.asm-offsets:2: recipe for target 'drivers/memory/emif-asm-offsets.s' failed
make[2]: *** [drivers/memory/emif-asm-offsets.s] Error 1
.../Makefile:1060: recipe for target 'arch/arm/mach-omap2' failed
make[1]: *** [arch/arm/mach-omap2] Error 2

Quoted 4 lines

This prevents any kernel being built that includes decending into arch/arm/mach-omap2 with split object directories.

This is a regression.

Dave, I presume you're looking into this already?

Regards,

Tony

#2 lore raw
Quoted 11 lines · Tony Lindgren
Quoted 10 lines · Russell King - ARM Linux

When building a kernel with split object directories, the following failure occurs:

.../drivers/memory/emif-asm-offsets.c:1:0: fatal error: can't open drivers/memory/emif-asm-offsets.s for writing: No such file or directory compilation terminated.
drivers/memory/Makefile.asm-offsets:2: recipe for target 'drivers/memory/emif-asm-offsets.s' failed
make[2]: *** [drivers/memory/emif-asm-offsets.s] Error 1
.../Makefile:1060: recipe for target 'arch/arm/mach-omap2' failed
make[1]: *** [arch/arm/mach-omap2] Error 2

Quoted 7 lines
Quoted 4 lines

This prevents any kernel being built that includes decending into arch/arm/mach-omap2 with split object directories.

This is a regression.

Dave, I presume you're looking into this already?

Fix is already posted by 'Anders Roxell <[email protected]>' You are copied on the email Tony.

Regards,
Santosh

author maintainer
#3 lore raw
Quoted 15 lines · Santosh Shilimkar
Quoted 14 lines · Tony Lindgren
Quoted 13 lines · Russell King - ARM Linux

When building a kernel with split object directories, the following failure occurs:

.../drivers/memory/emif-asm-offsets.c:1:0: fatal error: can't open drivers/memory/emif-asm-offsets.s for writing: No such file or directory compilation terminated.
drivers/memory/Makefile.asm-offsets:2: recipe for target 'drivers/memory/emif-asm-offsets.s' failed
make[2]: *** [drivers/memory/emif-asm-offsets.s] Error 1
.../Makefile:1060: recipe for target 'arch/arm/mach-omap2' failed
make[1]: *** [arch/arm/mach-omap2] Error 2

This prevents any kernel being built that includes decending into arch/arm/mach-omap2 with split object directories.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

This is a regression.

Dave, I presume you're looking into this already?

Fix is already posted by 'Anders Roxell <[email protected]>' You are copied on the email Tony.

Arnd also has a fix for it as well, which moves emif-asm-offsets.s into include/generated, as that will always exist prior to these rules being invoked. Arnd's passing it through his randconfig builder before publishing it.

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
#4 lore raw

2018-04-07 3:55 GMT+09:00 Russell King - ARM Linux <[email protected]>:

Quoted 20 lines · Santosh Shilimkar
Quoted 19 lines · Tony Lindgren
Quoted 18 lines · Russell King - ARM Linux
Quoted 10 lines

When building a kernel with split object directories, the following failure occurs:

.../drivers/memory/emif-asm-offsets.c:1:0: fatal error: can't open drivers/memory/emif-asm-offsets.s for writing: No such file or directory compilation terminated.
drivers/memory/Makefile.asm-offsets:2: recipe for target 'drivers/memory/emif-asm-offsets.s' failed
make[2]: *** [drivers/memory/emif-asm-offsets.s] Error 1
.../Makefile:1060: recipe for target 'arch/arm/mach-omap2' failed
make[1]: *** [arch/arm/mach-omap2] Error 2

Quoted 4 lines

This prevents any kernel being built that includes decending into arch/arm/mach-omap2 with split object directories.

This is a regression.

Dave, I presume you're looking into this already?

Quoted 7 lines
Quoted 2 lines

Fix is already posted by 'Anders Roxell <[email protected]>' You are copied on the email Tony.

Arnd also has a fix for it as well, which moves emif-asm-offsets.s into include/generated, as that will always exist prior to these rules being invoked. Arnd's passing it through his randconfig builder before publishing it.

I do not like this idea.

Not sure exactly what Arnd is trying to do,
but the same file should not be touched from multiple points in case Kbuild descends into mach-omap2/ and memory/ at the same time.

I recommend to put copies in each directory:

arch/arm/mach-omap2/emif-asm-offsets.h
drivers/memory/ti-emif-asm-offsets.h

If you want me to send a patch,
I will give it a try.

Signature · 2 lines
Best Regards
Masahiro Yamada
author maintainer
#5 lore raw
Quoted 37 lines · Masahiro Yamada

2018-04-07 3:55 GMT+09:00 Russell King - ARM Linux <[email protected]>:

Quoted 20 lines · Santosh Shilimkar
Quoted 19 lines · Tony Lindgren
Quoted 18 lines · Russell King - ARM Linux
Quoted 10 lines

When building a kernel with split object directories, the following failure occurs:

.../drivers/memory/emif-asm-offsets.c:1:0: fatal error: can't open drivers/memory/emif-asm-offsets.s for writing: No such file or directory compilation terminated.
drivers/memory/Makefile.asm-offsets:2: recipe for target 'drivers/memory/emif-asm-offsets.s' failed
make[2]: *** [drivers/memory/emif-asm-offsets.s] Error 1
.../Makefile:1060: recipe for target 'arch/arm/mach-omap2' failed
make[1]: *** [arch/arm/mach-omap2] Error 2

Quoted 4 lines

This prevents any kernel being built that includes decending into arch/arm/mach-omap2 with split object directories.

This is a regression.

Dave, I presume you're looking into this already?

Quoted 7 lines
Quoted 2 lines

Fix is already posted by 'Anders Roxell <[email protected]>' You are copied on the email Tony.

Arnd also has a fix for it as well, which moves emif-asm-offsets.s into include/generated, as that will always exist prior to these rules being invoked. Arnd's passing it through his randconfig builder before publishing it.

I do not like this idea.

Not sure exactly what Arnd is trying to do,
but the same file should not be touched from multiple points in case Kbuild descends into mach-omap2/ and memory/ at the same time.

Quoted 8 lines

I recommend to put copies in each directory:

arch/arm/mach-omap2/emif-asm-offsets.h
drivers/memory/ti-emif-asm-offsets.h

If you want me to send a patch,
I will give it a try.

Or we try and find another way around this.

The original idea was to start throwing platform specific (iow, stuff in arch/arm/mach-omap2/) includes into arch/arm/kernel/asm-offsets.c. I objected to that, and suggested that the generic infrastructure for doing the asm-offsets thing should be used to generate an architecture specific header.

Then it turns out that files in both arch/arm/mach-omap2 and drivers/memory need these constants, and TI proposed the existing method.

Obviously, all the right people reviewed it and approved it, which is why it's now in mainline, but unfortunately it doesn't actually work, and breaks my kernel builds!

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
#6 lore raw

Hi,

Quoted 55 lines · Russell King - ARM Linux
Quoted 37 lines · Masahiro Yamada

2018-04-07 3:55 GMT+09:00 Russell King - ARM Linux <[email protected]>:

Quoted 20 lines · Santosh Shilimkar
Quoted 19 lines · Tony Lindgren
Quoted 18 lines · Russell King - ARM Linux
Quoted 10 lines

When building a kernel with split object directories, the following failure occurs:

.../drivers/memory/emif-asm-offsets.c:1:0: fatal error: can't open drivers/memory/emif-asm-offsets.s for writing: No such file or directory compilation terminated.
drivers/memory/Makefile.asm-offsets:2: recipe for target 'drivers/memory/emif-asm-offsets.s' failed
make[2]: *** [drivers/memory/emif-asm-offsets.s] Error 1
.../Makefile:1060: recipe for target 'arch/arm/mach-omap2' failed
make[1]: *** [arch/arm/mach-omap2] Error 2

Quoted 4 lines

This prevents any kernel being built that includes decending into arch/arm/mach-omap2 with split object directories.

This is a regression.

Dave, I presume you're looking into this already?

Quoted 7 lines
Quoted 2 lines

Fix is already posted by 'Anders Roxell <[email protected]>' You are copied on the email Tony.

Arnd also has a fix for it as well, which moves emif-asm-offsets.s into include/generated, as that will always exist prior to these rules being invoked. Arnd's passing it through his randconfig builder before publishing it.

I do not like this idea.

Not sure exactly what Arnd is trying to do,
but the same file should not be touched from multiple points in case Kbuild descends into mach-omap2/ and memory/ at the same time.

Quoted 8 lines

I recommend to put copies in each directory:

arch/arm/mach-omap2/emif-asm-offsets.h
drivers/memory/ti-emif-asm-offsets.h

If you want me to send a patch,
I will give it a try.

Or we try and find another way around this.

The original idea was to start throwing platform specific (iow, stuff in arch/arm/mach-omap2/) includes into arch/arm/kernel/asm-offsets.c. I objected to that, and suggested that the generic infrastructure for doing the asm-offsets thing should be used to generate an architecture specific header.

Quoted 7 lines

Then it turns out that files in both arch/arm/mach-omap2 and drivers/memory need these constants, and TI proposed the existing method.

Obviously, all the right people reviewed it and approved it, which is why it's now in mainline, but unfortunately it doesn't actually work, and breaks my kernel builds!

A solution that I see is to allow pm-asm-offsets to just include the macros that would be defined by emif-asm-offsets in the header generated by pm-asm-offsets. This way there is no need to introduce the arch -> drivers build dependency that is causing our issue, each driver generates its own header with everything it needs included. I'll move the actual macro definitions for emif-asm-offsets.c into a header and then by including them in both emif-asm-offsets and pm-asm-offsets we get all macro definitions in both places with them still being defined only in one location.

I've inlined the changes below. I will send a proper split up series if it's considered acceptable.

Regards,
Dave

8< ----------------------

Quoted 1 line

From 7350c7caa773d7235ddb21013bd039a16cb6d156 Mon Sep 17 00:00:00 2001

From: Dave Gerlach <[email protected]>
Date: Mon, 9 Apr 2018 10:56:59 -0500
Subject: [PATCH] RFC: Fix build when using split object directories

The sleep33xx and sleep43xx files should not depend on a header file generated in drivers/memory. Remove this dependency and instead generate the macros needed as part of pm-asm-offsets.c to avoid complicating the build.

---
 arch/arm/mach-omap2/Makefile         |  7 +---
 arch/arm/mach-omap2/pm-asm-offsets.c |  3 ++
 arch/arm/mach-omap2/sleep33xx.S      |  1 -
 arch/arm/mach-omap2/sleep43xx.S      |  1 -
 drivers/memory/emif-asm-offsets.c    | 72 +---------------------------------
 include/linux/ti-emif-sram.h         | 75 ++++++++++++++++++++++++++++++++++++
 6 files changed, 81 insertions(+), 78 deletions(-)
arch/arm/mach-omap2/Makefile +0 -0
index 4603c30fef73..1257810cdb80 100644
@@ -243,8 +243,5 @@ arch/arm/mach-omap2/pm-asm-offsets.s:

arch/arm/mach-omap2/pm-asm-offsets.c
include/generated/ti-pm-asm-offsets.h: arch/arm/mach-omap2/pm-asm-offsets.s FORCE
$(call filechk,offsets,__TI_PM_ASM_OFFSETS_H__)

-# For rule to generate ti-emif-asm-offsets.h dependency -include drivers/memory/Makefile.asm-offsets
-
-arch/arm/mach-omap2/sleep33xx.o: include/generated/ti-pm-asm-offsets.h include/generated/ti-emif-asm-offsets.h -arch/arm/mach-omap2/sleep43xx.o: include/generated/ti-pm-asm-offsets.h include/generated/ti-emif-asm-offsets.h +arch/arm/mach-omap2/sleep33xx.o: include/generated/ti-pm-asm-offsets.h +arch/arm/mach-omap2/sleep43xx.o: include/generated/ti-pm-asm-offsets.h

(quoted diff) +0 -0

b/arch/arm/mach-omap2/pm-asm-offsets.c
index 6d4392da7c11..b9846b19e5e2 100644

arch/arm/mach-omap2/pm-asm-offsets.c +3 -0
@@ -7,9 +7,12 @@
 
 #include <linux/kbuild.h>
 #include <linux/platform_data/pm33xx.h>
+#include <linux/ti-emif-sram.h>
 
 int main(void)
 {
+	ti_emif_asm_offsets();
+
 	DEFINE(AMX3_PM_WFI_FLAGS_OFFSET,
 	       offsetof(struct am33xx_pm_sram_data, wfi_flags));
 	DEFINE(AMX3_PM_L2_AUX_CTRL_VAL_OFFSET,
arch/arm/mach-omap2/sleep33xx.S +0 -1
index 218d79930b04..322b3bb868b4 100644
@@ -6,7 +6,6 @@
  *	Dave Gerlach, Vaibhav Bedia
  */
 
-#include <generated/ti-emif-asm-offsets.h>
 #include <generated/ti-pm-asm-offsets.h>
 #include <linux/linkage.h>
 #include <linux/ti-emif-sram.h>
arch/arm/mach-omap2/sleep43xx.S +0 -1
index b24be624e8b9..8903814a6677 100644
@@ -6,7 +6,6 @@
  *	Dave Gerlach, Vaibhav Bedia
  */
 
-#include <generated/ti-emif-asm-offsets.h>
 #include <generated/ti-pm-asm-offsets.h>
 #include <linux/linkage.h>
 #include <linux/ti-emif-sram.h>
drivers/memory/emif-asm-offsets.c +1 -71

78 lines not on this page · raw message

include/linux/ti-emif-sram.h +75 -0

81 lines not on this page · raw message

Signature · 1 line
1.9.1
maintainer Acked-by
#7 lore raw
Quoted 2 lines · Dave Gerlach

I've inlined the changes below. I will send a proper split up series if it's considered acceptable.

Seems fine from my point of view. No need to split the patch, best to do the fix as a single patch.

We should test build it also with make randconfigs though.

So assuming others are OK with this and it does not introduce new randconfig build errors:

Reviewed-by
#8 lore raw
In reply to Dave Gerlach

2018-04-10 1:05 GMT+09:00 Dave Gerlach <[email protected]>:

Quoted 117 lines

Hi,

Quoted 55 lines · Russell King - ARM Linux
Quoted 37 lines · Masahiro Yamada

2018-04-07 3:55 GMT+09:00 Russell King - ARM Linux <[email protected]>:

Quoted 20 lines · Santosh Shilimkar
Quoted 19 lines · Tony Lindgren
Quoted 18 lines · Russell King - ARM Linux
Quoted 10 lines

When building a kernel with split object directories, the following failure occurs:

.../drivers/memory/emif-asm-offsets.c:1:0: fatal error: can't open drivers/memory/emif-asm-offsets.s for writing: No such file or directory compilation terminated.
drivers/memory/Makefile.asm-offsets:2: recipe for target 'drivers/memory/emif-asm-offsets.s' failed
make[2]: *** [drivers/memory/emif-asm-offsets.s] Error 1
.../Makefile:1060: recipe for target 'arch/arm/mach-omap2' failed
make[1]: *** [arch/arm/mach-omap2] Error 2

Quoted 4 lines

This prevents any kernel being built that includes decending into arch/arm/mach-omap2 with split object directories.

This is a regression.

Dave, I presume you're looking into this already?

Quoted 7 lines
Quoted 2 lines

Fix is already posted by 'Anders Roxell <[email protected]>' You are copied on the email Tony.

Arnd also has a fix for it as well, which moves emif-asm-offsets.s into include/generated, as that will always exist prior to these rules being invoked. Arnd's passing it through his randconfig builder before publishing it.

I do not like this idea.

Not sure exactly what Arnd is trying to do,
but the same file should not be touched from multiple points in case Kbuild descends into mach-omap2/ and memory/ at the same time.

Quoted 8 lines

I recommend to put copies in each directory:

arch/arm/mach-omap2/emif-asm-offsets.h
drivers/memory/ti-emif-asm-offsets.h

If you want me to send a patch,
I will give it a try.

Or we try and find another way around this.

The original idea was to start throwing platform specific (iow, stuff in arch/arm/mach-omap2/) includes into arch/arm/kernel/asm-offsets.c. I objected to that, and suggested that the generic infrastructure for doing the asm-offsets thing should be used to generate an architecture specific header.

Quoted 7 lines

Then it turns out that files in both arch/arm/mach-omap2 and drivers/memory need these constants, and TI proposed the existing method.

Obviously, all the right people reviewed it and approved it, which is why it's now in mainline, but unfortunately it doesn't actually work, and breaks my kernel builds!

A solution that I see is to allow pm-asm-offsets to just include the macros that would be defined by emif-asm-offsets in the header generated by pm-asm-offsets. This way there is no need to introduce the arch -> drivers build dependency that is causing our issue, each driver generates its own header with everything it needs included. I'll move the actual macro definitions for emif-asm-offsets.c into a header and then by including them in both emif-asm-offsets and pm-asm-offsets we get all macro definitions in both places with them still being defined only in one location.

I've inlined the changes below. I will send a proper split up series if it's considered acceptable.

Regards,
Dave

8< ----------------------
From 7350c7caa773d7235ddb21013bd039a16cb6d156 Mon Sep 17 00:00:00 2001
From: Dave Gerlach <[email protected]>
Date: Mon, 9 Apr 2018 10:56:59 -0500
Subject: [PATCH] RFC: Fix build when using split object directories

The sleep33xx and sleep43xx files should not depend on a header file generated in drivers/memory. Remove this dependency and instead generate the macros needed as part of pm-asm-offsets.c to avoid complicating the build.

---
 arch/arm/mach-omap2/Makefile         |  7 +---
 arch/arm/mach-omap2/pm-asm-offsets.c |  3 ++
 arch/arm/mach-omap2/sleep33xx.S      |  1 -
 arch/arm/mach-omap2/sleep43xx.S      |  1 -
 drivers/memory/emif-asm-offsets.c    | 72 +---------------------------------
 include/linux/ti-emif-sram.h         | 75 ++++++++++++++++++++++++++++++++++++
 6 files changed, 81 insertions(+), 78 deletions(-)
arch/arm/mach-omap2/Makefile +0 -0
index 4603c30fef73..1257810cdb80 100644
@@ -243,8 +243,5 @@ arch/arm/mach-omap2/pm-asm-offsets.s:

arch/arm/mach-omap2/pm-asm-offsets.c
include/generated/ti-pm-asm-offsets.h: arch/arm/mach-omap2/pm-asm-offsets.s FORCE

        $(call filechk,offsets,__TI_PM_ASM_OFFSETS_H__)
arch/arm/mach-omap2/Makefile +0 -4
-# For rule to generate ti-emif-asm-offsets.h dependency
-include drivers/memory/Makefile.asm-offsets
-
-arch/arm/mach-omap2/sleep33xx.o: include/generated/ti-pm-asm-offsets.h

include/generated/ti-emif-asm-offsets.h -arch/arm/mach-omap2/sleep43xx.o: include/generated/ti-pm-asm-offsets.h include/generated/ti-emif-asm-offsets.h

arch/arm/mach-omap2/Makefile

Quoted 2 lines
arch/arm/mach-omap2/Makefile +2 -0
+arch/arm/mach-omap2/sleep33xx.o: include/generated/ti-pm-asm-offsets.h
+arch/arm/mach-omap2/sleep43xx.o: include/generated/ti-pm-asm-offsets.h

Nit:
You are touching these two lines.
You can also describe it like this:

$(obj)/sleep33xx.o $(obj)/sleep43xx.o: include/generated/ti-pm-asm-offsets.h

I prefer putting the local header, ti-pm-asm-offsets.h, into arch/arm/mach-omap2/, but that is a different issue.

So, I am fine with this.

Signature · 2 lines
Best Regards
Masahiro Yamada
#9 lore raw

Hi,

Quoted 130 lines · Masahiro Yamada

2018-04-10 1:05 GMT+09:00 Dave Gerlach <[email protected]>:

Quoted 117 lines

Hi,

Quoted 55 lines · Russell King - ARM Linux
Quoted 37 lines · Masahiro Yamada

2018-04-07 3:55 GMT+09:00 Russell King - ARM Linux <[email protected]>:

Quoted 20 lines · Santosh Shilimkar
Quoted 19 lines · Tony Lindgren
Quoted 18 lines · Russell King - ARM Linux
Quoted 10 lines

When building a kernel with split object directories, the following failure occurs:

.../drivers/memory/emif-asm-offsets.c:1:0: fatal error: can't open drivers/memory/emif-asm-offsets.s for writing: No such file or directory compilation terminated.
drivers/memory/Makefile.asm-offsets:2: recipe for target 'drivers/memory/emif-asm-offsets.s' failed
make[2]: *** [drivers/memory/emif-asm-offsets.s] Error 1
.../Makefile:1060: recipe for target 'arch/arm/mach-omap2' failed
make[1]: *** [arch/arm/mach-omap2] Error 2

Quoted 4 lines

This prevents any kernel being built that includes decending into arch/arm/mach-omap2 with split object directories.

This is a regression.

Dave, I presume you're looking into this already?

Quoted 7 lines
Quoted 2 lines

Fix is already posted by 'Anders Roxell <[email protected]>' You are copied on the email Tony.

Arnd also has a fix for it as well, which moves emif-asm-offsets.s into include/generated, as that will always exist prior to these rules being invoked. Arnd's passing it through his randconfig builder before publishing it.

I do not like this idea.

Not sure exactly what Arnd is trying to do,
but the same file should not be touched from multiple points in case Kbuild descends into mach-omap2/ and memory/ at the same time.

Quoted 8 lines

I recommend to put copies in each directory:

arch/arm/mach-omap2/emif-asm-offsets.h
drivers/memory/ti-emif-asm-offsets.h

If you want me to send a patch,
I will give it a try.

Or we try and find another way around this.

The original idea was to start throwing platform specific (iow, stuff in arch/arm/mach-omap2/) includes into arch/arm/kernel/asm-offsets.c. I objected to that, and suggested that the generic infrastructure for doing the asm-offsets thing should be used to generate an architecture specific header.

Quoted 7 lines

Then it turns out that files in both arch/arm/mach-omap2 and drivers/memory need these constants, and TI proposed the existing method.

Obviously, all the right people reviewed it and approved it, which is why it's now in mainline, but unfortunately it doesn't actually work, and breaks my kernel builds!

A solution that I see is to allow pm-asm-offsets to just include the macros that would be defined by emif-asm-offsets in the header generated by pm-asm-offsets. This way there is no need to introduce the arch -> drivers build dependency that is causing our issue, each driver generates its own header with everything it needs included. I'll move the actual macro definitions for emif-asm-offsets.c into a header and then by including them in both emif-asm-offsets and pm-asm-offsets we get all macro definitions in both places with them still being defined only in one location.

I've inlined the changes below. I will send a proper split up series if it's considered acceptable.

Regards,
Dave

8< ----------------------
From 7350c7caa773d7235ddb21013bd039a16cb6d156 Mon Sep 17 00:00:00 2001
From: Dave Gerlach <[email protected]>
Date: Mon, 9 Apr 2018 10:56:59 -0500
Subject: [PATCH] RFC: Fix build when using split object directories

The sleep33xx and sleep43xx files should not depend on a header file generated in drivers/memory. Remove this dependency and instead generate the macros needed as part of pm-asm-offsets.c to avoid complicating the build.

---
 arch/arm/mach-omap2/Makefile         |  7 +---
 arch/arm/mach-omap2/pm-asm-offsets.c |  3 ++
 arch/arm/mach-omap2/sleep33xx.S      |  1 -
 arch/arm/mach-omap2/sleep43xx.S      |  1 -
 drivers/memory/emif-asm-offsets.c    | 72 +---------------------------------
 include/linux/ti-emif-sram.h         | 75 ++++++++++++++++++++++++++++++++++++
 6 files changed, 81 insertions(+), 78 deletions(-)
arch/arm/mach-omap2/Makefile +0 -0
index 4603c30fef73..1257810cdb80 100644
@@ -243,8 +243,5 @@ arch/arm/mach-omap2/pm-asm-offsets.s:

arch/arm/mach-omap2/pm-asm-offsets.c
include/generated/ti-pm-asm-offsets.h: arch/arm/mach-omap2/pm-asm-offsets.s FORCE

        $(call filechk,offsets,__TI_PM_ASM_OFFSETS_H__)
arch/arm/mach-omap2/Makefile +0 -4
-# For rule to generate ti-emif-asm-offsets.h dependency
-include drivers/memory/Makefile.asm-offsets
-
-arch/arm/mach-omap2/sleep33xx.o: include/generated/ti-pm-asm-offsets.h

include/generated/ti-emif-asm-offsets.h -arch/arm/mach-omap2/sleep43xx.o: include/generated/ti-pm-asm-offsets.h include/generated/ti-emif-asm-offsets.h

arch/arm/mach-omap2/Makefile

Quoted 2 lines
arch/arm/mach-omap2/Makefile +2 -0
+arch/arm/mach-omap2/sleep33xx.o: include/generated/ti-pm-asm-offsets.h
+arch/arm/mach-omap2/sleep43xx.o: include/generated/ti-pm-asm-offsets.h

Nit:
You are touching these two lines.
You can also describe it like this:

$(obj)/sleep33xx.o $(obj)/sleep43xx.o: include/generated/ti-pm-asm-offsets.h

Quoted 10 lines

I prefer putting the local header, ti-pm-asm-offsets.h, into arch/arm/mach-omap2/, but that is a different issue.

So, I am fine with this.

Thanks, I have sent a patch with the nit above changed and slightly more info in the commit message and added the Ack from Tony and Reviewed-by from above.

https://lkml.org/lkml/2018/4/11/1281

Regards,
Dave