linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: John Ogness <john.ogness@linutronix.de>
Cc: Petr Mladek <pmladek@suse.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Saravana Kannan <saravanak@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Zijun Hu <quic_zijuhu@quicinc.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: lock in vsprintf(): was: Re: [PATCH] of: Add printf '%pOFm' for generating modalias
Date: Mon, 30 Dec 2024 14:26:43 -0600	[thread overview]
Message-ID: <20241230202643.GA2488017-robh@kernel.org> (raw)
In-Reply-To: <84o7171o9y.fsf@jogness.linutronix.de>

On Thu, Dec 19, 2024 at 08:17:21PM +0106, John Ogness wrote:
> On 2024-12-19, Petr Mladek <pmladek@suse.com> wrote:
> > I do not want to revert everything now just because of theoretical
> > problems.
> 
> What would you revert? This has always been an issue for printk().
> 
> > Well, it would be nice to document the lock dependency in
> > Documentation/core-api/printk-formats.rst
> 
> Yes. If any locking is involved at all, such specifiers should be
> documented as not safe in NMI context or within printk_cpu_sync
> blocks. 

For the folks that don't read documentation, should we bail out on 
in_nmi() for these as well?

> Also, it should be checked if all such locks are
> raw_spinlock_t. If any other lock type is used, it probably is already
> generating a lockdep splat since printk() formats records with local
> interrupts off.

At least for DT, that is the case. There is a mutex, but that's only 
taken if the tree is modified.

> Perhaps we should create a kunit that calls printk() for each of the
> supported specifiers and see if any lockdep splats appear.

That's already in place with the DT unit test (which doesn't use kunit 
ATM).

Rob

  parent reply	other threads:[~2024-12-30 20:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-17 18:37 [PATCH] of: Add printf '%pOFm' for generating modalias Rob Herring (Arm)
2024-12-18  2:21 ` quic_zijuhu
2024-12-18 10:16 ` Rasmus Villemoes
2024-12-18 15:28   ` Rob Herring
2024-12-18 11:35 ` ssize_t: was: " Petr Mladek
2024-12-18 17:10   ` Rob Herring
2024-12-19 14:44     ` Petr Mladek
2024-12-18 12:27 ` lock in vsprintf(): " Petr Mladek
2024-12-18 14:07   ` John Ogness
2024-12-19 15:05     ` Petr Mladek
2024-12-19 19:11       ` John Ogness
2024-12-20  8:01         ` Petr Mladek
2024-12-30 20:26         ` Rob Herring [this message]
2025-01-02 13:06           ` Petr Mladek
2025-01-02 14:02             ` John Ogness
2024-12-18 16:29   ` Rob Herring
2024-12-18 16:31   ` Steven Rostedt
2024-12-23 19:58 ` Andy Shevchenko
2024-12-30 20:52   ` Rob Herring

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=20241230202643.GA2488017-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=quic_zijuhu@quicinc.com \
    --cc=rostedt@goodmis.org \
    --cc=saravanak@google.com \
    --cc=senozhatsky@chromium.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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).