linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Eckert <fe@dev.tdt.de>
To: m.brock@vanmierlo.com
Cc: Eckert.Florian@googlemail.com, gregkh@linuxfoundation.org,
	jirislaby@kernel.org, pavel@ucw.cz, lee@kernel.org,
	kabel@kernel.org, u.kleine-koenig@pengutronix.de,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-leds@vger.kernel.org
Subject: Re: [PATCH v5 2/2] leds: ledtrig-tty: add new line mode evaluation
Date: Mon, 06 Nov 2023 09:40:50 +0100	[thread overview]
Message-ID: <092914b1a78135f7dcd0bab40e7995af@dev.tdt.de> (raw)
In-Reply-To: <ceec1d36f889eb82e724335d007334fd@vanmierlo.com>

On 2023-11-04 14:59, m.brock@vanmierlo.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

      reply	other threads:[~2023-11-06  8:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23  9:42 [PATCH v5 0/2] ledtrig-tty: add additional tty state evaluation Florian Eckert
2023-10-23  9:42 ` [PATCH v5 1/2] tty: add new helper function tty_get_tiocm Florian Eckert
2023-10-23 10:06   ` Greg KH
2023-10-23  9:42 ` [PATCH v5 2/2] leds: ledtrig-tty: add new line mode evaluation Florian Eckert
2023-10-23 10:06   ` Greg KH
2023-10-23 12:15     ` Florian Eckert
2023-10-23 12:27       ` Greg KH
2023-10-23 12:45         ` Florian Eckert
2023-10-23 12:59           ` Greg KH
2023-10-23 13:19             ` Florian Eckert
2023-10-28 10:43   ` m.brock
2023-10-30  8:15     ` Florian Eckert
2023-11-04 13:59       ` m.brock
2023-11-06  8:40         ` Florian Eckert [this message]

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=092914b1a78135f7dcd0bab40e7995af@dev.tdt.de \
    --to=fe@dev.tdt.de \
    --cc=Eckert.Florian@googlemail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kabel@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=m.brock@vanmierlo.com \
    --cc=pavel@ucw.cz \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).