mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vegard Nossum <vegard.nossum@oracle.com>
To: "Paul Cercueil" <paul@crapouillou.net>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Jonathan Corbet" <corbet@lwn.net>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"Nuno Sá" <noname.nuno@gmail.com>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Andrzej Pietrasiewicz" <andrzej.p@collabora.com>,
	linux-usb@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org
Subject: Re: [PATCH v3 4/4] Documentation: usb: Document FunctionFS DMABUF API
Date: Tue, 9 Jan 2024 14:08:03 +0100	[thread overview]
Message-ID: <9712abdd-cbca-4ad6-b1e9-ff9bf054b278@oracle.com> (raw)
In-Reply-To: <20240108120056.22165-5-paul@crapouillou.net>

On 08/01/2024 13:00, Paul Cercueil wrote:
> Add documentation for the three ioctls used to attach or detach
> externally-created DMABUFs, and to request transfers from/to previously
> attached DMABUFs.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> 
> ---
> v3: New patch
> ---
>   Documentation/usb/functionfs.rst | 36 ++++++++++++++++++++++++++++++++
>   1 file changed, 36 insertions(+)

Hi,

I'd like to point out that this file (usb/functionfs.rst) is currently
included by Documentation/subsystem-apis.rst, the top-level file for the
"Kernel subsystem documentation" set of books, which describe internal
APIs: "These books get into the details of how specific kernel
subsystems work from the point of view of a kernel developer".

However, functionfs.rst (and especially your new additions) are
documenting a userspace API, so it really belongs somewhere in
Documentation/userspace-api/ -- that's where /proc, /sys, /dev and ioctl
descriptions for userspace programmers belong.

I'm not NAKing the patch -- I just want to draw attention to this
discrepancy. Maybe we can separate the kernel-implementation details
(stuff about __init sections and stuff) from the new ioctl() info?

Looking at <https://docs.kernel.org/usb/> I see that there are many
other adjacent documents that are also not really documenting kernel
implementation details, rough categorization as follows:

USB support
-----------

- Linux ACM driver v0.16 ==> admin/user info
- Authorizing (or not) your USB devices to connect to the system ==> 
admin/user info
- ChipIdea Highspeed Dual Role Controller Driver => admin/user info
- DWC3 driver ==> driver TODOs (can be moved into source code?)
- EHCI driver ==> technical info + driver details
- How FunctionFS works
- Linux USB gadget configured through configfs ==> userspace API + 
implementation
- Linux USB HID gadget driver ==> implementation + userspace API
- Multifunction Composite Gadget ==> technical + user info
- Linux USB Printer Gadget Driver ==> userspace API
- Linux Gadget Serial Driver v2.0 ==> user/admin + userspace API
- Linux UVC Gadget Driver ==> user/admin + userspace API
- Gadget Testing ==> user/admin + userspace API
- Infinity Usb Unlimited Readme ==> user/admin
- Mass Storage Gadget (MSG) ==> user/admin
- USB 7-Segment Numeric Display ==> user/admin
- mtouchusb driver ==> user/admin
- OHCI ==> technical info
- USB Raw Gadget ==> userspace API
- USB/IP protocol ==> technical info
- usbmon ==> user/admin + userspace API
- USB serial ==> user/admin + technical info
- USB references
- Linux CDC ACM inf
- Linux inf
- USB devfs drop permissions source
- Credits

By "admin/user info", I mean things that a user would have to do or run
(e.g. modprobe + flags) to make use of a driver; "technical info" is
more like device specifications (transfer speeds, modes of operation,
etc.); "userspace API" is stuff like configfs and ioctls; "driver
details" is really implementation details and internal considerations.

The last ones I don't even really know how to categorize.

I'm guessing nobody is really enthralled by the idea of splitting
Documentation/usb/ up like this?

   Documentation/admin-guide/usb/
   Documentation/driver-api/usb/ (this one actually exists already)
   Documentation/userspace-api/usb/

For the stuff that is _actually_ internal to a specific driver (so not
useful for end users, not useful for admins, not generic USB info, and
not useful for userspace programmers), I would honestly propose to just
move it directly into the driver's source code, or, if the text is
obsolete, just get rid of it completely.

The distinction between user/admin and userspace API is pretty clear
(one is for end users, the other is for userspace _programmers_), but it
can sometimes be hard to determine whether something falls in one or the
other category.

In any case -- it looks like almost all of the usb/ directory does not
document "how specific kernel subsystems work from the point of view of
a kernel developer" so maybe we should just move the include to
userspace-api/ for now as an obvious improvement (if still not 100%
correct):

diff --git a/Documentation/subsystem-apis.rst 
b/Documentation/subsystem-apis.rst
index 2d353fb8ea26..fe972f57bf4c 100644
--- a/Documentation/subsystem-apis.rst
+++ b/Documentation/subsystem-apis.rst
@@ -81,7 +81,6 @@ Storage interfaces
     security/index
     crypto/index
     bpf/index
-   usb/index
     PCI/index
     misc-devices/index
     peci/index
diff --git a/Documentation/userspace-api/index.rst 
b/Documentation/userspace-api/index.rst
index 82f9dbd228f5..e60cd9174ada 100644
--- a/Documentation/userspace-api/index.rst
+++ b/Documentation/userspace-api/index.rst
@@ -41,6 +41,7 @@ Subsystem-specific documentation:
     tee
     isapnp
     dcdbas
+   ../usb/index

  Kernel ABIs: These documents describe the the ABI between the Linux
  kernel and userspace, and the relative stability of these interfaces.


Thoughts?


Vegard

  reply	other threads:[~2024-01-09 13:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-08 12:00 [PATCH v3 0/4] usb: gadget: functionfs: DMABUF import interface Paul Cercueil
2024-01-08 12:00 ` [PATCH v3 1/4] usb: gadget: Support already-mapped DMA SGs Paul Cercueil
2024-01-08 12:00 ` [PATCH v3 2/4] usb: gadget: functionfs: Factorize wait-for-endpoint code Paul Cercueil
2024-01-08 12:00 ` [PATCH v3 3/4] usb: gadget: functionfs: Add DMABUF import interface Paul Cercueil
2024-01-08 12:28   ` Christian König
2024-01-08 12:39   ` Daniel Vetter
2024-01-08 14:21     ` Paul Cercueil
2024-01-08 15:29       ` Daniel Vetter
2024-01-08 16:27         ` Paul Cercueil
2024-01-08 19:19           ` Daniel Vetter
2024-01-09 11:06             ` Paul Cercueil
2024-01-09 13:01               ` Daniel Vetter
2024-01-15 12:54                 ` Paul Cercueil
2024-01-18 13:56                   ` Daniel Vetter
2024-01-18 13:59                     ` Daniel Vetter
2024-01-18 19:39                       ` Paul Cercueil
2024-01-18 21:05                         ` Daniel Vetter
2024-01-08 12:00 ` [PATCH v3 4/4] Documentation: usb: Document FunctionFS DMABUF API Paul Cercueil
2024-01-09 13:08   ` Vegard Nossum [this message]
2024-01-17 12:09     ` Paul Cercueil

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=9712abdd-cbca-4ad6-b1e9-ff9bf054b278@oracle.com \
    --to=vegard.nossum@oracle.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andrzej.p@collabora.com \
    --cc=christian.koenig@amd.com \
    --cc=corbet@lwn.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=noname.nuno@gmail.com \
    --cc=paul@crapouillou.net \
    --cc=sumit.semwal@linaro.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

all inboxes | Powered by JetHome®