kernelci.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: Sean Wang <sean.wang@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Bamvor Jian Zhang <bamv2005@gmail.com>,
	Shuah Khan <shuah@kernel.org>
Cc: kernel@collabora.com, linux-mediatek@lists.infradead.org,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kselftest@vger.kernel.org, kernelci@lists.linux.dev
Subject: Re: [PATCH RFC v2 0/5] Verify bias functionality for pinctrl_paris driver through new gpio test
Date: Mon, 28 Oct 2024 10:02:41 -0400	[thread overview]
Message-ID: <cda91b70-7179-49b5-9207-3fa3a1aaa4d5@notapiano> (raw)
In-Reply-To: <20241025-kselftest-gpio-set-get-config-v2-0-040d748840bb@collabora.com>

On Fri, Oct 25, 2024 at 03:45:35PM -0400, Nícolas F. R. A. Prado wrote:
> This series was motivated by the regression fixed by 166bf8af9122
> ("pinctrl: mediatek: common-v2: Fix broken bias-disable for
> PULL_PU_PD_RSEL_TYPE"). A bug was introduced in the pinctrl_paris driver
> which prevented certain pins from having their bias configured.
> 
> Running this test on the mt8195-tomato platform with the test plan
> included below[1] shows the test passing with the fix applied, but failing
> without the fix:
> 
> With fix:
>   $ ./gpio-setget-config.py
>   TAP version 13
>   # Using test plan file: ./google,tomato.yaml
>   1..3
>   ok 1 pinctrl_paris.34.pull-up
>   ok 2 pinctrl_paris.34.pull-down
>   ok 3 pinctrl_paris.34.disabled
>   # Totals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0
> 
> Without fix:
>   $ ./gpio-setget-config.py
>   TAP version 13
>   # Using test plan file: ./google,tomato.yaml
>   1..3
>   # Bias doesn't match: Expected pull-up, read pull-down.
>   not ok 1 pinctrl_paris.34.pull-up
>   ok 2 pinctrl_paris.34.pull-down
>   # Bias doesn't match: Expected disabled, read pull-down.
>   not ok 3 pinctrl_paris.34.disabled
>   # Totals: pass:1 fail:2 xfail:0 xpass:0 skip:0 error:0
> 
> In order to achieve this, the first three patches expose bias
> configuration through the GPIO API in the MediaTek pinctrl drivers,
> notably, pinctrl_paris, patch 4 extends the gpio-mockup-cdev utility for
> use by patch 5, and patch 5 introduces a new GPIO kselftest that takes a
> test plan in YAML, which can be tailored per-platform to specify the
> configurations to test, and sets and gets back each pin configuration to
> verify that they match and thus that the driver is behaving as expected.
> 
> Since the GPIO uAPI only allows setting the pin configuration, getting
> it back is done through pinconf-pins in the pinctrl debugfs folder.
> 
> The test currently only verifies bias but it would be easy to extend to
> verify other pin configurations.
> 
> The test plan YAML file can be customized for each use-case and is
> platform-dependant. For that reason, only an example is included in
> patch 3 and the user is supposed to provide their test plan. That said,
> the aim is to collect test plans for ease of use at [2].
> 
> [1] This is the test plan used for mt8195-tomato:
> 
> - label: "pinctrl_paris"
>   tests:
>   # Pin 34 has type MTK_PULL_PU_PD_RSEL_TYPE and is unused.
>   # Setting bias to MTK_PULL_PU_PD_RSEL_TYPE pins was fixed by
>   # 166bf8af9122 ("pinctrl: mediatek: common-v2: Fix broken bias-disable for PULL_PU_PD_RSEL_TYPE")
>   - pin: 34
>     bias: "pull-up"
>   - pin: 34
>     bias: "pull-down"
>   - pin: 34
>     bias: "disabled"
> 
> [2] https://github.com/kernelci/platform-test-parameters
> 
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> ---
> Changes in v2:
> - Added patches 2 and 3 enabling the extra GPIO pin configurations on
>   the other mediatek drivers: pinctrl-moore and pinctrl-mtk-common
> - Tweaked function name in patch 1:
>   mtk_pinconf_set -> mtk_paris_pin_config_set,
>   to make it clear it is not a pinconf_ops
> - Adjusted commit message to make it clear the current support is
>   limited to pins supported by the EINT controller
> - Link to v1: https://lore.kernel.org/r/20240909-kselftest-gpio-set-get-config-v1-0-16a065afc3c1@collabora.com
> 
> ---
> Nícolas F. R. A. Prado (5):
>       pinctrl: mediatek: paris: Expose more configurations to GPIO set_config
>       pinctrl: mediatek: moore: Expose more configurations to GPIO set_config
>       pinctrl: mediatek: common: Expose more configurations to GPIO set_config

I forgot to mention that I don't have hardware that uses the moore or the common
drivers, so I'm not able to runtime test patches 2 and 3. So help with that is
appreciated.

Thanks,
Nícolas

>       selftest: gpio: Add wait flag to gpio-mockup-cdev
>       selftest: gpio: Add a new set-get config test
> 
>  drivers/pinctrl/mediatek/pinctrl-moore.c           | 283 +++++++++++----------
>  drivers/pinctrl/mediatek/pinctrl-mtk-common.c      |  48 ++--
>  drivers/pinctrl/mediatek/pinctrl-paris.c           |  26 +-
>  tools/testing/selftests/gpio/Makefile              |   2 +-
>  tools/testing/selftests/gpio/gpio-mockup-cdev.c    |  14 +-
>  .../gpio-set-get-config-example-test-plan.yaml     |  15 ++
>  .../testing/selftests/gpio/gpio-set-get-config.py  | 183 +++++++++++++
>  7 files changed, 395 insertions(+), 176 deletions(-)
> ---
> base-commit: a39230ecf6b3057f5897bc4744a790070cfbe7a8
> change-id: 20240906-kselftest-gpio-set-get-config-6e5bb670c1a5
> 
> Best regards,
> -- 
> Nícolas F. R. A. Prado <nfraprado@collabora.com>
> 

      parent reply	other threads:[~2024-10-28 14:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-25 19:45 [PATCH RFC v2 0/5] Verify bias functionality for pinctrl_paris driver through new gpio test Nícolas F. R. A. Prado
2024-10-25 19:45 ` [PATCH RFC v2 1/5] pinctrl: mediatek: paris: Expose more configurations to GPIO set_config Nícolas F. R. A. Prado
2024-11-01  7:41   ` Chen-Yu Tsai
2024-10-25 19:45 ` [PATCH RFC v2 2/5] pinctrl: mediatek: moore: " Nícolas F. R. A. Prado
2024-11-01  7:54   ` Chen-Yu Tsai
2024-10-25 19:45 ` [PATCH RFC v2 3/5] pinctrl: mediatek: common: " Nícolas F. R. A. Prado
2024-11-01  7:54   ` Chen-Yu Tsai
2024-11-01 12:04     ` Nícolas F. R. A. Prado
2024-10-25 19:45 ` [PATCH RFC v2 4/5] selftest: gpio: Add wait flag to gpio-mockup-cdev Nícolas F. R. A. Prado
2024-10-28 14:36   ` Linus Walleij
2024-10-25 19:45 ` [PATCH RFC v2 5/5] selftest: gpio: Add a new set-get config test Nícolas F. R. A. Prado
2024-10-28 14:37   ` Linus Walleij
2024-10-28 14:02 ` Nícolas F. R. A. Prado [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cda91b70-7179-49b5-9207-3fa3a1aaa4d5@notapiano \
    --to=nfraprado@collabora.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bamv2005@gmail.com \
    --cc=kernel@collabora.com \
    --cc=kernelci@lists.linux.dev \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=sean.wang@kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).