All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: "Marek Behún" <kabel@kernel.org>
Cc: Ian Pilcher <arequipeno@gmail.com>,
	linux-block@vger.kernel.org, linux-leds@vger.kernel.org,
	axboe@kernel.dk, pavel@ucw.cz, linux-kernel@vger.kernel.org,
	kernelnewbies@kernelnewbies.org
Subject: Re: [RFC PATCH v2 00/10] Add configurable block device LED triggers
Date: Mon, 9 Aug 2021 21:07:25 +0200	[thread overview]
Message-ID: <20210809190725.6jq2npa5kmruf6n7@pali> (raw)
In-Reply-To: <20210809205633.4300bbea@thinkpad>

On Monday 09 August 2021 20:56:33 Marek Behún wrote:
> Hello Ian,
> 
> thank you for your proposal. Some comments below:
> 
> On Sun,  8 Aug 2021 22:32:07 -0500
> Ian Pilcher <arequipeno@gmail.com> wrote:
> 
> > 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.
> 
> It may be simpler, but it is in contrast to how the netdev trigger
> works, which already is in upstream for many years. I really think we
> should try to have similar sysfs ABIs here. (I understand that the
> netdev trigger is currently unable to handle multiple network
> interfaces - but it is possible to extend it so.)
> 
> > 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 ([]).
> 
> I think it is reasonable to be able to set something like this:
>   led0 : blink on activity on any of [sda, sdb, sdc]
>   led1 : blink on activity on sda
>   led2 : blink on activity on sdb
>   led3 : blink on activity on sdc
> 
> If I am reading your code correctly, it looks that only one LED can be
> configured for a block device. Is this true? If so, then the above
> configuration cannot be set.
> 
> Also you are blinking the LED on any request to the block device. I
> would rather expect to be able to set the LED to blink on read and on
> write. (And possibly on other functions, like discard, or critical
> temperature, or error, ...) I would like to know what other people
> think about this.

Hello!

HP EliteBook laptops had dedicated LED for some kind of error and
encryption indication. And there is kernel acpi/wmi driver which can
control this LED. I do not know if recent HP laptops still have these
LEDs, but I would suggest to design API in a way that would allow to use
these dedicated LEDs for their original "vendor" purpose.

I'm mentioning it just because this functionality and design is already
on existing production mainstream laptops, and not something imaginary.

If Linux distributions are still cooperating with laptop vendors and
doing "official" Linux preloads then they may be interested in having
"native" LED functionality support in kernel.

WARNING: multiple messages have this Message-ID (diff)
From: "Pali Rohár" <pali@kernel.org>
To: "Marek Behún" <kabel@kernel.org>
Cc: axboe@kernel.dk, kernelnewbies@kernelnewbies.org,
	Ian Pilcher <arequipeno@gmail.com>,
	linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	pavel@ucw.cz, linux-leds@vger.kernel.org
Subject: Re: [RFC PATCH v2 00/10] Add configurable block device LED triggers
Date: Mon, 9 Aug 2021 21:07:25 +0200	[thread overview]
Message-ID: <20210809190725.6jq2npa5kmruf6n7@pali> (raw)
In-Reply-To: <20210809205633.4300bbea@thinkpad>

On Monday 09 August 2021 20:56:33 Marek Behún wrote:
> Hello Ian,
> 
> thank you for your proposal. Some comments below:
> 
> On Sun,  8 Aug 2021 22:32:07 -0500
> Ian Pilcher <arequipeno@gmail.com> wrote:
> 
> > 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.
> 
> It may be simpler, but it is in contrast to how the netdev trigger
> works, which already is in upstream for many years. I really think we
> should try to have similar sysfs ABIs here. (I understand that the
> netdev trigger is currently unable to handle multiple network
> interfaces - but it is possible to extend it so.)
> 
> > 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 ([]).
> 
> I think it is reasonable to be able to set something like this:
>   led0 : blink on activity on any of [sda, sdb, sdc]
>   led1 : blink on activity on sda
>   led2 : blink on activity on sdb
>   led3 : blink on activity on sdc
> 
> If I am reading your code correctly, it looks that only one LED can be
> configured for a block device. Is this true? If so, then the above
> configuration cannot be set.
> 
> Also you are blinking the LED on any request to the block device. I
> would rather expect to be able to set the LED to blink on read and on
> write. (And possibly on other functions, like discard, or critical
> temperature, or error, ...) I would like to know what other people
> think about this.

Hello!

HP EliteBook laptops had dedicated LED for some kind of error and
encryption indication. And there is kernel acpi/wmi driver which can
control this LED. I do not know if recent HP laptops still have these
LEDs, but I would suggest to design API in a way that would allow to use
these dedicated LEDs for their original "vendor" purpose.

I'm mentioning it just because this functionality and design is already
on existing production mainstream laptops, and not something imaginary.

If Linux distributions are still cooperating with laptop vendors and
doing "official" Linux preloads then they may be interested in having
"native" LED functionality support in kernel.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply	other threads:[~2021-08-09 19:07 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=20210809190725.6jq2npa5kmruf6n7@pali \
    --to=pali@kernel.org \
    --cc=arequipeno@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=kabel@kernel.org \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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 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.