From patchwork Wed Nov 4 10:08:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 11880141 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3CDC5697 for ; Wed, 4 Nov 2020 10:09:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0542F2224E for ; Wed, 4 Nov 2020 10:09:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="DzhLBdo2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728683AbgKDKJz (ORCPT ); Wed, 4 Nov 2020 05:09:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728029AbgKDKJz (ORCPT ); Wed, 4 Nov 2020 05:09:55 -0500 Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EB37C0613D3; Wed, 4 Nov 2020 02:09:54 -0800 (PST) Received: by ozlabs.org (Postfix, from userid 1034) id 4CR2Sw2w6lz9sTK; Wed, 4 Nov 2020 21:09:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1604484592; bh=j+i1lX1PsZW/0GrkODpnzYhaB1+/DX2TTEqP93CyZjI=; h=From:To:Cc:Subject:Date:From; b=DzhLBdo2KgZz80mcMGk3llfgVqTCaBVr10DO2EwY/P9aygfMyHCNLOHYNR90M69XF XAWuLjk1+t0h+SQ2EQwqt8+bYpeF3DaWII6L8QXAU8hn9MBDqNIugLo+pQ2qYjhG5l HoYtUB/lC252+1TNIks5Nodvyz0CenE1aH6MPMSqWH8Ss2BVeeHRvuXDi/glFutY8+ Sz6lZH2kd/Zdy5dgS5jiWNbS2yVjWMV00BysQ6VZaIb2fHz2IBoPPC9MvT+YACEEUi l1DmVB+epgTAzmEydaTpQXMgHcsRyTGlBdz1/e0LobiMG0YuS3qBWzf+TK/CCPf9Wp HC87f2yY/SmaA== From: Michael Ellerman To: linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH 1/4] selftests/gpio: Use TEST_GEN_PROGS_EXTENDED Date: Wed, 4 Nov 2020 21:08:40 +1100 Message-Id: <20201104100843.660407-1-mpe@ellerman.id.au> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 --- tools/testing/selftests/gpio/Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) base-commit: cf7cd542d1b538f6e9e83490bc090dd773f4266d 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) From patchwork Wed Nov 4 10:08:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 11880147 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1B7E6697 for ; Wed, 4 Nov 2020 10:10:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E697C223AB for ; Wed, 4 Nov 2020 10:10:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="mLeKP7vy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729211AbgKDKKE (ORCPT ); Wed, 4 Nov 2020 05:10:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728535AbgKDKJz (ORCPT ); Wed, 4 Nov 2020 05:09:55 -0500 Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F028BC061A4A; Wed, 4 Nov 2020 02:09:54 -0800 (PST) Received: by ozlabs.org (Postfix, from userid 1034) id 4CR2Sx0Fksz9sVK; Wed, 4 Nov 2020 21:09:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1604484593; bh=QdkZmMlvcp+swaCH7i/edBCL/QIGYMmP5xj/ytrnGyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mLeKP7vy1SjZ0eVFOsVU5Q3kG9DJLP7rOZNmdd5RnXXxiP52+/d/1J3rLxNWvawf8 t69pl5Cwf7gndCJ7e2ch1UlbDWnhqyNHjmPAa8e0qIa7Ohn8+FYyD5i12RlEkqJoVM tDpifag+Y6Lecj/qorwY9ksbNDdNeQvsTF2a6RtfOYtpj6jW9TgQys239zwwRIkufH UQobA+RFGUZc1dK7d6VVc8RRUVil4c36ZMJSK/lIKCPvGZ29Cs92dsDQ8UB7spc6Mp pBmNXWii1hmB1qmMF3Mq7Fq+NlTesafHqP6IL92zn/e9SSUvAO0av8xDeSJ2RiBiOF 8CQVGGzOxjI3Q== From: Michael Ellerman To: linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH 2/4] selftests/gpio: Move include of lib.mk up Date: Wed, 4 Nov 2020 21:08:41 +1100 Message-Id: <20201104100843.660407-2-mpe@ellerman.id.au> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201104100843.660407-1-mpe@ellerman.id.au> References: <20201104100843.660407-1-mpe@ellerman.id.au> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 --- 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): From patchwork Wed Nov 4 10:08:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 11880149 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB2EA697 for ; Wed, 4 Nov 2020 10:10:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B0E2A223AB for ; Wed, 4 Nov 2020 10:10:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="neaKBrQn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729242AbgKDKKK (ORCPT ); Wed, 4 Nov 2020 05:10:10 -0500 Received: from ozlabs.org ([203.11.71.1]:50033 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727923AbgKDKJz (ORCPT ); Wed, 4 Nov 2020 05:09:55 -0500 Received: by ozlabs.org (Postfix, from userid 1034) id 4CR2Sx3CqYz9sVM; Wed, 4 Nov 2020 21:09:53 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1604484593; bh=a5WygqkHDCvwgU6p3aiWlaAFRr9MW05zMhpOiiyYDM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=neaKBrQnwCB9rzlcas5HnhYy9tFLA98XSU3+J5icD6SfgCl+IvbLy8Cz3jKuNrkX/ Nmw5MTRXBp9fwviHydCqFEvsxSSapEU+5VOt+kkcOHDp8tekBpsfjFw73eX5Y1gYiP bD1BZW8C+5SureaekOP4OzqPPs2Qh3/o4QjReNGQpVhlbDebzscNF016gDzZPgIzjv krDQhtcBQ6KPdEoJQ7XPyrd1Ri5GTAsBHeRh7s+UlMPRHOOjD4wVOb5Fy6EYQ6cBqW qxzD//co8O0TXn3xLpWXjyKILLLth8mRbZaNbB9fWvcHO40ZQufKrRY+QOfvcp8G9A yr1dfKtcUA6rw== From: Michael Ellerman To: linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH 3/4] selftests/gpio: Fix build when source tree is read only Date: Wed, 4 Nov 2020 21:08:42 +1100 Message-Id: <20201104100843.660407-3-mpe@ellerman.id.au> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201104100843.660407-1-mpe@ellerman.id.au> References: <20201104100843.660407-1-mpe@ellerman.id.au> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 --- 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) From patchwork Wed Nov 4 10:08:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 11880145 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9B7E1752 for ; Wed, 4 Nov 2020 10:10:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4F3E22409 for ; Wed, 4 Nov 2020 10:10:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="FSawxRlJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729016AbgKDKJ6 (ORCPT ); Wed, 4 Nov 2020 05:09:58 -0500 Received: from bilbo.ozlabs.org ([203.11.71.1]:58219 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728229AbgKDKJ5 (ORCPT ); Wed, 4 Nov 2020 05:09:57 -0500 Received: by ozlabs.org (Postfix, from userid 1034) id 4CR2Sx6FHYz9sVN; Wed, 4 Nov 2020 21:09:53 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1604484593; bh=3kFSwF+mKTTL4Iah+YZCWoNxgZ901GzljCfDkfAwxW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FSawxRlJDKo9uROKSB32k4Z/z3AOVHuT31P2LG+Q0cjSKQGpr2nSAG6pvPu7/gEP4 0SM90Lhy9WtXeH8oOycfvYv2DW3zzD+r/t3A7xiMybhWJqzAbB+iju8EdTrqreDOt0 97BAe99otfYwzOWIA+XXmDOlV0XV96p4ouMz2skY0iylXTuFuajisA6V5EGesfvN2S EnWIKPp5gbDjHjv8pbw5zMIdkaEOipWJDjbISEl1XoZDWp2Ygwg5zrDyDsVAUn9lbe RbBE9DjUCZ4sJ3xUIGrL2VBBtoIDzPsnA0PohN7BLvFPe7xFJoTQwXf9YDXHrZFwvd 2ryOz6wRJb6ww== From: Michael Ellerman To: linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH 4/4] selftests/gpio: Add to CLEAN rule rather than overriding Date: Wed, 4 Nov 2020 21:08:43 +1100 Message-Id: <20201104100843.660407-4-mpe@ellerman.id.au> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201104100843.660407-1-mpe@ellerman.id.au> References: <20201104100843.660407-1-mpe@ellerman.id.au> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Rather than overriding the CLEAN rule we can just append to it. Signed-off-by: Michael Ellerman --- tools/testing/selftests/gpio/Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile index acf4088a9891..41582fe485ee 100644 --- a/tools/testing/selftests/gpio/Makefile +++ b/tools/testing/selftests/gpio/Makefile @@ -20,10 +20,7 @@ GPIODIR := $(realpath ../../../gpio) GPIOOUT := $(OUTPUT)/tools-gpio/ GPIOOBJ := $(GPIOOUT)/gpio-utils.o -override define CLEAN - $(RM) $(TEST_GEN_PROGS_EXTENDED) - $(RM) -rf $(GPIOOUT) -endef +CLEAN += ; $(RM) -rf $(GPIOOUT) $(TEST_GEN_PROGS_EXTENDED): $(GPIOOBJ)