From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Stephen Boyd <sboyd@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Petr Mladek <pmladek@suse.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: Fri, 1 Jun 2018 11:30:01 +0200 [thread overview]
Message-ID: <CAMuHMdVH7Gp5U84X86fg8kkspbn5VeLByuWe1g15VxxDbFM9pg@mail.gmail.com> (raw)
In-Reply-To: <cb01782c-3947-2409-aea2-24f264f3f2ea@gmail.com>
Hi Jia-Ju,
On Fri, Jun 1, 2018 at 2:59 AM, Jia-Ju Bai <baijiaju1990@gmail.com> wrote:
> On 2018/6/1 5:13, Steven Rostedt wrote:
>> On Thu, 31 May 2018 18:42:48 +0200
>> Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>>> 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.
OK, patches sent.
Thanks for reporting!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
prev parent reply other threads:[~2018-06-01 9:30 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
2018-06-01 0:59 ` Jia-Ju Bai
2018-06-01 9:30 ` Geert Uytterhoeven [this message]
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=CAMuHMdVH7Gp5U84X86fg8kkspbn5VeLByuWe1g15VxxDbFM9pg@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=baijiaju1990@gmail.com \
--cc=bhelgaas@google.com \
--cc=corbet@lwn.net \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--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 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).