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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190214230307.GA17358@amd>
Date:   Fri, 15 Feb 2019 00:03:07 +0100
From:   Pavel Machek <pavel@....cz>
To:     Jacek Anaszewski <jacek.anaszewski@...il.com>
Cc:     Hans de Goede <hdegoede@...hat.com>,
        Yauhen Kharuzhy <jekhor@...il.com>,
        linux-kernel@...r.kernel.org, linux-leds@...r.kernel.org
Subject: Re: [PATCH v2 1/2] leds: Add Intel Cherry Trail Whiskey Cove PMIC
 LEDs

Hi!

> >>>I suggest that we deal with this special case by adding 3 custom
> >>>sysfs attributes:
> >>>
> >>>1) "mode" which when read, prints, e.g. :
> >>>manual [on-when-charging]
> >>
> >>While this allows _user on console_ to control everything using echo,
> >>it is not suitable for applications trying to control LEDs.
> >>
> >>As there's nothing special about the case here, I believe we should
> >>have generic solution here.
> >>
> >>My preffered solution would be "hardware" trigger that leaves the LED
> >>in hardware control.
> >
> >As you explained in the parts which I snipped, there are many
> >devices which have a similar choice for a LED being under hw or
> >user control. I can see how this looks like a trigger and how we
> >could use the trigger API for this.
> >
> >I believe though, that if we implement a "virtual" (for lack of
> >a better word) trigger for this, that this should be done in the
> >LED core. I can envision this working like this:
> >
> >1) Add a:
> >
> >hw_control_set(struct led_classdev *led_cdev, bool enable_hw_control);
> 
> Please note that we have support for hw patterns in the pattern trigger.
> (see how drivers/leds/leds-sc27xx-bltc.c makes use of it for its
> breathing pattern).
> We have also support for hw blinking in timer trigger via blink_set op.
> 
> In addition to that there is brightness_hw_changed sysfs attribute
> with led_classdev_notify_brightness_hw_changed() LED API.
> 
> Couldn't they be used in concert to support the specific features
> of the device in question?

I believe main issue here is this:

Hardware can automatically control the LED according to the charging
status, or it can be used as normal software-controlled LED.

I believe we should use trigger to select if hardware controls it or
not (and then add driver-specific files to describe the
details). Other proposal is in the mail thread, too.

Best regards,

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ