From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <sha@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 01/14] show_progress: add system wide progress stage notifier
Date: Thu, 15 Apr 2021 09:39:15 +0200 [thread overview]
Message-ID: <3cb43395-74c9-1782-e660-097d052d43d9@pengutronix.de> (raw)
In-Reply-To: <20210415072911.GB19819@pengutronix.de>
Hi,
On 15.04.21 09:29, Sascha Hauer wrote:
> On Tue, Apr 13, 2021 at 12:34:49AM +0200, Ahmad Fatoum wrote:
>> Use case is e.g. board code that wants to register a client to light
>> status LEDs to indicate system state when no serial output is available.
>> This functionality doesn't increase code size due to linker GC when
>> CONFIG_PROGRESS_NOTIFIER is disabled.
>>
>> There is a generic progress notifier provided that just logs the
>> status. This could be shared with the booted kernel via pstore or
>> the log as a whole written to a system setup USB drive.
>>
>> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
>> ---
>> include/progress.h | 43 +++++++++++++++++++++++++++++++++++++++++++
>> lib/Kconfig | 6 ++++++
>> lib/show_progress.c | 28 ++++++++++++++++++++++++++++
>> 3 files changed, 77 insertions(+)
>>
>> diff --git a/include/progress.h b/include/progress.h
>> index 50b15fb12b4c..7230bd3a9bd5 100644
>> --- a/include/progress.h
>> +++ b/include/progress.h
>> @@ -3,6 +3,8 @@
>> #define __PROGRSS_H
>>
>> #include <linux/types.h>
>> +#include <notifier.h>
>> +#include <errno.h>
>>
>> /* Initialize a progress bar. If max > 0 a one line progress
>> * bar is printed where 'max' corresponds to 100%. If max == 0
>> @@ -15,4 +17,45 @@ void init_progression_bar(loff_t max);
>> */
>> void show_progress(loff_t now);
>>
>> +extern struct notifier_head progress_notifier;
>> +
>> +enum progress_stage {
>> + PROGRESS_UNSPECIFIED = 0,
>> + PROGRESS_UPDATING,
>> + PROGRESS_UPDATE_SUCCESS,
>> + PROGRESS_UPDATE_FAIL,
>> +};
>
> Neither the commit message nor the function names say it, but here it
> seems the progress is only used in context of a software update. Do you
> anticipate going other types of progress here as well?
I don't need any other progress stages myself. If the need arises, they
can be added though. Progress notifiees are supposed to ignore stages
they don't know about.
Cheers,
Ahmad
>
> Sascha
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2021-04-15 7:40 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-12 22:34 [PATCH 00/14] usb: gadget: refactor to allow easier extension Ahmad Fatoum
2021-04-12 22:34 ` [PATCH 01/14] show_progress: add system wide progress stage notifier Ahmad Fatoum
2021-04-15 7:29 ` Sascha Hauer
2021-04-15 7:39 ` Ahmad Fatoum [this message]
2021-04-12 22:34 ` [PATCH 02/14] common: console: add log_dprint to print to file descriptor Ahmad Fatoum
2021-04-15 7:25 ` Sascha Hauer
2021-04-15 7:43 ` Ahmad Fatoum
2021-04-12 22:34 ` [PATCH 03/14] string: implement strstarts along with strends Ahmad Fatoum
2021-04-12 22:34 ` [PATCH 04/14] vsprintf: introduce %m shorthand for "%s", strerror(errno) Ahmad Fatoum
2021-04-12 22:34 ` [PATCH 05/14] param: introduce file-list parameter type Ahmad Fatoum
2021-04-12 22:34 ` [PATCH 06/14] common: add generic machine partitions interface Ahmad Fatoum
2021-04-14 10:08 ` Sascha Hauer
2021-04-14 10:20 ` Ahmad Fatoum
2021-04-12 22:34 ` [PATCH 07/14] fastboot: handle ill-named partitions gracefully Ahmad Fatoum
2021-04-12 22:34 ` [PATCH 08/14] usb: gadget: dfu: change status message to info log level Ahmad Fatoum
2021-04-12 22:34 ` [PATCH 09/14] usbgadget: autostart: fix indeterminism around usbgadget.autostart Ahmad Fatoum
2021-04-12 22:34 ` [PATCH 10/14] usbgadget: allow DFU and Fastboot functions to coexist Ahmad Fatoum
2021-04-12 22:34 ` [PATCH 11/14] fastboot/dfu: use machine partitions as fall back Ahmad Fatoum
2021-04-12 22:35 ` [PATCH 12/14] bbu: add function to directly add handlers into file_list Ahmad Fatoum
2021-04-12 22:35 ` [PATCH 13/14] file_list: add file_list_detect_all() Ahmad Fatoum
2021-04-12 22:35 ` [PATCH 14/14] common: make FILE_LIST feature unconditional Ahmad Fatoum
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=3cb43395-74c9-1782-e660-097d052d43d9@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=sha@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