Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp379931imm; Fri, 1 Jun 2018 02:32:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJZpTJcWBPUTnrqPGJEtNoCC80c/SyyiYT4K1ugrAf1T8Kd2+MBENsB8LShlK56Zg/juNq7 X-Received: by 2002:a63:7804:: with SMTP id t4-v6mr8490481pgc.323.1527845535974; Fri, 01 Jun 2018 02:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527845535; cv=none; d=google.com; s=arc-20160816; b=vFtvy3Hc6z7YOyaSEfT1G5OuPBQnKvlVPiaAw8o1tSRUI6/i7+PwkfwTFD2mdsbRiV dPJZYvlhoQ0CyN09N1S4CT+z+xyqN3/MvJ8uWW/WYKwUMlwcrliR2cYjTLJpahmXjAOU AWQF6kxtTtXCofryqrzhKKxElbGfdnWy4czeTD/1/j85WpP298AnC/EV0tSlnHxXVylE yHbKMxIhjblkiHzYOQn5jLS+Ktsm0jXDMq6H8jGgqSHxSGeR1cv7LTHjXnV+tG+oBGZp ++YukjDCBhndEfR5G8IOjmh/Dxq6EyY+QOWjehJWRPBv7/u5qFcJIzKY/wjKro6KWqk8 BpeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=imBhWL/V7p8ug2pk/P2/o1kCrV5EByZgXPztfqjrGOM=; b=ToFUjOmRqYnnu7Mr64LfUGnq2pbka3g1OvRtEwdSAQZglKSPA8loHY5cwJ5An1yBR9 ueTPwL3ogXb0KGDS4aLDtxs+SWr0yHryaGh72o47itL8GuxBvUn7NOMYdD2Fj6tUgiNr HlrJYvh5HDAu92uIkjY1ksEmtEYCxTT94XuIwx7SvxZmEAWsRZhLsiabZT1cMO/Ga2QG c3hURlLQcsqXDdz9PmgrYoXepqEUu2573Oo958UlYxivLQNg6Ng0cZkEtXHGyg/NG27v P9sbEFKAAcOzdWuwR885dmVKr39AuO8T4b86X1S30zpctM5LgFj7HjX/W1YGvwwyNTs2 fWkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Tl63owKw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7-v6si15747534pfn.247.2018.06.01.02.32.01; Fri, 01 Jun 2018 02:32:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Tl63owKw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751690AbeFAJaI (ORCPT + 99 others); Fri, 1 Jun 2018 05:30:08 -0400 Received: from mail-vk0-f50.google.com ([209.85.213.50]:41654 "EHLO mail-vk0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751223AbeFAJaC (ORCPT ); Fri, 1 Jun 2018 05:30:02 -0400 Received: by mail-vk0-f50.google.com with SMTP id 128-v6so9760947vkf.8 for ; Fri, 01 Jun 2018 02:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=imBhWL/V7p8ug2pk/P2/o1kCrV5EByZgXPztfqjrGOM=; b=Tl63owKwzAT2hUq5sbaEB7JWf1hxzaAMk6r1HAxFdYWbLeHwyAfsfYp6pd49VvYoZC By2vUNv2YF7qhZZX3IE567VyfOkx97+3GBZBX5JWH108gx8nCYbDufEmINNuu/uFCBPQ C3Y2Ewf8Qf44HN/NgbWVN8/5cQg/RY4SQX6Wp/EE3QAU10/cyGoEf/zBxSVPozvWATqZ Uv3kXTIatAhV1IsmtCKLfU40cgf8m61Yf+ftEm3S0lGZb9PWq14YYqp2VH//n9+C3h9A FJwMmNFiDMG41CGYddpUaCzprauGjQX14fUdYqG4IehiJErUmGo9UZB+4g76HD7GSJeq 32dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=imBhWL/V7p8ug2pk/P2/o1kCrV5EByZgXPztfqjrGOM=; b=BUQxKERQT6wQx3A6Pn0HtAT8lrg6B7xu5QCUG9hPCvoPcBk3ZzCfsIb3SXeYZRizp1 yvM58WU0VsZIqqOpN/7n1Hgsaum6s37sLVMn61oavCjRbdcKWYNmE4Ccjl3MWw03KmVB /B9hn0SuY5c+kTNVwNogJ/kaIqiCuIfxpybeOFScEfshsU3qUou8cZuHtlhOZBu9g9vr nhxuzCh2OPj5rt1WW3zEeIFQktvVuZDlE/ZwzPNsgrxzryuYqRlsWKHz83AzaGO6T3tv lPjRbUvOy0hPc57eDqG6kQMp7GRc6Hi08x6RGeCYwr655aliZoPFXFscojvlushN8zOv Eywg== X-Gm-Message-State: ALKqPwd1OLstDzcctXd1f3yKYiOCkvWB3eHVlHTSVprAuuSPnXbrZ/1M eVsugg+C7oL5VAp//4WLb5+AP4YWC3sbxmD8/kc= X-Received: by 2002:a1f:1957:: with SMTP id 84-v6mr6224749vkz.90.1527845401786; Fri, 01 Jun 2018 02:30:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:7a0a:0:0:0:0:0 with HTTP; Fri, 1 Jun 2018 02:30:01 -0700 (PDT) In-Reply-To: References: <20180531100457.fncibp5cxdozvbjh@pathway.suse.cz> <152777998940.144038.2717154952249020053@swboyd.mtv.corp.google.com> <20180531171308.08474a70@vmware.local.home> From: Geert Uytterhoeven Date: Fri, 1 Jun 2018 11:30:01 +0200 X-Google-Sender-Auth: NVPT1KVeOF5JcO1KEm25MqBKO8I Message-ID: Subject: Re: Can printk() sleep at runtime? To: Jia-Ju Bai Cc: Steven Rostedt , Stephen Boyd , Linus Torvalds , Petr Mladek , Bjorn Helgaas , SergeySenozhatsky , Al Viro , Greg Kroah-Hartman , Jonathan Corbet , Linux Kernel Mailing List , Thomas Gleixner , Geert Uytterhoeven , Michael Turquette Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jia-Ju, On Fri, Jun 1, 2018 at 2:59 AM, Jia-Ju Bai wrote: > On 2018/6/1 5:13, Steven Rostedt wrote: >> On Thu, 31 May 2018 18:42:48 +0200 >> Geert Uytterhoeven wrote: >>> On Thu, May 31, 2018 at 5:19 PM, Stephen Boyd wrote: >>>> Quoting Linus Torvalds (2018-05-31 07:32:10) >>>>> On Thu, May 31, 2018 at 5:05 AM Petr Mladek 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