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] [day] [month] [year] [list]
Date:   Mon, 06 Nov 2023 09:40:50 +0100
From:   Florian Eckert <fe@....tdt.de>
To:     m.brock@...mierlo.com
Cc:     Eckert.Florian@...glemail.com, gregkh@...uxfoundation.org,
        jirislaby@...nel.org, pavel@....cz, lee@...nel.org,
        kabel@...nel.org, u.kleine-koenig@...gutronix.de,
        linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
        linux-leds@...r.kernel.org
Subject: Re: [PATCH v5 2/2] leds: ledtrig-tty: add new line mode evaluation

On 2023-11-04 14:59, m.brock@...mierlo.com wrote:
> Florian Eckert wrote on 2023-10-30 09:15:
> 
>>> Shouldn't the led return to the line controlled steady state?
>> 
>> Sorry I do not understand your question.
>> 
>>> Set an invert variable to true if state was TTY_LED_ENABLE before it 
>>> got set
>>> to TTY_LED_BLINK
>> 
>> No matter whether the LED is on or off beforehand. I understand that 
>> the
>> LED is always on for the first half of the period and off for the rest 
>> of
>> the period. I think that is correct and I don't need to make a 
>> distinction
>> via invert here. I hope I have understood your comment correctly here.
>> 
>>> How do interval and the frequency of ledtrig_tty_work() relate?
>> 
>> The work is twice as long as of the interval. So the variable
>> LEDTRIG_TTY_INTERVAL = 50 and the work is scheduled 
>> LEDTRIG_TTY_INTERVAL * 2.
>> But that was also before my change.
> 
> This explains why you don't necessarily need to invert the blink.
> If E.g. both CTS and TX are configured I would expect to see the led 
> turn on
> once CTS actives and then blink off when something is transmitted. 
> After that
> I expect to see the led still on because CTS is still active.

The evaluation starts again with the next iteration of the work.
And if no data was transferred but CTS was set, the LED is enabled again
but does not flash.

> Now only because the work interval is 2*LEDTRIG_TTY_INTERVAL and the 
> blink
> uses an interval of LEDTRIG_TTY_INTERVAL for both on and off the user 
> doesn't
> notice any difference except maybe a bit of delay of the blink.

That is correct

> If either the work schedule was larger than 2*LEDTRIG_TTY_INTERVAL or 
> the on
> interval would differ from the off interval the behaviour would differ
> noticably.
> 
> This is why I recommend to use an invert variable that is set to true 
> when
> the previous state was TTY_LED_ENABLE.

In the next patch round, I will save the state of the LED and evaluate 
whether
I need to invert the LED if the state of the LED has been set to blink.

> Maarten

Thanks for your feedback

--
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ