From patchwork Wed Nov 8 11:47:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 118241 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5178961qgn; Wed, 8 Nov 2017 03:48:00 -0800 (PST) X-Google-Smtp-Source: ABhQp+SJuWzgvS63A0HaeX6vy5KN5wB0h8pnepBSxZIpttflxyvQNFwdhI29WJuA0dcTpsmqAWCb X-Received: by 10.84.252.141 with SMTP id y13mr188604pll.295.1510141679995; Wed, 08 Nov 2017 03:47:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510141679; cv=none; d=google.com; s=arc-20160816; b=poMlGnIE3Om8BtObJB9hPCB5hszF9wA0tdZkbAK5QboPCvczrjZTJHEj+8X8H8eV7K lfx/+5No8EqnU87H+izL+lVTddKiYZ4ik3Lr3bfYzivpOJHv/AuFl74vZoIey6jhSeDg o5JByS7hGxSmVyzvN+suL2qT14dqGWYlrcci32ywJDnmgHd6+Mr010bmDUX0u92jWYyI 22i3PBS1Ehw3wN6xP+rIWXcY5j/TmHRzWN2rLHqvOwaJveZBOi2/ZVuERY/3KCrpeRc4 KX/s0zRE7sJA1NFQ2hYGqPxOmSL9kac1/RVmiK/XhFdEZnlP/ENMZbrKY9C6oB+TOqwj tdrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:author:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=0LH/LCWXhwhfX7/gwTJAcs3BtVRBH6AvYKxdxU8nRR4=; b=FBZ4doEut8UCpRCXhp7M8RcRhMyrSeMbe952HaJHyUukJm2vZDv835ZTUilQKwE2wd HGXRpihMosthgHiNU3HRXWQOnyzW5Ute1n3rS9rfXryWhqyFg5GxxwILq63a4JMcKrzo KJhx1q9uUXKYz6TcyUdKPIYe0RIVUoTGoHla5QwzqJqnj3fKx2Lvho7AL53STbrThnkr BthfNyxHVrO0UoEkHpzyxL1ut+ROID13KPMmUKnfgQPAQhU+HDl2U77u2CSJEiRHZtJd sD2ctuVoqIAo5bCS8GcLuuAoF966RP6D0jBNh4wzsfd7bKlAqg2krrM3EBqfwYGKkv4d fDKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FehUQ13C; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si3663916pgn.171.2017.11.08.03.47.59; Wed, 08 Nov 2017 03:47:59 -0800 (PST) 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=@linaro.org header.s=google header.b=FehUQ13C; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752210AbdKHLr6 (ORCPT + 21 others); Wed, 8 Nov 2017 06:47:58 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:50696 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751826AbdKHLrx (ORCPT ); Wed, 8 Nov 2017 06:47:53 -0500 Received: by mail-pg0-f66.google.com with SMTP id y5so1635115pgq.7 for ; Wed, 08 Nov 2017 03:47:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references:author; bh=0LH/LCWXhwhfX7/gwTJAcs3BtVRBH6AvYKxdxU8nRR4=; b=FehUQ13CNAOyyRiSaR3HgadBqjBZTMrcnktByGrTo2srmB1tnLze+i2oAtzRo04pfJ ViXC0pzCP4xERY/TKh+BPODZrcAj+/f6GDhc0l9g4Do8iGYRX90Ghlhwl74H5bM7b10k Br/TXTlpZv7fSime8C+NAo5Ea7yq6p6jrobJ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:author; bh=0LH/LCWXhwhfX7/gwTJAcs3BtVRBH6AvYKxdxU8nRR4=; b=oFle89gKLTxMq0sge9sFNMDALSxhgr4yNV+gplYxFdZQ9RtuA/f3KsIE1Laxq9VDlO o1m0X6WaubqrHil6lP5anGtvsu5dBtT7msT3ZrHx8gbSAdVsXyYpyuxGN5Mg+MYj7Xuw 04SqxjxOpsjcNUBdvtrwI9VcFndnXTyGdbqyTqYV/zl9Ps7Su/QhisCgEF7gD7zjav// wRyo6O90u5Lqmnyx9OJvR28jxfWOV0wYbLoyoI6Hr5dE9lEe7VmD1SAws1Ls6+kacm/L pMJtI8EIpfO/5npBMdwN6UBUMIK4Xafr68mqbYK2rRW2JWXgMRyOXuWEYk6L/8V5HLMx g/5w== X-Gm-Message-State: AJaThX69JU6I3fymGBR0Kjxzwoi5f/Fgs1j6MVpifcD0FycOLfyR9rXH wonuqtWCTuBgQXcwGbHKYp/0v6a0Pm4= X-Received: by 10.98.217.78 with SMTP id s75mr265312pfg.40.1510141672522; Wed, 08 Nov 2017 03:47:52 -0800 (PST) Received: from localhost.localdomain ([106.51.18.232]) by smtp.gmail.com with ESMTPSA id m74sm8742203pfi.2.2017.11.08.03.47.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Nov 2017 03:47:51 -0800 (PST) From: Amit Pundir To: kselftest , lkml Cc: Shuah Khan , Greg Kroah-Hartman , "Luis R . Rodriguez" , Masami Hiramatsu , Sumit Semwal Subject: [PATCH 1/2] selftests: firmware: skip unsupported async loading tests Date: Wed, 8 Nov 2017 17:17:39 +0530 Message-Id: <1510141660-31612-2-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510141660-31612-1-git-send-email-amit.pundir@linaro.org> References: <1510141660-31612-1-git-send-email-amit.pundir@linaro.org> Author: Amit Pundir Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ignore async firmware loading tests on older kernel releases, which do not support this feature. Signed-off-by: Amit Pundir --- tools/testing/selftests/firmware/fw_filesystem.sh | 34 ++++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) -- 2.7.4 Acked-by: Greg Kroah-Hartman diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh index 62f2d6f54929..b1f20fef36c7 100755 --- a/tools/testing/selftests/firmware/fw_filesystem.sh +++ b/tools/testing/selftests/firmware/fw_filesystem.sh @@ -70,9 +70,13 @@ if printf '\000' >"$DIR"/trigger_request 2> /dev/null; then exit 1 fi -if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then - echo "$0: empty filename should not succeed (async)" >&2 - exit 1 +if [ ! -e "$DIR"/trigger_async_request ]; then + echo "$0: empty filename: async trigger not supported" >&2 +else + if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then + echo "$0: empty filename should not succeed (async)" >&2 + exit 1 + fi fi # Request a firmware that doesn't exist, it should fail. @@ -105,17 +109,21 @@ else fi # Try the asynchronous version too -if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then - echo "$0: could not trigger async request" >&2 - exit 1 -fi - -# Verify the contents are what we expect. -if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then - echo "$0: firmware was not loaded (async)" >&2 - exit 1 +if [ ! -e "$DIR"/trigger_async_request ]; then + echo "$0: firmware loading: async trigger not supported" >&2 else - echo "$0: async filesystem loading works" + if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then + echo "$0: could not trigger async request" >&2 + exit 1 + fi + + # Verify the contents are what we expect. + if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then + echo "$0: firmware was not loaded (async)" >&2 + exit 1 + else + echo "$0: async filesystem loading works" + fi fi ### Batched requests tests From patchwork Wed Nov 8 11:47:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 118242 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp1696338edm; Wed, 8 Nov 2017 03:49:42 -0800 (PST) X-Google-Smtp-Source: ABhQp+S+pAliAbfglK3S0ScSAWGStSncIpqjWXVtkgU9eiSno9A9w/NbNlPCQCF3CXrc/BdhFPGx X-Received: by 10.84.176.131 with SMTP id v3mr219615plb.208.1510141688325; Wed, 08 Nov 2017 03:48:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510141688; cv=none; d=google.com; s=arc-20160816; b=D7kuGHCC/7iHsTYnFC8KSij6A6aF/YPwfcXC914BlSZSrPKhG8HFJWX2OFOovYriP7 0zVqcMa3/7kCv8KiXB33WvSyK0blUg8If9wiuDuywr1pIS2EzO+Fd/KSCHDjA0aCOckH Z6aHXhZT9gN4L3ZiX8L6F61noRexFVE4YzjyaqFONTawhokKEMIxOq196eG0BMosa31d Q6FH66Q5KAAkGNCOtd02bFtWcodA4yNeFPFU8q8iw4K1Yy+x+5pl4ylMsHQY/dfByVRU oe6rQ33rYk1UNefxY3KHghTkrfT5TUEzTugRnYFxSOrEhzMI+Q+dwHpS9AZQ35y7NrPV icoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:author:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=JgreyHgHsvahNUV5vbRqVinNFMMrfhe/z4ndpXanHNs=; b=zEVtwTh7j0r+gLiQTvU8WuSnLg7jQnJ1aKfcAJNUKswG+EmGyW2BlbvO3SCyJVSlGs Wdjn2RtrHA2NoSowBPTDMrN/a+7ZRe64ZBODHB33rYEzvuE0c++DQ9vyWmolN62chOQo CM1M8b/sO6ZnOV4gV4zlzmwv5zJVi/qYFpY2BuzP5ShwAQZjdQx+wlfdRAmaYBtRGAkj gx3awyivmC9jHRyS23heJz5vsVLXSJXu89cgdpxIpYOq5F22O9skcZxZk/p9Th5MKFVx jFKL/0LQIXwBk+7G3zUA+v023TLVouW+DM+SG7gGX/0NUpg28akGQxJIF/iCYYjUFMw+ XPXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c9faS8s/; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si3663916pgn.171.2017.11.08.03.48.08; Wed, 08 Nov 2017 03:48:08 -0800 (PST) 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=@linaro.org header.s=google header.b=c9faS8s/; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752250AbdKHLsH (ORCPT + 21 others); Wed, 8 Nov 2017 06:48:07 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:46374 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752134AbdKHLr5 (ORCPT ); Wed, 8 Nov 2017 06:47:57 -0500 Received: by mail-pf0-f196.google.com with SMTP id p87so1550695pfj.3 for ; Wed, 08 Nov 2017 03:47:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references:author; bh=JgreyHgHsvahNUV5vbRqVinNFMMrfhe/z4ndpXanHNs=; b=c9faS8s/MZxG26KrMm31YHXqgGtAgGcLFMUPGrDGknfFAAOxHlnga2Gd9rOMrZzV2Q JbAppmxRIW2C2M1juPfX83vZM5jl7gZ43GZKvnYRW6P+aHxSWkPtKtJR7/C273tQgSaS RJIlrM61Tp7YLeHcLbZGLOMOqHPUWYANvgYt4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:author; bh=JgreyHgHsvahNUV5vbRqVinNFMMrfhe/z4ndpXanHNs=; b=a7rR28kXGKlZOOlhAqnXa/7OJDilNvhMza8+jJKjPBX0hRP1MZOZfqMkG95km3ZtEV Dr/cZvy50/sVJJBFDJde60B31PVNbaKTgNZV6djFWA4sKI+4F+KTouAgq0lHFJyw8ZDl 4ssoypO0ryQy50O7+fpM+IhOrghvZbst0ZJfQccCa2o2+X9/VG/50+K97GdpGLI9nLLT k04LsG4wOhRlx5AEWgpeX5tN7YmvB/4R0h3WtB4y+VBwmpu5OLtqB+lePijJVPl9mMqt KWAa6og3JxqhA1yM6Ou8G0hI2eoHsdEH1rQAAIbfeflxHNTv93ORGT6FtNNKYWdqQ65O 8Rig== X-Gm-Message-State: AJaThX79mZRfjR3malJfoLZizmEtvlNaoUds/mNLRUK7V5Bue9KWR3Qo nsr3MLvw4T/9WzkfMYgvjh+RgQ== X-Received: by 10.159.206.193 with SMTP id x1mr190934plo.319.1510141676542; Wed, 08 Nov 2017 03:47:56 -0800 (PST) Received: from localhost.localdomain ([106.51.18.232]) by smtp.gmail.com with ESMTPSA id m74sm8742203pfi.2.2017.11.08.03.47.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Nov 2017 03:47:55 -0800 (PST) From: Amit Pundir To: kselftest , lkml Cc: Shuah Khan , Greg Kroah-Hartman , "Luis R . Rodriguez" , Masami Hiramatsu , Sumit Semwal Subject: [PATCH 2/2] selftests: firmware: skip unsupported custom firmware fallback tests Date: Wed, 8 Nov 2017 17:17:40 +0530 Message-Id: <1510141660-31612-3-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510141660-31612-1-git-send-email-amit.pundir@linaro.org> References: <1510141660-31612-1-git-send-email-amit.pundir@linaro.org> Author: Amit Pundir Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ignore custom firmware loading and cancellation tests on older kernel releases, which do not support this feature. Signed-off-by: Amit Pundir --- tools/testing/selftests/firmware/fw_fallback.sh | 38 +++++++++++++++++-------- 1 file changed, 26 insertions(+), 12 deletions(-) -- 2.7.4 Acked-by: Greg Kroah-Hartman diff --git a/tools/testing/selftests/firmware/fw_fallback.sh b/tools/testing/selftests/firmware/fw_fallback.sh index a52a3bab532b..72858c921eed 100755 --- a/tools/testing/selftests/firmware/fw_fallback.sh +++ b/tools/testing/selftests/firmware/fw_fallback.sh @@ -86,6 +86,11 @@ load_fw_cancel() load_fw_custom() { + if [ ! -e "$DIR"/trigger_custom_fallback ]; then + echo "$0: custom fallback loading trigger not supported" >&2 + return 1 + fi + local name="$1" local file="$2" @@ -108,11 +113,17 @@ load_fw_custom() # Wait for request to finish. wait + return 0 } load_fw_custom_cancel() { + if [ ! -e "$DIR"/trigger_custom_fallback ]; then + echo "$0: cancelling custom fallback trigger not supported" >&2 + return 1 + fi + local name="$1" local file="$2" @@ -133,6 +144,7 @@ load_fw_custom_cancel() # Wait for request to finish. wait + return 0 } load_fw_fallback_with_child() @@ -227,20 +239,22 @@ else echo "$0: cancelling fallback mechanism works" fi -load_fw_custom "$NAME" "$FW" -if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then - echo "$0: firmware was not loaded" >&2 - exit 1 -else - echo "$0: custom fallback loading mechanism works" +if load_fw_custom "$NAME" "$FW" ; then + if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then + echo "$0: firmware was not loaded" >&2 + exit 1 + else + echo "$0: custom fallback loading mechanism works" + fi fi -load_fw_custom_cancel "nope-$NAME" "$FW" -if diff -q "$FW" /dev/test_firmware >/dev/null ; then - echo "$0: firmware was expected to be cancelled" >&2 - exit 1 -else - echo "$0: cancelling custom fallback mechanism works" +if load_fw_custom_cancel "nope-$NAME" "$FW" ; then + if diff -q "$FW" /dev/test_firmware >/dev/null ; then + echo "$0: firmware was expected to be cancelled" >&2 + exit 1 + else + echo "$0: cancelling custom fallback mechanism works" + fi fi set +e