From: Willy Tarreau <w@1wt.eu>
To: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>, Pavel Machek <pavel@ucw.cz>,
linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org
Subject: Re: [PATCH] leds/trigger/activity: add a system activity LED trigger
Date: Mon, 28 Aug 2017 08:57:45 +0200 [thread overview]
Message-ID: <20170828065745.GA26097@1wt.eu> (raw)
In-Reply-To: <ca324dc7-3c26-2d7b-dbb0-7d7cd2462d4b@gmail.com>
Hi Jacek,
On Sun, Aug 27, 2017 at 06:44:05PM +0200, Jacek Anaszewski wrote:
> Hi Willy,
>
> Thanks for the updated patch.
>
> One formal note: please send the patches with git send-email instead
> of attaching them to the message.
Yep, I hesitated and wanted to reply. Will do it the other way next
time, sorry for the hassle.
> > diff --git a/drivers/leds/trigger/ledtrig-activity.c b/drivers/leds/trigger/ledtrig-activity.c
> > new file mode 100644
> > index 0000000..6f00235
> > --- /dev/null
> > +++ b/drivers/leds/trigger/ledtrig-activity.c
> > @@ -0,0 +1,297 @@
> > +/*
> > + * Activity LED trigger
> > + *
> > + * Copyright (C) 2017 Willy Tarreau <w@1wt.eu>
> > + * Partially based on Atsushi Nemoto's ledtrig-heartbeat.c.
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + *
> > + */
> > +#include <linux/module.h>
> > +#include <linux/kernel.h>
> > +#include <linux/kernel_stat.h>
> > +#include <linux/init.h>
> > +#include <linux/slab.h>
> > +#include <linux/timer.h>
> > +#include <linux/sched.h>
> > +#include <linux/leds.h>
> > +#include <linux/reboot.h>
> > +#include <linux/suspend.h>
>
> Please sort the includes alphabetically.
I'm amazed I did this, I suspect I inherited it from the original file
because I'm also used to annoy people for the same thing! Shame on me!
> > + activity_data->time_left -= 100;
> > + if (activity_data->time_left <= 0) {
> > + activity_data->time_left = 0;
> > + activity_data->state = !activity_data->state;
> > + led_set_brightness_nosleep(led_cdev,
> > + (activity_data->state ^ activity_data->invert) ?
> > + led_cdev->max_brightness : LED_OFF);
>
> Have you considered making the top brightness adjustable? I'd make it
> possible especially that we have a similar solution in the
> ledtrig-heartbeat.c already - see the following patch in 4.12:
>
> commit fb3d769173d26268d7bf068094a599bb28b2ac63
> Author: Jacek Anaszewski <j.anaszewski@samsung.com>
> Date: Wed Nov 9 11:43:46 2016 +0100
(...)
I never thought about it and it makes a lot of sense actually. I'll check
this commit, thanks for the pointer.
> > + switch (pm_event) {
> > + case PM_SUSPEND_PREPARE:
> > + case PM_HIBERNATION_PREPARE:
> > + case PM_RESTORE_PREPARE:
> > + led_trigger_unregister(&activity_led_trigger);
> > + break;
> > + case PM_POST_SUSPEND:
> > + case PM_POST_HIBERNATION:
> > + case PM_POST_RESTORE:
> > + rc = led_trigger_register(&activity_led_trigger);
> > + if (rc)
> > + pr_err("could not re-register activity trigger\n");
> > + break;
> > + default:
> > + break;
> > + }
> > + return NOTIFY_DONE;
> > +}
>
> It turned out to cause problems in ledtrig-heartbeat.c and was reverted.
> Please don't register pm notifier and remove related facilities from the
> patch according to the following revert patch:
>
> commit 436c4c45b5b9562b59cedbb51b7343ab4a6dd8cc
> Author: Zhang Bo <bo.zhang@nxp.com>
> Date: Tue Jun 13 10:39:20 2017 +0800
OK fine for me. I thought it was mandatory to properly handle pm
eventhough I was not particularly interested in this for this
specific purpose.
I'll send you an updated patch ASAP.
Thanks very much for your review,
Willy
next prev parent reply other threads:[~2017-08-28 6:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-11 23:41 [PATCH] leds/trigger/activity: add a system activity LED trigger Willy Tarreau
2017-02-15 10:24 ` Pavel Machek
2017-02-15 10:42 ` Willy Tarreau
2017-02-15 21:10 ` Pavel Machek
2017-03-09 20:48 ` Jacek Anaszewski
2017-03-10 6:44 ` Willy Tarreau
2017-08-24 12:07 ` Willy Tarreau
2017-08-27 16:44 ` Jacek Anaszewski
2017-08-28 6:57 ` Willy Tarreau [this message]
[not found] ` <1503945891-31722-1-git-send-email-w@1wt.eu>
2017-08-29 20:44 ` [PATCH v3] " Jacek Anaszewski
2017-08-30 2:38 ` Willy Tarreau
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=20170828065745.GA26097@1wt.eu \
--to=w@1wt.eu \
--cc=jacek.anaszewski@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rpurdie@rpsys.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;
as well as URLs for NNTP newsgroup(s).