Skip to content

Commit af92b67

Browse files
Dorinda Basseyslp
authored andcommitted
libkrunfw: Fix virtio-rtc compatibility for kernel 6.12
Add compatibility patch to backport virtio-rtc driver to kernel 6.12. Fix API differences: - Replace secs_to_jiffies(60) with msecs_to_jiffies(60 * 1000) (secs_to_jiffies was introduced after 6.12) - Replace devm_device_init_wakeup(dev) with device_init_wakeup(dev, true) (devm_device_init_wakeup was introduced after 6.12) Both changes provide equivalent functionality and allow the driver to build cleanly on kernel 6.12.76. Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
1 parent bfed4d9 commit af92b67

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From: Dorinda Bassey <dbassey@redhat.com>
2+
Date: Tue, 29 Apr 2026 11:35:00 +0200
3+
Subject: [PATCH] virtio_rtc: Fix compatibility for kernel 6.12
4+
5+
Backport virtio_rtc driver to kernel 6.12 by fixing API differences:
6+
7+
1. secs_to_jiffies() doesn't exist in 6.12, use msecs_to_jiffies()
8+
2. devm_device_init_wakeup() doesn't exist in 6.12, use device_init_wakeup()
9+
10+
These functions were introduced in later kernels. The replacements
11+
provide equivalent functionality.
12+
13+
Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
14+
---
15+
drivers/virtio/virtio_rtc_driver.c | 4 ++--
16+
1 file changed, 2 insertions(+), 2 deletions(-)
17+
18+
diff --git a/drivers/virtio/virtio_rtc_driver.c b/drivers/virtio/virtio_rtc_driver.c
19+
index bc303c39d568..e7a9c4f6b2e5 100644
20+
--- a/drivers/virtio/virtio_rtc_driver.c
21+
+++ b/drivers/virtio/virtio_rtc_driver.c
22+
@@ -575,7 +575,7 @@ int viortc_cross_cap(struct viortc_dev *viortc, u16 vio_clk_id, u8 hw_counter,
23+
*/
24+
25+
/** timeout for clock readings, where timeouts are considered non-fatal */
26+
-#define VIORTC_MSG_READ_TIMEOUT secs_to_jiffies(60)
27+
+#define VIORTC_MSG_READ_TIMEOUT msecs_to_jiffies(60 * 1000)
28+
29+
/**
30+
* viortc_read() - VIRTIO_RTC_REQ_READ wrapper
31+
@@ -961,7 +961,7 @@ static int viortc_class_try_init(struct viortc_dev *viortc, bool have_alarm)
32+
viortc->viortc_class = viortc_class;
33+
34+
if (have_alarm)
35+
- devm_device_init_wakeup(dev);
36+
+ device_init_wakeup(dev, true);
37+
38+
return viortc_class_register(viortc_class) ?: 1;
39+
}
40+
--
41+
2.43.0

0 commit comments

Comments
 (0)