From 36edd1b9845efba0b225eb16ebe1a6399b58e7ba Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Fri, 28 May 2021 08:41:23 -0400 Subject: [PATCH] Fixes for 5.10 Signed-off-by: Sasha Levin --- ...ix-build-when-source-tree-is-read-on.patch | 64 +++++++++++++++++++ ...tests-gpio-move-include-of-lib.mk-up.patch | 47 ++++++++++++++ ...sts-gpio-use-test_gen_progs_extended.patch | 56 ++++++++++++++++ queue-5.10/series | 3 + 4 files changed, 170 insertions(+) create mode 100644 queue-5.10/selftests-gpio-fix-build-when-source-tree-is-read-on.patch create mode 100644 queue-5.10/selftests-gpio-move-include-of-lib.mk-up.patch create mode 100644 queue-5.10/selftests-gpio-use-test_gen_progs_extended.patch create mode 100644 queue-5.10/series diff --git a/queue-5.10/selftests-gpio-fix-build-when-source-tree-is-read-on.patch b/queue-5.10/selftests-gpio-fix-build-when-source-tree-is-read-on.patch new file mode 100644 index 00000000000..975896d319a --- /dev/null +++ b/queue-5.10/selftests-gpio-fix-build-when-source-tree-is-read-on.patch @@ -0,0 +1,64 @@ +From 48ee7ad12757b15bbeb61abfe9548bf6baee7034 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 4 Nov 2020 21:08:42 +1100 +Subject: selftests/gpio: Fix build when source tree is read only + +From: Michael Ellerman + +[ Upstream commit b68c1c65dec5fb5186ebd33ce52059b4c6db8500 ] + +Currently the gpio selftests fail to build if the source tree is read +only: + + make -j 160 -C tools/testing/selftests TARGETS=gpio + make[1]: Entering directory '/linux/tools/testing/selftests/gpio' + make OUTPUT=/linux/tools/gpio/ -C /linux/tools/gpio + make[2]: Entering directory '/linux/tools/gpio' + mkdir -p /linux/tools/gpio/include/linux 2>&1 || true + ln -sf /linux/tools/gpio/../../include/uapi/linux/gpio.h /linux/tools/gpio/include/linux/gpio.h + ln: failed to create symbolic link '/linux/tools/gpio/include/linux/gpio.h': Read-only file system + +This happens because we ask make to build ../../../gpio (tools/gpio) +without pointing OUTPUT away from the source directory. + +To fix it we create a subdirectory of the existing OUTPUT directory, +called tools-gpio, and tell tools/gpio to build in there. + +Signed-off-by: Michael Ellerman +Signed-off-by: Shuah Khan +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/gpio/Makefile | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile +index 615c8a953ade..acf4088a9891 100644 +--- a/tools/testing/selftests/gpio/Makefile ++++ b/tools/testing/selftests/gpio/Makefile +@@ -17,14 +17,18 @@ KSFT_KHDR_INSTALL := 1 + include ../lib.mk + + GPIODIR := $(realpath ../../../gpio) +-GPIOOBJ := gpio-utils.o ++GPIOOUT := $(OUTPUT)/tools-gpio/ ++GPIOOBJ := $(GPIOOUT)/gpio-utils.o + + override define CLEAN + $(RM) $(TEST_GEN_PROGS_EXTENDED) +- $(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean ++ $(RM) -rf $(GPIOOUT) + endef + +-$(TEST_GEN_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) ++$(TEST_GEN_PROGS_EXTENDED): $(GPIOOBJ) + +-$(GPIODIR)/$(GPIOOBJ): +- $(MAKE) OUTPUT=$(GPIODIR)/ -C $(GPIODIR) ++$(GPIOOUT): ++ mkdir -p $@ ++ ++$(GPIOOBJ): $(GPIOOUT) ++ $(MAKE) OUTPUT=$(GPIOOUT) -C $(GPIODIR) +-- +2.30.2 + diff --git a/queue-5.10/selftests-gpio-move-include-of-lib.mk-up.patch b/queue-5.10/selftests-gpio-move-include-of-lib.mk-up.patch new file mode 100644 index 00000000000..bec8ed3e01c --- /dev/null +++ b/queue-5.10/selftests-gpio-move-include-of-lib.mk-up.patch @@ -0,0 +1,47 @@ +From e9cc839bff154f0c24bca89aac867ac16e5d6fc3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 4 Nov 2020 21:08:41 +1100 +Subject: selftests/gpio: Move include of lib.mk up + +From: Michael Ellerman + +[ Upstream commit 449539da2e237336bc750b41f1736a77f9aca25c ] + +Move the include of lib.mk up so that in a subsequent patch we can use +OUTPUT, which is initialised by lib.mk, in the definition of the GPIO +variables. + +Signed-off-by: Michael Ellerman +Signed-off-by: Shuah Khan +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/gpio/Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile +index c85fb5acf5f4..615c8a953ade 100644 +--- a/tools/testing/selftests/gpio/Makefile ++++ b/tools/testing/selftests/gpio/Makefile +@@ -13,6 +13,9 @@ TEST_PROGS := gpio-mockup.sh + TEST_FILES := gpio-mockup-sysfs.sh + TEST_GEN_PROGS_EXTENDED := gpio-mockup-chardev + ++KSFT_KHDR_INSTALL := 1 ++include ../lib.mk ++ + GPIODIR := $(realpath ../../../gpio) + GPIOOBJ := gpio-utils.o + +@@ -21,9 +24,6 @@ override define CLEAN + $(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean + endef + +-KSFT_KHDR_INSTALL := 1 +-include ../lib.mk +- + $(TEST_GEN_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) + + $(GPIODIR)/$(GPIOOBJ): +-- +2.30.2 + diff --git a/queue-5.10/selftests-gpio-use-test_gen_progs_extended.patch b/queue-5.10/selftests-gpio-use-test_gen_progs_extended.patch new file mode 100644 index 00000000000..614ec9d3442 --- /dev/null +++ b/queue-5.10/selftests-gpio-use-test_gen_progs_extended.patch @@ -0,0 +1,56 @@ +From 15981291e987e8e4b91a871e0cd6c2a28c31fb29 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 4 Nov 2020 21:08:40 +1100 +Subject: selftests/gpio: Use TEST_GEN_PROGS_EXTENDED + +From: Michael Ellerman + +[ Upstream commit ff2c395b9257f0e617f9cd212893f3c72c80ee6c ] + +Use TEST_GEN_PROGS_EXTENDED rather than TEST_PROGS_EXTENDED. + +That tells the lib.mk logic that the files it references are to be +generated by the Makefile. + +Having done that we don't need to override the all rule. + +Signed-off-by: Michael Ellerman +Signed-off-by: Shuah Khan +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/gpio/Makefile | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile +index 32bdc978a711..c85fb5acf5f4 100644 +--- a/tools/testing/selftests/gpio/Makefile ++++ b/tools/testing/selftests/gpio/Makefile +@@ -11,22 +11,20 @@ LDLIBS += $(VAR_LDLIBS) + + TEST_PROGS := gpio-mockup.sh + TEST_FILES := gpio-mockup-sysfs.sh +-TEST_PROGS_EXTENDED := gpio-mockup-chardev ++TEST_GEN_PROGS_EXTENDED := gpio-mockup-chardev + + GPIODIR := $(realpath ../../../gpio) + GPIOOBJ := gpio-utils.o + +-all: $(TEST_PROGS_EXTENDED) +- + override define CLEAN +- $(RM) $(TEST_PROGS_EXTENDED) ++ $(RM) $(TEST_GEN_PROGS_EXTENDED) + $(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean + endef + + KSFT_KHDR_INSTALL := 1 + include ../lib.mk + +-$(TEST_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) ++$(TEST_GEN_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) + + $(GPIODIR)/$(GPIOOBJ): + $(MAKE) OUTPUT=$(GPIODIR)/ -C $(GPIODIR) +-- +2.30.2 + diff --git a/queue-5.10/series b/queue-5.10/series new file mode 100644 index 00000000000..26cc816f71d --- /dev/null +++ b/queue-5.10/series @@ -0,0 +1,3 @@ +selftests-gpio-use-test_gen_progs_extended.patch +selftests-gpio-move-include-of-lib.mk-up.patch +selftests-gpio-fix-build-when-source-tree-is-read-on.patch -- 2.47.3