From: Ovidiu Panait <ovpanait@gmail.com>
To: u-boot@lists.denx.de
Cc: Ovidiu Panait <ovpanait@gmail.com>, Michal Simek <michal.simek@amd.com>
Subject: [PATCH 3/3] timer: xilinx-timer: use timer_conv_64() to fix timer wrap around
Date: Wed, 12 Oct 2022 08:36:56 +0300 [thread overview]
Message-ID: <20221012053656.1492457-3-ovpanait@gmail.com> (raw)
In-Reply-To: <20221012053656.1492457-1-ovpanait@gmail.com>
Current xilinx_timer_get_count() implementation does not take into account
the periodic 32-bit wrap arounds, as it directly returns the 32-bit counter
register value. The roll-overs cause problems in the upper timer layers, as
generic timer code expects an incrementing 64-bit value from get_count() to
work correctly.
Add the missing 64-bit up-conversion to fix random hangs/delays in
__udelay().
Fixes: a36d86720f ("microblaze: Convert axi timer to DM driver")
Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
---
drivers/timer/xilinx-timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/timer/xilinx-timer.c b/drivers/timer/xilinx-timer.c
index 75b4473b63..172fd9f929 100644
--- a/drivers/timer/xilinx-timer.c
+++ b/drivers/timer/xilinx-timer.c
@@ -40,7 +40,7 @@ static u64 xilinx_timer_get_count(struct udevice *dev)
regmap_read(priv->regs, TIMER_COUNTER_OFFSET, &value);
- return value;
+ return timer_conv_64(value);
}
static int xilinx_timer_probe(struct udevice *dev)
--
2.25.1
next prev parent reply other threads:[~2022-10-12 5:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 5:36 [PATCH 1/3] timer-uclass: add timer_get_ops() macro Ovidiu Panait
2022-10-12 5:36 ` [PATCH 2/3] timer-uclass: relocate ops pointers for CONFIG_NEEDS_MANUAL_RELOC Ovidiu Panait
2022-10-12 12:59 ` Simon Glass
2022-10-12 15:21 ` Ovidiu Panait
2022-10-12 5:36 ` Ovidiu Panait [this message]
2022-10-12 8:58 ` [PATCH 3/3] timer: xilinx-timer: use timer_conv_64() to fix timer wrap around Michal Simek
2022-10-25 9:32 ` Michal Simek
2022-10-12 12:59 ` [PATCH 1/3] timer-uclass: add timer_get_ops() macro Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221012053656.1492457-3-ovpanait@gmail.com \
--to=ovpanait@gmail.com \
--cc=michal.simek@amd.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox