Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2321195imc; Tue, 12 Mar 2019 11:19:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmfBXUZHnQyHwnOHHffnrj37gatYr38FAAIe5hQHzU5MuZtVjdUe8JbeOsCOc88N9u7nXk X-Received: by 2002:a17:902:8692:: with SMTP id g18mr40335775plo.149.1552414761607; Tue, 12 Mar 2019 11:19:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552414761; cv=none; d=google.com; s=arc-20160816; b=zz1LQ8E8GJBxtxXtvSU6L86pLozGyC4Kj/aTDtv5GZeK7R2GHDJFWpfF7fdxIFR+RK kDntTXuhiK+EVO2zgKcHPx9Da8Dj1web924cnyWva0id5+MGekgaB+xvZTAyBsiNkur9 WRc/FoWE2Y8zEJrO+NuNvTcSbz+5v7Y50TXVZqzZfMhLMDX0sTXyMVipEr95SvCwHQbu HzUtoE5ILZM7MfSiZb4R1O7JnbA/+P19AO8pxKre7x9J+5r4ALdktVYsHM/3YBYT6d/R Dzl4MbkpHKJjE/M1WBY9RCwHTT2cE5um+Q8dmQZ4Kq4snL8e/aw/7AMIWOeQoVBWiycT Nypg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=z6m+LzbdpKywZ9ztl4xZSrqI+END0oe6hrhH8t7zGYs=; b=IWVBxOQFg+jL2E2gNpuq/Lkovs6LpdaKBz1KioGVGMo2vtKf5INNO70Rgud9KjaBXX oKdNR6Dt1xo/W3mdU10IziWaFz/AG3RiNA+ZKI/FBLX80dYgP5Dj/g/LDfJJREVDNAe9 Ro/he5ENducDQ7toGOJNHR/t/QDJguMMdJmhJNtN0dIABbZdZc1xMnJNymkRluSWn8qa xadnHrvO/kc7z04cIY+B9ArR5iPOwUAWluvFNFDNQ/AFA0BLiDuHP2lWf+rxhAab6vmZ DD1HTTe+McKGlijoGnMON/6c5XOcjBynm8Q5UP2jGx4IqAYJTaXDYkHMMOv7UT1UzRNy U1VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@lechnology.com header.s=default header.b=rXtaTwey; 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 189si7874002pgb.412.2019.03.12.11.19.05; Tue, 12 Mar 2019 11:19: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; dkim=neutral (body hash did not verify) header.i=@lechnology.com header.s=default header.b=rXtaTwey; 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 S1727035AbfCLSSc (ORCPT + 99 others); Tue, 12 Mar 2019 14:18:32 -0400 Received: from vern.gendns.com ([98.142.107.122]:52414 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726783AbfCLSSa (ORCPT ); Tue, 12 Mar 2019 14:18:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nxy6hp1KT2epjRWinnQrniXb9mEekMK++cZ16YqPPeY=; b=rXtaTweysS160xvRtLo1nmbB4n +u5dZ6ESM11Tosnv1TnZHiojlIouLmG+oXy71u9BWN1lxkXyG8ewiuYDeaqObmuUjxZva9hiF4dnM 5W9suwPyx1KpLsUvJzz9BBTApNh9zCRCTd6ruj8vK7+9a+fv5b5G0ilkAB8M/i42uVBAy3XsNNjMq r108Sjuq+VME/ECkvywQw/ycAwBTF18v1Ov+zOx+9vkAgjzyi1LE8EJzLVf8JLrxZTgWTz502PTbk zrHWksYt0yY1BTcjcIaFf9FZ/IsVitbJhJ+C64TCJ6cHTnP/p4HgbgrWquSYey0oDLGQ7If6olX7H NvjVnq5A==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:36884 helo=[192.168.0.134]) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1h3lxr-0002WA-Lf; Tue, 12 Mar 2019 14:17:23 -0400 Subject: Re: [PATCH v3 01/11] clocksource: davinci-timer: new driver To: Bartosz Golaszewski , Sekhar Nori , Kevin Hilman , Daniel Lezcano , Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Bartosz Golaszewski References: <20190226120633.18200-1-brgl@bgdev.pl> <20190226120633.18200-2-brgl@bgdev.pl> From: David Lechner Message-ID: <1808a9f5-7e0c-3d1b-20a7-25792f9df8b5@lechnology.com> Date: Tue, 12 Mar 2019 13:18:26 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190226120633.18200-2-brgl@bgdev.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/26/19 6:06 AM, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Currently the clocksource and clockevent support for davinci platforms > lives in mach-davinci. It hard-codes many things, uses global variables, > implements functionalities unused by any platform and has code fragments > scattered across many (often unrelated) files. > > Implement a new, modern and simplified timer driver and put it into > drivers/clocksource. We still need to support legacy board files so > export a config structure and a function that allows machine code to > register the timer. > > We don't bother freeing resources on errors in davinci_timer_register() > as the system won't boot without a timer anyway. > > Signed-off-by: Bartosz Golaszewski > --- Reviewed-by: David Lechner with a few minor formatting issues ... > diff --git a/drivers/clocksource/timer-davinci.c b/drivers/clocksource/timer-davinci.c > new file mode 100644 > index 000000000000..ba2b21c94c2f > --- /dev/null > +++ b/drivers/clocksource/timer-davinci.c ... > +/** > + * struct davinci_timer_regs - timer-specific register offsets > + * > + * tim_off - timer counter register > + * prd_off - timer period register > + * enamode_shift - left bit-shift of the enable register associated > + * with this timer in the TCR register fields should be: @field: description ... > diff --git a/drivers/clocksource/timer-davinci.c b/drivers/clocksource/timer-davinci.c > new file mode 100644 > index 000000000000..ba2b21c94c2f > --- /dev/null > +++ b/drivers/clocksource/timer-davinci.c > @@ -0,0 +1,438 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +// > +// TI DaVinci clocksource driver > +// > +// Copyright (C) 2019 Texas Instruments > +// Author: Bartosz Golaszewski > +// (with some parts adopted from code by Kevin Hilman ) > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#undef pr_fmt > +#define pr_fmt(fmt) "%s: " fmt "\n", __func__ ... > + rv = clk_prepare_enable(clk); > + if (rv) { > + pr_err("Unable to prepare and enable the timer clock\n"); Won't this cause double newline in error message since pr_fmt also includes "\n"? Same with additional pr_err messages elsewhere in this patch.