Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp358542imp; Wed, 20 Feb 2019 01:21:04 -0800 (PST) X-Google-Smtp-Source: AHgI3IYx10KXZYijPdW6euUpeWm6OkLBlPpMHSQvvlNlzBob6ZNEp54NXV8dImNuEMmjx+vjKSjx X-Received: by 2002:a17:902:7889:: with SMTP id q9mr15130994pll.305.1550654463956; Wed, 20 Feb 2019 01:21:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550654463; cv=none; d=google.com; s=arc-20160816; b=HOp+3Lho8uhbSqMb5EwHOJbQa6eo6Y9+46tyoUS3kpxmbtmYDqLtmG57n9hNFuCgHs HV5A9GWv2BmD4zi1d9KdrodKsGI/wjee/eRpPgugaEVi0UcOWY2T8PkUzaPDPOCjmhKD utppX7dqNnprC5V5KiJ7sY0PFIUMuUL/x3yoQy70N5TkZhYB+6PRwDi1nBXRmiepwMr/ 6w7tXaepqxmw+KdQrHi852c0EtUnUwd7qlBDN56NvrGLTkf6kPgyAD4wUd9ntNJzgGsD GEvihUMGDcZNlZXzvjRvOY2voJyomrfPRm3QWyhnyTTrKguYZPdOGoLcl9HtSl4LjJID 3eSA== 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 :in-reply-to:references:mime-version:dkim-signature; bh=4B9NzpkAopf8RQY348E3G+2brMdCIhEuSb1SpVc+UIE=; b=dZJbz6tOXNE5srxB3X+dOEgi41y6TdE81IARULEGsVcdiA/jU0d44jZnOVcGSLrqgp G5UH9qUX8JvxA17dswN76sySqBxzP0AerXFGaUIuXK97lza3tTPgm9FZ+sap6tengyqy UCQcIIqYc+UnIjBqWbpKRERYqiCPnav5+OetD6s0cL2tp1uAC0vRyv6IWltrMojHNP2f aGerHAfoZC2yMIFZmOEcs9jErEhrmpg8xmk56KilrKluYhgIW6vnWKQmPoRhYefg2wCr xhC5xH77zepsSlapAYmE0YiwcD0z/KP9WXeTRHOim2gXr9F0NcyXDNkPgooU/iQpJOT2 xSew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="oEdOR/SZ"; 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 q17si7464695pll.343.2019.02.20.01.20.48; Wed, 20 Feb 2019 01:21:03 -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="oEdOR/SZ"; 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 S1726846AbfBTJUF (ORCPT + 99 others); Wed, 20 Feb 2019 04:20:05 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:36294 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726827AbfBTJUF (ORCPT ); Wed, 20 Feb 2019 04:20:05 -0500 Received: by mail-qt1-f195.google.com with SMTP id p25so26129838qtb.3 for ; Wed, 20 Feb 2019 01:20:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4B9NzpkAopf8RQY348E3G+2brMdCIhEuSb1SpVc+UIE=; b=oEdOR/SZoZj/dl856c+xdYqakFTJJgoJAZCLewMZxRjObuwwCd5vPCynQ82rbZ+6Z0 Ex9MLuIpm3efp8YbJvZBMzmoYDKevzelMaA07KMRmZwVu+t9oOt8ob5oyVh4ppuUs0kC l7T5QWIhT7qP0M7g7GsSrkagPIo2l0JrPBMcFzToDNRiFIlMxbIwRVoL1tq9wct3P/SA TqP1n/XV3Mt+tqGVbuzHhxQbAPbUbbZts6jtRpBJg/ttAzKfOT1HuAMMpHhx5S/xxYE6 kZ50dw3PdS+wiJLNILll1VcffMzlQAfXQXhr2pAUcxrn9/2BwRm4/uYMhekY/xkoJ3oy 1pKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4B9NzpkAopf8RQY348E3G+2brMdCIhEuSb1SpVc+UIE=; b=XHiVJe7VSx7pTxw46fgPR+ycJwEAh7jiAeEzzJbXNu9mV0Fezx45cyMMgC4gzp6tJ+ 1NabPOYf7W8l0zg8sJWF7mSgOcQ+wG477ijmLX1q3ONtHrxxhHLY7pfKMG4S93dn2Y6J rnyzKZ4BOd0D+XxLV4GosbLQLZwgPwiayZlUJeJXLS9rIxFYQGMb3ryXK9fJfjvkUQ7N q3RWjH4rCucrvHtvWT2W2oGKkP7Jy8V3kKab05GKkg8BclAZT72Z8yaIVn1lVYLME/s8 cC38u6i98i3wMqJ1qxjat6xUGapm5oH/zpHG/LXM3IedjT7555BOaBbjFQWy/KHcO0nG GipA== X-Gm-Message-State: AHQUAub+Ia+64sW+T6pKhyl4FrE/a/tUexLcXyPJpat7VfLMcEsh570X TgU+P45FgMrNKfF9rh1l3bow37UGkftFiO8OCt+hdw== X-Received: by 2002:a0c:e942:: with SMTP id n2mr24617900qvo.119.1550654404226; Wed, 20 Feb 2019 01:20:04 -0800 (PST) MIME-Version: 1.0 References: <20190220011718.GD2811@localhost.localdomain> In-Reply-To: <20190220011718.GD2811@localhost.localdomain> From: Amit Kucheria Date: Wed, 20 Feb 2019 14:49:53 +0530 Message-ID: Subject: Re: [PATCH v1 13/24] drivers: thermal: tsens: Print IP version To: Eduardo Valentin Cc: Linux Kernel Mailing List , linux-arm-msm , Bjorn Andersson , Andy Gross , Daniel Lezcano , David Brown , Zhang Rui , Linux PM list 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 On Wed, Feb 20, 2019 at 6:47 AM Eduardo Valentin wrote: > > On Thu, Feb 07, 2019 at 04:19:31PM +0530, Amit Kucheria wrote: > > On some TSENS IP, version is stored. Print that version at init. > > > > Signed-off-by: Amit Kucheria > > --- > > drivers/thermal/qcom/tsens-common.c | 23 ++++++++++++++++++++++- > > 1 file changed, 22 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c > > index aae3d71d7eed..39cd5733fd44 100644 > > --- a/drivers/thermal/qcom/tsens-common.c > > +++ b/drivers/thermal/qcom/tsens-common.c > > @@ -121,7 +121,7 @@ int __init init_common(struct tsens_priv *priv) > > void __iomem *tm_base, *srot_base; > > struct device *dev = priv->dev; > > struct resource *res; > > - u32 enabled; > > + u32 enabled, maj_ver, min_ver; > > int ret, i, j; > > struct platform_device *op = of_find_device_by_node(priv->dev->of_node); > > > > @@ -155,6 +155,27 @@ int __init init_common(struct tsens_priv *priv) > > if (IS_ERR(priv->tm_map)) > > return PTR_ERR(priv->tm_map); > > > > + for (i = 0; i < MAX_REGFIELDS; i++) { > > + priv->rf[i] = NULL; > > + } > > + > > + /* alloc regmap_fields in srot_map */ > > + if (priv->feat->ver_info) { > > + for (i = 0, j = VER_MAJOR; i < 2; i++, j++) { > > + priv->rf[j] = devm_regmap_field_alloc(dev, priv->srot_map, > > + priv->fields[j]); > > + if (IS_ERR(priv->rf[j])) > > + return PTR_ERR(priv->rf[j]); > > + } > > + ret = regmap_field_read(priv->rf[VER_MAJOR], &maj_ver); > > + if (ret) > > + return ret; > > + ret = regmap_field_read(priv->rf[VER_MINOR], &min_ver); > > + if (ret) > > + return ret; > > + dev_info(dev, "version: %d.%d\n", maj_ver, min_ver); > > Is this really needed? Printing stuff into kernel log during boot can > just add a lot of info that ends up just slowing down things. Besides, > if this info is important shouldnt be available somewhere else as the > kernel log is a circular buffer and eventually that line will get > wrapped up? Fair point, I'll remove this statement and dump this into debugfs for which I'll send a separate series adding debugfs support.