Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1830882ybv; Fri, 14 Feb 2020 06:47:32 -0800 (PST) X-Google-Smtp-Source: APXvYqw01JRS2iksvzWr/qx/dFWfe7Zbmpg4g+gelmlMstf1+5wtMEOLieSQOFMVCg08sXGsiSFq X-Received: by 2002:a9d:7602:: with SMTP id k2mr2586732otl.39.1581691652328; Fri, 14 Feb 2020 06:47:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581691652; cv=none; d=google.com; s=arc-20160816; b=c/1xrtaJV2RfvLyciENny0iY7thnyAWKl7eyhxS0d/iQs9NC2DDjLoGj9KBmNyTJ6Y fcWpbsjxUMF+kw8zeYXXhG/z7gVi4hUIyG+BmUlizwgQeRJu4aatYSTNqOy6u6WxQNPI JEty9ETyG7K1eCSDGK6RMxtpw5x0CNCa1ybp891o976PQbG/th83pzwUuQEqYEIwk7FT tSxKRmoXq/YK6m8DjgeiZ1WZQ5Ksg9JHjpVcoT2Sho80TvwPaKox9UQm2W8+N4vhvjC9 fcznCadTataAZEq+2FRqjGB7+jR9tQeEMblr2bs9Zcg7evlymId4WC7zr0ADDTzkyU+G c4mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=eu7NWdR44vGqAg311ZA9lCuCsCVDE9dmz9a5vuuJXbs=; b=wb3YIHVPwsF+5IFfO1aWMG9EJgm6mxakoNWmggAVf5U1Ldq+mB/B6VI8eurljbtFzn 7SEPittbsbCbgEeqBD3CsHSQS9+ahPuDm3kVhYru7mKJEB00VM50fR/05IhB132onQmH Rn4/qrSF/ykcVfD3k/qIXtUAdB7pzwsBGmmER1OETklpgUC5vbO8PHdI+quXbHiuf3Iq ypiXX5i/NPEDb1Xcu0M/BsnoNlDiXJ7oqTcVE5+WrUApYwQrH7NuWIGADvcxZH6JDLbq 88h2o/GFUPFD+wVQvs2C0D8VSQL9rTulkpyFDzdFZp2hZxLfM2EQy2OIe02jIXLbZLtq IZiw== 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 t28si2819894otr.16.2020.02.14.06.47.20; Fri, 14 Feb 2020 06:47:32 -0800 (PST) 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 S1729268AbgBNOqD (ORCPT + 99 others); Fri, 14 Feb 2020 09:46:03 -0500 Received: from mx2.suse.de ([195.135.220.15]:38516 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727822AbgBNOqD (ORCPT ); Fri, 14 Feb 2020 09:46:03 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 19CCDB028; Fri, 14 Feb 2020 14:46:02 +0000 (UTC) Message-ID: Subject: Re: [PATCH] clocksource: owl: Improve owl_timer_init fail messages From: Andreas =?ISO-8859-1?Q?F=E4rber?= To: Manivannan Sadhasivam , Matheus Castello Cc: daniel.lezcano@linaro.org, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Fri, 14 Feb 2020 15:46:05 +0100 In-Reply-To: <20200214141714.GA30872@Mani-XPS-13-9360> References: <20200214064923.190035-1-matheus@castello.eng.br> <20200214141714.GA30872@Mani-XPS-13-9360> Organization: SUSE Linux GmbH Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Am Freitag, den 14.02.2020, 19:47 +0530 schrieb Manivannan Sadhasivam: > On Fri, Feb 14, 2020 at 03:49:23AM -0300, Matheus Castello wrote: > > Adding error messages, in case of not having a defined clock > > property > > and in case of an error in clocksource_mmio_init, which may not be > > fatal, so just adding a pr_err to notify that it failed. > > > > Signed-off-by: Matheus Castello > > --- > > > > Tested on my Caninos Labrador s500 based board. If the clock > > property is not > > set this message would help debug: > > > > ... > > [ 0.000000] Failed to get OF clock for clocksource > > [ 0.000000] Failed to initialize '/soc/timer@b0168000': -2 > > [ 0.000000] timer_probe: no matching timers found > > ... > > > > drivers/clocksource/timer-owl.c | 11 ++++++++--- > > 1 file changed, 8 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/clocksource/timer-owl.c > > b/drivers/clocksource/timer-owl.c > > index 900fe736145d..f53596f9e86c 100644 > > --- a/drivers/clocksource/timer-owl.c > > +++ b/drivers/clocksource/timer-owl.c > > @@ -135,8 +135,10 @@ static int __init owl_timer_init(struct > > device_node *node) > > } > > > > clk = of_clk_get(node, 0); > > - if (IS_ERR(clk)) > > + if (IS_ERR(clk)) { > > + pr_err("Failed to get OF clock for clocksource\n"); > > No need to mention OF here. Just, "Failed to get clock for > clocksource" > is good enough. We should be consistent then and output PTR_ERR(clk), too. i.e., "Failed to get clock for clocksource (%d)\n" > > > return PTR_ERR(clk); > > + } > > > > rate = clk_get_rate(clk); > > > > @@ -144,8 +146,11 @@ static int __init owl_timer_init(struct > > device_node *node) > > owl_timer_set_enabled(owl_clksrc_base, true); > > > > sched_clock_register(owl_timer_sched_read, 32, rate); > > - clocksource_mmio_init(owl_clksrc_base + OWL_Tx_VAL, node->name, > > - rate, 200, 32, > > clocksource_mmio_readl_up); > > + ret = clocksource_mmio_init(owl_clksrc_base + OWL_Tx_VAL, node- > > >name, > > + rate, 200, 32, > > clocksource_mmio_readl_up); > > + > > + if (ret) > > + pr_err("Failed to register clocksource %d\n", ret); It's not a numeric clocksource, so for humans please use "... (%d)\n". > > > > Do you want to continue if it fails? I'd bail out. Agreed, but I'd suggest to check under which circumstances this can actually fail and how other drivers handle it, given that it was not checked before. Was this missed during original review, or is the return value new? Cheers, Andreas -- SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer HRB 36809 (AG Nürnberg)