public inbox for linux-can@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Fabio Baltieri <fabio.baltieri@gmail.com>, linux-can@vger.kernel.org
Subject: Re: [RFC PATCH v2 1/2] can: add tx/rx LED trigger support
Date: Wed, 25 Apr 2012 09:05:42 +0200	[thread overview]
Message-ID: <4F97A246.2050603@grandegger.com> (raw)
In-Reply-To: <4F96F79C.5090301@hartkopp.net>

On 04/24/2012 08:57 PM, Oliver Hartkopp wrote:
> On 24.04.2012 20:08, Wolfgang Grandegger wrote:
> 
>> On 04/24/2012 05:41 PM, Oliver Hartkopp wrote:
>>> On 24.04.2012 08:46, Wolfgang Grandegger wrote:
>>>
>>>
>>>>> - The blink timer is implemented as:
>>>>>   * keep on for delay_time
>>>>>   * turn off and retrigger the timer
>>>>>   * turn back on after delay
>>>>>   so that the hot-path only contains a switch-case, some checks and a mod_timer.
>>>>>
>>>>> This is tested on an x86 with a custom usb-can interface and on a flexcan-based
>>>>> Freescale ARM board. I'll post some patch to implement support in other drivers
>>>>> if anyone is interested into testing this one.
>>>>>
>>>>> Any comments?
>>>>
>>>> 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.
>>>
>>>
>>> Hello Wolfgang,
>>>
>>> what exactly do you mean with "timer class" ??
>>>
>>> To me the current implementation looks like standard jiffie-based timer usage.
>>>
>>> IMO hrtimers are not needed here - or what are you thinking of?
>>
>> I mean that the code doing that kind of blinking should go to the timer
>> class as generic function/feature, which other drivers could then use as
>> well, similar to led_trigger_event or led_trigger_blink. Should not be a
>> big deal, I think. See also my previous mail:
>>
>>   http://marc.info/?l=linux-can&m=133425656510148&w=2
>>
> 
> 
> Hm - as i see from the two examples there, the LEDs have a different
> behaviour. E.g. on which use-case specific events they blink or set the LEDs
> to fixed values.
> 
> I can't see any real benefit for these LED users to implement a generic LED
> blinking framework. IMO using timers and the led_trigger_event stuff is the
> appropriate abstraction level.

It's not the task of the CAN driver to let LEDs blink! Or what should
the LED class then be good for?

> If you look into other networking drivers (e.g. the wireless) - they do it
> with delayed_work:
> 
> http://lxr.linux.no/#linux+v3.3.1/drivers/net/wireless/ath/carl9170/led.c#L105
> 
> And everyone defines a specific struct like this one:
> 
> http://lxr.linux.no/#linux+v3.3.1/drivers/net/wireless/ath/carl9170/carl9170.h#L205
> 
> I think it's an enormous effort to unify all the LED users ...

Yes, they do that because there is no generic support. I believe that
the "one-shot-blinking" is useful in general which new drivers may use.
I did not ask for adapting old drivers.

Wolfgang.

  reply	other threads:[~2012-04-25  7:05 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 [this message]
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
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=4F97A246.2050603@grandegger.com \
    --to=wg@grandegger.com \
    --cc=fabio.baltieri@gmail.com \
    --cc=linux-can@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    /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