[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=MfRm02TRJ52CU3iLhsvwd95CBhxmkbebCJ=riiXxsCkyg@mail.gmail.com>
Date: Wed, 22 Jan 2025 10:26:27 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Koichiro Den <koichiro.den@...onical.com>
Cc: linux-kselftest@...r.kernel.org, linux-gpio@...r.kernel.org,
bamv2005@...il.com, shuah@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] selftests: gpio: gpio-sim: Fix missing chip disablements
On Wed, Jan 22, 2025 at 5:33 AM Koichiro Den <koichiro.den@...onical.com> wrote:
>
> Since upstream commit 8bd76b3d3f3a ("gpio: sim: lock up configfs that an
> instantiated device depends on"), rmdir for an active virtual devices
> been prohibited.
>
> Update gpio-sim selftest to align with the change.
>
> Reported-by: kernel test robot <oliver.sang@...el.com>
> Closes: https://lore.kernel.org/oe-lkp/202501221006.a1ca5dfa-lkp@intel.com
> Signed-off-by: Koichiro Den <koichiro.den@...onical.com>
> ---
> tools/testing/selftests/gpio/gpio-sim.sh | 31 +++++++++++++++++++-----
> 1 file changed, 25 insertions(+), 6 deletions(-)
>
> diff --git a/tools/testing/selftests/gpio/gpio-sim.sh b/tools/testing/selftests/gpio/gpio-sim.sh
> index 6fb66a687f17..bbc29ed9c60a 100755
> --- a/tools/testing/selftests/gpio/gpio-sim.sh
> +++ b/tools/testing/selftests/gpio/gpio-sim.sh
> @@ -46,12 +46,6 @@ remove_chip() {
> rmdir $CONFIGFS_DIR/$CHIP || fail "Unable to remove the chip"
> }
>
> -configfs_cleanup() {
> - for CHIP in `ls $CONFIGFS_DIR/`; do
> - remove_chip $CHIP
> - done
> -}
> -
> create_chip() {
> local CHIP=$1
>
> @@ -105,6 +99,13 @@ disable_chip() {
> echo 0 > $CONFIGFS_DIR/$CHIP/live || fail "Unable to disable the chip"
> }
>
> +configfs_cleanup() {
> + for CHIP in `ls $CONFIGFS_DIR/`; do
> + disable_chip $CHIP
> + remove_chip $CHIP
> + done
> +}
> +
> configfs_chip_name() {
> local CHIP=$1
> local BANK=$2
> @@ -181,6 +182,7 @@ create_chip chip
> create_bank chip bank
> enable_chip chip
> test -n `cat $CONFIGFS_DIR/chip/bank/chip_name` || fail "chip_name doesn't work"
> +disable_chip chip
> remove_chip chip
>
Hi! Thanks for addressing it.
Is there any place in this file where we'd call remove_chip() without
calling disable_chip() first? Maybe we can fold disable_chip() into
remove_chip() and make the patch much smaller?
Bart
Powered by blists - more mailing lists