Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mmc: sdhci: allow drivers to pre-allocate bounce buffer

Allow platform drivers to pre-allocate bounce buffer by checking if
host->bounce_buffer is already set before attempting allocation.

This enables platforms with specific DMA constraints (such as 32-bit
DMA on controllers that cannot access high memory) to use their own
reserved memory regions for the bounce buffer.

Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Albert Yang <yangzh0906@thundersoft.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Albert Yang and committed by
Ulf Hansson
ef7eb1a7 d5159623

+7
+7
drivers/mmc/host/sdhci.c
··· 4193 4193 unsigned int bounce_size; 4194 4194 int ret; 4195 4195 4196 + /* Drivers may have already allocated the buffer */ 4197 + if (host->bounce_buffer) { 4198 + bounce_size = host->bounce_buffer_size; 4199 + max_blocks = bounce_size / 512; 4200 + goto out; 4201 + } 4196 4202 /* 4197 4203 * Cap the bounce buffer at 64KB. Using a bigger bounce buffer 4198 4204 * has diminishing returns, this is probably because SD/MMC ··· 4247 4241 4248 4242 host->bounce_buffer_size = bounce_size; 4249 4243 4244 + out: 4250 4245 /* Lie about this since we're bouncing */ 4251 4246 mmc->max_segs = max_blocks; 4252 4247 mmc->max_seg_size = bounce_size;