static void huc_delayed_load_start(struct intel_huc *huc)
{
- int delay;
+ ktime_t delay;
GEM_BUG_ON(intel_huc_is_authenticated(huc, INTEL_HUC_AUTH_BY_GSC));
*/
switch (huc->delayed_load.status) {
case INTEL_HUC_WAITING_ON_GSC:
- delay = GSC_INIT_TIMEOUT_MS;
+ delay = ms_to_ktime(GSC_INIT_TIMEOUT_MS);
break;
case INTEL_HUC_WAITING_ON_PXP:
- delay = PXP_INIT_TIMEOUT_MS;
+ delay = ms_to_ktime(PXP_INIT_TIMEOUT_MS);
break;
default:
gsc_init_error(huc);
#ifdef __linux__
hrtimer_start(&huc->delayed_load.timer, delay, HRTIMER_MODE_REL);
#else
- timeout_add_msec(&huc->delayed_load.timer, delay);
+ timeout_add_nsec(&huc->delayed_load.timer, ktime_to_ns(delay));
#endif
}
-/* $OpenBSD: ktime.h,v 1.7 2023/01/01 01:34:58 jsg Exp $ */
+/* $OpenBSD: ktime.h,v 1.8 2024/03/28 02:36:38 jsg Exp $ */
/*
* Copyright (c) 2013, 2014, 2015 Mark Kettenis
*
return ns;
}
+static inline ktime_t
+ms_to_ktime(uint64_t ms)
+{
+ return ms * NSEC_PER_MSEC;
+}
+
static inline int64_t
ktime_divns(ktime_t a, int64_t ns)
{