From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 968B035336C; Wed, 20 Aug 2025 00:34:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755650054; cv=none; b=BreVpqnCQEQR/fACrwBxvUoQqkJ4CHL+uga8ijcdUmvhZJKgu4LmjIcC7Uj9shfCI3TGc9aGuuLhrOXIDCsSWHLSb/HumA/WZOXqyRzkxuzSAnD+FGTN0oH/sJa7a/Xcie3kqqJAhUaqglASw54C+uE1qgbJAfcUmnBN7jjYytA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755650054; c=relaxed/simple; bh=JAI+oYkdbTIFn8JsqjU/opW6sYv/yyl6y9q76TmwkxQ=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=W/MYuxV/GQKUKlDPHNkcPUeBQryED0bpmiG7K1NwkK7PtzBuG284Zct55+XNQD4gX9t36Q/TXExysWa6Z9UcTRWL7hTZ/FdqaxNOSgZsgkpfDDAvPgKiqhCk/72gSvZWAZtEJTg4N//RMZvHFeW/IkzofLI0+8dq6niya3m1AlQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=joIF5yeQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="joIF5yeQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24FFFC4CEF1; Wed, 20 Aug 2025 00:34:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755650054; bh=JAI+oYkdbTIFn8JsqjU/opW6sYv/yyl6y9q76TmwkxQ=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=joIF5yeQMxdAwvFbojfpO5WzAKLrlTIFhUXiHjKaZwUIXQzvvrELiXa2mcFqvaQ19 acpb04faE+MKfSIgNl+zM01YV7MplxCAQLMxjFhcVimrkRM0cBYHwJV9zdXCeg3AAd LfdJG4zchqLMGvIJsGldZXtW9mVJZNjs8XOXoXja7R3j2PUAca+0IYRaWJmJ1w07fx 4pGSviBW6kIpNZ/I5TesMvZ58jrih8zZ7+WTv3TNsVKjrJY0vkcjYJoDiFQlp0HdPf 6Hk6QobI1kDRXcz2lySI09f3VIyou8/WhH64VM6XtsCwcOUO0q6mQvcSdX+5gm29wS weHGuvofWRQwA== Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 20 Aug 2025 02:34:09 +0200 Message-Id: Subject: Re: [PATCH v10 5/7] samples: rust: Add debugfs sample driver Cc: "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Greg Kroah-Hartman" , "Rafael J. Wysocki" , "Sami Tolvanen" , "Timur Tabi" , "Benno Lossin" , "Dirk Beheme" , , To: "Matthew Maurer" From: "Danilo Krummrich" References: <20250819-debugfs-rust-v10-0-86e20f3cf3bb@google.com> <20250819-debugfs-rust-v10-5-86e20f3cf3bb@google.com> In-Reply-To: <20250819-debugfs-rust-v10-5-86e20f3cf3bb@google.com> On Wed Aug 20, 2025 at 12:53 AM CEST, Matthew Maurer wrote: > Adds a new sample driver that demonstrates the debugfs APIs. > > The driver creates a directory in debugfs and populates it with a few > files: > - A read-only file that displays a fwnode property. > - A read-write file that exposes an atomic counter. > - A read-write file that exposes a custom struct. > > This sample serves as a basic example of how to use the `debugfs::Dir` > and `debugfs::File` APIs to create and manage debugfs entries. > > Signed-off-by: Matthew Maurer This is a great example, thanks! I really like how the API turned out. When it comes to the newly added Scope API - and I assume this does not com= e at a surprise - I have some concerns. But first, thanks a lot for posting the socinfo driver in both variants, wi= th and without the Scope API. I had a brief look at both of those and I can see why you want this. With the Scope thing you can indeed write things a bit more compressed (I t= hink in the patches the differences looks quite a bit bigger than it actually is= , because the scope-based one uses quite some code from the file-based one). I think the downsides are mainly: - The degree of complexity added for a rather specific use-case, that is = also perfectly representable with the file-based API. - It makes it convinient to expose multiple fields grouped under the same= lock as separate files, which design wise we shouln't encourage for the reas= ons we discussed in v8. I think for the sake of getting this series merged, which I would really lo= ve to see, I think we should focus on the file-based API first. Once we got this landed I think we can still revisit the Scope idea and have some more discu= ssion about it. I will have a more detailed look tomorrow (at least for the patches 1-5). Thanks again for working on this! - Danilo