1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/crypto/intel/qat/qat_common/adf_gen4_timer.h
Damian Muszynski fd77d8da1f crypto: qat - add internal timer for qat 4xxx
The power management feature in QAT 4xxx devices can disable clock
sources used to implement timers. Because of that, the firmware needs to
get an external reliable source of time.

Add a kernel delayed work that periodically sends an event to the
firmware. This is triggered every 200ms. At each execution, the driver
sends a sync request to the firmware reporting the current timestamp
counter value.

This is a pre-requisite for enabling the heartbeat, telemetry and
rate limiting features.

Signed-off-by: Damian Muszynski <damian.muszynski@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2023-07-20 22:16:01 +12:00

21 lines
480 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright(c) 2023 Intel Corporation */
#ifndef ADF_GEN4_TIMER_H_
#define ADF_GEN4_TIMER_H_
#include <linux/ktime.h>
#include <linux/workqueue.h>
struct adf_accel_dev;
struct adf_timer {
struct adf_accel_dev *accel_dev;
struct delayed_work work_ctx;
ktime_t initial_ktime;
};
int adf_gen4_timer_start(struct adf_accel_dev *accel_dev);
void adf_gen4_timer_stop(struct adf_accel_dev *accel_dev);
#endif /* ADF_GEN4_TIMER_H_ */