From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.171 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796135228; b=oWHFDUkZjPBqeeDvfWKWZX7u7G1ytbLKJZ7YDrs7jptMbkSNJfwvZpF8B4zy/tXnCau3 I0+otVUo5OUMN3RloUnfB4DWDqIWpNdvX9MqPgR4Ecu8uwkxLCoZmhn1D4JkIFkKeVRlD bbnMIJPjsmsoeCtC/+pvdWyW+Jb5TRPGQZpitUfNfecEgMnXoTlTWhcjuIYPTyuMJDYEx D8/gfU3o7NA2Op6lKQM7cwyiuPujgSG6iQdkQK6MRVK/O//Jc0ClEwzPLwz4kaZaGEOOK 1KEvARPqhr7X79KOsZG2Q/FZ6lW4CANjeoRzgpXfkC8qzsTiMGD6/8kjX7B2HJHBC6g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796135228; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=Y0S6D18gk+Wy3aEj7lwuE5btLqzpidwdlVGEEgqHohU=; b=ccFCFoeQC3FU0Kxtj7jmTWb2uqJl1lWxKjAx7+rQVDmbjuvLc8h0sE1UePvlBPzCEjz6 a2lGRN/cm70ZbJCkPxTLmIyxLaEmoypKqAG3Kvekbri5XCbewmI8YBoWATPNE7FnyIKl+ gMYtFX+xqVTfPM+CGoDQmC05wx2/w5DzfwnM2hZZzq5EjWOwxdui39Z7y+YvIC45N15a4 ZbcZQJH2ix4umXUFY2fvq+HLlA5YHsiT8abUuUFq59FDPvcCpLNW4IAA0g4B5j/vcFp7A lKMeQ8z64D4la/pkPEMNs0HvZvX3Jam1TTMZUlJLNXjt3VdGxPAsD7zy2AutDoWvM9g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="uEseRk/c"; arc=none smtp.remote-ip=209.85.210.171 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82C8D606A33F for ; Tue, 1 Dec 2026 14:27:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 82C8D606A33F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=uEseRk/c Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-8b5e5e64494so6294063b3a.1 for ; Tue, 01 Dec 2026 06:27:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796135228; x=1796740028; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=Y0S6D18gk+Wy3aEj7lwuE5btLqzpidwdlVGEEgqHohU=; b=uEseRk/cQ4AqNrBOyRTobwvVOkByxsjM4PoVhRTmgPNsEWn9yROASw+BxEBno3ukCy 5h3D1j5dm4bo//aDjxQci1mw1E3aII+uX/txSEF/zXfbrcYMxL+UYbF+rUESyou63zB7 KYWPxLtCUpHG3Tk8p8vdyEBCQ7qOq7lonL4t/FD7R8bP8vDYBK5lmUhM0ZY2WlIwZNXe wQ7lq4tNtL0SpD2O0XHJQVMWr9Jit0SZBv+NeWUMM9P5coToQBBUyAGxMoU+aM59+65X USkmxxtqpaNYLS2BXc6LThG1V3lFFz6LgOpU4DwQNjMf5bEn63STFLxONVSmLW4N6Xl/ Bciw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796135228; x=1796740028; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Y0S6D18gk+Wy3aEj7lwuE5btLqzpidwdlVGEEgqHohU=; b=UYFiKLm2h3CBjhVm0CXa2X7Ym06Yii14bYO7I789MtQ0XEzLBYXiaWhLyEU+nHOpWp jsXCBwxJ2Ej4+fO6YQHJynd3X1MklaTG6Foxze/wCVgKbLVXC9/EMjayQfedJcENSzDC cFx6Kq+87jF+N1QjpRPFVANc4Bt3OC3iceaVv+CYe+/4+bYi2cJicpp89LJSVQTj3b3v 7xXhVO2kJjMeVPlSEy5IP1dgiS3I8GrUSOE5pR8DHhNA01qwNOdKrvRiZYGnsGxls9KL osrWBhSWcStFkrR4YJfwiM1XRjmJPqB2AVo3PXGBsuDEfq4ytDJ9E6KLOU8SFCdgRXDa 6mHg== X-Forwarded-Encrypted: i=1; AL+hErF1j+euN+WkLcfNU3ZJeDfIsLUgW3YBx+yD6TO3oebJvcU40b08qzCHOaHXmJd+eWAz5zYA1xYcMXM=@vger.kernel.org X-Gm-Message-State: APuU4Z/w06jdxCSOHuHvWZj/qe6z2q2l+pwapTHaSKUx2N+YSbd9QusV aQGszHVdLhvEBxbmDtgFUEYLyCiHJ57c/jBXFFrLN9L3Fpmu8NNekpYj X-Gm-Gg: AZFdTZclkpdF6koDUjGWwN6FLwOuavD8DEr/KvOudUwYvKM4BeYQL5JTY0lKvwBz5Ns 9/lt3UxrTRJUv5w49rZZTc6gYA2wrfUosb4uUpz6bB3huKfhUAEkOOtBhNg2/ghrNCefS5QWhWN uOUeKQjnsXelvWRZIOOnjBgUSTOTspD6iUiYbtifZZ1zuEUi5x8hYRD9VAJoc9zIJgInv/+wOUr zT/Z40/79MV/0SFpt2Cmdemfg9LCgLP7I+ShkkdtA5HrQEHgk75NKPKNAvlGVzp6ibVVm1cXiv8 KgI1CxZATBngR9mbw6F6lXNW8O/SQfXeBWe2cpC6ObxwgL9S4vESAiZdTr8vwb3tvlSowyrSZ0I yddw2SEClwD8bCkLk2/xiJViHHc0t1hiQH8ZEDG/oCOum3ELz5InAZdpQnDsM5Rcexhe3WJO+np gh3EqQtC6ebJuSiOElk0bLX6kkJro+drWSyg4tHLe3+O0JqZV0qL2NXubioSRIsLX1DmDy5elJN yI1WMCzB5q69wFH71o62+cdWI3eIZU8zA8I27srEium6c4we8pCnutk6AS4lhQg5OBGr1bh2pz3 cRjCd3tBNXyWpKROj45udfuz4siICsiw8/TXBH7z0RzgkY9MtOdHoxhMG970wnWUhKkUYOFCoXK yOEWIjLI+7dRfo1aO7BzadghxG+7+ X-Received: by 2002:a05:6a21:a97:b0:3f8:87a0:9267 with SMTP id adf61e73a8af0-4014cf529f1mr40274087637.62.1796135227384; Tue, 01 Dec 2026 06:27:07 -0800 (PST) Received: from DESKTOP-TPPBPA1 (36-226-254-86.dynamic-ip.hinet.net. [36.226.254.86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c87077944bsm20280798b3a.2.2026.12.01.06.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 06:27:06 -0800 (PST) From: Lin Tzu Yang To: Linus Walleij , Bartosz Golaszewski , Shuah Khan Cc: Bamvor Jian Zhang , Jonathan Corbet , linux-gpio@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] gpio: virtuser: add a selftest Date: Tue, 1 Dec 2026 22:27:01 +0800 Message-ID: <20261201142703.900902-1-rongh7426@gmail.com> X-Mailer: git-send-email 2.51.1.windows.1 X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit gpio-virtuser has no selftest yet, while gpio-sim and gpio-aggregator do. Patch 2 adds one, driving the consumer against a gpio-sim chip. Writing it turned up a documentation mismatch, fixed in patch 1, and two driver bugs, fixed separately against gpio/for-current: - "gpio: virtuser: fix one-byte overflow in lookup entry key show" (20261201024151.872725-1-rongh7426@gmail.com, sent earlier today): test 2.3 reads back a 4095-byte key. Without that fix the read still returns the right bytes, but KASAN reports the overflow. - "gpio: virtuser: report the right dev_name before the device is live" (sent just before this series): without it, test 1.1 fails with "dev_name changed when the consumer was enabled". Testing, in a QEMU/KVM arm64 guest (KASAN, configfs-next 2e0fad9d2eae, gpio-sim and gpio-virtuser built in, busybox userspace): - with both fixes: PASS in five runs, no kernel warnings - without the dev_name fix: FAIL at 1.1, as expected - with only the dev_name fix: PASS, plus two KASAN reports from 2.3 The series is against gpio/for-next. This series was written with the help of an AI coding assistant (Claude). I ran the tests above and reviewed the changes. Lin Tzu Yang (2): Documentation: gpio: virtuser: list the accepted direction values selftests: gpio: add a test for gpio-virtuser .../admin-guide/gpio/gpio-virtuser.rst | 5 +- tools/testing/selftests/gpio/Makefile | 3 +- tools/testing/selftests/gpio/config | 2 + tools/testing/selftests/gpio/gpio-virtuser.sh | 420 ++++++++++++++++++ 4 files changed, 427 insertions(+), 3 deletions(-) create mode 100755 tools/testing/selftests/gpio/gpio-virtuser.sh -- 2.47.3