From nobody Sat Oct 10 18:28:59 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4j2C183xYWz6vdF2 for ; Sat, 10 Oct 2026 18:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j2C180cw1z4nH0 for ; Sat, 10 Oct 2026 18:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791656940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mTxvuSUnjgTAkkPUIzWFvzKP7Yp7bmqfoQAl4zEjvOE=; b=PphqRMG+nwspkKiHdCRfXNFI8qFXcatPMFZnjnfiqVk/MxTWwLzGR4KQTr37ZXWtJy/n9D pPqVZw7bXhiGsUPfNMEDKHIJaqpR6zZPbjs+yGz+vh9VqRaq4nk5s6ti25XJzCc3jQvDxt UiHv59eEjvbFO1Yf7b3OScHFxCYJge+uGuFxPKyLYEaxZko5HFbZA6wHSI19NkyJ3g50gM 9L0ZSV5ElYG5mQgNhTOrBBcZ+Czd+mNkIc1uMxOf6oljyOIDmwZTcFFklsobcr77+TaAAY vA/9+n/46xtlAtBMh24vlVCBiHAajj8okUia8j57eaEA0+ZBaKSK9vmXm7EDXw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791656940; b=qOt4lvBRiKF/YP4GsY2s77xdxmSVJWFbKSrSDFyzTo0BAeBVnRqMH/VNtmxeP9bp3E/e4z isskLhIXAd975reutFh6KEhVfLdzPTpJ2693Yyl8t4eXqWDuqU2S0ALFYgV4/JJsgxevCc I54FqTakPDUfcIJdpG6X1Ls/NJRwyaLUuJOfvrzEzX4qqg+lW+F81PSbkubeM6X8EbsGed yL6GxW3KRiax95MXNwFOC59cEPOKn8zIHQ/6d1rXenthI0dSULzcYnuPK4iabfSHhT7C1R k/qxwq+JaL6Z+aHxiI2DJKSpXvntjA70DzAB21RQOnckhcZkx/yFEkweojdS5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791656940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mTxvuSUnjgTAkkPUIzWFvzKP7Yp7bmqfoQAl4zEjvOE=; b=Uj0pHENmU7hQ5YcuqxbB1hJE27XMy3kxYap6L/ajwWZkjgRFom0fct2EGL/p19JVxxeyd1 tOB0lAFx9Wqhy1CdcJ6aaGfZJRJLJFpUHxCHQPZHqo1xZbn6z6NUIzctYCWiXLWYBBwE+Q jCwo3tFP3XTaYj/pI8suPKk9pByUFH3NqLTmYOW/drnq8HjcJZ3cBlkRS7gbNA6GJArRX1 JX9/fGehrPD7QcJKDRzMpNj1Sdx0Saslvz7u6SjT1lCPxTPm8qanl8Tdr7RUzggDMKsGiw DYakJlsvhNb4GRIn81+g3qetptTqCLdHZiIb+di67mJvklxK1MarXWniUSPOKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4j2C176H2Fz15hZ for ; Sat, 10 Oct 2026 18:28:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 21321 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 10 Oct 2026 18:28:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 3521cce445d4 - main - lindebugfs: implement debugfs_create_devm_seqfile() List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3521cce445d4238aa425629c5fcc1c723b427d3e Auto-Submitted: auto-generated Date: Sat, 10 Oct 2026 18:28:59 +0000 Message-Id: <6aca83eb.21321.2f3c35c9@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3521cce445d4238aa425629c5fcc1c723b427d3e commit 3521cce445d4238aa425629c5fcc1c723b427d3e Author: Bjoern A. Zeeb AuthorDate: 2026-06-10 11:15:42 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-10-10 18:28:32 +0000 lindebugfs: implement debugfs_create_devm_seqfile() Implement debugfs_create_devm_seqfile() keyed by device and a read function. This was implemented months ago in order to support debugfs with mt76 but hasn't been exercised since. The code does not really seem to belong in lindebugfs, but also does not really fit into debugfs.h (rather fs.h?); leave it here with a comment for now as neither dumbbell nor I could come up with a better place. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D57524 --- sys/compat/lindebugfs/lindebugfs.c | 42 ++++++++++++++++++++++ sys/compat/linuxkpi/common/include/linux/debugfs.h | 5 +++ 2 files changed, 47 insertions(+) diff --git a/sys/compat/lindebugfs/lindebugfs.c b/sys/compat/lindebugfs/lindebugfs.c index 89652b5685c4..b79990ae36d4 100644 --- a/sys/compat/lindebugfs/lindebugfs.c +++ b/sys/compat/lindebugfs/lindebugfs.c @@ -70,6 +70,7 @@ #include #include #include +#include MALLOC_DEFINE(M_DFSINT, "debugfsint", "Linux debugfs internal"); @@ -807,6 +808,47 @@ debugfs_create_blob(const char *name, umode_t mode, struct dentry *parent, return (debugfs_create_file(name, mode & 0444, parent, value, &__fops_blob_ro)); } +/* ---------------------------------------------------------------------------- */ +/* This should be migrated to ??? */ + +struct debugfs_devm_seqfile { + struct device *dev; + int (*readfunc)(struct seq_file *, void *); +}; + +static int +debugfs_devm_seqfile_open(struct inode *inode, struct linux_file *f) +{ + struct debugfs_devm_seqfile *s; + + s = inode->i_private; + return (single_open(f, s->readfunc, s->dev)); +} + +static const struct file_operations debugfs_devm_seqfile_ops = { + .owner = THIS_MODULE, + .open = debugfs_devm_seqfile_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + +void +debugfs_create_devm_seqfile(struct device *dev, const char *name, + struct dentry *d, int (*readfunc)(struct seq_file *m, void *arg)) +{ + struct debugfs_devm_seqfile *s; + + s = devm_kzalloc(dev, sizeof(*s), GFP_KERNEL); + if (s == NULL) + return; + + s->dev = dev; + s->readfunc = readfunc; + + debugfs_create_file(name, 0444, d, s, &debugfs_devm_seqfile_ops); +} +/* ---------------------------------------------------------------------------- */ static int lindebugfs_init(PFS_INIT_ARGS) diff --git a/sys/compat/linuxkpi/common/include/linux/debugfs.h b/sys/compat/linuxkpi/common/include/linux/debugfs.h index 4d146e085a7b..268ae2bab0da 100644 --- a/sys/compat/linuxkpi/common/include/linux/debugfs.h +++ b/sys/compat/linuxkpi/common/include/linux/debugfs.h @@ -121,4 +121,9 @@ void debugfs_create_str(const char *name, umode_t mode, struct dentry *parent, struct dentry *debugfs_create_blob(const char *name, umode_t mode, struct dentry *parent, struct debugfs_blob_wrapper *value); +struct device; +struct dentry; +void debugfs_create_devm_seqfile(struct device *, const char *, struct dentry *, + int (*)(struct seq_file *, void *)); + #endif /* _LINUXKPI_LINUX_DEBUGFS_H_ */