From: Alexander Kochetkov <al.kochet@gmail.com> To: Vinod Koul <vinod.koul@intel.com>, Dan Williams <dan.j.williams@intel.com>, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Caesar Wang <wxt@rock-chips.com>, Doug Anderson <dianders@chromium.org>, linux-rockchip@lists.infradead.org, Heiko Stuebner <heiko@sntech.de>, Alexander Kochetkov <al.kochet@gmail.com> Subject: [PATCH 2/3 v3] dmaengine: pl330: don't emit code for one iteration loop Date: Thu, 10 Mar 2016 14:02:43 +0300 [thread overview] Message-ID: <1457607764-30495-3-git-send-email-al.kochet@gmail.com> (raw) In-Reply-To: <1457607764-30495-1-git-send-email-al.kochet@gmail.com> 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 <al.kochet@gmail.com> Reviewed-by: Caesar Wang <wxt@rock-chips.com> --- 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; -- 1.7.9.5
WARNING: multiple messages have this Message-ID (diff)
From: Alexander Kochetkov <al.kochet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>, Dan Williams <dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>, dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Alexander Kochetkov <al.kochet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>, Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>, Caesar Wang <wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.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 [thread overview] Message-ID: <1457607764-30495-3-git-send-email-al.kochet@gmail.com> (raw) In-Reply-To: <1457607764-30495-1-git-send-email-al.kochet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <al.kochet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Reviewed-by: Caesar Wang <wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org> --- 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; -- 1.7.9.5
next prev parent reply other threads:[~2016-03-10 11:03 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-02-18 12:31 Cleanups and improvenments for pl330 Alexander Kochetkov 2016-02-18 12:31 ` [PATCH 1/4] dmaengine: pl330: cleanup quirk pass code Alexander Kochetkov 2016-02-18 12:31 ` [PATCH 2/4] dmaengine: pl330: cleanup brst_len usage Alexander Kochetkov 2016-02-18 12:31 ` [PATCH 3/4] dmaengine: pl330: don't emit code for one iteration loop Alexander Kochetkov 2016-02-18 12:31 ` [PATCH 4/4] dmaengine: pl330: make cyclic transfer free runnable Alexander Kochetkov 2016-03-08 3:03 ` Cleanups and improvenments for pl330 Vinod Koul 2016-03-10 10:57 ` [PATCH 1/3 v2] dmaengine: pl330: cleanup quirk pass code Alexander Kochetkov 2016-03-10 10:57 ` [PATCH 2/3 v2] dmaengine: pl330: don't emit code for one iteration loop Alexander Kochetkov 2016-03-10 10:57 ` Alexander Kochetkov 2016-03-10 10:57 ` [PATCH 3/3 v2] dmaengine: pl330: make cyclic transfer free runnable Alexander Kochetkov 2016-03-10 10:57 ` Alexander Kochetkov 2016-03-10 11:02 ` Cleanups and improvenments for pl330 v3 Alexander Kochetkov 2016-03-10 11:02 ` [PATCH 1/3 v3] dmaengine: pl330: cleanup quirk pass code Alexander Kochetkov 2016-03-10 11:02 ` Alexander Kochetkov 2016-03-10 11:02 ` Alexander Kochetkov [this message] 2016-03-10 11:02 ` [PATCH 2/3 v3] dmaengine: pl330: don't emit code for one iteration loop Alexander Kochetkov 2016-03-10 11:02 ` [PATCH 3/3 v3] dmaengine: pl330: make cyclic transfer free runnable Alexander Kochetkov 2016-03-10 11:02 ` Alexander Kochetkov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1457607764-30495-3-git-send-email-al.kochet@gmail.com \ --to=al.kochet@gmail.com \ --cc=dan.j.williams@intel.com \ --cc=dianders@chromium.org \ --cc=dmaengine@vger.kernel.org \ --cc=heiko@sntech.de \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-rockchip@lists.infradead.org \ --cc=vinod.koul@intel.com \ --cc=wxt@rock-chips.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.