mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Logan Gunthorpe <logang@deltatee.com>
To: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	Vinod Koul <vkoul@kernel.org>
Cc: "Frank Li" <Frank.li@nxp.com>,
	"Christoph Hellwig" <hch@infradead.org>,
	"Christophe Jaillet" <christophe.jaillet@wanadoo.fr>,
	"Dave Jiang" <dave.jiang@intel.com>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Kelvin Cao" <kelvin.cao@microchip.com>,
	"Logan Gunthorpe" <logang@deltatee.com>
Subject: [PATCH v3 0/4] Add sysfs interface to switchtec-dma
Date: Tue,  3 Nov 2026 09:40:17 -0600	[thread overview]
Message-ID: <20261103154022.459620-1-logang@deltatee.com> (raw)

This patch set adds a handful of sysfs attributes to the switchtec-dma
driver. This is the 3rd version which I'm hoping to get it in now
that my bug fixes and cleanup branch from Sashiko feedback was merged.

The first two patches clean up and generalize the technique that
ioat used to add sysfs attributes to a dma channel. The other two
patches add a couple different sets of sysfs attributes that are useful
in configuring and monitoring the hardware.

This patch set is based on v7.4-rc1.

Logan

Changes since v2:
 - Renamed the new channel lookup helpers to use the dmaengine_ prefix:
   dma_chan_from_dev_lock() and dma_chan_from_dev_unlock() are now
   dmaengine_chan_from_dev_lock() and dmaengine_chan_from_dev_unlock(),
   and the dma_chan_from_dev CLASS is now dmaengine_chan_from_dev.
   (Per Frank Li)
 - Rebased on v7.4-rc1

Changes since v1:
 - Replaced the per-channel embedded-kobject approach entirely with a
   new dma_device.chan_groups mechanism that attaches driver sysfs
   attributes directly to the channel's existing struct device
   instead of a second, separately-managed kobject. (Per Sashiko)
 - Fixed the busy-channel check in perf_cfg_store(): it now returns
   -EBUSY instead of falsely reporting success, and the racy lockless
   chan->client_count check has been replaced with a hw_cfg_locked
   flag that's set/cleared under hw_ctrl_lock from
   alloc/free_chan_resources(), closing a TOCTOU window against
   concurrent channel allocation. (Per Sashiko)
 - Took the hw_ctrl_lock around the perf_cfg read-modify-write
   so concurrent sysfs writes to different config attributes can't
   interleave and lose an update. (Per Sashiko)
 - Converted latency_selector_show() from strcat() to
   sysfs_emit()/sysfs_emit_at(). (Per Sashiko)
 - The PCI1008 device ID patch has been removed from this
   series, expanded and sent separately.

Logan Gunthorpe (4):
  dmaengine: add per-channel sysfs attribute groups via chan_groups
  dmaengine: ioatdma: convert per-channel sysfs to chan_groups
  dmaengine: switchtec-dma: add config sysfs attributes
  dmaengine: switchtec-dma: add pmon sysfs attributes

 drivers/dma/dmaengine.c     |  27 +++
 drivers/dma/dmaengine.h     |  19 ++
 drivers/dma/ioat/dma.h      |   6 +-
 drivers/dma/ioat/init.c     |   5 +-
 drivers/dma/ioat/sysfs.c    | 166 ++++++-------
 drivers/dma/switchtec_dma.c | 452 ++++++++++++++++++++++++++++++++++++
 include/linux/dmaengine.h   |   4 +
 7 files changed, 569 insertions(+), 110 deletions(-)


base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.47.3


             reply	other threads:[~2026-11-03 15:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 15:40 Logan Gunthorpe [this message]
2026-11-03 15:40 ` [PATCH v3 1/4] dmaengine: add per-channel sysfs attribute groups via chan_groups Logan Gunthorpe
2026-11-03 15:40 ` [PATCH v3 2/4] dmaengine: ioatdma: convert per-channel sysfs to chan_groups Logan Gunthorpe
2026-11-03 16:00   ` Dave Jiang
2026-11-03 15:40 ` [PATCH v3 3/4] dmaengine: switchtec-dma: add config sysfs attributes Logan Gunthorpe
2026-11-03 15:40 ` [PATCH v3 4/4] dmaengine: switchtec-dma: add pmon " Logan Gunthorpe

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=20261103154022.459620-1-logang@deltatee.com \
    --to=logang@deltatee.com \
    --cc=Frank.li@nxp.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=hch@infradead.org \
    --cc=kelvin.cao@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=vkoul@kernel.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®