mmc: alcor: work with multiple-entry sglists
authorDaniel Drake <drake@endlessm.com>
Mon, 29 Apr 2019 05:14:26 +0000 (13:14 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 6 May 2019 09:55:39 +0000 (11:55 +0200)
commitc671b6dede27f8a73b0f3554630ba0ed436f357d
tree48a138ca818ecd34460f82402b0c29ec6ea5d77a
parentf19337d55fac5db6d703905077c5e251c87c37d3
mmc: alcor: work with multiple-entry sglists

DMA on this hardware is limited to dealing with a 4096 bytes at a
time. Previously, the driver was set up accordingly to request single-page
DMA buffers, however that had the effect of generating a large number
of small MMC requests for data I/O.

Improve the driver to accept multi-entry scatter-gather lists. The size of
each entry is already capped to 4096 bytes (AU6601_MAX_DMA_BLOCK_SIZE),
matching the hardware requirements. Existing driver code already iterates
through remaining sglist entries after each DMA transfer is complete.

Also add some comments to help clarify the situation, and clear up
some of the confusion I had regarding DMA vs PIO.

Testing with dd, this increases write performance from 2mb/sec to
10mb/sec, and increases read performance from 4mb/sec to 14mb/sec.

Signed-off-by: Daniel Drake <drake@endlessm.com>
Link: http://lkml.kernel.org/r/CAD8Lp47JYdZzbV9F+asNwvSfLF_po_J7ir6R_Vb-Dab21_=Krw@mail.gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/alcor.c
include/linux/alcor_pci.h