public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch v3 1/3] dt: OF_UNITTEST make dependency broken, framework fixes
@ 2015-03-12 13:15 Frank Rowand
  2015-03-12 13:18 ` [Patch v3 3/3] dt: OF_UNITTEST make dependency broken, fix unittest.c after move Frank Rowand
  2015-03-13 13:13 ` [Patch v3 1/3] dt: OF_UNITTEST make dependency broken, framework fixes Rob Herring
  0 siblings, 2 replies; 4+ messages in thread
From: Frank Rowand @ 2015-03-12 13:15 UTC (permalink / raw)
  To: Grant Likely, Rob Herring, Michal Marek, Linux Kernel list,
	devicetree@vger.kernel.org, linux-kbuild

From: Frank Rowand <frank.rowand@sonymobile.com>

This 3 patch series is not bisectable.  If CONFIG_OF_UNITTEST=y then the kernel
will not build with just patch 1 or just patches 1 and 2 applied.

If CONFIG_OF_UNITTEST=y then a kernel image make will always cause .version to
be incremented, even if there are not source changes.  This is caused by
a lack of dependency tracking and checking for
drivers/of/unittest-data/testcases.dtb.o.  Fixing the problem was made more
complicated by the fact that testcases.dtb.o was linked into ../of_unittest.o.

Patch 1 modifies makefiles to move of_unittest.c into unittest-data/ and
creates missing dependency tracking for testcases.dtb.o.

Patch 2 will move of_unittest.c into unittest-data/

Patch 3 will fix an of_unittest.c include path to account for the move.

Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com>

---

changes since version 2:

  patch 1:
  Add .gitignore so that generated files will not get committed.

changes since version 1:

  patch 1:
  Remove some changes to scripts/Makefile.lib that are not needed.  They
  were left over from attempts to fix the problem without moving of_unitest.c
  into unittest-data/.


 drivers/of/Makefile                 |    4 ++--
 drivers/of/unittest-data/.gitignore |    2 ++
 drivers/of/unittest-data/Makefile   |    9 +++++++++
 3 files changed, 13 insertions(+), 2 deletions(-)

Index: b/drivers/of/Makefile
===================================================================
--- a/drivers/of/Makefile
+++ b/drivers/of/Makefile
@@ -6,8 +6,6 @@ obj-$(CONFIG_OF_PROMTREE) += pdt.o
 obj-$(CONFIG_OF_ADDRESS)  += address.o
 obj-$(CONFIG_OF_IRQ)    += irq.o
 obj-$(CONFIG_OF_NET)	+= of_net.o
-obj-$(CONFIG_OF_UNITTEST) += of_unittest.o
-of_unittest-objs := unittest.o unittest-data/testcases.dtb.o
 obj-$(CONFIG_OF_MDIO)	+= of_mdio.o
 obj-$(CONFIG_OF_PCI)	+= of_pci.o
 obj-$(CONFIG_OF_PCI_IRQ)  += of_pci_irq.o
@@ -16,5 +14,7 @@ obj-$(CONFIG_OF_RESERVED_MEM) += of_rese
 obj-$(CONFIG_OF_RESOLVE)  += resolver.o
 obj-$(CONFIG_OF_OVERLAY) += overlay.o
 
+obj-$(CONFIG_OF_UNITTEST) += unittest-data/
+
 CFLAGS_fdt.o = -I$(src)/../../scripts/dtc/libfdt
 CFLAGS_fdt_address.o = -I$(src)/../../scripts/dtc/libfdt
Index: b/drivers/of/unittest-data/Makefile
===================================================================
--- /dev/null
+++ b/drivers/of/unittest-data/Makefile
@@ -0,0 +1,9 @@
+
+obj-$(CONFIG_OF_UNITTEST) += of_unittest.o
+of_unittest-objs := unittest.o testcases.dtb.o
+
+targets += testcases.dtb testcases.dtb.S
+
+.SECONDARY: \
+	$(obj)/testcases.dtb.S \
+	$(obj)/testcases.dtb
Index: b/drivers/of/unittest-data/.gitignore
===================================================================
--- /dev/null
+++ b/drivers/of/unittest-data/.gitignore
@@ -0,0 +1,2 @@
+testcases.dtb
+testcases.dtb.S

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

* [Patch v3 3/3] dt: OF_UNITTEST make dependency broken, fix unittest.c after move
  2015-03-12 13:15 [Patch v3 1/3] dt: OF_UNITTEST make dependency broken, framework fixes Frank Rowand
@ 2015-03-12 13:18 ` Frank Rowand
  2015-03-13 13:13 ` [Patch v3 1/3] dt: OF_UNITTEST make dependency broken, framework fixes Rob Herring
  1 sibling, 0 replies; 4+ messages in thread
From: Frank Rowand @ 2015-03-12 13:18 UTC (permalink / raw)
  To: frowand.list, Grant Likely, Rob Herring, Michal Marek,
	Linux Kernel list, devicetree@vger.kernel.org, linux-kbuild

From: Frank Rowand <frank.rowand@sonymobile.com>

Fix an of_unittest.c include path to account for the move of
unittest.c into unittest-data/.

Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com>

---
 drivers/of/unittest-data/unittest.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/drivers/of/unittest-data/unittest.c
===================================================================
--- a/drivers/of/unittest-data/unittest.c
+++ b/drivers/of/unittest-data/unittest.c
@@ -23,7 +23,7 @@
 #include <linux/i2c.h>
 #include <linux/i2c-mux.h>
 
-#include "of_private.h"
+#include "../of_private.h"
 
 static struct selftest_results {
 	int passed;

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

* Re: [Patch v3 1/3] dt: OF_UNITTEST make dependency broken, framework fixes
  2015-03-12 13:15 [Patch v3 1/3] dt: OF_UNITTEST make dependency broken, framework fixes Frank Rowand
  2015-03-12 13:18 ` [Patch v3 3/3] dt: OF_UNITTEST make dependency broken, fix unittest.c after move Frank Rowand
@ 2015-03-13 13:13 ` Rob Herring
  2015-03-13 19:18   ` Frank Rowand
  1 sibling, 1 reply; 4+ messages in thread
From: Rob Herring @ 2015-03-13 13:13 UTC (permalink / raw)
  To: Frank Rowand
  Cc: Grant Likely, Rob Herring, Michal Marek, Linux Kernel list,
	devicetree@vger.kernel.org, linux-kbuild

On Thu, Mar 12, 2015 at 8:15 AM, Frank Rowand <frowand.list@gmail.com> wrote:
> From: Frank Rowand <frank.rowand@sonymobile.com>
>
> This 3 patch series is not bisectable.  If CONFIG_OF_UNITTEST=y then the kernel
> will not build with just patch 1 or just patches 1 and 2 applied.

If you did 2 patches with the move first, wouldn't that make it
bisectable. However, I'd rather avoid the move.

> If CONFIG_OF_UNITTEST=y then a kernel image make will always cause .version to
> be incremented, even if there are not source changes.  This is caused by
> a lack of dependency tracking and checking for
> drivers/of/unittest-data/testcases.dtb.o.  Fixing the problem was made more
> complicated by the fact that testcases.dtb.o was linked into ../of_unittest.o.

Couldn't we change that to be 2 modules.

> Patch 1 modifies makefiles to move of_unittest.c into unittest-data/ and
> creates missing dependency tracking for testcases.dtb.o.
>
> Patch 2 will move of_unittest.c into unittest-data/
>
> Patch 3 will fix an of_unittest.c include path to account for the move.

This should all be in an intro email, not patch #1.

Rob

>
> Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com>
>
> ---
>
> changes since version 2:
>
>   patch 1:
>   Add .gitignore so that generated files will not get committed.
>
> changes since version 1:
>
>   patch 1:
>   Remove some changes to scripts/Makefile.lib that are not needed.  They
>   were left over from attempts to fix the problem without moving of_unitest.c
>   into unittest-data/.
>
>
>  drivers/of/Makefile                 |    4 ++--
>  drivers/of/unittest-data/.gitignore |    2 ++
>  drivers/of/unittest-data/Makefile   |    9 +++++++++
>  3 files changed, 13 insertions(+), 2 deletions(-)
>
> Index: b/drivers/of/Makefile
> ===================================================================
> --- a/drivers/of/Makefile
> +++ b/drivers/of/Makefile
> @@ -6,8 +6,6 @@ obj-$(CONFIG_OF_PROMTREE) += pdt.o
>  obj-$(CONFIG_OF_ADDRESS)  += address.o
>  obj-$(CONFIG_OF_IRQ)    += irq.o
>  obj-$(CONFIG_OF_NET)   += of_net.o
> -obj-$(CONFIG_OF_UNITTEST) += of_unittest.o
> -of_unittest-objs := unittest.o unittest-data/testcases.dtb.o
>  obj-$(CONFIG_OF_MDIO)  += of_mdio.o
>  obj-$(CONFIG_OF_PCI)   += of_pci.o
>  obj-$(CONFIG_OF_PCI_IRQ)  += of_pci_irq.o
> @@ -16,5 +14,7 @@ obj-$(CONFIG_OF_RESERVED_MEM) += of_rese
>  obj-$(CONFIG_OF_RESOLVE)  += resolver.o
>  obj-$(CONFIG_OF_OVERLAY) += overlay.o
>
> +obj-$(CONFIG_OF_UNITTEST) += unittest-data/
> +
>  CFLAGS_fdt.o = -I$(src)/../../scripts/dtc/libfdt
>  CFLAGS_fdt_address.o = -I$(src)/../../scripts/dtc/libfdt
> Index: b/drivers/of/unittest-data/Makefile
> ===================================================================
> --- /dev/null
> +++ b/drivers/of/unittest-data/Makefile
> @@ -0,0 +1,9 @@
> +
> +obj-$(CONFIG_OF_UNITTEST) += of_unittest.o
> +of_unittest-objs := unittest.o testcases.dtb.o
> +
> +targets += testcases.dtb testcases.dtb.S
> +
> +.SECONDARY: \
> +       $(obj)/testcases.dtb.S \
> +       $(obj)/testcases.dtb
> Index: b/drivers/of/unittest-data/.gitignore
> ===================================================================
> --- /dev/null
> +++ b/drivers/of/unittest-data/.gitignore
> @@ -0,0 +1,2 @@
> +testcases.dtb
> +testcases.dtb.S

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

* Re: [Patch v3 1/3] dt: OF_UNITTEST make dependency broken, framework fixes
  2015-03-13 13:13 ` [Patch v3 1/3] dt: OF_UNITTEST make dependency broken, framework fixes Rob Herring
@ 2015-03-13 19:18   ` Frank Rowand
  0 siblings, 0 replies; 4+ messages in thread
From: Frank Rowand @ 2015-03-13 19:18 UTC (permalink / raw)
  To: Rob Herring
  Cc: Grant Likely, Rob Herring, Michal Marek, Linux Kernel list,
	devicetree@vger.kernel.org, linux-kbuild

On 3/13/2015 6:13 AM, Rob Herring wrote:
> On Thu, Mar 12, 2015 at 8:15 AM, Frank Rowand <frowand.list@gmail.com> wrote:
>> From: Frank Rowand <frank.rowand@sonymobile.com>
>>
>> This 3 patch series is not bisectable.  If CONFIG_OF_UNITTEST=y then the kernel
>> will not build with just patch 1 or just patches 1 and 2 applied.
> 
> If you did 2 patches with the move first, wouldn't that make it
> bisectable. However, I'd rather avoid the move.

Yes, I did not like the move either.  Fortunately you gave me the cluebat I needed
to avoid the move.

> 
>> If CONFIG_OF_UNITTEST=y then a kernel image make will always cause .version to
>> be incremented, even if there are not source changes.  This is caused by
>> a lack of dependency tracking and checking for
>> drivers/of/unittest-data/testcases.dtb.o.  Fixing the problem was made more
>> complicated by the fact that testcases.dtb.o was linked into ../of_unittest.o.
> 
> Couldn't we change that to be 2 modules.

Thanks, that was just the hint I needed to realize that of_unittest.o was
just an artifact of the problem I was trying to solve.  I will send a new
patch that removes the of_unittest.o cruft and does not need to move unittest.c

> 
>> Patch 1 modifies makefiles to move of_unittest.c into unittest-data/ and
>> creates missing dependency tracking for testcases.dtb.o.
>>
>> Patch 2 will move of_unittest.c into unittest-data/
>>
>> Patch 3 will fix an of_unittest.c include path to account for the move.
> 
> This should all be in an intro email, not patch #1.


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

end of thread, other threads:[~2015-03-13 19:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-12 13:15 [Patch v3 1/3] dt: OF_UNITTEST make dependency broken, framework fixes Frank Rowand
2015-03-12 13:18 ` [Patch v3 3/3] dt: OF_UNITTEST make dependency broken, fix unittest.c after move Frank Rowand
2015-03-13 13:13 ` [Patch v3 1/3] dt: OF_UNITTEST make dependency broken, framework fixes Rob Herring
2015-03-13 19:18   ` Frank Rowand

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