All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Stephen Boyd <sboyd@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Petr Mladek <pmladek@suse.com>,
	baijiaju1990@gmail.com, Bjorn Helgaas <bhelgaas@google.com>,
	SergeySenozhatsky <sergey.senozhatsky@gmail.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Michael Turquette <mturquette@baylibre.com>
Subject: Re: Can printk() sleep at runtime?
Date: Thu, 31 May 2018 17:13:08 -0400	[thread overview]
Message-ID: <20180531171308.08474a70@vmware.local.home> (raw)
In-Reply-To: <CAMuHMdWbwQ3GKovGGjMv+uWdJBoLYgXHAFj53qLcK1PjHg=0Gg@mail.gmail.com>

On Thu, 31 May 2018 18:42:48 +0200
Geert Uytterhoeven <geert@linux-m68k.org> wrote:

> Hi Stephen,
> 
> On Thu, May 31, 2018 at 5:19 PM, Stephen Boyd <sboyd@kernel.org> wrote:
> > Quoting Linus Torvalds (2018-05-31 07:32:10)  
> >> On Thu, May 31, 2018 at 5:05 AM Petr Mladek <pmladek@suse.com> wrote:  
> >> > Anyway, we need to fix or remove this format. vsprintf-like functions
> >> > are called in any context and nobody expect that they might sleep.  
> >>
> >> Ack. I guess the argument is that "%pCr" is rare, and none of *those*
> >> users may care, but I do think that doing things wrong as-is.
> >>
> >> It's too subtle to have to know you're in a particular locking context
> >> when you use a particular %p modifier.  
> >
> > Agreed. Removing the format seems to be the best approach. It looks like
> > only Geert has used it in the last few years and it hasn't been used
> > much otherwise.  
> 
> Indeed, just 3 users (the broadcom one isn't mine):
>     drivers/clk/renesas/renesas-cpg-mssr.c
>     drivers/thermal/broadcom/bcm2835_thermal.c
>     drivers/tty/serial/sh-sci.c
> 
> Alternatively, can we have a special version __clk_get_rate() that just
> returns clk->core->rate?
> Or would that be too inaccurate in the presence of CLK_GET_RATE_NOCACHE?
> The function could still return 0 in case the flag is set.

If it's only used in three locations, I think it would be better to
simply remove it from vsprintf() and have the three callers call
clk_get_rate() directly.

-- Steve

  reply	other threads:[~2018-05-31 21:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31  9:08 Can printk() sleep at runtime? Jia-Ju Bai
2018-05-31  9:45 ` Sergey Senozhatsky
2018-05-31 10:04 ` Petr Mladek
2018-05-31 14:32   ` Linus Torvalds
2018-05-31 15:19     ` Stephen Boyd
2018-05-31 16:42       ` Geert Uytterhoeven
2018-05-31 21:13         ` Steven Rostedt [this message]
2018-06-01  0:59           ` Jia-Ju Bai
2018-06-01  9:30             ` Geert Uytterhoeven

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=20180531171308.08474a70@vmware.local.home \
    --to=rostedt@goodmis.org \
    --cc=baijiaju1990@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=pmladek@suse.com \
    --cc=sboyd@kernel.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.