Files
kernel_google_redbull/include/linux/dma-mapping-fast.h
lucaswei 60f98a6728 GKI: dma-mapping-fast: fix CRC issues related to the AU merge
Commit ad5f02c192 ("dma-mapping-fast: reduce TLBI during map")
introduced an ABI change. It is suppose to provide increased map
performance of fastmap clients. To address the CRC issues, we use
GENKSYMS to mask the ABI differences.

Bug: 172988823
Bug: 176525217
Change-Id: Ifbacb54af02d4c2af85a743b7e7b58ca37fbe280
Signed-off-by: Will McVicker <willmcvicker@google.com>
2021-03-17 10:55:06 +08:00

59 lines
1.3 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
*/
#ifndef __LINUX_DMA_MAPPING_FAST_H
#define __LINUX_DMA_MAPPING_FAST_H
#include <linux/iommu.h>
#include <linux/io-pgtable-fast.h>
struct dma_iommu_mapping;
struct io_pgtable_ops;
struct iova_domain;
struct dma_fast_smmu_mapping {
struct device *dev;
struct iommu_domain *domain;
struct iova_domain *iovad;
dma_addr_t base;
size_t size;
size_t num_4k_pages;
unsigned int bitmap_size;
/* bitmap has 1s marked only valid mappings */
unsigned long *bitmap;
unsigned long next_start;
#ifndef __GENKSYMS__
/* clean_bitmap has 1s marked for both valid and stale tlb mappings */
unsigned long *clean_bitmap;
#else
unsigned long upcoming_stale_bit;
#endif
bool have_stale_tlbs;
dma_addr_t pgtbl_dma_handle;
struct io_pgtable_ops *pgtbl_ops;
spinlock_t lock;
struct notifier_block notifier;
};
#ifdef CONFIG_IOMMU_IO_PGTABLE_FAST
int fast_smmu_init_mapping(struct device *dev,
struct dma_iommu_mapping *mapping);
void fast_smmu_put_dma_cookie(struct iommu_domain *domain);
#else
static inline int fast_smmu_init_mapping(struct device *dev,
struct dma_iommu_mapping *mapping)
{
return -ENODEV;
}
static inline void fast_smmu_put_dma_cookie(struct iommu_domain *domain) {}
#endif
#endif /* __LINUX_DMA_MAPPING_FAST_H */