Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 450ABC32771 for ; Sun, 18 Sep 2022 10:49:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4CD1684601; Sun, 18 Sep 2022 12:49:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1663498194; bh=5XQHC4J3gxEua05lIeeUII+Lw7Zx/IO3oaUixQLXUr4=; h=Date:Subject:From:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=KUJZz+jpv3fZlNc2rB+//mqSpq25o7ewHMfsJpv3otoXqc4098oThi6APGPGU7lj/ KAGpIhc8T6tMwsNb5o/LFD2XoJ1D+7eHhDdEgdRzWVoAolEh0xrwGfavApb7AnRwFk NGQhEgHF8HObiB4yWw41zmCz8Fe2Fsd8yc+SFYwNZqJ5BzJzv4ty/ff3GiZULpomWr KKO8pNoAZdRbJ0G0Dx0piLvgub6IqFnRzPbKC5YKZvOn8eiiYD9eEk/blli+NTXJ5T 11jmwTiqNLyu5hydjkfstqMVPNUrI4MutWF2UZQHhZ7cKVQnDYXXG5FrziLsdZM4OK uSW1iDAl7p5yQ== Received: by phobos.denx.de (Postfix, from userid 109) id 213CE8495A; Sun, 18 Sep 2022 12:49:53 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [80.241.59.204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 24E288456E for ; Sun, 18 Sep 2022 12:49:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4MVl1n1vN1z9sQl; Sun, 18 Sep 2022 12:49:49 +0200 (CEST) Message-ID: Date: Sun, 18 Sep 2022 12:49:48 +0200 MIME-Version: 1.0 Subject: Re: [PATCH v3 1/8] timer: orion-timer: Use timer_conv_64() to fix timer wrap around Content-Language: en-US From: Stefan Roese To: u-boot@lists.denx.de Cc: pali@kernel.org, mibodhi@gmail.com, michael@walle.cc, Stefan Herbrechtsmeier References: <20220915142043.1549061-1-sr@denx.de> <20220915142043.1549061-2-sr@denx.de> In-Reply-To: <20220915142043.1549061-2-sr@denx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 15.09.22 16:20, Stefan Roese wrote: > While testing on some Kirkwood platforms it was noticed that the timer > did not function correctly all the time. The driver did not correctly > handle 32bit timer value wrap arounds. Using the timer_conv_64() > conversion function fixes this issue. > > Fixes: e9e73d78a8fb ("timer: add orion-timer support") > Suggested-by: Stefan Herbrechtsmeier > Signed-off-by: Stefan Roese > Tested-by: Tony Dinh Applied to u-boot-marvell/master Thanks, Stefan > --- > v3: > - Add Fixes tag > > v2: > - New patch > > drivers/timer/orion-timer.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/timer/orion-timer.c b/drivers/timer/orion-timer.c > index fd30e1bf036c..d7d1a1b24462 100644 > --- a/drivers/timer/orion-timer.c > +++ b/drivers/timer/orion-timer.c > @@ -19,7 +19,7 @@ static uint64_t orion_timer_get_count(struct udevice *dev) > { > struct orion_timer_priv *priv = dev_get_priv(dev); > > - return ~readl(priv->base + TIMER0_VAL); > + return timer_conv_64(~readl(priv->base + TIMER0_VAL)); > } > > static int orion_timer_probe(struct udevice *dev) Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de