Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp378301imm; Fri, 1 Jun 2018 02:30:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ6ZDh6ujSxGtjLHnlwAGSx/EWZIVEeHZ+6atPpsG7oXAASleMbGCjMHz6LMPd6lDSnuXnc X-Received: by 2002:a17:902:8d81:: with SMTP id v1-v6mr10212338plo.136.1527845421582; Fri, 01 Jun 2018 02:30:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527845421; cv=none; d=google.com; s=arc-20160816; b=Ysz3XpIZJ+L8jrXh9xDZ8XQJ1+0BTHVqSyZDvtW12XIXh6kkzpUqO0uhqqqpiuS0zk vtWQxvPGPRV8ngw5+Rh4LOyNuQWKQ8K9q7mT60ODOLQ0owaAIvCtHh8enYypEg8JGh2I 03pIyLK1vwPBm1L/DbNf75KTd2XfChRXqXAyWhBTJII23gXnFfyNBqVinWd7RITMO0OG eyQGNQOBpllMSmgZo3XaiwAIrhY4nW7jcJd43LwakfXVqtAGPLQ7k23E9atnz2fSQl0a ous/XQbiPhB0V8yGNeQ0F7r62EaD8w8ABy/cEwDiCMPo26h7K4s7ByZ4QNjyMKSUM+4M unqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Aa1p31a8UImSbd7hs45N0F8JC6rg+WZq1LWD0l3ku3M=; b=gRvjntUUlbQJAhCrpt6ndYtDZZx0bmgUEIWTYR/1jOLqvuLnWNeFyytvTFTDVOMFP9 EoGLWcyPaXuE08vsiaTztwVh1UYF21xcNC88XXEuGahjLEiV2n5pBQZYMnfT+y9Upp7C L/8FNS7CjNaiCEGYLqdM7e/1QU6f9E7gp8vuV/YZEpKngm9qtjXAE/qmghRaRVcDq3pQ wOp2kENSuVorvnv/DdUYS7JGpS4XSRnF+5yQpPc5u8zYcFDxx7S4X245X+m3NN2KzJIL tW4PrR+XdyPhLhSq86qFcsSij4Ayba93yAazyu5mCli6h3UHWWwU+oeK3rSh6KCzV4Is z9UQ== ARC-Authentication-Results: i=1; mx.google.com; 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 p9-v6si24190213plo.208.2018.06.01.02.30.05; Fri, 01 Jun 2018 02:30:21 -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; 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 S1751740AbeFAJ3W (ORCPT + 99 others); Fri, 1 Jun 2018 05:29:22 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:53170 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751699AbeFAJ3K (ORCPT ); Fri, 1 Jun 2018 05:29:10 -0400 Received: from ayla.of.borg ([84.194.111.163]) by baptiste.telenet-ops.be with bizsmtp id tMUt1x00s3XaVaC01MUtwt; Fri, 01 Jun 2018 11:29:09 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1fOgMf-0007a9-Nd; Fri, 01 Jun 2018 11:28:53 +0200 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1fOgMf-0003Be-Lg; Fri, 01 Jun 2018 11:28:53 +0200 From: Geert Uytterhoeven To: Jia-Ju Bai , Jonathan Corbet , Michael Turquette , Stephen Boyd , Zhang Rui , Eduardo Valentin , Eric Anholt , Stefan Wahren , Greg Kroah-Hartman Cc: Sergey Senozhatsky , Petr Mladek , Linus Torvalds , Steven Rostedt , linux-doc@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 4/4] lib/vsprintf: Remove atomic-unsafe support for %pCr Date: Fri, 1 Jun 2018 11:28:22 +0200 Message-Id: <1527845302-12159-5-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527845302-12159-1-git-send-email-geert+renesas@glider.be> References: <1527845302-12159-1-git-send-email-geert+renesas@glider.be> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "%pCr" formats the current rate of a clock, and calls clk_get_rate(). The latter obtains a mutex, hence it must not be called from atomic context. Remove support for this rarely-used format, as vsprintf() (and e.g. printk()) must be callable from any context. Any remaining out-of-tree users will start seeing the clock's name printed instead of its rate. Reported-by: Jia-Ju Bai Fixes: 900cca2944254edd ("lib/vsprintf: add %pC{,n,r} format specifiers for clocks") Signed-off-by: Geert Uytterhoeven --- Documentation/core-api/printk-formats.rst | 3 +-- lib/vsprintf.c | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst index eb30efdd2e789616..25dc591cb1108790 100644 --- a/Documentation/core-api/printk-formats.rst +++ b/Documentation/core-api/printk-formats.rst @@ -419,11 +419,10 @@ struct clk %pC pll1 %pCn pll1 - %pCr 1560000000 For printing struct clk structures. %pC and %pCn print the name (Common Clock Framework) or address (legacy clock framework) of the -structure; %pCr prints the current clock rate. +structure. Passed by reference. diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 247a7e0bf24f6f74..a48aaa79d352313a 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1469,9 +1469,6 @@ char *clock(char *buf, char *end, struct clk *clk, struct printf_spec spec, return string(buf, end, NULL, spec); switch (fmt[1]) { - case 'r': - return number(buf, end, clk_get_rate(clk), spec); - case 'n': default: #ifdef CONFIG_COMMON_CLK -- 2.7.4