lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <589ba4d7-31f5-c789-d5ca-c13650cf5b03@gmail.com>
Date:   Wed, 2 Oct 2019 19:46:40 +0200
From:   Jacek Anaszewski <jacek.anaszewski@...il.com>
To:     Dan Murphy <dmurphy@...com>, Akinobu Mita <akinobu.mita@...il.com>,
        linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Pavel Machek <pavel@....cz>
Subject: Re: [PATCH -next 2/2] leds: add /sys/class/leds/<led>/current-trigger

Dan,

On 10/2/19 5:47 PM, Dan Murphy wrote:
> Akinobu
> 
> On 10/2/19 10:13 AM, Akinobu Mita wrote:
>> Reading /sys/class/leds/<led>/trigger returns all available LED triggers.
>> However, this violates the "one value per file" rule of sysfs.
>>
>> This provides /sys/class/leds/<led>/current-trigger which is almost
>> identical to /sys/class/leds/<led>/trigger.  The only difference is that
>> 'current-trigger' only shows the current trigger name.
>>
>> This new file follows the "one value per file" rule of sysfs.
>> We can find all available LED triggers by listing the
>> /sys/devices/virtual/led-trigger/ directory.
>>
>> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
>> Cc: "Rafael J. Wysocki" <rafael@...nel.org>
>> Cc: Jacek Anaszewski <jacek.anaszewski@...il.com>
>> Cc: Pavel Machek <pavel@....cz>
>> Cc: Dan Murphy <dmurphy@...com>
>> Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>
>> ---
>>   Documentation/ABI/testing/sysfs-class-led | 13 +++++++++++
>>   drivers/leds/led-class.c                  | 10 ++++++++
>>   drivers/leds/led-triggers.c               | 38
>> +++++++++++++++++++++++++++----
>>   drivers/leds/leds.h                       |  5 ++++
>>   4 files changed, 62 insertions(+), 4 deletions(-)
>>
>> diff --git a/Documentation/ABI/testing/sysfs-class-led
>> b/Documentation/ABI/testing/sysfs-class-led
>> index 5f67f7a..fdfed3f 100644
>> --- a/Documentation/ABI/testing/sysfs-class-led
>> +++ b/Documentation/ABI/testing/sysfs-class-led
>> @@ -61,3 +61,16 @@ Description:
>>           gpio and backlight triggers. In case of the backlight trigger,
>>           it is useful when driving a LED which is intended to indicate
>>           a device in a standby like state.
>> +
>> +What:        /sys/class/leds/<led>/current-trigger
>> +Date:        September 2019
>> +KernelVersion:    5.5
>> +Contact:    linux-leds@...r.kernel.org
>> +Description:
>> +        Set the trigger for this LED. A trigger is a kernel based source
>> +        of LED events.
>> +        Writing the trigger name to this file will change the current
>> +        trigger. Trigger specific parameters can appear in
>> +        /sys/class/leds/<led> once a given trigger is selected. For
>> +        their documentation see sysfs-class-led-trigger-*.
>> +        Reading this file will return the current LED trigger name.
> 
> Why do we need this new file can't we just update the current trigger
> file implementation?

We can't change existing ABI. It doesn't matter if it is documented
or not - it's in place for very long time and you can't guarantee there
are no users relying on triggers file show format.

> I don't see any documentation that states that the read of the trigger
> file will print a list of known triggers.
> 
> And writing to the trigger file still works so I would think the _show
> just needs to be fixed.
> 
> Besides this patch does not fix the issue in the commit message that the
> trigger file still violates the one value per file rule.
> 
> Dan
> 
> 

-- 
Best regards,
Jacek Anaszewski

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ