<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/rust/kernel/time/hrtimer/arc.rs, branch v6.18.21</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>rust: hrtimer: Add HrTimerCallbackContext and ::forward()</title>
<updated>2025-09-04T14:54:39+00:00</updated>
<author>
<name>Lyude Paul</name>
<email>lyude@redhat.com</email>
</author>
<published>2025-08-21T19:32:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=3f2a5ba784b808109cac0aac921213e43143a216'/>
<id>3f2a5ba784b808109cac0aac921213e43143a216</id>
<content type='text'>
With Linux's hrtimer API, there's a number of methods that can only be
called in two situations:

* When we have exclusive access to the hrtimer and it is not currently
  active
* When we're within the context of an hrtimer callback context

This commit handles the second situation and implements hrtimer_forward()
support in the context of a timer callback. We do this by introducing a
HrTimerCallbackContext type which is provided to users during the
RawHrTimerCallback::run() callback, and then add a forward() function to
the type.

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Link: https://lore.kernel.org/r/20250821193259.964504-5-lyude@redhat.com
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With Linux's hrtimer API, there's a number of methods that can only be
called in two situations:

* When we have exclusive access to the hrtimer and it is not currently
  active
* When we're within the context of an hrtimer callback context

This commit handles the second situation and implements hrtimer_forward()
support in the context of a timer callback. We do this by introducing a
HrTimerCallbackContext type which is provided to users during the
RawHrTimerCallback::run() callback, and then add a forward() function to
the type.

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Link: https://lore.kernel.org/r/20250821193259.964504-5-lyude@redhat.com
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: time: Make HasHrTimer generic over HrTimerMode</title>
<updated>2025-06-24T17:52:47+00:00</updated>
<author>
<name>FUJITA Tomonori</name>
<email>fujita.tomonori@gmail.com</email>
</author>
<published>2025-06-10T13:28:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=e0c0ab04f6785abaa71b9b8dc252cb1a2072c225'/>
<id>e0c0ab04f6785abaa71b9b8dc252cb1a2072c225</id>
<content type='text'>
Add a `TimerMode` associated type to the `HasHrTimer` trait to
represent the operational mode of the timer, such as absolute or
relative expiration. This new type must implement the `HrTimerMode`
trait, which defines how expiration values are interpreted.

Update the `start()` method to accept an `expires` parameter of type
`&lt;Self::TimerMode as HrTimerMode&gt;::Expires` instead of the fixed `Ktime`.
This enables different timer modes to provide strongly typed expiration
values, such as `Instant&lt;C&gt;` or `Delta`.

The `impl_has_hr_timer` macro is also extended to allow specifying the
`HrTimerMode`. In the following example, it guarantees that the
`start()` method for `Foo` only accepts `Instant&lt;Monotonic&gt;`. Using a
`Delta` or an `Instant` with a different clock source will result in a
compile-time error:

struct Foo {
    #[pin]
    timer: HrTimer&lt;Self&gt;,
}

impl_has_hr_timer! {
    impl HasHrTimer&lt;Self&gt; for Foo {
        mode : AbsoluteMode&lt;Monotonic&gt;,
        field : self.timer
    }
}

This design eliminates runtime mismatches between expires types and
clock sources, and enables stronger type-level guarantees throughout
hrtimer.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@gmail.com&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Link: https://lore.kernel.org/r/20250610132823.3457263-5-fujita.tomonori@gmail.com
[ changed conversion method names to `as_*` - Andreas ]
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a `TimerMode` associated type to the `HasHrTimer` trait to
represent the operational mode of the timer, such as absolute or
relative expiration. This new type must implement the `HrTimerMode`
trait, which defines how expiration values are interpreted.

Update the `start()` method to accept an `expires` parameter of type
`&lt;Self::TimerMode as HrTimerMode&gt;::Expires` instead of the fixed `Ktime`.
This enables different timer modes to provide strongly typed expiration
values, such as `Instant&lt;C&gt;` or `Delta`.

The `impl_has_hr_timer` macro is also extended to allow specifying the
`HrTimerMode`. In the following example, it guarantees that the
`start()` method for `Foo` only accepts `Instant&lt;Monotonic&gt;`. Using a
`Delta` or an `Instant` with a different clock source will result in a
compile-time error:

struct Foo {
    #[pin]
    timer: HrTimer&lt;Self&gt;,
}

impl_has_hr_timer! {
    impl HasHrTimer&lt;Self&gt; for Foo {
        mode : AbsoluteMode&lt;Monotonic&gt;,
        field : self.timer
    }
}

This design eliminates runtime mismatches between expires types and
clock sources, and enables stronger type-level guarantees throughout
hrtimer.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@gmail.com&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Link: https://lore.kernel.org/r/20250610132823.3457263-5-fujita.tomonori@gmail.com
[ changed conversion method names to `as_*` - Andreas ]
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: hrtimer: Add Ktime temporarily</title>
<updated>2025-04-29T13:31:07+00:00</updated>
<author>
<name>FUJITA Tomonori</name>
<email>fujita.tomonori@gmail.com</email>
</author>
<published>2025-04-23T19:28:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=1116f0c5ff3385658ceb8ae2c5c4cb05bd7836d7'/>
<id>1116f0c5ff3385658ceb8ae2c5c4cb05bd7836d7</id>
<content type='text'>
Add Ktime temporarily until hrtimer is refactored to use Instant and
Delta types.

Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Reviewed-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@gmail.com&gt;
Link: https://lore.kernel.org/r/20250423192857.199712-2-fujita.tomonori@gmail.com
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add Ktime temporarily until hrtimer is refactored to use Instant and
Delta types.

Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Reviewed-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@gmail.com&gt;
Link: https://lore.kernel.org/r/20250423192857.199712-2-fujita.tomonori@gmail.com
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: hrtimer: allow timer restart from timer handler</title>
<updated>2025-03-22T11:08:54+00:00</updated>
<author>
<name>Andreas Hindborg</name>
<email>a.hindborg@kernel.org</email>
</author>
<published>2025-03-09T15:18:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=94e05a66ea3ebed48e7e1a0dee68d40184386d25'/>
<id>94e05a66ea3ebed48e7e1a0dee68d40184386d25</id>
<content type='text'>
Allow timer handlers to report that they want a timer to be restarted after
the timer handler has finished executing.

Acked-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Tamir Duberstein &lt;tamird@gmail.com&gt;
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Link: https://lore.kernel.org/r/20250309-hrtimer-v3-v6-12-rc2-v12-4-73586e2bd5f1@kernel.org
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow timer handlers to report that they want a timer to be restarted after
the timer handler has finished executing.

Acked-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Tamir Duberstein &lt;tamird@gmail.com&gt;
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Link: https://lore.kernel.org/r/20250309-hrtimer-v3-v6-12-rc2-v12-4-73586e2bd5f1@kernel.org
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: hrtimer: implement `HrTimerPointer` for `Arc`</title>
<updated>2025-03-11T20:00:42+00:00</updated>
<author>
<name>Andreas Hindborg</name>
<email>a.hindborg@kernel.org</email>
</author>
<published>2025-03-09T15:18:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=d7bf4786b5250b0e490a937d1f8a16ee3a54adbe'/>
<id>d7bf4786b5250b0e490a937d1f8a16ee3a54adbe</id>
<content type='text'>
Allow the use of intrusive `hrtimer` fields in structs that are managed by
an `Arc` by implementing `HrTimerPointer` and `RawTimerCallbck` for `Arc`.

Acked-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Link: https://lore.kernel.org/r/20250309-hrtimer-v3-v6-12-rc2-v12-3-73586e2bd5f1@kernel.org
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow the use of intrusive `hrtimer` fields in structs that are managed by
an `Arc` by implementing `HrTimerPointer` and `RawTimerCallbck` for `Arc`.

Acked-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Link: https://lore.kernel.org/r/20250309-hrtimer-v3-v6-12-rc2-v12-3-73586e2bd5f1@kernel.org
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
