All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v2 00/10] Add configurable block device LED triggers
@ 2021-08-09  3:32 ` Ian Pilcher
  0 siblings, 0 replies; 56+ messages in thread
From: Ian Pilcher @ 2021-08-09  3:32 UTC (permalink / raw)
  To: linux-block, linux-leds; +Cc: axboe, pavel, linux-kernel, kernelnewbies

This is a significant rewrite of the patchset that I originally posted
back on 28 July.  It incorporates almost all of the suggestions that I
received as feedback to my original patchset (largely because I was
finally able to wrap my head around how complex LED triggers work).

One thing that has not changed is that associations between block
devices and LEDs are still set via an attribute on the device, rather
than the LED.  This is much simpler, as the device attribute only has
to handle a single value (the name of the associated LED), rather than
potentially handling multiple device names.

More importantly, it avoids the need to iterate through all of the
block devices on the system, searching by name.  This was proposed
fairly recently, and the reaction was not positive.[1][2]

I have modeled the interface for the /sys/block/<DEVICE>/led
attribute on the sysfs interface used for selecting a trigger.  All
available LEDs (all LEDs associated with the blkdev trigger) are
shown when the attribute is read, with the currently selected LED
enclosed in square brackets ([]).

As before, this is all very new to me (particularly the RCU stuff), so
I welcome feedback.

Thanks!

Changes from the original patchset:

* Use a single complex LED trigger ("blkdev"), rather than multiple
  user-defined triggers.

* Configurable blink time and interval for each LED:

    /sys/class/leds/<LED>/blink_{on,off}

* Associated block devices linked from LED subdirectory:

    /sys/class/leds/<LED>/block_devices

  (Avoids violating the "one value per entry" sysfs rule.)

* Device-LED associations set via /sys/block/<DEVICE>/led

* Document all sysfs attributes in Documentation/ABI/testing (but also kept
  the overview doc)

* Removed unnecessary [un]likely macros

* Reduced number of "user error" log messages and changed level to INFO

* More detailed commit messages

* Add Kconfig option in final commit

* Use RCU-protected pointer (rather than mutex)

* No in-kernel APIs for now

[1] https://www.spinics.net/lists/linux-leds/msg18256.html
[2] https://www.spinics.net/lists/linux-leds/msg18261.html

Ian Pilcher (10):
  docs: Add block device LED trigger documentation
  block: Add file (blk-ledtrig.c) for block device LED trigger
    implementation
  block: Add block device LED trigger fields to gendisk structure
  block: Add functions to set & clear block device LEDs
  block: Add block device sysfs attribute to set/clear/show LED
  block: Add activate and deactivate functions for block device LED
    trigger
  block: Add sysfs attributes to LEDs associated with blkdev trigger
  block: Add init function for block device LED trigger
  block: Blink device LED (if any) when request is sent to its driver
  block: Add config option to enable block device LED triggers

 Documentation/ABI/testing/sysfs-block         |  16 +
 .../testing/sysfs-class-led-trigger-blkdev    |  28 ++
 Documentation/block/blk-ledtrig.rst           |  79 +++
 Documentation/block/index.rst                 |   1 +
 block/Kconfig                                 |   8 +
 block/Makefile                                |   1 +
 block/blk-ledtrig.c                           | 469 ++++++++++++++++++
 block/blk-ledtrig.h                           |  45 ++
 block/blk-mq.c                                |   2 +
 block/genhd.c                                 |  11 +
 include/linux/genhd.h                         |   4 +
 11 files changed, 664 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-class-led-trigger-blkdev
 create mode 100644 Documentation/block/blk-ledtrig.rst
 create mode 100644 block/blk-ledtrig.c
 create mode 100644 block/blk-ledtrig.h

-- 
2.31.1


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

end of thread, other threads:[~2021-08-12 16:28 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09  3:32 [RFC PATCH v2 00/10] Add configurable block device LED triggers Ian Pilcher
2021-08-09  3:32 ` Ian Pilcher
2021-08-09  3:32 ` [RFC PATCH v2 01/10] docs: Add block device LED trigger documentation Ian Pilcher
2021-08-09  3:32   ` Ian Pilcher
2021-08-10 13:49   ` Pavel Machek
2021-08-10 13:49     ` Pavel Machek
2021-08-09  3:32 ` [RFC PATCH v2 02/10] block: Add file (blk-ledtrig.c) for block device LED trigger implementation Ian Pilcher
2021-08-09  3:32   ` Ian Pilcher
2021-08-09  3:32 ` [RFC PATCH v2 03/10] block: Add block device LED trigger fields to gendisk structure Ian Pilcher
2021-08-09  3:32   ` Ian Pilcher
2021-08-09  3:32 ` [RFC PATCH v2 04/10] block: Add functions to set & clear block device LEDs Ian Pilcher
2021-08-09  3:32   ` Ian Pilcher
2021-08-09  3:32 ` [RFC PATCH v2 05/10] block: Add block device sysfs attribute to set/clear/show LED Ian Pilcher
2021-08-09  3:32   ` Ian Pilcher
2021-08-09  4:21   ` Jackie Liu
2021-08-09  4:21     ` Jackie Liu
2021-08-09 15:44     ` Ian Pilcher
2021-08-09 15:44       ` Ian Pilcher
2021-08-09  3:32 ` [RFC PATCH v2 06/10] block: Add activate and deactivate functions for block device LED trigger Ian Pilcher
2021-08-09  3:32   ` Ian Pilcher
2021-08-09  3:32 ` [RFC PATCH v2 07/10] block: Add sysfs attributes to LEDs associated with blkdev trigger Ian Pilcher
2021-08-09  3:32   ` Ian Pilcher
2021-08-09  3:32 ` [RFC PATCH v2 08/10] block: Add init function for block device LED trigger Ian Pilcher
2021-08-09  3:32   ` Ian Pilcher
2021-08-09  3:32 ` [RFC PATCH v2 09/10] block: Blink device LED (if any) when request is sent to its driver Ian Pilcher
2021-08-09  3:32   ` Ian Pilcher
2021-08-09  3:32 ` [RFC PATCH v2 10/10] block: Add config option to enable block device LED triggers Ian Pilcher
2021-08-09  3:32   ` Ian Pilcher
2021-08-09 18:56 ` [RFC PATCH v2 00/10] Add configurable " Marek Behún
2021-08-09 18:56   ` Marek Behún
2021-08-09 19:07   ` Pali Rohár
2021-08-09 19:07     ` Pali Rohár
2021-08-09 19:54   ` Ian Pilcher
2021-08-09 19:54     ` Ian Pilcher
2021-08-09 22:43     ` Marek Behún
2021-08-09 22:43       ` Marek Behún
2021-08-09 23:50       ` Ian Pilcher
2021-08-09 23:50         ` Ian Pilcher
2021-08-10  6:35         ` Greg KH
2021-08-10  6:35           ` Greg KH
2021-08-10 13:38           ` Marek Behún
2021-08-10 13:38             ` Marek Behún
2021-08-10 14:48             ` Greg KH
2021-08-10 14:48               ` Greg KH
2021-08-10 15:55               ` Ian Pilcher
2021-08-10 15:55                 ` Ian Pilcher
2021-08-10 16:24                 ` Greg KH
2021-08-10 16:24                   ` Greg KH
2021-08-10 16:39                   ` Marek Behún
2021-08-10 16:39                     ` Marek Behún
2021-08-10 16:43                   ` Ian Pilcher
2021-08-10 16:43                     ` Ian Pilcher
2021-08-11  6:26         ` Christoph Hellwig
2021-08-11  6:26           ` Christoph Hellwig
2021-08-11 10:50           ` Marek Behún
2021-08-11 10:50             ` Marek Behún

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.