drivers: ata: ahci_sunxi: Increased SATA/AHCI DMA TX/RX FIFOs for-5.3/libata for-5.3/libata-20190708
authorUenal Mutlu <um@mutluit.com>
Mon, 13 May 2019 14:24:10 +0000 (16:24 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 5 Jul 2019 16:17:18 +0000 (10:17 -0600)
commit120357ea176e420d313cf8cf2ff35fbe233d3bab
tree070548efa3eef6a71d91eff1f26c9b3f16815b31
parent8756a25b07e6fe878c1a3a40e71a322b18ba57af
drivers: ata: ahci_sunxi: Increased SATA/AHCI DMA TX/RX FIFOs

Increasing the SATA/AHCI DMA TX/RX FIFOs (P0DMACR.TXTS and .RXTS, ie.
TX_TRANSACTION_SIZE and RX_TRANSACTION_SIZE) from default 0x0 each
to 0x3 each, gives a write performance boost of 120 MiB/s to 132 MiB/s
from lame 36 MiB/s to 45 MiB/s previously.
Read performance is above 200 MiB/s.
[tested on SSD using dd bs=4K/8K/12K/16K/20K/24K/32K: peak-perf at 12K]

Tested on the SBCs Banana Pi R1 (aka Lamobo R1) and Banana Pi M1 which
are based on the Allwinner A20 32bit-SoC (ARMv7-a / arm-linux-gnueabihf).
These devices are RaspberryPi-like small devices.

This problem of slow SATA write-speed with these small devices lasts
for about 7 years now (beginning with the A10 SoC). Many commentators
throughout the years wrongly assumed the slow write speed was a
hardware limitation. This patch finally solves the problem, which
in fact was just a hard-to-find software problem due to lack of
SATA/AHCI documentation by the SoC-maker Allwinner Technology.

Lists of the affected sunxi and other boards and SoCs with SATA using
the ahci_sunxi driver:
  $ grep -i -e "^&ahci" arch/arm/boot/dts/sun*dts
  and http://linux-sunxi.org/SATA#Devices_with_SATA_ports
  See also http://linux-sunxi.org/Category:Devices_with_SATA_port

Tested-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Uenal Mutlu <um@mutluit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/ata/ahci_sunxi.c