Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp72405pxb; Thu, 21 Jan 2021 01:20:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVy45ycIYl94Os1/xrw9K9YeK3rD/TcZrq4GdS3fshWBZDu2d6PW5YtdWVZ7Yl1dcpxtUh X-Received: by 2002:a17:906:7156:: with SMTP id z22mr8460806ejj.441.1611220837549; Thu, 21 Jan 2021 01:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611220837; cv=none; d=google.com; s=arc-20160816; b=woXM4P7Owhy4IW1c5ar+PTuHRUrWVc77SwQ28AIMbcf2zyXdcDcfP6becF3U5XqZyH RMiPIh+FB1V+fhK6mNPUyRFwvptl7XbgfKN+adqOs5rydFMci8OM9rxweqRA/a1wXVw8 4NZG8dMXFxvQaRfBm/SCUiethRSJDqTVFwxX9jX+YWnwru4cmD5Mi94ku0dRQhOIaGX+ 0YrmDCSlcBMTViz6hJQBII4/f7v9P2DUrx+MRzAO1E3tjGf26lxIFQ/Sf5vQ1OriZ0Sp WXeWft81q4z0pUCneKvEGx3/kMsyzdLnftplvYEtsihCNll6TQBnubOhD3DEL80i6JBD HSsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=KvSZXCYCWOThZAfGsURUVFj6535QaWB9mdWG/Okc3Dc=; b=Ne/vTWcXu74bzwzmsHfwhlw6nRSMDRIXnQg/DU5lCRy991VVpiaK1DKC1prS4XQE6e Z6DhXyms6Cvk/eaRfuLFseofvdrE2KPT35l97RVZq2SDGiktSyTGrS2/AdaLXTLibn1E T4KJdbXMul41HXJYOZFfUig5su7qWbt3UM4acLjLg/fWRKSgVbx+W1e7Oqb+rqTVUUrq LnTBkMiAt0bzpuhwRvBPhB7QVkkRgl0MnhgFxSr2F9WwkPQYIif2/LIRkNLkYzby5pHs BaGvQ/mNnZUND8fXiRN7bKJoO5A0crZblZx0hqhmXXEWue7BbHW7eWqsLJDdz3jxRkFp h46w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=KwxrYMpH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ak15si1544797ejc.547.2021.01.21.01.20.14; Thu, 21 Jan 2021 01:20:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=KwxrYMpH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726208AbhAUJTD (ORCPT + 99 others); Thu, 21 Jan 2021 04:19:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726668AbhAUJK6 (ORCPT ); Thu, 21 Jan 2021 04:10:58 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C678CC0613C1 for ; Thu, 21 Jan 2021 01:10:17 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id hs11so1588705ejc.1 for ; Thu, 21 Jan 2021 01:10:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KvSZXCYCWOThZAfGsURUVFj6535QaWB9mdWG/Okc3Dc=; b=KwxrYMpHH9qLRqqFUZUCA/DpVUlNgagc9NdihZv6Bm4DwVruBYO7srGUU9Nq3fnieT 5mkU7Hmeen6wQzsG8A5DBEisThlpyPJ+haaaE9pTRg1QnpDswmpCOd2KaB1y1kV90/I9 WNRuxeh7payKI6+CrTTdR0mKCFBIamgnCzS997gxh1RUMHZgxiZIFrIl5Y82kNSvWZ+0 UgY3NtQouMUwza9ORQ/KGtT+AdFxOWZtxlKdLyS4GdbFQtQhkaeQiZoteAoxI+PzTVGL +5KblkR4eZm1JIi1CybByAZJWA3BHsvxZJLkz2r72TfxDhzbtNroCZsXPBZT7xI/cdfz BelQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KvSZXCYCWOThZAfGsURUVFj6535QaWB9mdWG/Okc3Dc=; b=J3FJ0X1+KlIT5AEatXmIKv+waIvGN96Via30LGJf/rn17nka+7E+tRhh1CqmoSsNtn 73nB1bPImd1lAm0qfjA+FUQIbbrTi97dlSzODA6cUitDDDebAtpMHZDCo+Czr+a2nU4b MDqmMN7u+MqShzVO8dGhFUnaSA0WDQI5pTHoqVjliXOYJTlKum6qrmZP4VoFhwbul1zm 6Fj+ITIAWZP1oChS3JMzF10drbhtnQUKfEvXktH91cZ5jQTkntIxcHazs297SyCwul1H FwVGbb6C40SWETKMBbCrtbsR20UTvuXxrlEpjaBthCi/O9gg45aAAA+KZHtET0eYhzTb fjEw== X-Gm-Message-State: AOAM5330jLSrddLOGV+jbj5JbwMZFkoW+Nn4/WgFR7q684uW9U0fsedl mRLFepDNvmFTZ3jXrkMPFEIEACGFZ4k/G03U8dnh/nqzbCU= X-Received: by 2002:a17:906:3146:: with SMTP id e6mr8232507eje.363.1611220216355; Thu, 21 Jan 2021 01:10:16 -0800 (PST) MIME-Version: 1.0 References: <20210119123059.102004-1-warthog618@gmail.com> In-Reply-To: <20210119123059.102004-1-warthog618@gmail.com> From: Bartosz Golaszewski Date: Thu, 21 Jan 2021 10:10:05 +0100 Message-ID: Subject: Re: [PATCH v3 0/7] selftests: gpio: rework and port to GPIO uAPI v2 To: Kent Gibson Cc: LKML , linux-gpio , linux-kselftest@vger.kernel.org, Linus Walleij , Shuah Khan , Bamvor Jian Zhang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 19, 2021 at 1:31 PM Kent Gibson wrote: > > Initially I just wanted to port the selftests to the latest GPIO uAPI, > but on finding that, due to dependency issues, the selftests are not built > for the buildroot environments that I do most of my GPIO testing in, I > decided to take a closer look. > > The first patch is essentially a rewrite of the exising test suite. > It uses a simplified abstraction of the uAPI interfaces to allow a common > test suite to test the gpio-mockup using either of the uAPI interfaces. > The simplified cdev interface is implemented in gpio-mockup.sh, with the > actual driving of the uAPI implemented in gpio-mockup-cdev.c. > The simplified sysfs interface replaces gpio-mockup-sysfs.sh and is > loaded over the cdev implementation when selected. > > The new tests should also be simpler to extend to cover new mockup > interfaces, such as the one Bart has been working on. > > I have dropped support for testing modules other than gpio-mockup from > the command line options, as the tests are very gpio-mockup specific so > I didn't see any calling for it. > > I have also tried to emphasise in the test output that the tests are > covering the gpio-mockup itself. They do perform some implicit testing > of gpiolib and the uAPI interfaces, and so can be useful as smoke tests > for those, but their primary focus is the gpio-mockup. > > Patches 2 through 5 do some cleaning up that is now possible with the > new implementation, including enabling building in buildroot environments. > Patch 4 doesn't strictly clean up all the old gpio references that it > could - the gpio was the only Level 1 test, so the Level 1 tests could > potentially be removed, but I was unsure if there may be other > implications to removing a whole test level, or that it may be useful > as a placeholder in case other static LDLIBS tests are added in > the future?? > > Patch 6 finally gets around to porting the tests to the latest GPIO uAPI. > > And Patch 7 updates the config to set the CONFIG_GPIO_CDEV option that > was added in v5.10. > > Cheers, > Kent. > > Changes v2 -> v3: > - remove 'commit' from Fixes tag in patch 1. > - rebase on Bart's gpio/for-next > > Changes v1 -> v2 (all in patch 1 and gpio-mockup.sh unless stated > otherwise): > - reorder includes in gpio-mockup-cdev.c > - a multitude of improvements to gpio-mockup.sh and gpio-mockup-sysfs.sh > based on Andy's review comments > - improved cleanup to ensure all child processes are killed on exit > - added race condition prevention or mitigation including the wait in > release_line, the retries in assert_mock, the assert_mock in set_mock, > and the sleep in set_line > > Kent Gibson (7): > selftests: gpio: rework and simplify test implementation > selftests: gpio: remove obsolete gpio-mockup-chardev.c > selftests: remove obsolete build restriction for gpio > selftests: remove obsolete gpio references from kselftest_deps.sh > tools: gpio: remove uAPI v1 code no longer used by selftests > selftests: gpio: port to GPIO uAPI v2 > selftests: gpio: add CONFIG_GPIO_CDEV to config > > tools/gpio/gpio-utils.c | 89 ---- > tools/gpio/gpio-utils.h | 6 - > tools/testing/selftests/Makefile | 9 - > tools/testing/selftests/gpio/Makefile | 26 +- > tools/testing/selftests/gpio/config | 1 + > .../testing/selftests/gpio/gpio-mockup-cdev.c | 198 +++++++ > .../selftests/gpio/gpio-mockup-chardev.c | 323 ------------ > .../selftests/gpio/gpio-mockup-sysfs.sh | 168 ++---- > tools/testing/selftests/gpio/gpio-mockup.sh | 497 ++++++++++++------ > tools/testing/selftests/kselftest_deps.sh | 4 +- > 10 files changed, 603 insertions(+), 718 deletions(-) > create mode 100644 tools/testing/selftests/gpio/gpio-mockup-cdev.c > delete mode 100644 tools/testing/selftests/gpio/gpio-mockup-chardev.c > > > base-commit: 64e6066e16b8c562983dd9d33e604c0001ae0fc7 > -- > 2.30.0 > Series applied, thanks! Bartosz