All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/8] Add configurable block device LED triggers
@ 2021-07-29  1:53 ` Ian Pilcher
  0 siblings, 0 replies; 50+ messages in thread
From: Ian Pilcher @ 2021-07-29  1:53 UTC (permalink / raw)
  To: linux-block, linux-leds
  Cc: axboe, pavel, linux-kernel, kernelnewbies, Ian Pilcher

This patch series adds configurable (i.e. user-defined) block device LED
triggers.

* Triggers can be created, listed, and deleted via sysfs block class
  attributes (led_trigger_{new,list,del}).

* Once created, block device LED triggers are associated with LEDs just
  like any other LED trigger (via /sys/class/leds/${LED}/trigger).

* Each block device gains a new device attribute (led_trigger) that can
  be used to associate the device with a trigger or clear its
  association.

* My expectation is that most configuration will be done via sysfs
  (driven by udev), but there also in-kernel APIs for creating,
  deleting, and (dis)associating triggers.

* Multiple devices can be associated with one trigger, so this supports
  a single LED driven by multiple devices, multiple device-specific
  LEDs, or arbitrary combinations.

  Along with support for more than just ATA devices, this is the main
  difference between this function and the current disk activity
  trigger.  It makes it suitable for use on systems like the Thecus
  N5550 NAS, which has a software-driven activity LEDs for each disk.

* In addition to physical block devices, many types of virtual block
  devices can drive LEDs; device mapper, MD RAID, and loop devices
  work (but zram swap devices do not).

* The led trigger is "blinked" (75 msec on, 25 msec off) when a request
  is successfully sent to the low-level driver.  The intent is to
  provide a visual indication of device activity, not any sort of exact
  measurement.

* Related to the previous bullet, if the blink function is unable to
  immediately acquire a lock on the device's LED trigger information
  it simply returns, so that I/O processing can continue.

It's probably obvious that I'm basically a complete newbie at kernel
development, so I welcome feedback.

Thanks!

Ian Pilcher (8):
  docs: Add block device LED trigger documentation
  block: Add block device LED trigger list
  block: Add kernel APIs to create & delete block device LED triggers
  block: Add block class attributes to manage LED trigger list
  block: Add block device LED trigger info to struct genhd
  block: Add kernel APIs to set & clear per-block device LED triggers
  block: Add block device attributes to set & clear LED triggers
  block: Blink device LED when request is sent to low-level driver

 Documentation/block/index.rst        |   1 +
 Documentation/block/led-triggers.rst | 124 ++++++
 block/Kconfig                        |  10 +
 block/Makefile                       |   1 +
 block/blk-ledtrig.c                  | 570 +++++++++++++++++++++++++++
 block/blk-ledtrig.h                  |  51 +++
 block/blk-mq.c                       |   2 +
 block/genhd.c                        |  14 +
 include/linux/blk-ledtrig.h          |  24 ++
 include/linux/genhd.h                |   4 +
 10 files changed, 801 insertions(+)
 create mode 100644 Documentation/block/led-triggers.rst
 create mode 100644 block/blk-ledtrig.c
 create mode 100644 block/blk-ledtrig.h
 create mode 100644 include/linux/blk-ledtrig.h

-- 
2.31.1


^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2021-07-31 19:31 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29  1:53 [RFC PATCH 0/8] Add configurable block device LED triggers Ian Pilcher
2021-07-29  1:53 ` Ian Pilcher
2021-07-29  1:53 ` [RFC PATCH 1/8] docs: Add block device LED trigger documentation Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  3:09   ` Valdis Klētnieks
2021-07-29  3:09     ` Valdis Klētnieks
2021-07-29 15:52     ` Ian Pilcher
2021-07-29 15:52       ` Ian Pilcher
2021-07-30  5:22       ` Greg KH
2021-07-30  5:22         ` Greg KH
2021-07-29  5:53   ` Greg KH
2021-07-29  5:53     ` Greg KH
2021-07-29 11:59   ` Marek Behún
2021-07-29 11:59     ` Marek Behún
2021-07-29 18:03     ` Ian Pilcher
2021-07-29 18:03       ` Ian Pilcher
2021-07-29  1:53 ` [RFC PATCH 2/8] block: Add block device LED trigger list Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  3:14   ` Valdis Klētnieks
2021-07-29  3:14     ` Valdis Klētnieks
2021-07-29 15:55     ` Ian Pilcher
2021-07-29 15:55       ` Ian Pilcher
2021-07-29  1:53 ` [RFC PATCH 3/8] block: Add kernel APIs to create & delete block device LED triggers Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  3:45   ` Valdis Klētnieks
2021-07-29  3:45     ` Valdis Klētnieks
2021-07-29 16:16     ` Ian Pilcher
2021-07-29 16:16       ` Ian Pilcher
2021-07-29  5:52   ` Greg KH
2021-07-29  5:52     ` Greg KH
2021-07-29  1:53 ` [RFC PATCH 4/8] block: Add block class attributes to manage LED trigger list Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  5:54   ` Greg KH
2021-07-29  5:54     ` Greg KH
2021-07-29  1:53 ` [RFC PATCH 5/8] block: Add block device LED trigger info to struct genhd Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  1:53 ` [RFC PATCH 6/8] block: Add kernel APIs to set & clear per-block device LED triggers Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  1:53 ` [RFC PATCH 7/8] block: Add block device attributes to set & clear " Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  1:53 ` [RFC PATCH 8/8] block: Blink device LED when request is sent to low-level driver Ian Pilcher
2021-07-29  1:53   ` Ian Pilcher
2021-07-29  8:54 ` [RFC PATCH 0/8] Add configurable block device LED triggers Pavel Machek
2021-07-29  8:54   ` Pavel Machek
2021-07-29 17:03   ` Ian Pilcher
2021-07-29 17:03     ` Ian Pilcher
2021-07-29 18:35     ` Pavel Machek
2021-07-29 18:35       ` Pavel Machek
2021-07-29 19:14       ` Ian Pilcher
2021-07-29 19:14         ` Ian Pilcher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.