| Message ID | 20190510192550.17458-1-um@mutluit.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBDJNR5GB6YGRBH5B27TAKGQEAW3J57A@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6AF263F033 for <linux-amarula@patchwork.amarulasolutions.com>; Fri, 10 May 2019 21:27:28 +0200 (CEST) Received: by mail-wr1-f69.google.com with SMTP id q16sf5093474wrr.22 for <linux-amarula@patchwork.amarulasolutions.com>; Fri, 10 May 2019 12:27:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1557516448; cv=pass; d=google.com; s=arc-20160816; b=POiWJ7ikBahdY7EYZ+txOglO6uyhkMdD/eKI69JAhjMcoYfhtNPXWsKMh3p6vKLsQW 1Emnxz7bnwcn3QiFULW6/YA3Tvfjy3g3eX6ED3+BEn+EnW0g8eCJ1zOa7+InAaCpFs62 xYnm6Lugra1EF7FpJ4ZPWldd7juLbM8bEF3Yq37w66zPcZ6IZ49RQkSr4BM0qWMS6HZu DUG8oDtC9044diq7LR09ftI1Vh8oHGWDFrV2qNiK+qy4sJTuV7Gark1LkKctayDgxtP3 Rzq3npFzfkaxf7z6AVP22WyKVfUrRs5vUKH28qx899GnDzg1s7jbmvyP9eMXSWzZ1q6y 4SWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:message-id:date:subject:cc:to:from :mime-version:sender:dkim-signature; bh=OYL3jv/lWdesW3QjHJZZmiEDnh0zPSnSweIyKJ/a4gg=; b=wTWEf5K8Bg1xhIn4qOrF1DUajPH+2kL9mGyORcqXbRthTk1TTe4BM0xwUkTugfVWXd lE1Oe/hASU+ykhOWwy2kcVoqRlFlSAGdur1EPZsggSEas+FDcAcAErFTaz3rki7TvI2A rA9ViCkDttDbxaRB82HJW4ge7Q900F9MDVtzE13HzSCyIDAd5ELaHirhhUis+Xhk1tiG GLkQMqg2ZwVXgDVk8QXkIjdfKkfa/pYUEqwe6qHTMCGK2Cna5bRdTmTHIy6A6Stmxd0L 70fTRDkLWsQczjgl1Rta/kvI9rw5wUD4MHII81st/cMjRqaQ//VflhF5yi4G0fRfthOJ Neeg== ARC-Authentication-Results: i=2; mx.google.com; spf=pass (google.com: domain of um@mutluit.com designates 82.211.8.197 as permitted sender) smtp.mailfrom=um@mutluit.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=sender:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=OYL3jv/lWdesW3QjHJZZmiEDnh0zPSnSweIyKJ/a4gg=; b=DgTeNOCQbWE2gP0rxDz+8z5KmFYcV0PhRqK7LtOnX9gn0zFlFW2Fl9wzU/Xq/roT2+ E6ss7aFOrH8QxPIQSCzKAdQlLT9U8bneocc645ckhrjln4JpPAbnkKMfYRDafiEQMgXw Om46Dt8epUFuGjerDytY7H0fl9XWFlY/atHdg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-unsubscribe; bh=OYL3jv/lWdesW3QjHJZZmiEDnh0zPSnSweIyKJ/a4gg=; b=dxas1PpnRfqsHLcZGnIz3S51OTtGglhmGLZ5kjDA7BlOgGm19Ul2lg1feieF5uHhHa ib6QPx0bETjDt3bT3932oCRHobqXiybd0jk2LKI1xI+R1W7jBTuCsr5YhMmorWKGx/2t FZGmUPuDrg8eYvSFUe+lVgAoWGO8mFbPu0k1ak9H2cVyEASua8+j3/EweXIcpRRTfnBe CHRK1ATSjTwQS9YpQGKcAS0d6mNy2tapF/vQksATWL3s6ayHYj8/CQO/JS49jUy2hDkJ HkxIub0oA2IPjGpaFnnT/Fk8EsGxMsfZ8vrqIKCWJ3FG3m4pueeW9rht3sUc9XKWVCDy 3yZA== Sender: linux-amarula@amarulasolutions.com X-Gm-Message-State: APjAAAWnPPO+8Dd6nnow93o7CqASDs1wauiOmFiigw6IUCO5FbrCEla2 qTYo/8iFcYOK9gaXgRdnStOFpCXN X-Google-Smtp-Source: APXvYqz6ykodQiIMgtdgvXiPgDzQxgYj1jJmx3su2gNXIzqIL7qW7RnA/wNjIT0MblKAa0wUqBOgww== X-Received: by 2002:adf:f68c:: with SMTP id v12mr9248180wrp.40.1557516447917; Fri, 10 May 2019 12:27:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6000:8b:: with SMTP id m11ls1634292wrx.4.gmail; Fri, 10 May 2019 12:27:27 -0700 (PDT) X-Received: by 2002:adf:b446:: with SMTP id v6mr8808114wrd.30.1557516447335; Fri, 10 May 2019 12:27:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557516447; cv=none; d=google.com; s=arc-20160816; b=DlpIUttQLbfgdjiia0CmDhtZMExNI2cHuQq/ExFQcH7mSxRyhXvKazwNIRijp5symv FfkGN4IETszELq97BH2Y1cYvJz2/6cRmHVYVdLX2KUUWLunNKDbI/XeL4t9f8bFvHzZ9 GlidqrWwdAeKNV+2vzTQ6QjFtjNtsFLlnXRGaLndBpqal6Usf26w0EZimnVB/YG0zGsd FbhNk0u5rsz4Ojeia5oAuPXZjcugfs2kW9dJ8eVBXA6jXM7mO/2+jUWtOWslBaGOkEzV +w70F2Tb7nAFZkq75qlXW4ibxbsOJvcrdjnBYzJ9lMCaIC5alG9M9bX7M0rgvMPaAQaB YIlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from; bh=NpKxRtZsmu6BCN2V5y8IyHxVrosWE5xHZFcqOka/r5s=; b=cAdT8p6O/8mpNQaIRw0MAk2Kd13qD2VjqvVpRv6NVG0tsCsWSZNpoVADPQi/97Qz9h gMOdIZRMhET679OI2gbrvDGKrVa4Xb4itngkVCRD24p8Qw2anAkQn3CpxXekpM/l/1L/ 3qiETzmo8ss9Pe+VFvOzGHgQwcGd7QsESavy5LcDBcN9PMq7K0r1zOXA7aOn5psKWmSQ +Wbb6SFUP7X5Z+TVA53E/G64AAGm4yBLsxjpjeC2CublC6WL3AMcB20B9LXnshbzPkrQ 284mSfAw427DcPx4nb27i5VwoUWIy01rk5n68KhIN8w2PfVxzfEhB9rsVv/M9ovzd51y R6+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of um@mutluit.com designates 82.211.8.197 as permitted sender) smtp.mailfrom=um@mutluit.com Received: from mutluit.com (mutluit.com. [82.211.8.197]) by mx.google.com with ESMTP id i18si4708766wrv.193.2019.05.10.12.27.27 for <linux-amarula@amarulasolutions.com>; Fri, 10 May 2019 12:27:27 -0700 (PDT) Received-SPF: pass (google.com: domain of um@mutluit.com designates 82.211.8.197 as permitted sender) client-ip=82.211.8.197; Received: from c22-local.mutluit.com (ip4d1674dc.dynamic.kabel-deutschland.de [77.22.116.220]:31668) by mutluit.com (s2.mutluit.com [82.211.8.197]:25) with ESMTP ([XMail 1.27 ESMTP Server]) id <S16FAC33> for <linux-amarula@amarulasolutions.com> from <um@mutluit.com>; Fri, 10 May 2019 15:27:26 -0400 From: Uenal Mutlu <um@mutluit.com> To: Jens Axboe <axboe@kernel.dk>, Maxime Ripard <maxime.ripard@bootlin.com>, Chen-Yu Tsai <wens@csie.org>, linux-ide@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Uenal Mutlu <um@mutluit.com>, linux-sunxi@googlegroups.com, u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki <jagan@amarulasolutions.com>, Pablo Greco <pgreco@centosproject.org>, Mark Rutland <mark.rutland@arm.com>, Oliver Schinagl <oliver@schinagl.nl>, Linus Walleij <linus.walleij@linaro.org>, Hans de Goede <hdegoede@redhat.com>, FUKAUMI Naoki <naobsd@gmail.com>, Andre Przywara <andre.przywara@arm.com> Subject: [RFC PATCH] drivers: ata: ahci_sunxi: Increased SATA/AHCI DMA TX/RX FIFOs Date: Fri, 10 May 2019 21:25:50 +0200 Message-Id: <20190510192550.17458-1-um@mutluit.com> X-Mailer: git-send-email 2.11.0 X-Original-Sender: um@mutluit.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of um@mutluit.com designates 82.211.8.197 as permitted sender) smtp.mailfrom=um@mutluit.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
[RFC] drivers: ata: ahci_sunxi: Increased SATA/AHCI DMA TX/RX FIFOs
|
|
Commit Message
Uenal Mutlu
May 10, 2019, 7:25 p.m. UTC
Increasing the SATA/AHCI DMA TX/RX FIFOs (P0DMACR.TXTS and .RXTS) from
default 0x0 each to 0x3 each gives a write performance boost of 120MB/s
from lame 36MB/s to 45MB/s previously. Read performance is about 200MB/s
[tested on SSD using dd bs=4K count=512K].
Tested on the Banana Pi R1 (aka Lamobo R1) and Banana Pi M1 SBCs
with Allwinner A20 32bit-SoCs (ARMv7-a / arm-linux-gnueabihf).
These devices are RaspberryPi-like small devices.
RFC: Since more than about 25 similar SBC/SoC models do use the
ahci_sunxi driver, users are encouraged to test it on all the
affected boards and give feedback.
List 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/Category:Devices_with_SATA_port
Signed-off-by: Uenal Mutlu <um@mutluit.com>
---
drivers/ata/ahci_sunxi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi, On Fri, May 10, 2019 at 09:25:50PM +0200, Uenal Mutlu wrote: > Increasing the SATA/AHCI DMA TX/RX FIFOs (P0DMACR.TXTS and .RXTS) from > default 0x0 each to 0x3 each gives a write performance boost of 120MB/s > from lame 36MB/s to 45MB/s previously. Read performance is about 200MB/s > [tested on SSD using dd bs=4K count=512K]. > > Tested on the Banana Pi R1 (aka Lamobo R1) and Banana Pi M1 SBCs > with Allwinner A20 32bit-SoCs (ARMv7-a / arm-linux-gnueabihf). > These devices are RaspberryPi-like small devices. > > RFC: Since more than about 25 similar SBC/SoC models do use the > ahci_sunxi driver, users are encouraged to test it on all the > affected boards and give feedback. > > List 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/Category:Devices_with_SATA_port > > Signed-off-by: Uenal Mutlu <um@mutluit.com> > --- > drivers/ata/ahci_sunxi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c > index 911710643305..257986431c79 100644 > --- a/drivers/ata/ahci_sunxi.c > +++ b/drivers/ata/ahci_sunxi.c > @@ -158,7 +158,7 @@ static void ahci_sunxi_start_engine(struct ata_port *ap) > struct ahci_host_priv *hpriv = ap->host->private_data; > > /* Setup DMA before DMA start */ > - sunxi_clrsetbits(hpriv->mmio + AHCI_P0DMACR, 0x0000ff00, 0x00004400); > + sunxi_clrsetbits(hpriv->mmio + AHCI_P0DMACR, 0x0000ffff, 0x00004433); Having comments / defines here would be great, once fixed: Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Hi Maxime & Others,
what follows is a somewhat lengthy technical story behind this patch;
you can just skip it and jump to the end.
As can be seen in the ahci_sunxi.c, the port used in this patch
is this one (32bit):
#define AHCI_P0DMACR 0x0170
It's a so called "Vendor Specific Port" according to the SATA/AHCI specs by Intel.
The data behind it is actually a struct, consisting of 4 fields,
each 4bits long, plus a 16bits long field that is marked as Reserved
in secondary literature (see below):
struct AHCI_P0DMACR_t
{
unsigned TXTS : 4,
RXTS : 4,
TXABL : 4,
RXABL : 4,
Res1 : 16;
};
This struct is just my creation for my own tests as it's not part of the
driver source. The patch touches only the first 2 fields: TXTS and RXTS.
See this similar product documentation by Texas Instruments for the above struct:
https://www.ti.com/lit/ug/sprugj8c/sprugj8c.pdf
TMS320C674x/OMAP-L1x Processor, Serial ATA (SATA) Controller, User's Guide,
Literature Number: SPRUGJ8C, March 2011,
Page 68, Chapter 4.33 "Port DMA Control Register (P0DMACR)"
The above TI document describes the two fields as follows:
TXTS:
Transmit Transaction Size (TX_TRANSACTION_SIZE). This field defines the DMA
transaction size in
DWORDs for transmit (system bus read, device write) operation. [...]
RXTS:
Receive Transaction Size (RX_TRANSACTION_SIZE). This field defines the Port
DMA transaction size
in DWORDs for receive (system bus write, device read) operation. [...]
So, in my patch the fields TXTS and RXTS are set to 3 each.
Without the patch, these fields seem to have some random content
(I'vee seen 5 and 6, 4 and 4, and 0 and 0 on different devices),
as the previous code doesn't touch these 2 fields (ie. these two fields
are not within the used old mask of 0xff00; cf. ahci_sunxi.c, function
ahci_sunxi_start_engine(...)).
Some background story in my hunt for obtaining product documentation:
I couldn't find any product documentation for the SATA/AHCI
in these SoCs by Allwinner Technology (allwinnertech.com),
unlike with such products from other such companies.
I asked Allwinner, but they just said that the A20 of my SBC
would (allegedly) no more be actual and that the support for it
has ended (but this statement somehow cannot be true as the
A20 SoC is still continued being marketed at their website).
They instead sent me a bunch of really irrelevant PDFs which have
nothing to do with SATA/AHCI.
So, the company Allwinner Technology unfortunately was not cooperative
to provide me information on their SATA/AHCI-implementation in their SoCs :-(
Even the ports used in the actual ahci_sunxi.c in the linux tree are undocumented;
it is even commented with "/* This magic is from the original code */"
and below it many ports are used for which no documentation is available,
or at least I couldn't find any on the Internet. And the initial programmer
in 2014 and prior was Daniel Wang (danielwang@allwinnertech.com),
but email to that address bounces.
So, I was forced to research secondary literature from other vendors
like Texas Instruments (thanks TI !) and Intel, and also studying
very old source codes in the old Linux repositories (as it differs
much from the current version) going back to the year 2014, and had
to do many (blind) experiments until I found this solution.
The above given User's Guide by Texas Instruments (and their such
documents for their newer such products) helped me much to find the solution.
It's of course not really the correct documentation for the Allwinner SoCs,
but still better than nothing.
If I only had the right documentation, then I for sure could try
to further improve that already achieved result by this patch,
as with SATA-II upto 300 MiB/s is possible.
Yes, I'll resend the patch with some appropriate comments.
Uenal Mutlu
Maxime Ripard wrote on 05/12/2019 02:12 PM:
> Hi,
>
> On Fri, May 10, 2019 at 09:25:50PM +0200, Uenal Mutlu wrote:
>> Increasing the SATA/AHCI DMA TX/RX FIFOs (P0DMACR.TXTS and .RXTS) from
>> default 0x0 each to 0x3 each gives a write performance boost of 120MB/s
>> from lame 36MB/s to 45MB/s previously. Read performance is about 200MB/s
>> [tested on SSD using dd bs=4K count=512K].
>>
>> Tested on the Banana Pi R1 (aka Lamobo R1) and Banana Pi M1 SBCs
>> with Allwinner A20 32bit-SoCs (ARMv7-a / arm-linux-gnueabihf).
>> These devices are RaspberryPi-like small devices.
>>
>> RFC: Since more than about 25 similar SBC/SoC models do use the
>> ahci_sunxi driver, users are encouraged to test it on all the
>> affected boards and give feedback.
>>
>> List 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/Category:Devices_with_SATA_port
>>
>> Signed-off-by: Uenal Mutlu <um@mutluit.com>
>> ---
>> drivers/ata/ahci_sunxi.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c
>> index 911710643305..257986431c79 100644
>> --- a/drivers/ata/ahci_sunxi.c
>> +++ b/drivers/ata/ahci_sunxi.c
>> @@ -158,7 +158,7 @@ static void ahci_sunxi_start_engine(struct ata_port *ap)
>> struct ahci_host_priv *hpriv = ap->host->private_data;
>>
>> /* Setup DMA before DMA start */
>> - sunxi_clrsetbits(hpriv->mmio + AHCI_P0DMACR, 0x0000ff00, 0x00004400);
>> + sunxi_clrsetbits(hpriv->mmio + AHCI_P0DMACR, 0x0000ffff, 0x00004433);
>
> Having comments / defines here would be great, once fixed:
> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
>
> Maxime
>
> --
> Maxime Ripard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Hi, On Sun, May 12, 2019 at 06:08:19PM +0200, U.Mutlu wrote: > Hi Maxime & Others, > > what follows is a somewhat lengthy technical story behind this patch; > you can just skip it and jump to the end. > > > As can be seen in the ahci_sunxi.c, the port used in this patch > is this one (32bit): > #define AHCI_P0DMACR 0x0170 > It's a so called "Vendor Specific Port" according to the SATA/AHCI specs by Intel. > The data behind it is actually a struct, consisting of 4 fields, > each 4bits long, plus a 16bits long field that is marked as Reserved > in secondary literature (see below): > > struct AHCI_P0DMACR_t > { > unsigned TXTS : 4, > RXTS : 4, > TXABL : 4, > RXABL : 4, > Res1 : 16; > }; > > This struct is just my creation for my own tests as it's not part of the > driver source. The patch touches only the first 2 fields: TXTS and RXTS. > > See this similar product documentation by Texas Instruments for the above struct: > https://www.ti.com/lit/ug/sprugj8c/sprugj8c.pdf > TMS320C674x/OMAP-L1x Processor, Serial ATA (SATA) Controller, User's Guide, > Literature Number: SPRUGJ8C, March 2011, > Page 68, Chapter 4.33 "Port DMA Control Register (P0DMACR)" > > The above TI document describes the two fields as follows: > > TXTS: > Transmit Transaction Size (TX_TRANSACTION_SIZE). This field defines the > DMA transaction size in > DWORDs for transmit (system bus read, device write) operation. [...] > > RXTS: > Receive Transaction Size (RX_TRANSACTION_SIZE). This field defines the > Port DMA transaction size > in DWORDs for receive (system bus write, device read) operation. [...] > > > So, in my patch the fields TXTS and RXTS are set to 3 each. > Without the patch, these fields seem to have some random content > (I'vee seen 5 and 6, 4 and 4, and 0 and 0 on different devices), > as the previous code doesn't touch these 2 fields (ie. these two fields > are not within the used old mask of 0xff00; cf. ahci_sunxi.c, function > ahci_sunxi_start_engine(...)). > > > Some background story in my hunt for obtaining product documentation: > > I couldn't find any product documentation for the SATA/AHCI > in these SoCs by Allwinner Technology (allwinnertech.com), > unlike with such products from other such companies. > > I asked Allwinner, but they just said that the A20 of my SBC > would (allegedly) no more be actual and that the support for it > has ended (but this statement somehow cannot be true as the > A20 SoC is still continued being marketed at their website). > They instead sent me a bunch of really irrelevant PDFs which have > nothing to do with SATA/AHCI. > > So, the company Allwinner Technology unfortunately was not cooperative > to provide me information on their SATA/AHCI-implementation in their SoCs :-( > Even the ports used in the actual ahci_sunxi.c in the linux tree are undocumented; > it is even commented with "/* This magic is from the original code */" > and below it many ports are used for which no documentation is available, > or at least I couldn't find any on the Internet. And the initial programmer > in 2014 and prior was Daniel Wang (danielwang@allwinnertech.com), > but email to that address bounces. > > So, I was forced to research secondary literature from other vendors > like Texas Instruments (thanks TI !) and Intel, and also studying > very old source codes in the old Linux repositories (as it differs > much from the current version) going back to the year 2014, and had > to do many (blind) experiments until I found this solution. > > The above given User's Guide by Texas Instruments (and their such > documents for their newer such products) helped me much to find the solution. > It's of course not really the correct documentation for the Allwinner SoCs, > but still better than nothing. > > If I only had the right documentation, then I for sure could try > to further improve that already achieved result by this patch, > as with SATA-II upto 300 MiB/s is possible. > > > Yes, I'll resend the patch with some appropriate comments. That's awesome research and explanation, thanks! :) Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c index 911710643305..257986431c79 100644 --- a/drivers/ata/ahci_sunxi.c +++ b/drivers/ata/ahci_sunxi.c @@ -158,7 +158,7 @@ static void ahci_sunxi_start_engine(struct ata_port *ap) struct ahci_host_priv *hpriv = ap->host->private_data; /* Setup DMA before DMA start */ - sunxi_clrsetbits(hpriv->mmio + AHCI_P0DMACR, 0x0000ff00, 0x00004400); + sunxi_clrsetbits(hpriv->mmio + AHCI_P0DMACR, 0x0000ffff, 0x00004433); /* Start DMA */ sunxi_setbits(port_mmio + PORT_CMD, PORT_CMD_START);