spi: spi_qsd: Set DMA mask for SPI device
Set the DMA mask for the SPI device appropriately. This will alleviate usage of bounce buffers by the dma kernel library and prevent some of the crashes due to the kernel running out of bounce buffers. Change-Id: I7b0b123be6e7bb1e30d0755ca8b1b72ea4e2b5f6 Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
This commit is contained in:
parent
efaccb4adb
commit
f61d2a9a02
2 changed files with 9 additions and 1 deletions
|
@ -2535,6 +2535,7 @@ static int msm_spi_probe(struct platform_device *pdev)
|
|||
dd->use_dma = 1;
|
||||
}
|
||||
|
||||
spi_dma_mask(&pdev->dev);
|
||||
skip_dma_resources:
|
||||
|
||||
spin_lock_init(&dd->queue_lock);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -167,6 +167,13 @@ enum msm_spi_state {
|
|||
/* Data Mover commands should be aligned to 64 bit(8 bytes) */
|
||||
#define DM_BYTE_ALIGN 8
|
||||
|
||||
#if defined(CONFIG_ARM64) || defined(CONFIG_LPAE)
|
||||
#define spi_dma_mask(dev) (dma_set_mask((dev), DMA_BIT_MASK(36)))
|
||||
#else
|
||||
#define spi_dma_mask(dev) (dma_set_mask((dev), DMA_BIT_MASK(32)))
|
||||
#endif
|
||||
|
||||
|
||||
enum msm_spi_qup_version {
|
||||
SPI_QUP_VERSION_NONE = 0x0,
|
||||
SPI_QUP_VERSION_BFAM = 0x2,
|
||||
|
|
Loading…
Add table
Reference in a new issue