qcacmn: Do IPA version based DMA coherent mask setting

In case of IPA hw version less than 3.0, only 32 bit DMA
address can be handled as it is only 32 bit compliant.
Because of this, setting DMA coherent mask of 37 when
IPA hw version is less than 3.0, crash is happening.

Do IPA version based DMA coherent mask setting such that
when IPA hw version is less than 3.0, set DMA coherent mask
as 32 only.

Change-Id: I8dec7da47766985ab0590f885b29f345f153cd08
CRs-Fixed: 1114605
This commit is contained in:
Himanshu Agarwal
2017-01-23 18:09:44 +05:30
کامیت شده توسط qcabuildsw
والد 4bd194660d
کامیت 846cf37306
4فایلهای تغییر یافته به همراه98 افزوده شده و 8 حذف شده

مشاهده پرونده

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -520,4 +520,19 @@ unsigned long qdf_rounddown_pow_of_two(unsigned long n)
return __qdf_rounddown_pow_of_two(n);
}
/**
* qdf_set_dma_coherent_mask() - set max number of bits allowed in dma addr
* @dev: device pointer
* @addr_bits: max number of bits allowed in dma address
*
* This API sets the maximum allowed number of bits in the dma address.
*
* Return: 0 - success, non zero - failure
*/
static inline
int qdf_set_dma_coherent_mask(struct device *dev, uint8_t addr_bits)
{
return __qdf_set_dma_coherent_mask(dev, addr_bits);
}
#endif /*_QDF_UTIL_H*/

مشاهده پرونده

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -363,4 +363,39 @@ unsigned long __qdf_rounddown_pow_of_two(unsigned long n)
return __rounddown_pow_of_two(n);
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)
/**
* __qdf_set_dma_coherent_mask() - set max number of bits allowed in dma addr
* @dev: device pointer
* @addr_bits: max number of bits allowed in dma address
*
* This API sets the maximum allowed number of bits in the dma address.
*
* Return: 0 - success, non zero - failure
*/
static inline
int __qdf_set_dma_coherent_mask(struct device *dev, uint8_t addr_bits)
{
return dma_set_mask_and_coherent(dev, DMA_BIT_MASK(addr_bits));
}
#else
/**
* __qdf_set_dma_coherent_mask() - set max number of bits allowed in dma addr
* @dev: device pointer
* @addr_bits: max number of bits allowed in dma address
*
* This API sets the maximum allowed number of bits in the dma address.
*
* Return: 0 - success, non zero - failure
*/
static inline
int __qdf_set_dma_coherent_mask(struct device *dev, uint8_t addr_bits)
{
return dma_set_coherent_mask(dev, DMA_BIT_MASK(addr_bits));
}
#endif
#endif /*_I_QDF_UTIL_H*/