From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj2-f13.google.com (mail-pj2-f13.google.com [74.125.227.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA37438423D for ; Sun, 13 Sep 2026 08:46:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.227.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789289178; cv=none; b=OQbo+7XnhQaKYJhIwMkciqOBIfSjeJdSdE5JghMFhvR0c0zi9DaAwEsLHn/lFhhWiH1gzlNtOrmo8FiBObC+WIcKtGCfBLGM5Il218clD5PShUC4V9zbfhj9VB6OOi+5Mw2DxuyUCewWR8q9ZSMvvbD5WqZYgGdcKvHzrbipUlY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789289178; c=relaxed/simple; bh=iHvIsz7cl3fIxEd7ZH9+eu1Bi+Ug2ZIJ7yL/8KUNzhc=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UOEipFgF3C4gn812vJM6FgMqA8fyTEY5YmCkAbMR151EZFgXApFOR6BnbvwHFLSDbfxu3YIISzxpF5ovRQLNb/3IvBRt+P8oKY9vcjDU+njmbP9jACQQq9BeVQQwymkMeY4y0JehlRugY+ry9NwusogwRSL94lGzOD5f/8DJRlU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jU/LtYRo; arc=none smtp.client-ip=74.125.227.141 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.b="jU/LtYRo" Received: by mail-pj2-f13.google.com with SMTP id d9443c01a7336-2d747ee1f38so12983405ad.2 for ; Sun, 13 Sep 2026 01:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789289176; x=1789893976; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:subject:cc:to:from:date:message-id:from:to:cc:subject :date:message-id:reply-to:content-type; bh=8L1RhqceTVtKN+YKBRtMP6Pzolyp5M8mVVEfY7BsJsg=; b=jU/LtYRoRbQUvU0jctkifESRhlMKVvQUlUykjquKDllblDB51b/rkhrsESGiMcN7Al xXdq/2FTTzsvKr4h1U0ZsXoY9job/bAk8QuSfNknKGGTlr1BBhPloUuIugXAQO9qn+R6 lSj14kVSGtgao1GCqRXc6tye9sAq1xw+7X3a9HPwzNENPHeea32LnkeIY5A75jvmd+mE mwm91v0IqjolDt4bj1UJpRKRXDwGIkObQbor6MxogEfzBuhZalMpbXkgBZqQICIuT6/O RD3wFusepTunoNKAiyXQ42piNvUFGFtRQ3fUJVj/UGmV9l80yqDGrJA7TfwQYt9b7J3q c7LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789289176; x=1789893976; h=in-reply-to:content-disposition:content-type:mime-version :references:subject:cc:to:from:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=8L1RhqceTVtKN+YKBRtMP6Pzolyp5M8mVVEfY7BsJsg=; b=lLmLREiy0KGL6nIzc3vEO4AdaoNK5GQ8OjtoIHz4CQEnrIhHLdT8XNzH/1u1NaCsTh E+hWgp4d45RGVKkiyr13ZiWh5yisBwxboSp7Phx5Nbygtahq81DgmhtcRk1p0pRWB7qn NI15JdeRO6SZsFnHy8dU8sT1o0Wr0d7NHOnkFKvD7j+N9tkYR32NoUuVtszeylzDeXoz 6wXJ4EMTbpt+YTf2MeWkeHyBtjBxYR19KW1lDWCvYIMZreCRsPuBVu6M6my9g8eSq6CS QhzFiQyXGgBxvWh1lTp4vmNaLaY/ZIVwQ5bKZ4XkwuP/h51qw3tCN1/4PgQ4WVA+nhgi /Mhg== X-Gm-Message-State: AFuF++mLmIdFv2UgmO8+HBHlk7DIO4RqqGGgk/+ejUHUmUtUUWQs9EMj 6UTNYQCPvq1lLkclyvcV3yr8LP/Jpa0VUuiNk0f5fWCyG2BMy57jox1y X-Gm-Gg: AYBFou2C08NHcOBTJpW/hMLC1b2OPVOVIfiYtsiD8PyvL71ftfxrkH3raVthslfdb+/ VMmBmIyFKUhUU9+6alUmUBOiy17mnpeTaCM4IQUsX9VgpfhTAmHNZwXfR3SF/Yo6BplIlpuqNc+ rKfNeDK66tYRSpBQ+1ijYX2m5GTvQt+q4NXnADISYuMPO0GIpZvPMKTh+VQvugvwOyjjC25ghko rgKYaaJ9AjK5N8vLWdm+MQxBXHWtvc+Wf+pFVS+zUbnKr3OcPi24ww8mxaeoQAG9fT6IbdPhsXV KQU0IOABaCsUXjFlNa16SPcby7sKaWKEwzzM58hY3tA0AWydRlOIn3q4iiSBJ7iCB7Qo1KIerAA osNA6lXRKKqwI8y4N1puRptbZxyFdtb0m7AhVchXMxowTUTmZcFWcAlhWMp99HnAcXZUkLz4vjn jhnrF2ZCN/xFSb4RTLyPTKJ50VQkcONqyHJweAadKcr4Y22Tdonr0t6XH5SkF+ne+4VA7yju4tL CS2FbHYtTq1F39SHBEuOsuzDfSF5g== X-Received: by 2002:a17:90b:3810:b0:398:9be8:ea68 with SMTP id 98e67ed59e1d1-39d9c35dddemr21890581a91.21.1789289176156; Sun, 13 Sep 2026 01:46:16 -0700 (PDT) Received: from localhost (madb688426.ap.nuro.jp. [219.104.132.38]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-39db113a3d0sm9891430a91.14.2026.09.13.01.46.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 01:46:15 -0700 (PDT) Message-ID: <6aa662d7.0ca013b1.1575e3.0a60@mx.google.com> X-Google-Original-Message-ID: <20260913084613.3dzcb4puhqeetjos@DESKTOP-1P5QNTF.> Date: Sun, 13 Sep 2026 17:46:13 +0900 From: Kohei Ito To: Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-gpio@vger.kernel.org, Miguel Ojeda , Boqun Feng , Gary Guo , =?utf-8?B?QmrDtnJu?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , Onur =?utf-8?B?w5Z6a2Fu?= Subject: Re: [PATCH 3/3] sample: rust: Add GPIO consumer sample driver References: <20260906-add-rust-gpio-consumer-v1-0-24d192f93760@gmail.com> <20260906-add-rust-gpio-consumer-v1-3-24d192f93760@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Hi, Bartosz, On Thu, Sep 10, 2026 at 12:37:17AM -0700, Bartosz Golaszewski wrote: > On Sun, 6 Sep 2026 10:45:51 +0200, Kohei Ito said: > > Add a sample driver to demonstrate the use of the Rust GPIO APIs. > > > > Signed-off-by: Kohei Ito > > --- > > I don't like samples as they rarely get built or tested. We seem to already > have kunit support for rust, wouldn't it make more sense to implement a kunit > module for rust GPIO abstractions? If we don't have provider abstractions, you > should be able to reuse gpio-sim as the GPIO controller for testing just by > instantiating simulated GPIO devices. Thank you for your suggestion. I assume the kunit module you have in mind would be implemented like `gpiolib-kunit.c`. Based on your comment, I agree that a kunit-based approach is more appropriate than a sample driver. However, as far as I know, we don't yet have Rust abstractions for platform_device registration and software_node, which are required to implement a kunit-based module for testing GPIO consumer APIs. Given the current state of Rust for Linux, I think creating a sample driver is a more practical approach for now. I would like to consider migrating to a kunit-based module as future work. Best regards, Kohei Ito