Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3552977ybi; Tue, 18 Jun 2019 02:41:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdHoBlMdoImVvABT4t1omgXC/FK5gWv8+6J773ksfnO77GL35VXOurwBHb7vHDwbo/E3RN X-Received: by 2002:a62:bd03:: with SMTP id a3mr62713724pff.209.1560850902186; Tue, 18 Jun 2019 02:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560850902; cv=none; d=google.com; s=arc-20160816; b=RBWC8OVAQUpbl4WR0IIgC6XWG7W+u0J51DAC4Q6VuOPVXdgMXOyWHull5bEnng+YaJ e1lUsd4sVijI8rgd5fnSCYENGD2FurzT9ayRVZVEHNMtyoAkE+YX4kUd/od+sw31nhdQ JHSfnXAxtKWHXjQl4TJIcmSwN/+7UXH23XrMk1dgL5bPSXp23qIJuNTHX+Od4erCAbl4 Dj7zjY/GWxYHL3akDwFvWnaH5yPzB3S0yE8N1duKrjLgl6j74ZUsKOTCZnJkL6/9pvlu vnGwv/K7FOe+bJTYzytXHBJk2th7G4JXMY9eZ32UrLER8PRJ37cTSc/wCBP1uLBFuAXC lTEg== 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=MVp7uympEdUunNVgJnVCM8FJZvV7BtdVx8tqs/H/PPc=; b=gJ+xNg6n2ggFbHOXqOwZnFqfOn2/Jr35N+RpAhLy435To2XMleIb9KqO/0GAS2xiPA lluqHbSkJTtQYxgneongrF4NQfDFdNfc42xXNRfMtM59iDIR4sva6AB5FuxsH4ZaV4x4 jUQRk/Xmb6RIGspf4WaWxk9yl0KZl9qJ3O4N3bsSk+HSgC8cNn8ZmdyzA3X3TvXrjeDt +2yIhU6DcNwXjcT+7H2rTu4QSKJuoSx2cB2j2JHByadpDLPZhfhAjL8SsroO2AJkuDmt oZ+qMna6reRT7cyrnk4Mbcq+SRqfTmIaLCrmgtXDyQ6eewvSdWu1BksLEKP5K0XudJFB HljA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tcm1rElK; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ch14si13028439plb.44.2019.06.18.02.41.23; Tue, 18 Jun 2019 02:41:42 -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=pass header.i=@gmail.com header.s=20161025 header.b=Tcm1rElK; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729353AbfFRJlT (ORCPT + 99 others); Tue, 18 Jun 2019 05:41:19 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:46122 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729230AbfFRJlT (ORCPT ); Tue, 18 Jun 2019 05:41:19 -0400 Received: by mail-lf1-f66.google.com with SMTP id z15so8706552lfh.13; Tue, 18 Jun 2019 02:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=MVp7uympEdUunNVgJnVCM8FJZvV7BtdVx8tqs/H/PPc=; b=Tcm1rElKSu2AXmKY3bgAORWiNuozrZpdUzuD2KMmKdOG807fDr4wfEE9i52rZRM4QP D3baVumWo4nawXVpXM9bNiykJLKUztcT8S0ATutAHrMrIMZPB3+vYROGj/lx2YR90L3p QNmR/z5JoqJOGMf9S94A7XtsecHatn6tIQGvEOSpjSPvm7m0yHqTotV3k7Ly1S7hxmT7 TCQe8whs2LZbbfJxXwBPlT76gdVB14F3wWt8QSGBW67Bf64rSpwZVPEGBXuLyjpxQe6T 5Q49ifK23fPpjoLIRxznFszSOeslVgl93MY5oivExoDqHCSd5ucnwto737YVudHVQHF9 eeAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MVp7uympEdUunNVgJnVCM8FJZvV7BtdVx8tqs/H/PPc=; b=nS62tzdHL4uA3RFXMxPJWe3SFgNJ4gD4kyyGbpHkrWyNkKzEqpXwraqZYBdXZn7YDm EjtIoDAwZ1GYm9+3kGFWYVtdTvuRkXMOOKxipF8m2f/GSrOEyhOaHCwGuUNyBi1zUX/f ZGTUh5EaspXKH+BaPHTEi8GnDyvMwvgICup4TodkdB9cPhCqy0pkHSOBcrCMu5T5I3ad zPNN+qJvfcWCP69kIBltXy0+GBlhtDdbtD+bZLsl5LY0FqgkHf8dgR2s6Qog0hImdKl5 b2lTcP+MyuuhEw+r54LngB+CxjuUGVo3yIlvABnCYOzfRMSOPXk4Ds8qKtWZ9ixvxP/h pzAw== X-Gm-Message-State: APjAAAVxCuhOKR+q7tituOtT8pV4hipJZ6c7TxYz1vmsfpAgoED6iJjA ap9rdImnn0EjVaGPUXAYrLQLwb8E X-Received: by 2002:ac2:546a:: with SMTP id e10mr10535640lfn.75.1560850876582; Tue, 18 Jun 2019 02:41:16 -0700 (PDT) Received: from [192.168.2.145] (ppp91-79-162-197.pppoe.mtu-net.ru. [91.79.162.197]) by smtp.googlemail.com with ESMTPSA id b11sm2511093ljf.8.2019.06.18.02.41.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 02:41:15 -0700 (PDT) Subject: Re: [PATCH v2 3/6] clocksource/drivers/tegra: Set and use timer's period To: Jon Hunter , Daniel Lezcano , Joseph Lo , Thierry Reding , Peter De Schrijver Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190610164400.11830-1-digetx@gmail.com> <20190610164400.11830-4-digetx@gmail.com> <3e941c50-ac62-719e-aac1-7072e9a3bcd0@gmail.com> <660f3645-3fa6-175c-75a6-3fcc79e972ad@nvidia.com> From: Dmitry Osipenko Message-ID: Date: Tue, 18 Jun 2019 12:41:15 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 18.06.2019 11:40, Jon Hunter пишет: > > On 17/06/2019 15:04, Dmitry Osipenko wrote: >> 17.06.2019 13:51, Jon Hunter пишет: >>> >>> On 14/06/2019 17:45, Dmitry Osipenko wrote: >>>> 14.06.2019 18:48, Jon Hunter пишет: >>>>> >>>>> On 10/06/2019 17:43, Dmitry Osipenko wrote: >>>>>> The of_clk structure has a period field that is set up initially by >>>>>> timer_of_clk_init(), that period value need to be adjusted for a case of >>>>>> TIMER1-9 that are running at a fixed rate that doesn't match the clock's >>>>>> rate. Note that the period value is currently used only by some of the >>>>>> clocksource drivers internally and hence this is just a minor cleanup >>>>>> change that doesn't fix anything. >>>>>> >>>>>> Signed-off-by: Dmitry Osipenko >>>>>> --- >>>>>> drivers/clocksource/timer-tegra.c | 5 +++-- >>>>>> 1 file changed, 3 insertions(+), 2 deletions(-) >>>>>> >>>>>> diff --git a/drivers/clocksource/timer-tegra.c b/drivers/clocksource/timer-tegra.c >>>>>> index 810b4e7435cf..646b3530c2d2 100644 >>>>>> --- a/drivers/clocksource/timer-tegra.c >>>>>> +++ b/drivers/clocksource/timer-tegra.c >>>>>> @@ -71,9 +71,9 @@ static int tegra_timer_shutdown(struct clock_event_device *evt) >>>>>> static int tegra_timer_set_periodic(struct clock_event_device *evt) >>>>>> { >>>>>> void __iomem *reg_base = timer_of_base(to_timer_of(evt)); >>>>>> + unsigned long period = timer_of_period(to_timer_of(evt)); >>>>>> >>>>>> - writel_relaxed(TIMER_PTV_EN | TIMER_PTV_PER | >>>>>> - ((timer_of_rate(to_timer_of(evt)) / HZ) - 1), >>>>>> + writel_relaxed(TIMER_PTV_EN | TIMER_PTV_PER | (period - 1), >>>>>> reg_base + TIMER_PTV); >>>>>> >>>>>> return 0; >>>>>> @@ -297,6 +297,7 @@ static int __init tegra_init_timer(struct device_node *np, bool tegra20, >>>>>> cpu_to->clkevt.rating = rating; >>>>>> cpu_to->clkevt.cpumask = cpumask_of(cpu); >>>>>> cpu_to->of_base.base = timer_reg_base + base; >>>>>> + cpu_to->of_clk.period = DIV_ROUND_UP(rate, HZ); >>>>> >>>>> Any reason you made this a round-up? >>>> >>>> That's what timer_of_clk_init() does, I assume it should be a more correct variant. >>> >>> Sounds to me like this should be 2 patches, because you are changing the >>> value. This is not just purely cleanup IMO. >> >> Indeed, that could be at least mentioned in the commit message. Probably I just >> assumed that this is such a minor change that not worth anything. A hundred of >> microseconds is hardly noticeable. >> >> I'm not really sure if this really worth a re-spin at this point. Jon, are you insisting? > > At a minimum the changelog needs to be udpated to reflect what is going > on here. Yes it may not be a massive difference, but I prefer not to > change things without any rationale. Okay, I'll respin this series and probably will just drop the round-up. I'll also append the other two new patches "cycles can't be 0" and "max limit correction" to this series. Daniel, I'll also correct the "Fixes" tag to satisfy the linux-next patch checker.