Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1802005ybv; Fri, 14 Feb 2020 06:18:12 -0800 (PST) X-Google-Smtp-Source: APXvYqw1CTv6GNypY+JAIh72lC3CwvnDJ2DKL3uMWIj16lcyAqAdCgL2q01gd3cq4p2yIc7YlZHz X-Received: by 2002:a9d:6d10:: with SMTP id o16mr2548042otp.28.1581689892261; Fri, 14 Feb 2020 06:18:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581689892; cv=none; d=google.com; s=arc-20160816; b=NDoSOjP8NvJoeLXfDzSycbThzQLBQ2jYcqigKJI/3qaD7lHf6uhQHP36M/N3RdX4kB ZWTl3cyZR0vvZKhF5n/2UPfeZcJXbSkC1rCcdt8BXOdM3oRN4Gakdqz2kIC7O8w3oX5p biCAkFlwlWLChOhYWYCEK9v1fs68jZIP5KWOkkc24ZnDKDV/3D3zOIbVldQR8K1uwZqf g4wdP69VrefBKwG7Gnh/vL6E30MGv/zaInQV+AeMemoN+P/WcUHneuW1b9nkHvrFNqFZ BewIHrG46ayosa3N2C7urixXNyMjV/tnzDNGS99xwosaSMgeR+CautVeTol32EbDp+qH PLjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=76JpXRWS3a2ABcUF6vWy9HDRZvc+hNwLnaKgXe8RuAI=; b=aJ//ac8cvllWkmL7Ggkd0E51oBjbl6V+zcQDxhH8vIMwJKPjacciyYHHX3b7iiyen+ QdsRRqrTfHtUvOlfgF0DeNsBYA7yTYaHBN+pxC3itk8e5i1RQSeOpUa1x3Hh8g3vSnfd Rm9iwNMk096jWssc5A+JElAReNNCHf/5wZKEtLsxRHfaNd/mJJXHzi7sgexgqguTQ13c HnRNrBMrTYpNZ+k/bTj3ZKs3bRhiwvZhcCWtEUf85aQOlir1wmCVY+9m1qIlY5IqlMwI Lo9VchrZuV109gxGZpFyGwmd3+a7nXPTsAmu9tWPsYajDcHVxKXyGagm/IumMAm7CcDE 9+ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T7yeJuzz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4si2934595oix.48.2020.02.14.06.18.00; Fri, 14 Feb 2020 06:18:12 -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; dkim=pass header.i=@linaro.org header.s=google header.b=T7yeJuzz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387455AbgBNORX (ORCPT + 99 others); Fri, 14 Feb 2020 09:17:23 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:33071 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387441AbgBNORX (ORCPT ); Fri, 14 Feb 2020 09:17:23 -0500 Received: by mail-pf1-f194.google.com with SMTP id n7so4973678pfn.0 for ; Fri, 14 Feb 2020 06:17:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=76JpXRWS3a2ABcUF6vWy9HDRZvc+hNwLnaKgXe8RuAI=; b=T7yeJuzzh3K1vLn8EbNBqnwsROHUoo7JAuFO2lfAi/M9FGp05QdjtlRKRIaW6kz+QA j1aBkAbc/kbGlTkKVndGe6TTW/WIto0NBk340o5Eu0J8w5IctHiKj00LkC6RhuMXMHyC 02X9Rd1PY0OWnHCWchXDkOeseUL+RBCx64kPQc3fXCq26P5YhdchWt1Nqd476EwPZVED afnHKQlvu9WzWxrc97n0LaUvCyx5ARwBJtJNAo1LcWnjMaIjWigYWr2lbjsbDQoWSKvv qpbD98HgYf3Cgo7j6UUM+EYCo1qb5Fe8F4Ho1CF+E7b3/jLic1oi5zXCrtdY9wLIYgxY AwRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=76JpXRWS3a2ABcUF6vWy9HDRZvc+hNwLnaKgXe8RuAI=; b=oJFBQVL4F7pe2v0Lb7U/v41EdDyBb5o8Y2QrNjzOHA9YuhRBLOmuYsmcqq6EACrf6m aN9PdX1P8yqH80dt6sOlfB+shFV6qC9/e55BrOQQ5ZjW+FS8wTCaAnz1ASF0YhM4xj+J Op4Ngr1kyzEhYMMvpaNJ45/IShffkZYJTMSiil7+Oleo2xGJNUJ+JQ2sq362xDU50Fyx jkPJO00OiuJcNP1CPELczaqoVASeRpNR2POEdM+JLaQNnD5d0wWnsRxWo3+7XcZk6Nux 0Iv8Qe/BAWiCuGoG80P9jZhnnNzBjNcss3nSJfD5faHnXgo7FRZBNL9nF8MthKrYNwvK LqRw== X-Gm-Message-State: APjAAAU31ffE5//W1tCPadl+6yq3Ia2NkljeMGq4hGaCwegsRm7Mo99a cQ5h10pPvOyy8ObmWOaPq5vQCJWUjQ== X-Received: by 2002:a65:641a:: with SMTP id a26mr3686775pgv.425.1581689841979; Fri, 14 Feb 2020 06:17:21 -0800 (PST) Received: from Mani-XPS-13-9360 ([2409:4072:482:690f:50bb:adfb:86f:a4bf]) by smtp.gmail.com with ESMTPSA id c11sm7295050pfo.170.2020.02.14.06.17.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 06:17:20 -0800 (PST) Date: Fri, 14 Feb 2020 19:47:14 +0530 From: Manivannan Sadhasivam To: Matheus Castello Cc: afaerber@suse.de, daniel.lezcano@linaro.org, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] clocksource: owl: Improve owl_timer_init fail messages Message-ID: <20200214141714.GA30872@Mani-XPS-13-9360> References: <20200214064923.190035-1-matheus@castello.eng.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200214064923.190035-1-matheus@castello.eng.br> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thanks for the patch! 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. > 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); > Do you want to continue if it fails? I'd bail out. Thanks, Mani > owl_timer_reset(owl_clkevt_base); > > -- > 2.25.0 >