From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933204AbcINUDa (ORCPT ); Wed, 14 Sep 2016 16:03:30 -0400 Received: from bear.ext.ti.com ([198.47.19.11]:44729 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755879AbcINUDY (ORCPT ); Wed, 14 Sep 2016 16:03:24 -0400 Subject: Re: [PATCH 8/9] net: ethernet: ti: cpts: fix overflow check period To: Richard Cochran References: <20160914130231.3035-1-grygorii.strashko@ti.com> <20160914130231.3035-9-grygorii.strashko@ti.com> <20160914142503.GF28592@localhost.localdomain> CC: "David S. Miller" , , Mugunthan V N , Sekhar Nori , , , WingMan Kwok From: Grygorii Strashko Message-ID: Date: Wed, 14 Sep 2016 23:03:18 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160914142503.GF28592@localhost.localdomain> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/14/2016 05:25 PM, Richard Cochran wrote: > On Wed, Sep 14, 2016 at 04:02:30PM +0300, Grygorii Strashko wrote: >> @@ -427,9 +427,6 @@ static void cpts_calc_mult_shift(struct cpts *cpts) >> u64 ns; >> u64 frac; >> >> - if (cpts->cc_mult || cpts->cc.shift) >> - return; >> - >> freq = clk_get_rate(cpts->refclk); >> >> /* Calc the maximum number of seconds which we can run before > > This hunk has nothing to do with $subject. Sry, but I did not get your comment here :( I'd happy to update patch according to your request, but could you provide more info here, pls? > >> @@ -442,11 +439,20 @@ static void cpts_calc_mult_shift(struct cpts *cpts) >> else if (maxsec > 600 && cpts->cc.mask > UINT_MAX) >> maxsec = 600; >> >> + /* Calc overflow check period (maxsec / 2) */ >> + cpts->ov_check_period = (HZ * maxsec) / 2; >> + dev_info(cpts->dev, "cpts: overflow check period %lu\n", >> + cpts->ov_check_period); >> + >> + if (cpts->cc_mult || cpts->cc.shift) >> + return; >> + >> clocks_calc_mult_shift(&mult, &shift, freq, NSEC_PER_SEC, maxsec); >> >> cpts->cc_mult = mult; >> cpts->cc.mult = mult; >> cpts->cc.shift = shift; >> + > > Nor does this. -- regards, -grygorii From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grygorii Strashko Subject: Re: [PATCH 8/9] net: ethernet: ti: cpts: fix overflow check period Date: Wed, 14 Sep 2016 23:03:18 +0300 Message-ID: References: <20160914130231.3035-1-grygorii.strashko@ti.com> <20160914130231.3035-9-grygorii.strashko@ti.com> <20160914142503.GF28592@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20160914142503.GF28592@localhost.localdomain> Sender: netdev-owner@vger.kernel.org To: Richard Cochran Cc: "David S. Miller" , netdev@vger.kernel.org, Mugunthan V N , Sekhar Nori , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, WingMan Kwok List-Id: linux-omap@vger.kernel.org On 09/14/2016 05:25 PM, Richard Cochran wrote: > On Wed, Sep 14, 2016 at 04:02:30PM +0300, Grygorii Strashko wrote: >> @@ -427,9 +427,6 @@ static void cpts_calc_mult_shift(struct cpts *cpts) >> u64 ns; >> u64 frac; >> >> - if (cpts->cc_mult || cpts->cc.shift) >> - return; >> - >> freq = clk_get_rate(cpts->refclk); >> >> /* Calc the maximum number of seconds which we can run before > > This hunk has nothing to do with $subject. Sry, but I did not get your comment here :( I'd happy to update patch according to your request, but could you provide more info here, pls? > >> @@ -442,11 +439,20 @@ static void cpts_calc_mult_shift(struct cpts *cpts) >> else if (maxsec > 600 && cpts->cc.mask > UINT_MAX) >> maxsec = 600; >> >> + /* Calc overflow check period (maxsec / 2) */ >> + cpts->ov_check_period = (HZ * maxsec) / 2; >> + dev_info(cpts->dev, "cpts: overflow check period %lu\n", >> + cpts->ov_check_period); >> + >> + if (cpts->cc_mult || cpts->cc.shift) >> + return; >> + >> clocks_calc_mult_shift(&mult, &shift, freq, NSEC_PER_SEC, maxsec); >> >> cpts->cc_mult = mult; >> cpts->cc.mult = mult; >> cpts->cc.shift = shift; >> + > > Nor does this. -- regards, -grygorii