From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E817CC43381 for ; Tue, 12 Mar 2019 18:18:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA992214AF for ; Tue, 12 Mar 2019 18:18:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lechnology.com header.i=@lechnology.com header.b="rXtaTwey" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727182AbfCLSSc (ORCPT ); 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.