@@ -889,6 +889,29 @@ static uint32_t ish_ipc_get_header(struct ishtp_device *dev, int length,
889889 return drbl_val ;
890890}
891891
892+ /**
893+ * _dma_no_cache_snooping()
894+ *
895+ * Check on current platform, DMA supports cache snooping or not.
896+ * This callback is used to notify uplayer driver if manully cache
897+ * flush is needed when do DMA operation.
898+ *
899+ * Please pay attention to this callback implementation, if declare
900+ * having cache snooping on a cache snooping not supported platform
901+ * will cause uplayer driver receiving mismatched data; and if
902+ * declare no cache snooping on a cache snooping supported platform
903+ * will cause cache be flushed twice and performance hit.
904+ *
905+ * @dev: ishtp device pointer
906+ *
907+ * Return: false - has cache snooping capability
908+ * true - no cache snooping, need manually cache flush
909+ */
910+ static bool _dma_no_cache_snooping (struct ishtp_device * dev )
911+ {
912+ return dev -> pdev -> device == EHL_Ax_DEVICE_ID ;
913+ }
914+
892915static const struct ishtp_hw_ops ish_hw_ops = {
893916 .hw_reset = _ish_hw_reset ,
894917 .ipc_reset = _ish_ipc_reset ,
@@ -897,7 +920,8 @@ static const struct ishtp_hw_ops ish_hw_ops = {
897920 .write = write_ipc_to_queue ,
898921 .get_fw_status = _ish_read_fw_sts_reg ,
899922 .sync_fw_clock = _ish_sync_fw_clock ,
900- .ishtp_read_hdr = _ishtp_read_hdr
923+ .ishtp_read_hdr = _ishtp_read_hdr ,
924+ .dma_no_cache_snooping = _dma_no_cache_snooping
901925};
902926
903927/**
0 commit comments