mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Petr Mladek <pmladek@suse.com>,
	linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	John Ogness <john.ogness@linutronix.de>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Tony Lindgren <tony.lindgren@linux.intel.com>,
	kernel-team@fb.com
Subject: Re: [PATCH v6 06/11] printk: console: Introduce sysfs interface for per-console loglevels
Date: Wed, 20 Nov 2024 05:01:47 +0000	[thread overview]
Message-ID: <Zz1tOxW6PO_2OeSA@chrisdown.name> (raw)
In-Reply-To: <2024111508-native-subtype-2990@gregkh>

Thanks for looking this over :-) All not mentioned points in this reply are 
acked.

Greg Kroah-Hartman writes:
>> diff --git a/Documentation/ABI/testing/sysfs-class-console b/Documentation/ABI/testing/sysfs-class-console
>> new file mode 100644
>> index 000000000000..40b90b190af3
>> --- /dev/null
>> +++ b/Documentation/ABI/testing/sysfs-class-console
>> @@ -0,0 +1,47 @@
>> +What:		/sys/class/console/
>> +Date:		October 2024
>
>It's no longer October 2024 :(

What would you recommend? When I sent them it was, and it doesn't seem 
realistic to think that it's going to be less than one month from me sending 
the patches to when it gets merged, no?

>> +What:		/sys/class/console/<C>/loglevel
>> +Date:		October 2024
>> +Contact:	Chris Down <chris@chrisdown.name>
>> +Description:	Read write. The current per-console loglevel, which will take
>> +		effect if not overridden by other non-sysfs controls (see
>> +		Documentation/admin-guide/per-console-loglevel.rst). Bounds are
>> +		0 (LOGLEVEL_EMERG) to 8 (LOGLEVEL_DEBUG + 1) inclusive. Also
>> +		takes the special value "-1" to indicate that no per-console
>> +		loglevel is set, and we should defer to the global controls.
>
>-1 is odd, why?  That's going to confuse everyone :(

I originally had it that you had to send "unset" instead of -1, but in 
discussion with Petr it was suggested to change it to -1.

Petr, what do you think?

>> +	if (console->classdev)
>> +		device_unregister(console->classdev);
>
>How could this be NULL?

I think it's from an earlier version of the patch where we would still continue 
setup even if we couldn't allocate it. I'm okay removing it.

>> +static ssize_t loglevel_show(struct device *dev, struct device_attribute *attr,
>> +			     char *buf)
>> +{
>> +	struct console *con = dev_get_drvdata(dev);
>> +
>> +	return sysfs_emit(buf, "%d\n", READ_ONCE(con->level));
>
>While I admire the use of READ_ONCE() properly, it really doesn't matter
>for sysfs as it could change right afterwards and no one cares.  So no
>need for that here, right?

I'm not sure I understand, could you clarify? From my reading of the code it 
looks like we need this to avoid tearing.

  parent reply	other threads:[~2024-11-20  5:01 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 16:45 [PATCH v6 00/11] printk: console: Per-console loglevels Chris Down
2024-10-28 16:45 ` [PATCH v6 01/11] printk: Avoid delaying messages that aren't solicited by any console Chris Down
2024-10-28 16:45 ` [PATCH v6 02/11] printk: Use struct console for suppression and extended console state Chris Down
2024-11-08  9:57   ` Petr Mladek
2024-11-15  8:30   ` John Ogness
2024-11-20  4:17     ` Chris Down
2024-11-20 12:03       ` Petr Mladek
2024-10-28 16:45 ` [PATCH v6 03/11] printk: console: Implement core per-console loglevel infrastructure Chris Down
2024-11-08 16:10   ` Petr Mladek
2024-11-12 10:25     ` Petr Mladek
2024-11-14 16:51     ` Petr Mladek
2024-10-28 16:45 ` [PATCH v6 04/11] printk: Support toggling per-console loglevel via syslog() and cmdline Chris Down
2024-11-12 10:56   ` Conflict with FORCE_CON: " Petr Mladek
2024-11-14 19:28     ` Chris Down
2024-11-15 11:41       ` Petr Mladek
2024-11-12 12:59   ` Petr Mladek
2024-11-14 17:14   ` syslog warning: was: " Petr Mladek
2024-11-14 18:53     ` Chris Down
2024-11-15 11:36       ` Petr Mladek
2024-10-28 16:45 ` [PATCH v6 05/11] MAINTAINERS: Mark printk-basics.rst as owned by printk subsystem Chris Down
2024-10-28 23:26   ` Thomas Gleixner
2024-10-28 23:52     ` Chris Down
2024-11-12 13:00   ` Petr Mladek
2024-10-28 16:45 ` [PATCH v6 06/11] printk: console: Introduce sysfs interface for per-console loglevels Chris Down
2024-11-13 15:58   ` Petr Mladek
2024-11-13 15:59   ` register_device: was: " Petr Mladek
2024-11-14 18:41     ` Chris Down
2024-11-15  4:08       ` Greg Kroah-Hartman
2024-11-18 15:19     ` Petr Mladek
2024-11-15  4:20   ` Greg Kroah-Hartman
2024-11-15 14:09     ` Petr Mladek
2024-11-20  5:01     ` Chris Down [this message]
2024-11-20  8:43       ` John Ogness
2024-11-20 14:54         ` Petr Mladek
2024-11-20 15:29           ` John Ogness
2024-11-20 14:45       ` Petr Mladek
2025-01-10 10:27   ` Joel Granados
2025-01-15 10:31     ` Petr Mladek
2024-10-28 16:45 ` [PATCH v6 07/11] printk: Constrain hardware-addressed console checks to name position Chris Down
2024-10-29  8:26   ` Tony Lindgren
2024-11-13 16:11   ` Petr Mladek
2024-10-28 16:45 ` [PATCH v6 08/11] printk: Support setting initial console loglevel via console= on cmdline Chris Down
2024-11-14  9:11   ` Petr Mladek
2024-10-28 16:45 ` [PATCH v6 09/11] printk: Add sysctl interface to set global loglevels Chris Down
2024-11-14 16:21   ` Petr Mladek
2025-01-10 10:09     ` Joel Granados
2024-10-28 16:45 ` [PATCH v6 10/11] printk: Deprecate the kernel.printk sysctl interface Chris Down
2024-11-14 16:25   ` Petr Mladek
2024-10-28 16:46 ` [PATCH v6 11/11] printk: Purge default_console_loglevel Chris Down
2024-11-14 16:38   ` Petr Mladek

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=Zz1tOxW6PO_2OeSA@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.ogness@linutronix.de \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=tony.lindgren@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome