From: Fabio Baltieri <fabio.baltieri@gmail.com>
To: Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>, linux-can@vger.kernel.org
Subject: Re: [RFC PATCH v2 1/2] can: add tx/rx LED trigger support
Date: Thu, 3 May 2012 23:49:40 +0200 [thread overview]
Message-ID: <20120503214940.GA1826@gmail.com> (raw)
In-Reply-To: <4F97CC48.5000809@grandegger.com>
Hello everyone,
I'm back on the activity-trigger subject.
On Wed, Apr 25, 2012 at 12:04:56PM +0200, Wolfgang Grandegger wrote:
> >>> On Tue, Apr 24, 2012 at 08:46:29AM +0200, Wolfgang Grandegger wrote:
> >>>> I still think that the blinking support should go to the timer class to
> >>>> avoid duplicated code. Any good reason against? Apart from that the
> >>>> patches look good.
> >>>>
> >> For me it still does make sense to provide a generic
> >> led_trigger_blink_once support. But well, go ahead if I'm the only one
> >> with that opinion.
> >
> > +1
> > At least start a discussion on the LED list (I don't know which list
> > that is).
>
> The MAINAINERS file does not list a mailing list, therefore the LKML
> should be used, with a CC to Richard Purdie, I think. While checking if
> LED support is discussed, I found related mails. One shot timer LED
> support seems to be a frequently discussed issue:
>
> http://marc.info/?t=133489487700001&r=1&w=2
> http://marc.info/?l=linux-kernel&m=133331013422467&w=4
>
> As usual, it's better to send a patch than to ask a (general) questions.
> I think we would get rather quick response.
I spent last couple of days trying to come up with a generic one-shot
blink patch clean enough to get some chance of integration, but what I
ended up with was these considerations in favor of framework-specific
code:
The only clean way I see to do that is to implement the function as an
extension of the actual soft-blink code.
That functions are used as fallback if no hw-blink is available and are
just blindly toggling values on-off, so they have to be modified quite
heavily to add necessary state information to support the behaviour of
the actual code (like when a trigger is added for an already up
interface) and the feature required by other usage cases (like the
trigger currently discussed in the list - which is going in the way of a
trigger-specific implemetation anyway). This would involve adding flags
and cases in both trigger and timer code.
So, I'm taking a break on this and trying to feed this argument: why the
socketcan code would benefit from a specific implementation rather than
a generic one?
Because overall code is *much* more simple and clean!
- the timer function body is just 12 lines of code, whithout special
cases, that's faster to execute and easy to understand (and debug).
- the event function for TX and RX paths is just some checks and a
mod_timer, without list iterations or locking, and as it's going to be
called in hard-irq context, I think this is a *strong* plus for the
implementation (the most important thing here is to get out of the way
as fast as possible, right? A generic implementation would only make
latencies worse here).
So, my point, do you still think that this feature would benefit of a
generic triggering implementation?
(of course, I'm posting a v3 with just Oliver's Kconfig notes if you
agree with my point :-) )
Regards,
Fabio
next prev parent reply other threads:[~2012-05-03 21:47 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 21:02 [RFC PATCH v2 1/2] can: add tx/rx LED trigger support Fabio Baltieri
2012-04-23 21:02 ` [RFC PATCH v2 2/2] can: flexcan: add " Fabio Baltieri
2012-04-24 5:16 ` [RFC PATCH v2 1/2] can: add tx/rx " Oliver Hartkopp
2012-04-24 19:10 ` Fabio Baltieri
2012-04-24 6:46 ` Wolfgang Grandegger
2012-04-24 15:41 ` Oliver Hartkopp
2012-04-24 18:08 ` Wolfgang Grandegger
2012-04-24 18:57 ` Oliver Hartkopp
2012-04-25 7:05 ` Wolfgang Grandegger
2012-04-24 19:02 ` Fabio Baltieri
2012-04-25 7:26 ` Wolfgang Grandegger
2012-04-25 7:41 ` Marc Kleine-Budde
2012-04-25 10:04 ` Wolfgang Grandegger
2012-05-03 21:49 ` Fabio Baltieri [this message]
2012-05-04 7:03 ` Oliver Hartkopp
2012-05-04 7:30 ` Wolfgang Grandegger
2012-04-24 8:38 ` Kurt Van Dijck
2012-04-24 20:22 ` Fabio Baltieri
2012-04-25 7:50 ` Kurt Van Dijck
2012-04-24 8:45 ` Kurt Van Dijck
2012-04-24 20:34 ` Fabio Baltieri
2012-04-25 8:00 ` Kurt Van Dijck
2012-04-25 20:39 ` Fabio Baltieri
2012-04-26 8:21 ` Kurt Van Dijck
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=20120503214940.GA1826@gmail.com \
--to=fabio.baltieri@gmail.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=wg@grandegger.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.