From patchwork Thu Mar 10 10:57:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kochetkov X-Patchwork-Id: 8555341 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 469669F38C for ; Thu, 10 Mar 2016 10:58:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D59B2034C for ; Thu, 10 Mar 2016 10:58:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 841642034B for ; Thu, 10 Mar 2016 10:58:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1adyIC-0003YL-66; Thu, 10 Mar 2016 10:58:08 +0000 Received: from mail-lb0-x242.google.com ([2a00:1450:4010:c04::242]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1adyI8-00037k-Vs for linux-rockchip@lists.infradead.org; Thu, 10 Mar 2016 10:58:05 +0000 Received: by mail-lb0-x242.google.com with SMTP id bc4so7858030lbc.0 for ; Thu, 10 Mar 2016 02:57:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O3bagnjEsTLBCGz7ZSnoOudeEKhwehnIUD2+ICKQMzg=; b=n0H5NyF2kdTgKiBvqXE4QBLAfaaipRc68mJWJs8MTcRXtgoBo+tdjUkrcTdulOssD+ wQcEYiD/OvfMkvHewqtJmYIKT/AKQ7iSuxbfcKl+iLe9qFQkzT059yHsj9wmn8x1E4Ak sUf0rMg3imIizI0pl23sVlG9bVlWcWIdIU2uWuHUWNrbepMmUZoFFXVig4+AQt1mDEcR 47l2/SunnSoDGJDn4dmyvFlhzCDtID5haLhVUyS+r7vgDZrsQGKHPxJzhLiOOUiSYSs9 IqzOC0lF+3o5dUZQT6fr2gbR27JzBSXg/49c2YjiGzEfqAosUMNASZhhZQzVQw32a0Rp 8sDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=O3bagnjEsTLBCGz7ZSnoOudeEKhwehnIUD2+ICKQMzg=; b=Krtt8J8AnY8uE3m65Z4QxYOg1G5wyqXotbMk1HOwBkakFchX9pqY9oGj42wQvEdUkI Albkv1K5D0IQXTJhXtfkVd7r1e9iRa0e1wG+zexRYFE51d/Wo9UYFQypupFGSrJ7KNo4 WSniAs4zg0uXRyFP0S1eQKmIG82m2jUS7Ye5s3Q9Wp/8YsL2vw8/pSsQSRVsr7LHtKX+ LGcfac8gKbfp+SZycbUU8V1vr83t+3tYmTWFss/fQZ6v3F5zFSioPWStG8LW2lteMbeq BPjxzl2seGFXpkQjZEyd9i/FjkhtfNlMrLc/9sOEnz1wUytJoO6E7qU6OQFJ+FxmZCWF C9/Q== X-Gm-Message-State: AD7BkJI7sPmAjb98hYGsl+qs8rhCaZlCxbwf9i9VsNZrNVsUrC4iVSPoH5iANtIh1uNanw== X-Received: by 10.25.218.1 with SMTP id r1mr732607lfg.63.1457607463189; Thu, 10 Mar 2016 02:57:43 -0800 (PST) Received: from ubuntu.lintech.ru ([185.35.119.87]) by smtp.gmail.com with ESMTPSA id r20sm257305lfd.4.2016.03.10.02.57.41 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Mar 2016 02:57:42 -0800 (PST) From: Alexander Kochetkov To: Vinod Koul , Dan Williams , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3 v2] dmaengine: pl330: don't emit code for one iteration loop Date: Thu, 10 Mar 2016 13:57:35 +0300 Message-Id: <1457607456-30458-2-git-send-email-al.kochet@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1457607456-30458-1-git-send-email-al.kochet@gmail.com> References: <1455798674-10186-1-git-send-email-al.kochet@gmail.com> <1457607456-30458-1-git-send-email-al.kochet@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160310_025805_284646_C0611B14 X-CRM114-Status: GOOD ( 11.22 ) X-Spam-Score: 0.6 (/) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, Alexander Kochetkov , Heiko Stuebner , Doug Anderson , Caesar Wang MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SBL_CSS, RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The patch remove one iteration outer loop in the _loop(). Removing loop saves 4 bytes of MicroCode buffer. DMALP_0 0 ... DMALPENDA_0 bjmpto_9 Signed-off-by: Alexander Kochetkov Reviewed-by: Caesar Wang --- drivers/dma/pl330.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 4abbc71..b080d70 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -1258,7 +1258,7 @@ static inline int _loop(unsigned dry_run, u8 buf[], lpend.bjump = 0; szlpend = _emit_LPEND(1, buf, &lpend); - if (lcnt0) { + if (lcnt0 > 1) { szlp *= 2; szlpend *= 2; } @@ -1274,7 +1274,7 @@ static inline int _loop(unsigned dry_run, u8 buf[], off = 0; - if (lcnt0) { + if (lcnt0 > 1) { off += _emit_LP(dry_run, &buf[off], 0, lcnt0); ljmp0 = off; } @@ -1290,7 +1290,7 @@ static inline int _loop(unsigned dry_run, u8 buf[], lpend.bjump = off - ljmp1; off += _emit_LPEND(dry_run, &buf[off], &lpend); - if (lcnt0) { + if (lcnt0 > 1) { lpend.cond = ALWAYS; lpend.forever = false; lpend.loop = 0; @@ -1299,7 +1299,7 @@ static inline int _loop(unsigned dry_run, u8 buf[], } *bursts = lcnt1 * cyc; - if (lcnt0) + if (lcnt0 > 1) *bursts *= lcnt0; return off;