summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Xu <even.xu@intel.com>2021-06-10 14:21:54 +0800
committerJiri Kosina <jkosina@suse.cz>2021-06-14 15:55:09 +0200
commitaa59d6bb5ec88e30802174f9accc5d2dc50209ad (patch)
tree7bdce764e2652113c8b6de8ab213fd228420fb84
parent4aae88b9a9749f5b1c74f004ed8bd8efbaa96440 (diff)
HID: intel-ish-hid: ipc: Specify that EHL no cache snooping
Specify that EHL doesn't support DMA cache snooping. Acked-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com> Signed-off-by: Even Xu <even.xu@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/intel-ish-hid/ipc/ipc.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-ish-hid/ipc/ipc.c
index 9037816e2bf7..45e0c7b1c9ec 100644
--- a/drivers/hid/intel-ish-hid/ipc/ipc.c
+++ b/drivers/hid/intel-ish-hid/ipc/ipc.c
@@ -889,6 +889,29 @@ static uint32_t ish_ipc_get_header(struct ishtp_device *dev, int length,
return drbl_val;
}
+/**
+ * _dma_no_cache_snooping()
+ *
+ * Check on current platform, DMA supports cache snooping or not.
+ * This callback is used to notify uplayer driver if manully cache
+ * flush is needed when do DMA operation.
+ *
+ * Please pay attention to this callback implementation, if declare
+ * having cache snooping on a cache snooping not supported platform
+ * will cause uplayer driver receiving mismatched data; and if
+ * declare no cache snooping on a cache snooping supported platform
+ * will cause cache be flushed twice and performance hit.
+ *
+ * @dev: ishtp device pointer
+ *
+ * Return: false - has cache snooping capability
+ * true - no cache snooping, need manually cache flush
+ */
+static bool _dma_no_cache_snooping(struct ishtp_device *dev)
+{
+ return dev->pdev->device == EHL_Ax_DEVICE_ID;
+}
+
static const struct ishtp_hw_ops ish_hw_ops = {
.hw_reset = _ish_hw_reset,
.ipc_reset = _ish_ipc_reset,
@@ -897,7 +920,8 @@ static const struct ishtp_hw_ops ish_hw_ops = {
.write = write_ipc_to_queue,
.get_fw_status = _ish_read_fw_sts_reg,
.sync_fw_clock = _ish_sync_fw_clock,
- .ishtp_read_hdr = _ishtp_read_hdr
+ .ishtp_read_hdr = _ishtp_read_hdr,
+ .dma_no_cache_snooping = _dma_no_cache_snooping
};
/**