From patchwork Thu Mar 10 11:02:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kochetkov X-Patchwork-Id: 8555451 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 3B3C79F46A for ; Thu, 10 Mar 2016 11:03:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51A2F2034E for ; Thu, 10 Mar 2016 11:03:24 +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 987A12024D for ; Thu, 10 Mar 2016 11:03:23 +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 1adyNH-0000WO-8P; Thu, 10 Mar 2016 11:03:23 +0000 Received: from mail-lb0-x243.google.com ([2a00:1450:4010:c04::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1adyND-0008KC-3a for linux-rockchip@lists.infradead.org; Thu, 10 Mar 2016 11:03:19 +0000 Received: by mail-lb0-x243.google.com with SMTP id h2so7910921lbs.2 for ; Thu, 10 Mar 2016 03:03:00 -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=tql7S31x+hxODhiyTPRdZ2vgtW3lWY7cqrPh0hvk6n44LplhIGu3A8PQPMPrnujpCV M61Zy6ADiVx0CNVTUL2HY/Amx5+t4YEqxTmuu5hoBlYeVyPa1HPoyQs9HfFbLBaeetMW QCNWSEe7YIrfDUg6MpVk5TT5Js8+rsXhaDvPs04sP0DGxuhClTEFRKaE/Cy5aH9CsuAn /Ju/1kKN+itXYALuFbn9gleoYZxXHAdcL+Ksrt7nuTxl7G9nXtaTjrTuudPSY8hVyEJe TnX+UD2j0CQPIAFrY1sbo//HWKV7aIiL/mSBkW0TBLbJFLLEB/hPYVxz1We7fSLQ3aqS 9k2Q== 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=Ndkb+p3OYtU7ErUwQsVKZou8N7XJr8ZNGQy6P3uCTy4BaAX0nSyl7P5lmdiBSsJ4u8 LQqnTNvSnraKqQXyacyNVRfOjYRJEANKdULQpbPR2+hjkvw6drXj2idhT7CBvuJS6Xxm 0YCXURFkwIoYVx3eX0l4MYAHMvSHeOj6ZdGJ9nmBD0oMO/FOVQoSwmhXkkBLpPuG6jc/ 5RDlb1Y+FZujMm49Tjg/3BylrC7FvW0r/8STIeW3vL22qDxdXk28zF9yFOMdqG2JgWzk zFspupjM8m+Uycd1DAD5alE4UIFw2DvNwO6dd1O9JaCINjP/9cS60wu/T7RHZhwtF0tU EcKQ== X-Gm-Message-State: AD7BkJKhywQBsg3K4KmPhz/HbGKDPt6IGPK3+jMfOC/4AGYk2RHjtaowugh/WLzQpZjuwg== X-Received: by 10.25.147.209 with SMTP id v200mr988730lfd.154.1457607778929; Thu, 10 Mar 2016 03:02:58 -0800 (PST) Received: from ubuntu.lintech.ru ([185.35.119.87]) by smtp.gmail.com with ESMTPSA id f134sm447919lff.34.2016.03.10.03.02.57 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Mar 2016 03:02:58 -0800 (PST) From: Alexander Kochetkov To: Vinod Koul , Dan Williams , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3 v3] dmaengine: pl330: don't emit code for one iteration loop Date: Thu, 10 Mar 2016 14:02:43 +0300 Message-Id: <1457607764-30495-3-git-send-email-al.kochet@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1457607764-30495-1-git-send-email-al.kochet@gmail.com> References: <1455798674-10186-1-git-send-email-al.kochet@gmail.com> <1457607764-30495-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_030319_355457_C05F0D53 X-CRM114-Status: GOOD ( 12.48 ) 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;