Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
omap_hsmmc: Reduce max_segs for reliability
Reduce max_segs to 64, a value that allows allocation of an entire
EDMA descriptor list within a single page - EDMA descriptors
are 40 bytes and the header is much larger. This avoids doing a
higher order GFP_ATOMIC allocation in edma_prep_slave_sg
when setting up a transfer which can potentially fail due to
fragmentation under heavy I/O load.

The current value of 1024 is unusually high in comparison to
other mmc host drivers which mostly use values of between 1
and 256. The EDMA driver at present splits lists above 20
segments in any case so reducing the size of lists we pass to
it shouldn't add much overhead.

rcn-ee: add use_adma option: https://www.spinics.net/lists/linux-omap/msg137942.html

Signed-off-by: Will Newton <willn@resin.io>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
  • Loading branch information
willnewton authored and RobertCNelson committed Nov 6, 2017
1 parent ac973e3 commit de8372e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/mmc/host/omap_hsmmc.c
Expand Up @@ -2979,9 +2979,12 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
host->use_adma = true;
}

/* Since we do only SG emulation, we can have as many segs
* as we want. */
mmc->max_segs = 1024;
/* Set this to a value that allows allocating an entire descriptor
* list within a page (zero order allocation). */
if (host->use_adma)
mmc->max_segs = 512;
else
mmc->max_segs = 64;

mmc->max_blk_size = 512; /* Block Length at max can be 1024 */
mmc->max_blk_count = 0xFFFF; /* No. of Blocks is 16 bits */
Expand Down

0 comments on commit de8372e

Please sign in to comment.