Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754562AbeAGT05 (ORCPT + 1 other); Sun, 7 Jan 2018 14:26:57 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:33018 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754372AbeAGT0z (ORCPT ); Sun, 7 Jan 2018 14:26:55 -0500 Date: Sun, 7 Jan 2018 20:26:33 +0100 From: Ladislav Michl To: Keerthy Cc: daniel.lezcano@linaro.org, tony@atomide.com, aaro.koskinen@iki.fi, thierry.reding@gmail.com, grygorii.strashko@ti.com, linux-omap@vger.kernel.org, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org, sebastian.reichel@collabora.co.uk, linux-kernel@vger.kernel.org, t-kristo@ti.com Subject: Re: [PATCH v6 10/10] clocksource: timer-dm: Check prescaler value Message-ID: <20180107192633.GA19198@lenoch> References: <1514887799-24605-1-git-send-email-j-keerthy@ti.com> <1514887799-24605-11-git-send-email-j-keerthy@ti.com> <20180104224713.GA11557@lenoch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Sun, Jan 07, 2018 at 09:26:44PM +0530, Keerthy wrote: > On 1/5/2018 4:17 AM, Ladislav Michl wrote: > > On Tue, Jan 02, 2018 at 03:39:59PM +0530, Keerthy wrote: > > > From: Ladislav Michl > > > > > > Invalid prescaler value is silently ignored. Fix that > > > by returning -EINVAL in such case. As invalid value > > > disabled use of the prescaler, use -1 explicitely for > > > that purpose. > > > > > > Signed-off-by: Ladislav Michl > > > --- > > > drivers/clocksource/timer-dm.c | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/drivers/clocksource/timer-dm.c b/drivers/clocksource/timer-dm.c > > > index 60db173..01a9cb0 100644 > > > --- a/drivers/clocksource/timer-dm.c > > > +++ b/drivers/clocksource/timer-dm.c > > > @@ -672,6 +672,9 @@ int omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler) > > > if (prescaler >= 0x00 && prescaler <= 0x07) { > > > l |= OMAP_TIMER_CTRL_PRE; > > > l |= prescaler << 2; > > > + } else { > > > + if (prescaler != -1) > > > + return -EINVAL; > > > > Argh... This is actually wrong, as it leaves timer enabled. > > I suggest simply dropping this patch and I'll rethink whole > > approach a bit later (and better). > > Okay. I hope the rest 9 patches work well for you. Yes. I rebased event capture patches on top of this serie (based on linux-next) and will post them during next week for review. Fixed patch will be included (note, it is not really needed for your serie as noone is calling this function). > > > > > } > > > omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); > > > > Sorry for the noise, > > ladis > >