From patchwork Tue Apr 11 17:15:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 673001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C655C77B70 for ; Tue, 11 Apr 2023 17:15:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229619AbjDKRPj (ORCPT ); Tue, 11 Apr 2023 13:15:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbjDKRPi (ORCPT ); Tue, 11 Apr 2023 13:15:38 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0F4B5BA0; Tue, 11 Apr 2023 10:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681233330; x=1712769330; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=l77rwRkmmaeKf8oCWhGD/yj1q+/ZZYlFQ+ZgKZ60owc=; b=YiTihbpZc/YfJWIudoEx6Ib8fCRULyyjKJ4Rt8bIUhEcu/IpB4gPij6a mSNnIUC6MV+LkfMOXKqBOJaRW8MU6pcxDX8gIXXeu4xHFeKpYepJC3Tg4 gpAiG3B9wSBUcvf2sVCK0G1f3Kle2uUVJg1FI0sRoWYHY2gG56oyFOpVH 1708YHElLb2x8WJkB/R5eR92Q9mS59gq18mj4/h5cTotcHVA1Gqun6ywZ KArNoOcq4oeSAXu38w+tdyc03m1hdcbVDGk4mMJ9hzpQD+FxPsCGp2yZR hlQgfsXi9oEV2/vw34zStgYIwDw88q8m2EIOseWowRVluKNU4t4LhXIr7 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="346354122" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="346354122" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2023 10:15:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="638904505" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="638904505" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2023 10:15:26 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id B7195438; Tue, 11 Apr 2023 20:15:29 +0300 (EEST) From: Andy Shevchenko To: linux-gpio@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bamvor Jian Zhang , Shuah Khan , Linus Walleij , Bartosz Golaszewski , Mirsad Todorovac , Andy Shevchenko Subject: [PATCH v1 1/2] selftests: gpio: gpio-sim: Fix BUG: test FAILED due to recent change Date: Tue, 11 Apr 2023 20:15:20 +0300 Message-Id: <20230411171521.29678-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Mirsad Todorovac According to Mirsad the gpio-sim.sh test appears to FAIL in a wrong way due to missing initialisation of shell variables: 4.2. Bias settings work correctly cat: /sys/devices/platform/gpio-sim.0/gpiochip18/sim_gpio0/value: No such file or directory ./gpio-sim.sh: line 393: test: =: unary operator expected bias setting does not work GPIO gpio-sim test FAIL After this change the test passed: 4.2. Bias settings work correctly GPIO gpio-sim test PASS His testing environment is AlmaLinux 8.7 on Lenovo desktop box with the latest Linux kernel based on v6.2: Linux 6.2.0-mglru-kmlk-andy-09238-gd2980d8d8265 x86_64 Suggested-by: Mirsad Todorovac Signed-off-by: Andy Shevchenko --- tools/testing/selftests/gpio/gpio-sim.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/gpio/gpio-sim.sh b/tools/testing/selftests/gpio/gpio-sim.sh index 9f539d454ee4..fa2ce2b9dd5f 100755 --- a/tools/testing/selftests/gpio/gpio-sim.sh +++ b/tools/testing/selftests/gpio/gpio-sim.sh @@ -389,6 +389,9 @@ create_chip chip create_bank chip bank set_num_lines chip bank 8 enable_chip chip +DEVNAME=`configfs_dev_name chip` +CHIPNAME=`configfs_chip_name chip bank` +SYSFS_PATH="/sys/devices/platform/$DEVNAME/$CHIPNAME/sim_gpio0/value" $BASE_DIR/gpio-mockup-cdev -b pull-up /dev/`configfs_chip_name chip bank` 0 test `cat $SYSFS_PATH` = "1" || fail "bias setting does not work" remove_chip chip From patchwork Tue Apr 11 17:15:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 672514 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DEA0C76196 for ; Tue, 11 Apr 2023 17:15:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230004AbjDKRPj (ORCPT ); Tue, 11 Apr 2023 13:15:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbjDKRPi (ORCPT ); Tue, 11 Apr 2023 13:15:38 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04A5C5FFB; Tue, 11 Apr 2023 10:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681233331; x=1712769331; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hkjCkl5c+7zSxcTy7EubOaO/P5T/a3MNoi17HIee2x8=; b=nHml3D/orgRA4H0jDsYVLB/YRZkiiA4BQo+w/OBhISLDOQfQDz0cI7XV rVh6KTkaxWnVG3hls975Js6s9lWnpVlMNv2BagCAeElKY131LSVTobUra lmX+Cq6eyTGaF7PBDUVm8NpndZ4Qw5BYhGsjkbfWtux+v6c9bA5HtBqFS zOE0o4HgBIfd2cq2PJDBmMRUlv2AOjzeOTxDjNj2rALMnBosOPdmxIJxV qqKA8GIdqVpqSrokvZx+e9SlZVI8SNTNOk59wzew97vwFNa5eAssPACrw ms15PueDPpVRRMAbUXH3l+5CK2iTQ/sspb5K2p2bcD8P2mVX6+V9wWNZk g==; X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="341172119" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="341172119" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2023 10:15:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="862951139" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="862951139" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 11 Apr 2023 10:15:28 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7D0E669A; Tue, 11 Apr 2023 20:15:31 +0300 (EEST) From: Andy Shevchenko To: linux-gpio@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bamvor Jian Zhang , Shuah Khan , Linus Walleij , Bartosz Golaszewski , Andy Shevchenko Subject: [PATCH v1 2/2] selftests: gpio: gpio-sim: Use same variable name for sysfs pathname Date: Tue, 11 Apr 2023 20:15:21 +0300 Message-Id: <20230411171521.29678-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230411171521.29678-1-andriy.shevchenko@linux.intel.com> References: <20230411171521.29678-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org SYSFS_PATH can be used locally and globally, especially that has the same content. Signed-off-by: Andy Shevchenko --- tools/testing/selftests/gpio/gpio-sim.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/gpio/gpio-sim.sh b/tools/testing/selftests/gpio/gpio-sim.sh index fa2ce2b9dd5f..6fb66a687f17 100755 --- a/tools/testing/selftests/gpio/gpio-sim.sh +++ b/tools/testing/selftests/gpio/gpio-sim.sh @@ -152,9 +152,9 @@ sysfs_set_pull() { local PULL=$4 local DEVNAME=`configfs_dev_name $DEV` local CHIPNAME=`configfs_chip_name $DEV $BANK` - local SYSFSPATH="/sys/devices/platform/$DEVNAME/$CHIPNAME/sim_gpio$OFFSET/pull" + local SYSFS_PATH="/sys/devices/platform/$DEVNAME/$CHIPNAME/sim_gpio$OFFSET/pull" - echo $PULL > $SYSFSPATH || fail "Unable to set line pull in sysfs" + echo $PULL > $SYSFS_PATH || fail "Unable to set line pull in sysfs" } # Load the gpio-sim module. This will pull in configfs if needed too.