From patchwork Mon Jul 16 20:56:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 944589 X-Patchwork-Delegate: openwrt@kresin.me Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="e55b7ioS"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="j6kznG96"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41TwhR4l3Pz9s0n for ; Tue, 17 Jul 2018 06:57:11 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=I64bTv+9yr/k6C8ksp0dBSAgfZL6gnomr76ZsTIpzOU=; b=e55b7ioSpY0prYEiLsspFo0PeF UNwo6DgSgcMABdmh5b8aOM0MAV/R61lxonf1uZA2cnFhzmlQYNHmqjrAaIIUxWtyhZN35qzEC+bTR fehjjFdnzwKeIKzERhR7t8vQwuDxFTffVg9iEgbVar/KqtQ/XC9hLL7cjuMKP9TtDnduRukuhuRgl PConSWYmgpZg+psQJyal7xvFtoom/kTQUlnT1bO2udwM4tsWL8ye2mUzNKxvdVV6Q85qBtkw0OGsy HGfCPksapOrguRSPiB+XcJJ1wgas8H3UBOQzI40SD/DZ0X4FtVlTGts+gGP+rnQebFs2RN60sKac9 KfiweKOQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffAYF-0006Ou-W1; Mon, 16 Jul 2018 20:56:59 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffAYC-0006Lk-5A for openwrt-devel@lists.openwrt.org; Mon, 16 Jul 2018 20:56:57 +0000 Received: by mail-wr1-x442.google.com with SMTP id b15-v6so33278623wrv.10 for ; Mon, 16 Jul 2018 13:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=0KECX0TIlh+kDxWg2wJaCq0A3GdWdbhbNMqFMx6S6zI=; b=j6kznG962TwMWemMXM04g760pbL/YYaBuG0vg3muF+uLIT0ajzUGytL41MQyR/Jlte f3lsTKCVakT1dL0c+vzsxx7bXSe3pkvhcOGF+Zs6B+/Dy2u7ezU/iNqLC57893jbHCTJ V7qRcp6/MndmlgaOHU1wm95tvMABM5XZ3oWiFOhG3jo4p6SJSCvgOBzoIKcV+qC/NUmK mVowSlrSc0WcYrTeTXc13oYwqZ9jM2E5yFeWPikjCDOvtJ8qsZmokiXWlDebuARoAYwV 9lbWQfClxf46EcNfm2bvqpmsjqnDj0Txyb6CSafmPJJ/KTCC9JrNY6J4UwNBWdt9bl/v W17g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=0KECX0TIlh+kDxWg2wJaCq0A3GdWdbhbNMqFMx6S6zI=; b=KnpBEk8uZmNWIK38o8X8FwKkc4wGpvzC6HYxTNQKeHfksKX79rf0FxvK5kJU6R361f b6J3UwGS65HdeZQ+9qINEUS76b5VeSsxhOzvDkgjcZcJY5OnUDpMycv7UYvx23CBgZqK CvqS3icCo8AFOo9z7AlAjnlxaPB0J3IodTqU7SqklWzoVWpqXeZat3YahJKrAxNcljEE w61zo0A0OJ9JtvpwDb/Jmhst3ReG3CtpdzV7i9lfZf6vojN7je8hE6GePoFLjUs+mpt6 FVI3qh9n6hmM4c2wOVmDrwMk+gzaxLN8AHYmI1ihMiUKjwtLfGKy0NapkBtLG4COiPRb Ubrg== X-Gm-Message-State: AOUpUlHGgtDvpeLm5PjWMe5eX+EQmURwovMwvWHH5U78p2r8uGiAvE99 cxJyzklXQAjKIId2nABUrTENLMMj X-Google-Smtp-Source: AAOMgpc2JqOv9p/Av9Yy6lAWhK6fTKvy0Wo7QeTtOHnaOg4cb0O2Vaq4RqGEWKqxLeVN6aepC/8MYQ== X-Received: by 2002:adf:81a3:: with SMTP id 32-v6mr14197480wra.9.1531774603838; Mon, 16 Jul 2018 13:56:43 -0700 (PDT) Received: from debian64.daheim (p200300D5FBC2DEFC0000000000000C3C.dip0.t-ipconnect.de. [2003:d5:fbc2:defc::c3c]) by smtp.gmail.com with ESMTPSA id u185-v6sm7741514wmg.25.2018.07.16.13.56.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Jul 2018 13:56:42 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.91) (envelope-from ) id 1ffAXs-0005fG-Vu for openwrt-devel@lists.openwrt.org; Mon, 16 Jul 2018 22:56:36 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Date: Mon, 16 Jul 2018 22:56:35 +0200 Message-Id: <20180716205636.21726-2-chunkeey@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716205636.21726-1-chunkeey@gmail.com> References: <20180716205636.21726-1-chunkeey@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180716_135656_194580_AD27BDB9 X-CRM114-Status: GOOD ( 13.11 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH][for lede-17.01] apm821xx: fix sata access freezes X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The original vendor's driver programmed the dma controller's AHB HPROT values to enable bufferable, privileged mode. This along with the "same priorty for both channels" fixes the freezes according to @takimata, @And.short, that have been reported on the forum by @ticerex. Furtheremore, @takimata reported that the patch also improved the performance of the HDDs considerably: | |It seems your patch unleashed the full power of the SATA port. |Where I was previously hitting a really hard limit at around |82 MB/s for reading and 27 MB/s for writing, I am now getting this: | |root@OpenWrt:/mnt# time dd if=/dev/zero of=tempfile bs=1M count=1024 |1024+0 records in |1024+0 records out |real 0m 13.65s |user 0m 0.01s |sys 0m 11.89s | |root@OpenWrt:/mnt# time dd if=tempfile of=/dev/null bs=1M count=1024 |1024+0 records in |1024+0 records out |real 0m 8.41s |user 0m 0.01s |sys 0m 4.70s | |This means: 121 MB/s reading and 75 MB/s writing! | |[...] | |The drive is a WD Green WD10EARX taken from an older MBL Single. |I repeated the test a few times with even larger files to rule out |any caching, I'm still seeing the same great performance. OpenWrt is |now completely on par with the original MBL firmware's performance. Signed-off-by: Christian Lamparter --- Same patch content as commit "apm821xx: attempt to fix sata access freezes". c3f9a1ac0e7ae536552e2745582dc47098cefc07 in master. But with a better commit log. --- ...-dw-dma-hprot-fix-and-equal-priortiy.patch | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 target/linux/apm821xx/patches-4.4/302-dw-dma-hprot-fix-and-equal-priortiy.patch diff --git a/target/linux/apm821xx/patches-4.4/302-dw-dma-hprot-fix-and-equal-priortiy.patch b/target/linux/apm821xx/patches-4.4/302-dw-dma-hprot-fix-and-equal-priortiy.patch new file mode 100644 index 0000000000..1e76813225 --- /dev/null +++ b/target/linux/apm821xx/patches-4.4/302-dw-dma-hprot-fix-and-equal-priortiy.patch @@ -0,0 +1,25 @@ +--- a/drivers/dma/dw/core.c ++++ b/drivers/dma/dw/core.c +@@ -150,6 +150,8 @@ static void dwc_initialize(struct dw_dma + cfghi |= DWC_CFGH_DST_PER(dwc->dst_id); + cfghi |= DWC_CFGH_SRC_PER(dwc->src_id); + ++ cfghi |= DWC_CFGH_PROTCTL(3); /* bufferable + privileged access */ ++ + channel_writel(dwc, CFG_LO, cfglo); + channel_writel(dwc, CFG_HI, cfghi); + +@@ -1539,11 +1541,8 @@ int dw_dma_probe(struct dw_dma_chip *chi + else + list_add(&dwc->chan.device_node, &dw->dma.channels); + +- /* 7 is highest priority & 0 is lowest. */ +- if (pdata->chan_priority == CHAN_PRIORITY_ASCENDING) +- dwc->priority = pdata->nr_channels - i - 1; +- else +- dwc->priority = i; ++ /* set all channels to the same priority */ ++ dwc->priority = pdata->nr_channels - 1; + + dwc->ch_regs = &__dw_regs(dw)->CHAN[i]; + spin_lock_init(&dwc->lock);