All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Bollinger, Seth" <Seth.Bollinger@digi.com>
Cc: "linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
	Dan Murphy <dmurphy@ti.com>, Seth Bollinger <seth.boll@gmail.com>
Subject: Re: Strange timer LED behavior
Date: Tue, 20 Oct 2020 20:08:13 +0200	[thread overview]
Message-ID: <20201020180813.GA25906@duo.ucw.cz> (raw)
In-Reply-To: <DF67F732-7B99-4C32-A7E9-4595E2B1E82A@digi.com>

[-- Attachment #1: Type: text/plain, Size: 1819 bytes --]

Hi!

> >>>> Yep. It allows hardware to provide different values if it can only
> >>>> blink at fixed rate.
> >>> 
> >>> Ok, I understand how hardware might make a different choice, but in this scenario we’re using software to blink, so everything is handled by the kernel.  Also, if the interface is hardware enabled, isn’t the path at line 177 used (which returns before the default is set)?
> >> 
> >> Why should software blink need to select a default rate since it should be able to handle all requests (even 0, 0)?
> >> 
> > 
> > How can software blink at "0, 0"?
> 
> This would mean, don’t blink.  :).

Can't change that now.

> Since we’re using sysfs, we need to update those values in 2 FS writes.  It appears that the sysfs is reordering the writes, so we can’t control what value is written when, so it glitches for us.  We change off first, then on, but the order of the calls in the kernel is on first (with off already 0), the kernel changes values to default, then the off is written, leaving on with a value of 500 (we set it to 0) and off with the value we wanted.
>

Aha, okay, so races are bad and patch to fix them would be probably accepted.

> Is there a way to avoid this?  Even if we write the on value twice,
>  it will flash for 500ms at least once…

There should be. Can you simply write new values to on and off,
without writing zeros there?

If not, can you use 1 instead of zero?

> 
> I tried setting the trigger to none, but of course this disabled the display settings and setting the trigger to timer ends up flashing at the default rate, which is also what we don’t want.
>

If there's no reasonable value to change the frequency, we'll need to
fix that.

Best regards,
							Pavel

-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2020-10-20 18:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 13:08 Strange timer LED behavior Bollinger, Seth
2020-10-19 14:06 ` Pavel Machek
2020-10-19 14:16   ` Bollinger, Seth
2020-10-20 12:04     ` Bollinger, Seth
2020-10-20 12:21       ` Pavel Machek
2020-10-20 12:31         ` Bollinger, Seth
2020-10-20 18:08           ` Pavel Machek [this message]
2020-10-20 18:28             ` Bollinger, Seth
2020-10-20 18:33               ` Pavel Machek
2020-10-20 18:35                 ` Bollinger, Seth
2020-10-20 18:40                   ` Pavel Machek
2020-10-20 18:51                     ` Bollinger, Seth
2020-10-22 10:06                       ` Pavel Machek
2020-10-22 11:34                         ` Bollinger, Seth
2020-10-24  7:45                           ` Pavel Machek
2020-10-21 20:23                   ` Jacek Anaszewski
2020-10-22 11:35                     ` Bollinger, Seth

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=20201020180813.GA25906@duo.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=Seth.Bollinger@digi.com \
    --cc=dmurphy@ti.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=seth.boll@gmail.com \
    /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.