[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/3] xen/riscv: implement udelay()
- To: Anandu Padinhare <Anandu.Padinhare@xxxxxxxxxxxxxx>
- From: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
- Date: Fri, 04 Dec 2026 11:39:53 +0100
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Feedback-ID"
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Alistair Francis <alistair.francis@xxxxxxx>, Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, andrew.cooper3@xxxxxxxxxx, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, roger@xxxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>
- Delivery-date: Fri, 04 Dec 2026 10:40:09 +0000
- Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Fri, 04 Dec 2026 03:03:13 +0000, Anandu Padinhare
<Anandu.Padinhare@xxxxxxxxxxxxxx> wrote:
> udelay() is still a stub that hits BUG_ON(), so mdelay() can't be used
> on RISC-V, for example to honour the delay in machine_restart().
>
> Implement udelay() by busy-waiting on the time CSR, as Linux's RISC-V
> __delay() does. Convert the delay to timer ticks once, multiplying
> before dividing and rounding up so that short delays aren't cut to zero
> ticks, then spin until that many ticks have passed.
>
> [...]
Reviewed-by: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
--
Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
|