From patchwork Fri Oct 5 16:13:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 148219 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp640103lji; Fri, 5 Oct 2018 09:14:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV60CQakIqtJ0CoHXYJKF6Pz9/G3nXGKt4NJlMqDgpO5noDhJVhOD7J6BwNF+aZsjks3q/IrV X-Received: by 2002:a63:d048:: with SMTP id s8-v6mr10708127pgi.311.1538756073970; Fri, 05 Oct 2018 09:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538756073; cv=none; d=google.com; s=arc-20160816; b=ViLYF4ihTEOPKdhTo4n2vhjckU0N3CpPLg4XLUk0GvS2DTkDjy/lumUi8Cva5361WP 9fFjSnDAws5K590RqcMyIap4vbnJ3SjsBijAKupiQ+w9mDxhIao+xFyOCBZ8t/nl3QSQ b1cHpjNgq2lo7qUHyfitbxCPIeNExE91M+/1/OW+zvtEtQNapnU3A7MciZHtdfgQFdwg +6T3aTXQJRSMrpZo3phZXTWKCiNfKK+5XADXf2ViZ7jHwftSNKViy9THyLbpdtMuUcqj ig90ERdaqDAMbUrWo9xSjcb20U15/+9bz2vC2AeUrUfrX1g6WABj5nvdPHrgnNGz8Ka4 1/Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=PWPKx7xefqbXHHc/PoD+aiUqEoX6CZ0miaDckF/1Ni0=; b=IpWY/MersIWWB/tqO/TSIJzhsBQjrkmxUCpwLAByMxArql3tLmRUHl4yO+EraQ2v+e 9Do2+EXSRbsJWyiTevvYFBOi9tM51sZLPAESPBKxwvgsPeokJ29I5U5e+PeQOHZbl1Uj MkapymcTEtZLBcbfpUo4rMW3o5fYr6mO4hRmqmoHqOBw8cKHQY9aX1riW2bgNG8Igbbt 72RfZ/tvvW9z4eZwcDkKXqLxlhm4Sm43IXTw/af+bBu6h8HDFNvF5yKqqPCd3x59N8R8 CcFVlTW25CdYTvkYfCx6mbQ1x3Gl/ZiNDhDev9o3UixI6TxHvRvinPqynT+n/HnYVgRq bW5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d6RbZ4vz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13-v6si8718403plq.373.2018.10.05.09.14.33; Fri, 05 Oct 2018 09:14:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d6RbZ4vz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728849AbeJEXNy (ORCPT + 32 others); Fri, 5 Oct 2018 19:13:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:50730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727746AbeJEXNw (ORCPT ); Fri, 5 Oct 2018 19:13:52 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7F71921480; Fri, 5 Oct 2018 16:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1538756070; bh=1FiQgOfPFrAV0YNL14Tj7C3+mIlgHoSdKDxx0omHHlI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d6RbZ4vzr165+NQzWhuAIPbTDPOnVOtpdW7Ccd20RbIvLpEgP9GAdwOVmC8TeX1Dg RusU1YnPAsbQ9gDjza10Vluvn6uPLng7v5vIi8il1ss5PeyarUs7UoLhKSoeOrAg9m 1biIlKZKAc/GfcYsIBdgB18//nNqo8ptv5fCX57A= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Anders Roxell , Shuah Khan , Sasha Levin Subject: [PATCH AUTOSEL 4.18 04/48] selftests: android: move config up a level Date: Fri, 5 Oct 2018 12:13:40 -0400 Message-Id: <20181005161424.20521-4-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181005161424.20521-1-sashal@kernel.org> References: <20181005161424.20521-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anders Roxell [ Upstream commit 88bc243a3f22b9938c0b53c577dee28025cdb920 ] 'make kselftest-merge' assumes that the config files for the tests are located under the 'main' test dir, like tools/testing/selftests/android/ and not in a subdir to android. Signed-off-by: Anders Roxell Signed-off-by: Shuah Khan (Samsung OSG) Signed-off-by: Sasha Levin --- tools/testing/selftests/android/{ion => }/config | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/testing/selftests/android/{ion => }/config (100%) -- 2.17.1 diff --git a/tools/testing/selftests/android/ion/config b/tools/testing/selftests/android/config similarity index 100% rename from tools/testing/selftests/android/ion/config rename to tools/testing/selftests/android/config From patchwork Fri Oct 5 16:13:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 148220 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp640203lji; Fri, 5 Oct 2018 09:14:39 -0700 (PDT) X-Google-Smtp-Source: ACcGV615ZdZ7q3g2cQ7qJfodG4RBVBZJoLJaZkN494xM4koWwGWFeSVcmv2IrUJs1UwIWXPgAqiA X-Received: by 2002:a17:902:be18:: with SMTP id r24-v6mr839509pls.341.1538756078788; Fri, 05 Oct 2018 09:14:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538756078; cv=none; d=google.com; s=arc-20160816; b=iwiXP8b+1x9hmuoUoBBkHS9LY3T3apsDlx+OTHlb6Jz64QyYxLkaifAAzM2F5xZkth xpisBpDMtKebaONjpd2CC3g+jknAd0LJhk2dcHV9fFcCaM6PAVcru291UBhI0jMwy71L D0n7DYCuYEUPfKrEH6rmn0ZK+rsEIdGYAxN0mIsJjy5DrByK66WPrGObZntsvBBWQeqR 0ebl3G4RAaaQZk/pCyKOGPbsrrOxTOfpXy88FA0NKFbJvK/1drzyADShbTIcCeSHArMN RM0CSP8H8phMztyAGPmqeE5J0atFntjnOvHZyE2qXRbgXHuCVS5rVB1X+mc67VrmpJi5 KpKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=hePC8lZVi7F5CQnWBxeiAkGCGW7BpVM78uR6WH8sB2o=; b=OV16lvZiQs0Kf8qtXhKpsePTgdKqMIaF1KNWNxqCkJh5AJe+z/69zIFJrwVYm1aQgT I8T18hkhCEVvyFaliibgGlbar5orfDst5RXG9ewBYgTzaptinh5nFf6TsUxaVTOY735t 8t0f1H4+ZLCisJ1HWt6tNdHXNy2oLbkTONWrbU2Ja/Wbc+ZR2oCXrhBcJKEOVVTHgWp9 swMgszf1XDkuUH14Q8WDEx34Wuj0Bo7wtGs18IWAfgMGor2MeGJAqQbbHXE3IEeTzMz1 3O4mLodSqCUhLP2m/VTXAbBlE26MYqQX5XCBxovxfXJuK/4M58t9elSXRqw7vOWq73gD jGiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CbZEFu+9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x15-v6si8963716pln.425.2018.10.05.09.14.38; Fri, 05 Oct 2018 09:14:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CbZEFu+9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729082AbeJEXN6 (ORCPT + 32 others); Fri, 5 Oct 2018 19:13:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:50896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727958AbeJEXN4 (ORCPT ); Fri, 5 Oct 2018 19:13:56 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CD0C42148D; Fri, 5 Oct 2018 16:14:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1538756074; bh=2CHOi86Myddl7TisdRqK1y06+D1TqKxm2Ker6sGEr1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CbZEFu+9WyuNaUGi8rkWRN7YwJCprspdIAGjYPjEEG8SGGsEXYZObf3dkhmGzkJpa LOaV5DMKH0/75PdnB0HrJ54p0e5TFeAdn8LRl7z0Jcr6zvnFMKQZjZSbauHLIrG6zR tPkp7wOXHyAbQojs2oU1Q4JKkqTeFt2ZX4aDCyO8= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Srinivas Kandagatla , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 4.18 09/48] ASoC: q6routing: initialize data correctly Date: Fri, 5 Oct 2018 12:13:45 -0400 Message-Id: <20181005161424.20521-9-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181005161424.20521-1-sashal@kernel.org> References: <20181005161424.20521-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Kandagatla [ Upstream commit 7aa09ff24301535491cd4de1b93107ee91449a12 ] Some of the router data fields are left as default zeros which are valid dai ids, so initialize these to invalid value of -1. Without intializing these correctly get_session_from_id() can return incorrect session resulting in not closing the opened copp and messing up with the copp ref count. Fixes: e3a33673e845 ("ASoC: qdsp6: q6routing: Add q6routing driver") Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/qcom/qdsp6/q6routing.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c index 593f66b8622f..33bb97c0b6b6 100644 --- a/sound/soc/qcom/qdsp6/q6routing.c +++ b/sound/soc/qcom/qdsp6/q6routing.c @@ -933,8 +933,10 @@ static int msm_routing_probe(struct snd_soc_component *c) { int i; - for (i = 0; i < MAX_SESSIONS; i++) + for (i = 0; i < MAX_SESSIONS; i++) { routing_data->sessions[i].port_id = -1; + routing_data->sessions[i].fedai_id = -1; + } return 0; } From patchwork Fri Oct 5 16:13:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 148227 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp655044lji; Fri, 5 Oct 2018 09:27:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV61oPHOC04WsELB+aNVs+2F20F4Y8KJLzdwVenC67GjKa6fNvXP2vqOXf7ekNlNriOtZi+Wh X-Received: by 2002:a17:902:b410:: with SMTP id x16-v6mr10845256plr.13.1538756835790; Fri, 05 Oct 2018 09:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538756835; cv=none; d=google.com; s=arc-20160816; b=w1jbnuurrbLMSdNnqiSwmz0MAmEG8bOZrEenb7kLKTRTHyLe4143vKmaYZWKS2tmKN uo2VhW5Dy3z5M35ART/c1amIBmrHPAolOqLuvJbvrllcXBlExjCV4WGVRUE/QWZKw+up swtpkv+RKriCeA7Ojb6m3VBwL3wRtx4F9KKuVfW21AficTdJvV6CUpWGZhYDuNU1eVF3 aMFvLcpu1XF21KU3vHIDvbAMtHM2sw/DNN7/b1RtQZ+5d8oSJbzVKVaIlh5sSR2avYIx TF/ILe41l2gDdr5gj4GBr+SJh2ztr6lzGQtBVe+CcKcQRH7dfZj2hthLrz9PQuVXGeP8 ltAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=T80wwy9kXDhoZ8ap3mAgcRQFeCPg2XB0Jt9X/YUHHvQ=; b=pExZz+aIeZc8cOxLDIQuZlH61WU/an3S7u+zZYPPTFVwo68AybwmoWx+5GYWQopSP+ 37uI7SyTTvi2fqiCgvUZMDR0biLLTIXyeKWG92EF5rjnzhiqD4J1oMcAS9G4G4D+jyEC /Y8NczUIEXXIwM9BRT2SVaI+3uGs9mqnmQn+M90XySAp/mlE3XWBfw0Z9gOvqBW2gyee q9Mol8aya4c1x6GyIlWD8TDf5Ah3FZUfEu+Nq9AM6cLyrHZrszr8hYnlmH2euagdDCPk 7BjD2A7cfGg9Fa21jONBiMmA5qMnpe7E5TtkdMM9qe/QBtvY21gH4Y2wZcFI3eAfdHau hUFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iT7RgJNB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h18-v6si8712332pgk.351.2018.10.05.09.27.15; Fri, 05 Oct 2018 09:27:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iT7RgJNB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729399AbeJEX0j (ORCPT + 32 others); Fri, 5 Oct 2018 19:26:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:50922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729047AbeJEXN6 (ORCPT ); Fri, 5 Oct 2018 19:13:58 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A9D4620834; Fri, 5 Oct 2018 16:14:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1538756075; bh=pg/zq5uVsx/WLdOsEb2kywynth0JDFD3XUDmA5N/z7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iT7RgJNBYYpU5YXQeYqQ4ty8kMBnRkRVAmmeyx119w6j0/2iMEFNiDxdM2RogDGVR vMFlhWf02mXa4XWXgQjoLmd0vdgwW7wwgzOqgmK1XsnN6yVRsOX5iWOl7BOd5n8BAI uXTEqkG+1ZEvgv6rzoRd25eS0ZeQKFNdU8nGDBHc= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Anders Roxell , Shuah Khan , Sasha Levin Subject: [PATCH AUTOSEL 4.18 10/48] selftests: add headers_install to lib.mk Date: Fri, 5 Oct 2018 12:13:46 -0400 Message-Id: <20181005161424.20521-10-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181005161424.20521-1-sashal@kernel.org> References: <20181005161424.20521-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anders Roxell [ Upstream commit b2d35fa5fc80c27e868e393dcab4c94a0d71737f ] If the kernel headers aren't installed we can't build all the tests. Add a new make target rule 'khdr' in the file lib.mk to generate the kernel headers and that gets include for every test-dir Makefile that includes lib.mk If the testdir in turn have its own sub-dirs the top_srcdir needs to be set to the linux-rootdir to be able to generate the kernel headers. Signed-off-by: Anders Roxell Reviewed-by: Fathi Boudra Signed-off-by: Shuah Khan (Samsung OSG) Signed-off-by: Sasha Levin --- Makefile | 14 +------------- scripts/subarch.include | 13 +++++++++++++ tools/testing/selftests/android/Makefile | 2 +- tools/testing/selftests/android/ion/Makefile | 2 ++ tools/testing/selftests/futex/functional/Makefile | 1 + tools/testing/selftests/gpio/Makefile | 7 ++----- tools/testing/selftests/kvm/Makefile | 7 ++----- tools/testing/selftests/lib.mk | 12 ++++++++++++ tools/testing/selftests/net/Makefile | 1 + .../selftests/networking/timestamping/Makefile | 1 + tools/testing/selftests/vm/Makefile | 4 ---- 11 files changed, 36 insertions(+), 28 deletions(-) create mode 100644 scripts/subarch.include -- 2.17.1 diff --git a/Makefile b/Makefile index 466e07af8473..f1076175e2b3 100644 --- a/Makefile +++ b/Makefile @@ -298,19 +298,7 @@ KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION -# SUBARCH tells the usermode build what the underlying arch is. That is set -# first, and if a usermode build is happening, the "ARCH=um" on the command -# line overrides the setting of ARCH below. If a native build is happening, -# then ARCH is assigned, getting whatever value it gets normally, and -# SUBARCH is subsequently ignored. - -SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ - -e s/sun4u/sparc64/ \ - -e s/arm.*/arm/ -e s/sa110/arm/ \ - -e s/s390x/s390/ -e s/parisc64/parisc/ \ - -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ - -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \ - -e s/riscv.*/riscv/) +include scripts/subarch.include # Cross compiling and selecting different set of gcc/bin-utils # --------------------------------------------------------------------------- diff --git a/scripts/subarch.include b/scripts/subarch.include new file mode 100644 index 000000000000..650682821126 --- /dev/null +++ b/scripts/subarch.include @@ -0,0 +1,13 @@ +# SUBARCH tells the usermode build what the underlying arch is. That is set +# first, and if a usermode build is happening, the "ARCH=um" on the command +# line overrides the setting of ARCH below. If a native build is happening, +# then ARCH is assigned, getting whatever value it gets normally, and +# SUBARCH is subsequently ignored. + +SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ + -e s/sun4u/sparc64/ \ + -e s/arm.*/arm/ -e s/sa110/arm/ \ + -e s/s390x/s390/ -e s/parisc64/parisc/ \ + -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ + -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \ + -e s/riscv.*/riscv/) diff --git a/tools/testing/selftests/android/Makefile b/tools/testing/selftests/android/Makefile index 72c25a3cb658..d9a725478375 100644 --- a/tools/testing/selftests/android/Makefile +++ b/tools/testing/selftests/android/Makefile @@ -6,7 +6,7 @@ TEST_PROGS := run.sh include ../lib.mk -all: +all: khdr @for DIR in $(SUBDIRS); do \ BUILD_TARGET=$(OUTPUT)/$$DIR; \ mkdir $$BUILD_TARGET -p; \ diff --git a/tools/testing/selftests/android/ion/Makefile b/tools/testing/selftests/android/ion/Makefile index e03695287f76..88cfe88e466f 100644 --- a/tools/testing/selftests/android/ion/Makefile +++ b/tools/testing/selftests/android/ion/Makefile @@ -10,6 +10,8 @@ $(TEST_GEN_FILES): ipcsocket.c ionutils.c TEST_PROGS := ion_test.sh +KSFT_KHDR_INSTALL := 1 +top_srcdir = ../../../../.. include ../../lib.mk $(OUTPUT)/ionapp_export: ionapp_export.c ipcsocket.c ionutils.c diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile index ff8feca49746..ad1eeb14fda7 100644 --- a/tools/testing/selftests/futex/functional/Makefile +++ b/tools/testing/selftests/futex/functional/Makefile @@ -18,6 +18,7 @@ TEST_GEN_FILES := \ TEST_PROGS := run.sh +top_srcdir = ../../../../.. include ../../lib.mk $(TEST_GEN_FILES): $(HEADERS) diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile index 1bbb47565c55..4665cdbf1a8d 100644 --- a/tools/testing/selftests/gpio/Makefile +++ b/tools/testing/selftests/gpio/Makefile @@ -21,11 +21,8 @@ endef CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ LDLIBS += -lmount -I/usr/include/libmount -$(BINARIES): ../../../gpio/gpio-utils.o ../../../../usr/include/linux/gpio.h +$(BINARIES):| khdr +$(BINARIES): ../../../gpio/gpio-utils.o ../../../gpio/gpio-utils.o: make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C ../../../gpio - -../../../../usr/include/linux/gpio.h: - make -C ../../../.. headers_install INSTALL_HDR_PATH=$(shell pwd)/../../../../usr/ - diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index d9d00319b07c..bcb69380bbab 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -32,9 +32,6 @@ $(LIBKVM_OBJ): $(OUTPUT)/%.o: %.c $(OUTPUT)/libkvm.a: $(LIBKVM_OBJ) $(AR) crs $@ $^ -$(LINUX_HDR_PATH): - make -C $(top_srcdir) headers_install - -all: $(STATIC_LIBS) $(LINUX_HDR_PATH) +all: $(STATIC_LIBS) $(TEST_GEN_PROGS): $(STATIC_LIBS) -$(TEST_GEN_PROGS) $(LIBKVM_OBJ): | $(LINUX_HDR_PATH) +$(STATIC_LIBS):| khdr diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 17ab36605a8e..0a8e75886224 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -16,8 +16,20 @@ TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED)) TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) +top_srcdir ?= ../../../.. +include $(top_srcdir)/scripts/subarch.include +ARCH ?= $(SUBARCH) + all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) +.PHONY: khdr +khdr: + make ARCH=$(ARCH) -C $(top_srcdir) headers_install + +ifdef KSFT_KHDR_INSTALL +$(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES):| khdr +endif + .ONESHELL: define RUN_TEST_PRINT_RESULT TEST_HDR_MSG="selftests: "`basename $$PWD`:" $$BASENAME_TEST"; \ diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile index 663e11e85727..d515dabc6b0d 100644 --- a/tools/testing/selftests/net/Makefile +++ b/tools/testing/selftests/net/Makefile @@ -15,6 +15,7 @@ TEST_GEN_FILES += udpgso udpgso_bench_tx udpgso_bench_rx TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa TEST_GEN_PROGS += reuseport_dualstack reuseaddr_conflict +KSFT_KHDR_INSTALL := 1 include ../lib.mk $(OUTPUT)/reuseport_bpf_numa: LDFLAGS += -lnuma diff --git a/tools/testing/selftests/networking/timestamping/Makefile b/tools/testing/selftests/networking/timestamping/Makefile index a728040edbe1..14cfcf006936 100644 --- a/tools/testing/selftests/networking/timestamping/Makefile +++ b/tools/testing/selftests/networking/timestamping/Makefile @@ -5,6 +5,7 @@ TEST_PROGS := hwtstamp_config rxtimestamp timestamping txtimestamp all: $(TEST_PROGS) +top_srcdir = ../../../../.. include ../../lib.mk clean: diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index fdefa2295ddc..58759454b1d0 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -25,10 +25,6 @@ TEST_PROGS := run_vmtests include ../lib.mk -$(OUTPUT)/userfaultfd: ../../../../usr/include/linux/kernel.h $(OUTPUT)/userfaultfd: LDLIBS += -lpthread $(OUTPUT)/mlock-random-test: LDLIBS += -lcap - -../../../../usr/include/linux/kernel.h: - make -C ../../../.. headers_install