mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-10 12:52:37 -05:00
qcacld-3.0: Fix crash caused by sdio ramdump allocation
For TF sdio chip with platform driver, ramdump is configured in platform driver. Driver can get the virtual memory, but it can't call ioremap again. If there is a platform driver, ramdump should be allocated in platform driver, and if there is no platform driver, ramdump should be allocated in driver. CRs-Fixed: 2066529 Change-Id: Ia2a32a4895f354e365522a30bbfac949ccb7a391
This commit is contained in:
parent
d2eee305f4
commit
75be2d0a45
2 changed files with 62 additions and 1 deletions
|
|
@ -59,7 +59,6 @@
|
|||
#define AXI_LOCATION 0x000a0000
|
||||
#define AXI_SIZE 0x00018000
|
||||
|
||||
#define TOTAL_DUMP_SIZE 0x00200000
|
||||
#define PCIE_READ_LIMIT 0x00005000
|
||||
|
||||
#define SHA256_DIGEST_SIZE 32
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#endif
|
||||
|
||||
#define PLD_QCA9377_REV1_1_VERSION 0x5020001
|
||||
#define TOTAL_DUMP_SIZE 0x00200000
|
||||
|
||||
#ifndef CONFIG_CNSS
|
||||
#define PLD_AR6004_VERSION_REV1_3 0x31c8088a
|
||||
|
|
@ -120,4 +121,65 @@ static inline void pld_sdio_device_crashed(struct device *dev)
|
|||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PLD_SDIO_CNSS
|
||||
/**
|
||||
* pld_hif_sdio_get_virt_ramdump_mem() - Get virtual ramdump memory
|
||||
* @dev: device
|
||||
* @size: buffer to virtual memory size
|
||||
*
|
||||
* Return: virtual ramdump memory address
|
||||
*/
|
||||
static inline void *pld_hif_sdio_get_virt_ramdump_mem(struct device *dev,
|
||||
unsigned long *size)
|
||||
{
|
||||
return cnss_common_get_virt_ramdump_mem(dev, size);
|
||||
}
|
||||
|
||||
/**
|
||||
* pld_hif_sdio_release_ramdump_mem() - Release virtual ramdump memory
|
||||
* @address: virtual ramdump memory address
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static inline void pld_hif_sdio_release_ramdump_mem(unsigned long *address)
|
||||
{
|
||||
}
|
||||
#else
|
||||
/**
|
||||
* pld_hif_sdio_get_virt_ramdump_mem() - Get virtual ramdump memory
|
||||
* @dev: device
|
||||
* @size: buffer to virtual memory size
|
||||
*
|
||||
* Return: virtual ramdump memory address
|
||||
*/
|
||||
static inline void *pld_hif_sdio_get_virt_ramdump_mem(struct device *dev,
|
||||
unsigned long *size)
|
||||
{
|
||||
size_t length = 0;
|
||||
int flags = GFP_KERNEL;
|
||||
|
||||
length = TOTAL_DUMP_SIZE;
|
||||
|
||||
if (size != NULL)
|
||||
*size = (unsigned long)length;
|
||||
|
||||
if (in_interrupt() || irqs_disabled() || in_atomic())
|
||||
flags = GFP_ATOMIC;
|
||||
|
||||
return kzalloc(length, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* pld_hif_sdio_release_ramdump_mem() - Release virtual ramdump memory
|
||||
* @address: virtual ramdump memory address
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static inline void pld_hif_sdio_release_ramdump_mem(unsigned long *address)
|
||||
{
|
||||
if (address != NULL)
|
||||
kfree(address);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue